/* Feuille de temps — styles (identité Technosens) */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e3e8ef;
  --text: #1c2430;
  --muted: #64748b;
  /* Marine Technosens — couleur d'action principale (boutons, CTA) */
  --primary: #262c47;
  --primary-dark: #1a1f36;
  /* Dégradé bleu clair → bleu foncé du logo — accents, focus, éléments actifs */
  --accent-light: #57a1e0;
  --accent-dark: #33529c;
  --accent-gradient: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
#root { height: 100%; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }

/* Mise en page */
.layout { display: flex; min-height: 100vh; }

/* ------------------------------------------------------------------
   Bande latérale — couleur configurable par utilisateur (Mon compte).
   Chaque thème définit un jeu de variables ; le reste des règles de la
   sidebar les consomme sans jamais coder une couleur en dur, pour que
   le contraste texte/fond reste correct dans toutes les variantes.
   ------------------------------------------------------------------ */
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--sb-bg); color: var(--sb-text);
  border-right: var(--sb-border, none);
  display: flex; flex-direction: column; padding: 16px 10px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar.theme-marine {
  --sb-bg: #262c47; --sb-text: #b7c0dc; --sb-text-muted: #8b96b8;
  --sb-hover: rgba(255,255,255,.07); --sb-active-bg: var(--accent-gradient); --sb-active-text: #fff;
  --sb-footer-border: rgba(255,255,255,.12); --sb-brand-text: #fff;
}
.sidebar.theme-bleu-technosens {
  --sb-bg: #16294f; --sb-text: #cdd8ef; --sb-text-muted: #8494bd;
  --sb-hover: #1f3563; --sb-active-bg: linear-gradient(135deg, #57a1e0, #33529c); --sb-active-text: #fff;
  --sb-footer-border: #24396b; --sb-brand-text: #fff;
}
.sidebar.theme-anthracite {
  --sb-bg: #23262e; --sb-text: #cfd2d9; --sb-text-muted: #8b8f9a;
  --sb-hover: #2d3039; --sb-active-bg: var(--accent-gradient); --sb-active-text: #fff;
  --sb-footer-border: #34373f; --sb-brand-text: #fff;
}
.sidebar.theme-blanc {
  --sb-bg: #ffffff; --sb-text: #3a4159; --sb-text-muted: #8792ad;
  --sb-hover: #f2f4fa; --sb-active-bg: #eaf1fc; --sb-active-text: #1d4ed8;
  --sb-border: 1px solid #e6e9f2; --sb-footer-border: #ebeef5; --sb-brand-text: #1c2233;
}
.sidebar.theme-gris {
  --sb-bg: #eef0f6; --sb-text: #3a4159; --sb-text-muted: #767f9c;
  --sb-hover: #e2e6f1; --sb-active-bg: #ffffff; --sb-active-text: #1d4ed8;
  --sb-border: 1px solid #dfe3ee; --sb-footer-border: #dde1ec; --sb-brand-text: #1c2233;
}
.sidebar.theme-bleu-pale {
  --sb-bg: #eaf1fb; --sb-text: #2d3c5e; --sb-text-muted: #6b81ab;
  --sb-hover: #dce9fa; --sb-active-bg: #ffffff; --sb-active-text: #1d4ed8;
  --sb-border: 1px solid #dbe6f7; --sb-footer-border: #d7e3f5; --sb-brand-text: #1c2233;
}

