/* Flow UI — les composants, en CSS nu.
 *
 * Chaque classe reprend une brique des apps (le nom React d'origine est en
 * commentaire) pour qu'un prototype HTML ou une démo parle la même langue
 * que le code. Tout passe par tokens.css : aucune couleur écrite en dur. */

/* ─────────────────────────────── base ─────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; border-color: hsl(var(--border)); }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 14px;               /* la base Notion */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
table { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }
.ic { width: 1em; height: 1em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.faint { color: hsl(var(--faint)); }
.muted { color: hsl(var(--muted-foreground)); }

/* Survol Notion : un voile d'encre, jamais une couleur de fond. */
.f-hover { transition: background-color .15s; border-radius: var(--radius); }
.f-hover:hover { background: hsl(var(--hover) / .06); }

/* ────────────────────────────── boutons ───────────────────────────── */

/* Button — le seul aplat plein d'un écran : le geste qu'on répète. */
.f-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: var(--radius);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, opacity .15s;
}
.f-btn:hover:not(:disabled) { background: hsl(var(--primary) / .9); }
.f-btn:disabled { opacity: .5; }
.f-btn .ic { font-size: 15px; }
/* Secondaire : blanc, ombre à deux couches — « Exporter », « Partager ». */
.f-btn--sec { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: var(--shadow-btn); font-weight: 400; }
.f-btn--sec:hover:not(:disabled) { background: hsl(var(--hover) / .04); }
/* Fantôme : un lien qui se comporte comme un bouton. */
.f-btn--ghost { background: transparent; color: hsl(var(--muted-foreground)); font-weight: 400; padding: 0 8px; }
.f-btn--ghost:hover:not(:disabled) { background: hsl(var(--hover) / .06); color: hsl(var(--foreground)); }
/* Validé : l'aplat accent, qui se reclique pour rouvrir. */
.f-btn--fait { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.f-btn--fait:hover:not(:disabled) { background: hsl(var(--hover) / .08); color: hsl(var(--foreground)); }
.f-btn--plein { width: 100%; justify-content: center; height: 36px; }
.f-icone {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius);
  color: hsl(var(--muted-foreground)); transition: background-color .15s, color .15s;
}
.f-icone:hover { background: hsl(var(--hover) / .06); color: hsl(var(--foreground)); }

/* ────────────────────────────── filtres ───────────────────────────── */

/* Chip — un filtre de catégorie : l'état pressé prend l'aplat accent. */
.f-chip {
  height: 28px; padding: 0 8px; border-radius: var(--radius);
  font-size: 14px; color: hsl(var(--muted-foreground)); transition: background-color .15s, color .15s;
}
.f-chip:hover { background: hsl(var(--hover) / .06); color: hsl(var(--foreground)); }
.f-chip[aria-pressed="true"] { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); font-weight: 500; }