.sidebar nav {
  flex: 1; margin-top: 18px; display: flex; flex-direction: column; gap: 2px;
  /* La marque en haut et le pied (langue, compte, déconnexion) restent visibles ;
     seule la liste des sections défile. Sur un écran court — ou avec plusieurs
     modules dépliés — le menu débordait sous la fenêtre sans aucun moyen
     d'atteindre les derniers éléments. */
  overflow-y: auto;
  /* `min-height: 0` est indispensable : dans un conteneur flex, un enfant refuse
     de rétrécir en deçà de son contenu par défaut, et `overflow` n'aurait aucun
     effet. */
  min-height: 0;
  /* Barre discrète, aux couleurs de la bande latérale plutôt qu'au gris du
     système, qui trancherait sur les thèmes sombres. */
  scrollbar-width: thin;
  scrollbar-color: var(--sb-text-muted) transparent;
}
.sidebar nav::-webkit-scrollbar { width: 8px; }
.sidebar nav::-webkit-scrollbar-track { background: transparent; }
.sidebar nav::-webkit-scrollbar-thumb {
  background: var(--sb-hover); border-radius: 4px;
}
.sidebar nav:hover::-webkit-scrollbar-thumb { background: var(--sb-text-muted); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; color: var(--sb-text); font-weight: 500;
}
.nav-item:hover { background: var(--sb-hover); text-decoration: none; }
.nav-item.active { background: var(--sb-active-bg); color: var(--sb-active-text); }
.nav-icon { width: 20px; text-align: center; }
/* Groupes de navigation dépliables (un par module — CRM, RH, etc.), voir App.jsx. */
.nav-group { display: flex; flex-direction: column; }
.nav-group-header {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; color: var(--sb-text); font-weight: 500;
  background: none; border: none; width: 100%; text-align: left;
  font: inherit; cursor: pointer;
}
.nav-group-header:hover { background: var(--sb-hover); }
.nav-group-header.has-active { color: var(--sb-active-text, var(--sb-text)); font-weight: 700; }
/* Indicateur + / − à droite du nom du groupe : « + » replié, « − » déplié. */
.nav-group-toggle {
  margin-left: auto; flex-shrink: 0;
  width: 16px; height: 16px; line-height: 15px; text-align: center;
  font-size: .9rem; font-weight: 700; opacity: .7;
  border: 1px solid currentColor; border-radius: 4px;
}
.nav-group-header:hover .nav-group-toggle { opacity: 1; }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
.nav-group-items .nav-item { padding-left: 32px; font-size: .93rem; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--sb-brand-text); padding: 4px 12px; font-size: 1.02rem; }
.brand-lg { font-size: 1.3rem; justify-content: center; color: var(--text); margin-bottom: 6px; }
.brand-icon { font-size: 1.25em; }
.sidebar-footer { border-top: 1px solid var(--sb-footer-border); padding-top: 10px; }
/* Sélecteur de langue FR/EN — petit interrupteur à deux positions dans le pied de la sidebar. */
.lang-switch {
  display: flex; gap: 2px; padding: 2px; margin: 0 12px 10px;
  background: var(--sb-hover); border-radius: 8px; width: fit-content;
}
.lang-btn {
  border: none; background: transparent; color: var(--sb-text-muted);
  font-size: .74rem; font-weight: 700; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.lang-btn.active { background: var(--sb-active-bg); color: var(--sb-active-text); }
.lang-btn:not(.active):hover { color: var(--sb-text); }
/* Variante utilisée hors sidebar (écran de connexion) — fond clair, pas de variables --sb-*. */
.lang-switch-login {
  position: fixed; top: 18px; right: 18px; margin: 0;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.lang-switch-login .lang-btn { color: var(--muted); }
.lang-switch-login .lang-btn.active { background: var(--accent-gradient); color: #fff; }
.lang-switch-login .lang-btn:not(.active):hover { color: var(--text); }
.user-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 2px; }
.user-name { font-weight: 600; color: var(--sb-active-text, var(--sb-text)); font-size: .92rem; }
.sidebar.theme-marine .user-name, .sidebar.theme-bleu-technosens .user-name, .sidebar.theme-anthracite .user-name { color: #fff; }
.user-role { font-size: .78rem; color: var(--sb-text-muted); }
/* Le bouton « Quitter » doit rester lisible quelle que soit la couleur de
   bande latérale choisie — il ne peut donc pas utiliser les couleurs
   génériques .btn-ghost (pensées pour un fond clair). */
.sidebar .btn-ghost {
  color: var(--sb-text); border-color: var(--sb-footer-border);
  flex-shrink: 0;
}
.sidebar .btn-ghost:hover { background: var(--sb-hover); color: var(--sb-active-text, var(--sb-text)); }

/* ------------------------------------------------------------------
   Panneau de configuration administrateur — tiroir latéral droit
   (voir components/ConfigPanel.jsx).
   ------------------------------------------------------------------ */
.config-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .38);
  display: flex; justify-content: flex-end; z-index: 60;
}
/* Large : l'onglet Utilisateurs contient un tableau à six colonnes (nom,
   courriel, rôle, taux, statut, actions) qui doit tenir sans être tronqué. */
.config-panel {
  width: 1240px; max-width: 96vw; background: var(--surface);
  display: flex; flex-direction: column; height: 100vh;
  border-left: 1px solid var(--border); box-shadow: -4px 0 24px rgba(16, 24, 40, .12);
}
.config-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.config-header h2 { margin: 0; font-size: 1.1rem; }
.config-tabs {
  display: flex; gap: 4px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.config-tab {
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-size: .88rem; padding: 6px 12px;
  border-radius: 7px; cursor: pointer;
}
.config-tab:hover { background: var(--bg); color: var(--text); }
.config-tab.active { background: #eaf1fc; color: var(--accent-dark); font-weight: 600; }
.config-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.config-section-title {
  font-size: .78rem; color: var(--muted); margin: 16px 0 8px;
}
.config-hint {
  font-size: .84rem; color: var(--muted); background: var(--bg);
  border-radius: 8px; padding: 9px 12px; margin: 12px 0 0;
}
/* Interrupteurs d'accès aux modules, un par ligne. */
.module-list { display: flex; flex-direction: column; gap: 6px; }
.module-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; cursor: pointer; background: var(--surface);
}
.module-row:hover { border-color: var(--accent-light); }
.module-row.is-disabled { opacity: .6; cursor: default; }
.module-row.is-disabled:hover { border-color: var(--border); }
.module-row-icon { width: 22px; text-align: center; }
.module-row-label { flex: 1; font-size: .92rem; }
.module-row-note { font-size: .76rem; color: var(--muted); }
.module-row input[type="checkbox"] { width: 17px; height: 17px; flex-shrink: 0; }
/* Bouton stylé comme un lien de navigation (pied de bande latérale). */
.nav-item-btn {
  border: none; background: none; font: inherit; width: 100%;
  text-align: left; cursor: pointer;
}

/* Bloc « dont recherche et développement » du formulaire de saisie — une
   portion des heures déjà saisies, encadrée pour ne pas se confondre avec la
   durée totale juste au-dessus. */
.rnd-block {
  border: 1px solid var(--border); border-radius: 9px;
  padding: 12px 14px; background: var(--bg);
}
.rnd-block-title { font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
.field-hint-error { color: var(--danger); }

/* ------------------------------------------------------------------
   Suivi des candidats (module RH) — bandeau de relances, bascule de
   vues, filtres rapides et indicateurs sur les cartes.
   ------------------------------------------------------------------ */
.followup-banner {
  border: 1px solid #f5d9a8; border-radius: var(--radius);
  background: #fdf6e8; padding: 12px 14px; margin-bottom: 14px;
}
.followup-banner-title { font-weight: 600; font-size: .92rem; color: #8a5a08; margin-bottom: 8px; }
.followup-banner-list { display: flex; flex-direction: column; gap: 5px; }
.followup-banner-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; font: inherit; text-align: left;
  padding: 3px 0; cursor: pointer; font-size: .87rem;
}
.followup-banner-row:hover .followup-banner-name { text-decoration: underline; }
.followup-banner-name { font-weight: 600; }
.chip { padding: 1px 8px; border-radius: 5px; font-size: .76rem; font-weight: 600; flex-shrink: 0; }
.chip-late { background: var(--danger); color: #fff; }
.chip-today { background: var(--warning); color: #fff; }

/* Bascule Pipeline / Liste / Relances */
.view-switch { display: flex; gap: 2px; padding: 2px; background: var(--bg); border-radius: 8px; }
.view-btn {
  border: none; background: transparent; color: var(--muted);
  font: inherit; font-size: .85rem; padding: 5px 12px; border-radius: 6px; cursor: pointer;
}
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--surface); color: var(--accent-dark); font-weight: 600; box-shadow: var(--shadow); }

/* Filtres rapides */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filter {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font: inherit; font-size: .82rem; padding: 5px 12px; border-radius: 14px; cursor: pointer;
}
.chip-filter:hover { border-color: var(--accent-light); color: var(--text); }
.chip-filter.active { background: #eaf1fc; border-color: var(--accent-light); color: var(--accent-dark); font-weight: 600; }

/* Indicateurs de suivi sur les cartes et dans les tableaux */
.followup { font-size: .83rem; color: var(--muted); margin: 3px 0; }
.followup-late { color: var(--danger); font-weight: 600; }
.followup-today { color: var(--warning); font-weight: 600; }
.avail-now { color: var(--success); font-weight: 600; }
.stars { color: #d9a219; letter-spacing: -1px; }
.kanban-card.card-late { border-color: var(--danger); }
/* Nom cliquable dans un tableau, sans l'apparence d'un bouton. */
.link-btn {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--accent-dark); cursor: pointer; text-align: left;
}
.link-btn:hover { text-decoration: underline; }

/* Bouton de connexion Microsoft Entra ID (écran de connexion). Aspect
   conforme aux directives de marque Microsoft : fond blanc, texte foncé,
   logo à quatre carrés. */
.btn-ms {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #5e5e5e; border: 1px solid #8c8c8c;
  border-radius: var(--radius); padding: 10px 14px; font-weight: 600;
  text-decoration: none;
}
.btn-ms:hover { background: #f3f3f3; text-decoration: none; color: #5e5e5e; }
.ms-logo {
  display: grid; grid-template-columns: 9px 9px; grid-template-rows: 9px 9px;
  gap: 2px; flex-shrink: 0;
}
.ms-logo span { display: block; width: 9px; height: 9px; }
/* Séparateur « ou avec un mot de passe » entre les deux modes de connexion. */
.login-sep {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: .82rem; margin: 4px 0;
}
.login-sep::before, .login-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Rôles recherchés : étiquettes cliquables dans le formulaire, statiques dans
   la fiche de détail. */
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.role-tag {
  display: inline-block; font-size: .82rem; padding: 3px 10px;
  border-radius: 14px; background: #eaf1fc; color: var(--accent-dark);
}
.role-names { color: var(--accent-dark); }
/* Champ numérique court (années, mois) — deux chiffres suffisent. */
.input-court { width: 88px; }
/* Version compacte pour l'édition en ligne d'un tableau. */
.input-mini { width: 58px; padding-left: 6px; padding-right: 2px; }
/* Ligne en cours de modification : fond distinct pour signaler l'état actif. */
.row-editing > td { background: #f5f8fd; vertical-align: middle; }
.row-editing input { width: 100%; }
.row-editing .field-row { gap: 4px; }
/* Ressources pressenties d'un appel d'offre : la note occupe l'espace restant,
   la colonne d'actions reste compacte et ses boutons alignés sur une ligne. */
.table-resources td { vertical-align: top; }
.table-resources .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table-resources .col-actions .btn + .btn { margin-left: 6px; }
.table-resources .row-editing > td { vertical-align: middle; }
/* Bandeau d'ajout : sélecteur large, note extensible, bouton aligné en bas. */
.resource-add {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.resource-add > .field { margin: 0; }
.resource-add > .field:first-child { min-width: 260px; }
.resource-add > .field:nth-child(2) { flex: 1 1 260px; }
/* Onglets d'une fiche (appel d'offre). Barre discrète : la fiche reste la
   même, seuls ses volets changent. */
.onglets { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.onglet {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 9px 16px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; gap: 7px;
}
.onglet:hover { color: var(--text); }
.onglet.actif { color: var(--accent-dark); border-bottom-color: var(--accent-dark); font-weight: 600; }
/* Pastille de rappel : les pièces obligatoires manquantes doivent se voir sans
   ouvrir l'onglet — un oubli coûte la soumission. */
.onglet-pastille {
  background: var(--danger); color: #fff; border-radius: 10px;
  padding: 0 7px; font-size: .72rem; font-weight: 700; line-height: 17px;
}
/* Tableau long : hauteur bornée et défilement, pour que la fiche reste
   parcourable et que les sections suivantes restent atteignables. */
.table-scroll { max-height: 460px; overflow-y: auto; }
.table-scroll thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--border);
}
.pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  margin-top: 10px;
}
/* Poste en cours — pas de date de fin, c'est une information et non un manque. */
.en-cours { color: var(--accent-dark); font-weight: 600; }
/* Pastille de technologie issue d'une analyse de CV plutôt que d'une saisie. */
.role-tag.tag-du-cv { border-style: dashed; }
/* Certification échue : signalée en rouge, c'est tout l'intérêt de suivre
   l'échéance au dossier plutôt que dans un tableur. */
.echeance-passee { color: var(--danger); font-weight: 600; }
/* Tableaux denses des sections candidat : la saisie en ligne ne doit pas
   déborder de sa cellule sur les colonnes étroites. */
.table-compact td input, .table-compact td select { width: 100%; }
.table-compact td .input-mini, .table-compact td .input-court { width: auto; }
/* Lien vers le profil LinkedIn du candidat — discret, dans le bloc d'identité. */
.lien-linkedin { font-size: .9rem; font-weight: 500; }
/* Recherche Outlook dans la fiche candidat : encart distinct de l'historique
   déjà enregistré, pour qu'on voie bien que rien n'est encore conservé. */
.outlook-panel {
  border: 1px dashed var(--border); border-radius: 8px;
  padding: 12px; margin-bottom: 14px; background: #fbfcfe;
}
.outlook-results { max-height: 340px; overflow-y: auto; margin-top: 10px; }
.outlook-results .is-imported { opacity: .6; }
/* Marque d'origine d'une communication importée. */
.tag-outlook {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 10px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  background: var(--accent-pale, #e8f0fb); color: var(--accent-dark, #1b4a86);
}
.comm-summary { white-space: pre-wrap; }
.comm-footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Aperçu de la signature : rendu tel qu'il partira, encadré pour qu'on voie
   où il commence et s'arrête. Le HTML est assaini côté serveur. */
.signature-preview {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; background: #fff; margin-bottom: 12px; overflow-x: auto;
}
.signature-preview img { max-width: 100%; }
/* Titre du résumé et son bouton de modification sur la même ligne. */
.summary-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.summary-header .config-section-title { margin: 0; }
/* Résumé du profil : texte long, on conserve les sauts de ligne saisis. */
.candidate-summary {
  white-space: pre-wrap; margin: 4px 0 0; font-size: .92rem; line-height: 1.5;
}

/* Sélecteur de couleur — page « Mon compte » */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.theme-option {
  display: flex; align-items: center; gap: 8px; font: inherit; font-size: .85rem; font-weight: 600;
  background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; cursor: pointer;
}
.theme-option:hover { background: #f5f7fb; }
.theme-option.selected { border-color: var(--accent-dark); box-shadow: 0 0 0 2px rgba(87,161,224,.25); }
.theme-option:disabled { opacity: .6; cursor: default; }
.theme-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex-shrink: 0; }

/* La zone de contenu occupe la largeur disponible plutôt qu'une colonne fixe :
   les fiches candidat portent désormais des tableaux à six colonnes (expériences
   avec envergure, formations, certifications) qui s'écrasaient à 1180 px.
   Le plafond à 1680 px évite l'effet inverse — des lignes de texte trop longues
   à lire sur un écran très large. */
.content { flex: 1; padding: 28px 34px; max-width: 1680px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }

/* Cartes */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px;
}
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 30px rgba(16,24,40,.10); padding: 34px 36px; width: 380px;
  display: flex; flex-direction: column; gap: 14px;
}
.stats-row { display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 24px; min-width: 160px;
}
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-card.accent { background: var(--accent-gradient); border-color: transparent; }
.stat-card.accent .stat-value, .stat-card.accent .stat-label { color: #fff; }
.stat-card.accent .stat-label { opacity: .9; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.field-label { font-size: .85rem; font-weight: 600; color: #364152; }
.field-hint { font-size: .78rem; color: var(--muted); }
input, select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); width: 100%;
}
/* Saisie directement dans une cellule de tableau — la référence Sage se tape
   là où elle s'affichera une fois la facture rattachée, pas dans une fenêtre
   séparée où l'on perdrait de vue la ligne concernée. */
.input-cellule { padding: 5px 8px; font-size: .85rem; min-width: 120px; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(87, 161, 224, .35); border-color: var(--accent-dark);
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.checkbox input { width: auto; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.toolbar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.inline-panel {
  border: 1px dashed var(--border); border-radius: 9px; padding: 12px 14px;
  background: #f8faff; display: flex; flex-direction: column; gap: 10px;
}
.field-row { display: flex; gap: 8px; align-items: flex-end; }
.field-row .field { flex: 1; }

/* Exigences d'un profil d'appel d'offre. Le gap de .inline-panel vaut 10px et
   détacherait l'intitulé de sa liste : les deux sont resserrés à la main. */
.profil-exigences-titre { margin: 0 0 -6px; font-weight: 600; }
.profil-exigences {
  margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px;
  font-size: .875rem; color: var(--muted);
}
.profil-exigences li { list-style: disc; }

/* Boutons */
.btn {
  font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; transition: background .12s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
/* Bouton qui n'a l'air que de son contenu : sert à rendre cliquable un badge
   déjà présent, sans ajouter une colonne d'action pour une seule ligne. */
.btn-lien {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer;
}
.btn-lien:focus-visible { outline: 2px solid rgba(87, 161, 224, .55); border-radius: 6px; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #eef2f7; }
.btn-sm { padding: 5px 11px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon {
  background: transparent; border: none; cursor: pointer; font-size: 1rem;
  padding: 4px 7px; border-radius: 6px; color: var(--muted);
}
.btn-icon:hover { background: #eef2f7; color: var(--text); }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.table td { padding: 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table-compact td { padding: 7px 10px; }
.row-click { cursor: pointer; }
.row-click:hover td { background: #f8fafc; }
.row-actions { white-space: nowrap; text-align: right; }
.row-rejected td { background: #fef5f5; }
.rejection { color: var(--danger); font-size: .82rem; margin-top: 3px; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .74rem;
  font-weight: 600; white-space: nowrap;
}
.badge-brouillon { background: #eef2f7; color: #475569; }
.badge-soumis { background: #fff3e0; color: var(--warning); }
.badge-approuve { background: #e7f6ec; color: var(--success); }
.badge-rejete { background: #fdeaea; color: var(--danger); }
.badge-facture { background: #e8eefc; color: var(--primary); margin-left: 4px; }

/* Liste de puces (ex. ressources pressenties) */
.chip-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 6px; background: #eef2f7; color: #334155;
  padding: 4px 6px 4px 12px; border-radius: 99px; font-size: .85rem;
}
.chip .btn-icon { padding: 2px 6px; }

/* Alertes */
.alert { padding: 10px 14px; border-radius: 8px; font-size: .9rem; margin-bottom: 4px; }
.alert-error { background: #fdeaea; color: #991b1b; }
.alert-success { background: #e7f6ec; color: #166534; }
.alert-info { background: #e8eefc; color: #1e40af; }

/* Feuille de temps */
.week-summary {
  display: flex; align-items: center; gap: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px; flex-wrap: wrap;
}
.day-block { padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.day-block:last-child { border-bottom: none; }
.day-block.today .day-name { color: var(--primary); }
.day-header { display: flex; align-items: center; gap: 12px; }
.day-name { font-weight: 700; width: 130px; }
.day-total { color: var(--muted); flex: 1; }

/* Minuterie */
.timer-card { border-left: 4px solid var(--primary); }
.timer-running { border-left-color: var(--success); }
.timer-clock { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-info { margin: 6px 0 12px; }

/* Modale */
/* z-index au-dessus du panneau de configuration (60) : les modales ouvertes
   depuis ce panneau (ex. « Modifier l'utilisateur ») doivent passer devant lui,
   sinon elles s'afficheraient derrière et sembleraient ne pas s'ouvrir. */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px;
  z-index: 70; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 14px; width: 520px; max-width: 100%;
  box-shadow: 0 16px 50px rgba(16, 24, 40, .25);
}
/* Modale large — formulaires comportant du texte long (résumé de profil,
   étiquettes de rôles) où la largeur par défaut de 520 px rend la lecture
   pénible. `max-width: 100%` sur .modal garde le comportement sur petit écran. */
.modal-wide { width: 880px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px 22px; }

/* Kanban — Pipeline CRM */
.kanban-board {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px; padding: 0;
}
.kanban-column {
  display: flex; flex-direction: column; background: var(--surface);
  border-radius: 12px; border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow);
}
.kanban-column-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: #f8fafb; border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.kanban-column-header h3 { margin: 0; font-size: .95rem; }
.kanban-column-content {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; min-height: 300px; overflow-y: auto;
}
.kanban-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .9rem;
}
.kanban-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; cursor: pointer; transition: all .2s;
}
.kanban-card:hover {
  border-color: var(--accent-light); box-shadow: 0 4px 12px rgba(87, 161, 224, .1);
}
.kanban-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.kanban-card-header h4 {
  margin: 0; font-size: .95rem; flex: 1; word-break: break-word;
}
.kanban-card-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}
.kanban-card p {
  margin: 4px 0; font-size: .85rem; line-height: 1.3;
}
.kanban-card .text-sm { font-size: .82rem; }

/* RH — planification des ressources (liste employés + tableau d'affectations) */
.split-layout { display: flex; gap: 18px; align-items: flex-start; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.plain-list-item {
  display: block; width: 100%; text-align: left; font: inherit; font-weight: 500;
  padding: 9px 12px; border-radius: 8px; border: none; background: transparent;
  color: var(--text); cursor: pointer;
}
.plain-list-item:hover { background: #eef2f7; }
.plain-list-item.active { background: var(--accent-gradient); color: #fff; }

/* Divers */
.muted { color: var(--muted); }
.empty-state { color: var(--muted); text-align: center; padding: 26px 0; }
.spinner {
  width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .content { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .split-layout { flex-direction: column; }
}

/* Structure d'un formulaire d'appel d'offre, sous son intitulé. */
.formulaire-structure { margin-top: 6px; }
.formulaire-structure .profil-exigences { margin-top: 2px; }

/* Nom de fichier cliquable : un bouton, parce que l'ouverture passe par une
   requête authentifiée et non par une URL directe — mais il doit se lire
   comme un lien. */
.lien-fichier {
  background: none; border: none; padding: 0; font: inherit;
  color: var(--accent-dark); cursor: pointer; text-align: left;
}
.lien-fichier:hover { text-decoration: underline; }

/* Numéro de lot dans un tableau : court, contrasté, aligné d'une ligne à
   l'autre. C'est le repère que l'organisme utilise dans ses communications. */
.lot-numero {
  display: inline-block; min-width: 22px; text-align: center;
  padding: 1px 6px; margin-right: 6px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border);
  font-weight: 700; font-size: .8rem;
}

/* Citation du devis : reprise mot pour mot, donc visuellement détachée du
   commentaire de l'application. */
.citation-devis {
  margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent-light);
  background: var(--bg); font-style: italic; font-size: .9rem;
}
/* Plan imposé par le devis. */
.plan-devis { margin: 8px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.plan-devis li { list-style: decimal; }
.plan-devis p { margin: 2px 0 0; }
/* Échanges avec Copilot — non conservés, d'où l'absence de mise en forme de
   conversation persistante (pas d'horodatage, pas d'auteur). */
.echanges-copilot { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.echange { border-left: 3px solid var(--border); padding-left: 12px; }
.echange-question { margin: 0 0 4px; font-weight: 600; }
.echange-reponse { margin: 0; white-space: pre-wrap; }

/* Bouton de dépôt d'une pièce : un <label> déguisé en bouton, l'input fichier
   étant masqué. Le curseur doit malgré tout indiquer une action. */
.depot-piece { cursor: pointer; display: inline-block; }

/* Origine d'une correspondance de recherche, sur la carte du candidat. */
.trouve-dans { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Engagements en cours d'un candidat — appels d'offres et projets. */
.engagements { margin-top: 8px; }
.engagements-compact {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 3px; font-size: .82rem;
}

/* Historique des communications : titre d'une ligne, détail dépliable. */
.comm-item { gap: 4px; }
.comm-entete { margin: 0; font-size: .82rem; color: var(--muted); }
.comm-titre {
  background: none; border: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--text); cursor: pointer; text-align: left; display: flex;
  align-items: baseline; gap: 6px; width: 100%;
}
.comm-titre:hover { color: var(--accent-dark); }
.comm-chevron { flex-shrink: 0; font-size: .7rem; color: var(--muted); }
.comm-titre-simple { margin: 0; font-weight: 600; }
.comm-actions { display: flex; gap: 4px; margin: 0 0 8px; }

/* Le pied de la bande latérale ne doit jamais être compressé par le menu :
   c'est là que se trouvent le sélecteur de langue et la déconnexion. */
.sidebar-footer { flex-shrink: 0; }
.sidebar .brand { flex-shrink: 0; }