/* Filtre — « Collègue Tous ⌄ » : un préfixe gris, la valeur en encre. */
.f-filtre {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px;
  border-radius: var(--radius); font-size: 14px; white-space: nowrap; transition: background-color .15s;
}
.f-filtre:hover { background: hsl(var(--hover) / .06); }
.f-filtre > .pre { color: hsl(var(--muted-foreground)); }
.f-filtre > .ic { font-size: 12px; color: hsl(var(--faint)); }
.f-filtre > .ic:first-child { font-size: 14px; }
.f-filtre.actif { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.f-filtre.actif > .pre { color: hsl(var(--accent-foreground) / .7); }

/* Manque — un filtre de contrôle avec son compte : « À valider 23 401 ».
   Il disparaît à zéro, sauf s'il est actif. */
.f-manque {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border: 1px solid hsl(var(--border)); border-radius: 999px; font-size: 14px;
  color: hsl(var(--muted-foreground)); transition: border-color .15s, color .15s;
}
.f-manque .n { color: hsl(var(--faint)); font-variant-numeric: tabular-nums; }
.f-manque:hover { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.f-manque[aria-pressed="true"] { border-color: transparent; background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); font-weight: 500; }
.f-manque[aria-pressed="true"] .n { color: hsl(var(--accent-foreground) / .7); }

/* Pilule de lecture — les familles d'une veille : « Tous » en encre pleine. */
.f-pilule {
  height: 28px; padding: 0 11px; border-radius: 999px; font-size: 13.5px;
  border: 1px solid hsl(var(--border)); color: hsl(var(--foreground) / .8);
  transition: background-color .15s, border-color .15s;
}
.f-pilule:hover { border-color: hsl(var(--foreground) / .25); }
.f-pilule[aria-pressed="true"] { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: transparent; }

.f-sep { display: inline-block; width: 1px; height: 18px; background: hsl(var(--border)); margin: 0 4px; }

/* ───────────────────────────── étiquettes ─────────────────────────── */

/* Tag — pastels Notion. Une couleur par sens, jamais pour décorer. */
.f-tag {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
  padding: 1px 8px; border-radius: var(--radius); font-size: 14px; line-height: 20px; white-space: nowrap;
  background: hsl(var(--tag-gray)); color: hsl(var(--tag-gray-fg));
}
.f-tag > span { overflow: hidden; text-overflow: ellipsis; }
.f-tag--sm { font-size: 12px; line-height: 18px; padding: 0 6px; }
.t-blue { background: hsl(var(--tag-blue)); color: hsl(var(--tag-blue-fg)); }
.t-green { background: hsl(var(--tag-green)); color: hsl(var(--tag-green-fg)); }
.t-yellow { background: hsl(var(--tag-yellow)); color: hsl(var(--tag-yellow-fg)); }
.t-red { background: hsl(var(--tag-red)); color: hsl(var(--tag-red-fg)); }
.t-purple { background: hsl(var(--tag-purple)); color: hsl(var(--tag-purple-fg)); }
/* La croix DANS la pastille, de sa couleur. */
.f-tag .x { display: grid; place-items: center; margin-right: -4px; padding: 2px; border-radius: 2px; opacity: .5; transition: opacity .15s; }
.f-tag .x:hover { opacity: 1; }
.f-tag .x .ic { font-size: 12px; }
/* Le « + » rond qui ne propose que ce qui reste. */
.f-plus {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  border: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); transition: border-color .15s, color .15s;
}
.f-plus:hover { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.f-plus .ic { font-size: 13px; }

/* ──────────────────────────────── champs ──────────────────────────── */

.f-input {
  height: 36px; width: 100%; padding: 0 12px; border-radius: 6px;
  border: 1px solid hsl(var(--input)); background: transparent; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.f-input::placeholder, .f-note::placeholder { color: hsl(var(--faint)); }
.f-input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .15); }
.f-champ-ic { position: relative; }
.f-champ-ic > .ic { position: absolute; left: 12px; top: 11px; font-size: 14px; opacity: .6; pointer-events: none; }
.f-champ-ic > .f-input { padding-left: 36px; }
.f-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }

/* Recherche — carrée dans une app de gestion… */
.f-recherche {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius); transition: border-color .15s;
}
.f-recherche:focus-within { border-color: hsl(var(--primary)); }
.f-recherche .ic { color: hsl(var(--faint)); font-size: 15px; }
.f-recherche input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 14px; }
.f-recherche input::placeholder { color: hsl(var(--faint)); }
/* …ronde et posée dans une app de lecture (la carte des lieux). */
.f-recherche--ronde { height: 40px; border-radius: 999px; padding: 0 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: box-shadow .15s; }
.f-recherche--ronde:focus-within { border-color: hsl(var(--border)); box-shadow: 0 2px 10px rgba(0,0,0,.1); }
.f-recherche--ronde input { font-size: 15px; }

/* Bascule — un interrupteur quand l'état se lit d'un coup d'œil. */
.f-bascule { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.f-bascule .piste { position: relative; width: 28px; height: 16px; border-radius: 999px; background: hsl(var(--border)); transition: background-color .15s; }
.f-bascule .piste::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 999px; background: hsl(var(--background)); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.f-bascule[aria-checked="true"] { color: hsl(var(--foreground)); }
.f-bascule[aria-checked="true"] .piste { background: hsl(var(--primary)); }
.f-bascule[aria-checked="true"] .piste::after { transform: translateX(12px); }

/* ────────────────────────────── lecture ───────────────────────────── */

/* Surtitre — « ACTIVITÉ », avec un complément à droite. */
.f-surtitre { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: hsl(var(--faint)); }
.f-surtitre > :first-child { font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
/* Un intitulé de groupe dans une liste ou une fiche. */
.f-groupe-titre { font-size: 12px; font-weight: 500; color: hsl(var(--faint)); padding: 8px 8px 4px; }

/* Section — le libellé collé dans la marge gauche. */
.f-section { display: grid; grid-template-columns: 110px minmax(0, 640px); gap: 8px 32px; }
.f-section > .marge { padding-top: 5px; text-align: right; font-size: 13px; color: hsl(var(--faint)); }
.f-section > .marge b { display: block; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.f-section > .corps { min-width: 0; font-size: 15.5px; line-height: 1.7; display: grid; gap: 14px; }

/* Citation de source — la pastille grise, comme dans Claude. */
.f-source {
  display: inline-block; max-width: 13em; height: 18px; padding: 0 6px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle; line-height: 18px; border-radius: 6px;
  background: hsl(var(--hover) / .07); color: hsl(var(--muted-foreground)); font-size: 12.5px; font-weight: 500;
  transition: background-color .12s, color .12s;
}
.f-source:hover { background: hsl(var(--hover) / .14); color: hsl(var(--foreground)); }

/* Déplier en douceur : grid-template-rows 0fr → 1fr. */
.f-depliable { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.22,.8,.24,1); }
.f-depliable > div { overflow: hidden; }
.ouvert > .f-depliable { grid-template-rows: 1fr; }

/* ─────────────────────────────── fiche ────────────────────────────── */

/* Sheet — le « side peek » : 720 px, glisse depuis la droite, voile à 10 %. */
.f-voile { position: absolute; inset: 0; background: rgb(0 0 0 / .1); animation: f-fondu .15s; }
.f-sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%);
  display: flex; flex-direction: column; background: hsl(var(--card)); box-shadow: var(--shadow-pop);
  animation: f-entre .15s ease-out;
}
.f-sheet.sortant { animation: f-sort .2s ease-in forwards; pointer-events: none; }
.f-voile.sortant { animation: f-fondu .2s reverse forwards; }
.f-sheet > .fermer { position: absolute; right: 12px; top: 12px; z-index: 1; }
.f-sheet > .corps { flex: 1; overflow-y: auto; padding: 40px 40px 32px; }
.f-sheet > .pied { display: flex; align-items: center; gap: 16px; border-top: 1px solid hsl(var(--border)); padding: 12px 40px; }
@keyframes f-entre { from { transform: translateX(100%); } }
@keyframes f-sort { to { transform: translateX(100%); } }
@keyframes f-fondu { from { opacity: 0; } }

/* Phrase — ce qui s'est passé, dit en français avant de l'être en champs. */
.f-phrase { font-size: 17px; line-height: 1.65; }
.f-phrase b { font-weight: 600; }
.f-phrase u { text-decoration: none; border-bottom: 2px solid hsl(var(--accent)); }
.f-citation { margin-top: 12px; padding-left: 16px; border-left: 2px solid hsl(var(--border)); font-size: 14px; color: hsl(var(--muted-foreground)); }

/* Detail — le détail de la saisie, replié : la phrase en dit l'essentiel. */
.f-detail { margin-top: 20px; }
.f-detail > summary {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius);
  list-style: none; cursor: pointer; font-size: 14px; color: hsl(var(--muted-foreground)); transition: background-color .15s;
}
.f-detail > summary::-webkit-details-marker { display: none; }
.f-detail > summary:hover { background: hsl(var(--hover) / .06); }
.f-detail > summary .ic { font-size: 13px; transition: transform .15s; }
.f-detail[open] > summary .ic { transform: rotate(90deg); }

/* Prop — ligne de propriété : libellé gris à gauche, valeur élastique. */
.f-props { display: grid; grid-template-columns: 156px 1fr; align-items: start; margin-top: 4px; }
.f-props > dt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); font-size: 14px; color: hsl(var(--muted-foreground)); }
.f-props > dt .ic { font-size: 13px; color: hsl(var(--faint)); }
.f-props > dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 32px; padding: 4px 8px; border-radius: var(--radius); font-size: 14px; }
.f-props > dt, .f-props > dd { transition: background-color .15s; }
.f-props > dt:hover, .f-props > dd:hover { background: hsl(var(--hover) / .06); }
.f-lien { display: inline-flex; align-items: center; gap: 4px; color: hsl(var(--primary)); text-decoration: none; font-size: 14px; }
.f-lien:hover { text-decoration: underline; }
.f-lien .ic { font-size: 11px; }

/* Question — une décision du tri, validable à part. */
.f-etapes { margin-top: 20px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); display: grid; gap: 8px; }
.f-question { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 14px 16px; transition: background-color .2s, border-color .2s, color .2s; }
.f-question h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.f-question .indice { margin: 2px 0 12px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.f-question.valide { border-color: transparent; background: hsl(var(--accent)); }
.f-question.ecarte { border-color: transparent; background: hsl(var(--hover) / .06); color: hsl(var(--muted-foreground)); }
.f-question .alerte { margin-top: 10px; font-size: 14px; color: hsl(var(--attente)); }
.f-choix-rang { display: flex; flex-wrap: wrap; gap: 8px; }

/* Choix — une réponse large, pour ne pas avoir à viser. */
.f-choix {
  flex: 1; min-width: 136px; padding: 8px 12px; border-radius: 6px; text-align: left;
  border: 1px solid hsl(var(--border)); background: hsl(var(--background)); font-size: 14px;
  transition: border-color .15s, color .15s, background-color .15s;
}
.f-choix b { display: block; font-weight: 500; }
.f-choix small { display: block; font-size: 12px; color: hsl(var(--faint)); }
.f-choix:hover:not(:disabled) { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.f-choix[aria-pressed="true"] { border-color: transparent; background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.f-choix[aria-pressed="true"].oui { background: hsl(var(--oui)); color: hsl(var(--oui-fg)); }
.f-choix[aria-pressed="true"].non { background: hsl(var(--tag-yellow)); color: hsl(var(--tag-yellow-fg)); }
.f-choix[aria-pressed="true"] small { color: inherit; opacity: .7; }
.f-choix:disabled:not([aria-pressed="true"]) { opacity: .5; }

/* Valider — une décision, pas une case qu'on coche en passant. */
.f-valider {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 4px 12px 4px 6px;
  border-radius: 999px; font-size: 14px; color: hsl(var(--muted-foreground)); transition: background-color .15s, color .15s;
}
.f-valider .ic { font-size: 16px; opacity: .6; }
.f-valider:hover:not(:disabled) { background: hsl(var(--hover) / .06); color: hsl(var(--foreground)); }
.f-valider[aria-pressed="true"] { color: hsl(var(--primary)); font-weight: 500; }
.f-valider[aria-pressed="true"] .ic { opacity: 1; }
.f-valider:disabled { opacity: .5; }

.f-note {
  display: block; width: 100%; margin-top: 8px; padding: 4px 8px; border: 0; border-radius: var(--radius);
  background: transparent; resize: none; font-size: 14px; outline: none; transition: background-color .15s;
}
.f-note:hover, .f-note:focus { background: hsl(var(--hover) / .06); }

/* Le compte des étapes : un point par étape, plein quand elle est validée. */
.f-points { display: flex; align-items: center; gap: 8px; font-size: 14px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.f-points > span:first-child { display: flex; gap: 4px; }
.f-points i { width: 8px; height: 8px; border-radius: 999px; border: 1.5px solid hsl(var(--faint)); transition: background-color .15s, border-color .15s; }
.f-points i.fait { border-color: hsl(var(--primary)); background: hsl(var(--primary)); }
/* …ou une barre, quand les étapes sont nombreuses. */
.f-barre { display: flex; align-items: center; gap: 8px; font-size: 14px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.f-barre > span:first-child { width: 80px; height: 6px; border-radius: 4px; background: hsl(var(--hover) / .12); overflow: hidden; }
.f-barre > span:first-child > span { display: block; height: 100%; background: hsl(var(--primary)); transition: width .3s; }
.f-barre b { font-weight: 500; color: hsl(var(--foreground)); }

/* ─────────────────────────────── listes ───────────────────────────── */

/* Les listes : la table de base de données Notion, telle quelle.
   Filets horizontaux ET verticaux #E9E9E7, lignes de 34 px, en-têtes gris
   avec l'icône du type de propriété, statuts en pilule à point, personnes
   avec leur avatar, et la ligne de calcul en pied. Aucun trait de couleur :
   ce qui reste à faire se lit dans la pilule de statut. */
.f-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; font-variant-numeric: tabular-nums; }
.f-table th, .f-table td { height: 34px; padding: 0 8px; border: 1px solid hsl(var(--border)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.f-table tr > :first-child { border-left: 0; }
.f-table tr > :last-child { border-right: 0; }
.f-table th { font-weight: 400; color: hsl(var(--muted-foreground)); }
.f-table th > span { display: inline-flex; align-items: center; gap: 6px; }
.f-table th .ic { font-size: 14px; color: hsl(var(--faint)); }
.f-table .d { text-align: right; }
.f-table .d > span { justify-content: flex-end; }
.f-table tbody tr { cursor: pointer; transition: background-color .12s; }
.f-table tbody tr:hover { background: hsl(var(--hover) / .03); }
.f-table tbody tr.vient { animation: f-flash 1.2s; }
@keyframes f-flash { 0%, 30% { background: hsl(var(--accent)); } }
/* La colonne titre : « OUVRIR » apparaît au survol, comme dans Notion. */
.f-table .titre { position: relative; font-weight: 500; }
.f-table .titre .ouvrir {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; align-items: center; gap: 4px;
  height: 22px; padding: 0 6px; border-radius: var(--radius); background: hsl(var(--background)); box-shadow: var(--shadow-btn);
  font-size: 11.5px; font-weight: 500; letter-spacing: .04em; color: hsl(var(--muted-foreground));
}
.f-table tbody tr:hover .titre .ouvrir { display: inline-flex; }
/* La ligne de calcul : « Somme 55 h », gris, sans filet dessous. */
.f-table tfoot td { border: 0; border-top: 1px solid hsl(var(--border)); height: 32px; font-size: 12.5px; color: hsl(var(--faint)); }
.f-table tfoot b { font-weight: 500; color: hsl(var(--muted-foreground)); margin-left: 4px; }

/* Un groupe : la flèche, sa valeur en pastille, son compte en gris. */
.f-groupe { display: flex; align-items: center; gap: 6px; padding: 18px 0 6px; font-size: 14px; }
.f-groupe .ic { font-size: 14px; color: hsl(var(--muted-foreground)); }
.f-groupe .n { color: hsl(var(--faint)); font-variant-numeric: tabular-nums; }

/* Statut Notion : une pilule avec un point de sa couleur. */
.f-statut { display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px 0 7px; border-radius: 999px; font-size: 14px; line-height: 20px; background: hsl(var(--tag-gray)); color: hsl(var(--tag-gray-fg)); }
.f-statut::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: currentColor; opacity: .45; }
.f-statut.t-green { background: hsl(var(--tag-green)); color: hsl(var(--tag-green-fg)); }
.f-statut.t-yellow { background: hsl(var(--tag-yellow)); color: hsl(var(--tag-yellow-fg)); }
.f-statut.t-purple { background: hsl(var(--tag-purple)); color: hsl(var(--tag-purple-fg)); }
.f-statut.t-blue { background: hsl(var(--tag-blue)); color: hsl(var(--tag-blue-fg)); }
/* Personne : l'avatar rond et le nom. */
.f-personne { display: inline-flex; align-items: center; gap: 6px; }
.f-personne i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: hsl(var(--tag-gray)); color: hsl(var(--muted-foreground)); font-size: 10.5px; font-style: normal; font-weight: 600; }

/* ───────────────────────────── panneaux ───────────────────────────── */

.f-pop { background: hsl(var(--popover)); color: hsl(var(--popover-foreground)); border-radius: 6px; box-shadow: var(--shadow-pop); }
.f-menu-item { display: block; width: 100%; padding: 4px 12px; border-radius: var(--radius); text-align: left; font-size: 14px; transition: background-color .15s; }
.f-menu-item:hover { background: hsl(var(--hover) / .06); }
.f-menu-item[aria-pressed="true"] { background: hsl(var(--accent)); color: hsl(var(--primary)); font-weight: 500; }
.f-menu-item:disabled { color: hsl(var(--faint)); cursor: not-allowed; }
.f-menu-item:disabled:hover { background: none; }

/* ────────────────────────── sélecteur de période ───────────────────── */

.f-periode { position: relative; display: inline-block; }
.f-periode > .f-pop { position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; display: flex; overflow: hidden; }
.f-periode .raccourcis { width: 212px; flex-shrink: 0; padding: 8px 0; border-right: 1px solid hsl(var(--border)); }
.f-periode .raccourcis .f-menu-item { width: calc(100% - 8px); margin: 0 4px; }
.f-periode .pastilles { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px; }
.f-periode .pastilles button {
  padding: 1px 10px; border-radius: 999px; border: 1px solid hsl(var(--border)); font-size: 14px;
  color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; transition: border-color .15s, color .15s;
}
.f-periode .pastilles button:hover:not(:disabled) { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.f-periode .pastilles button[aria-pressed="true"] { border-color: transparent; background: hsl(var(--accent)); color: hsl(var(--primary)); font-weight: 500; }
.f-periode .pastilles button:disabled { opacity: .4; }
.f-periode .mois { padding: 10px 12px; }
.f-periode .mois-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.f-periode .mois-tete > button:not(.f-icone) { padding: 2px 8px; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.f-periode .mois-tete > button:not(.f-icone):hover { background: hsl(var(--hover) / .06); }
.f-periode .mois-tete .f-icone { width: 22px; height: 22px; }
.f-periode .vide-fleche { width: 22px; }
.f-periode table { border-collapse: collapse; }
.f-periode th { width: 32px; padding-bottom: 4px; font-size: 12px; font-weight: 400; color: hsl(var(--faint)); }
.f-periode td { padding: 0; }
.f-periode td button { width: 32px; height: 28px; font-size: 14px; font-variant-numeric: tabular-nums; border-radius: var(--radius); transition: background-color .1s; }
.f-periode td button:hover { background: hsl(var(--hover) / .06); }
.f-periode td button.dans { background: hsl(var(--accent)); border-radius: 0; }
.f-periode td button.a, .f-periode td button.b { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.f-periode td button.a { border-radius: var(--radius) 0 0 var(--radius); }
.f-periode td button.b { border-radius: 0 var(--radius) var(--radius) 0; }
.f-periode td button.a.b { border-radius: var(--radius); }
.f-periode td button.auj { box-shadow: inset 0 -2px 0 hsl(var(--primary) / .5); }
.f-periode .bornes { display: flex; align-items: center; gap: 8px; padding: 4px 12px 12px; }
.f-periode .bornes input { height: 28px; width: 104px; padding: 0 8px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: transparent; font-size: 14px; font-variant-numeric: tabular-nums; outline: none; }
.f-periode .bornes input:focus { border-color: hsl(var(--primary)); }
.f-periode .bornes input::placeholder { color: hsl(var(--faint)); }
.f-periode .grille-mois { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 456px; padding: 10px 12px; }
.f-periode .grille-mois button { padding: 8px 0; border-radius: var(--radius); font-size: 14px; text-transform: capitalize; }
.f-periode .grille-mois button:hover { background: hsl(var(--hover) / .06); }
.f-periode .grille-mois button.courant { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

/* ───────────────────────────── fenêtres ───────────────────────────── */

/* Le cadre d'une démo : une fenêtre d'app, à sa largeur de bureau. */
.f-fenetre { position: relative; overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--background)); box-shadow: 0 1px 2px rgba(15,15,15,.04), 0 12px 32px -8px rgba(15,15,15,.1); }
.f-defile { overflow-x: auto; overscroll-behavior-x: contain; }
