/* Bricolage Grotesque (titres) : servie depuis notre serveur (dossier fonts/, licence OFL dans
   fonts/OFL.txt), plus depuis Google Fonts — aucune requête vers un tiers à l'ouverture de l'appli.
   Police variable : graisses 200 à 800 dans un seul fichier ; latin-ext ne se charge que si un
   caractère hors français courant apparaît (ex. ł, š dans un nom). */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --green-900: #163C2C;
  --green-700: #1F6F54;
  --green-600: #2C8A67;
  --green-100: #E4F0E8;
  --terracotta: #E0703F;
  --terracotta-100: #FCE7DC;
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --border: #E4E1D8;
  --text: #22261F;
  --text-muted: #6B7268;
  --success: #2F9E58;
  --success-bg: #E4F5E9;
  --warning: #B4790E;
  --warning-bg: #FBF0DA;
  --danger: #C4432E;
  --danger-bg: #FBE6E1;
  --info: #2F6FA8;
  --info-bg: #E4EEF7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22,60,44,0.06), 0 4px 16px rgba(22,60,44,0.06);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
h1, h2, h3, h4 { margin: 0 0 4px 0; font-weight: 700; color: var(--green-900); font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.brand-name { font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-900); }
.btn-secondary { background: var(--terracotta); color: #fff; }
.btn-secondary:hover { background: #c65a2c; }
.btn-outline { background: var(--surface); border-color: var(--border); }
.btn-outline:hover { border-color: var(--green-700); color: var(--green-700); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--green-100); color: var(--green-900); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Auth screen ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--green-100), var(--bg) 60%);
  padding: 24px;
}
/* Écran « repos » (js/repos.js, HUM-20) : à la place de l'appli, couleurs selon le moment ; maquette
   docs/maquettes/repos.html, proposition A. Pas de position fixe : il occupe la page comme l'écran de connexion. */
.repos-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: stretch; justify-content: center;
  color: #fff; text-align: center;
  background: linear-gradient(170deg, #2E4A6B, #16261F);
  padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
}
.repos-screen.repos-matin { background: linear-gradient(170deg, #C98A4B, #2E4A6B); }
.repos-screen.repos-soir { background: linear-gradient(170deg, #B0613A, #3A2A2A); }
.repos-screen.repos-conge { background: linear-gradient(170deg, #E0A03F, #1F6F54); }
.repos-screen.repos-soin { background: linear-gradient(170deg, #3C7A5E, #16261F); }
.repos-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.repos-body { margin-top: 12vh; }
.repos-art { width: 64px; height: 64px; stroke-width: 1.5; }
.repos-screen h1 { font-size: 26px; line-height: 1.2; margin: 20px 0 10px; font-weight: 700; color: #fff; }
.repos-screen p { margin: 0 auto; font-size: 16px; opacity: .9; max-width: 280px; }
.repos-next { display: inline-block; margin-top: 20px; padding: 10px 16px; border-radius: 12px; background: rgba(255,255,255,.14); font-size: 14px; }
.repos-next b { display: block; font-size: 16px; margin-top: 2px; }
.repos-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.repos-open { width: 100%; max-width: 320px; background: #fff; color: var(--green-900); border: none; font-weight: 600; padding: 13px 16px; }
.repos-open:hover { background: var(--green-100); }
.repos-never { background: none; border: none; color: rgba(255,255,255,.8); text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; padding: 6px; }
.repos-open:focus-visible, .repos-never:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* Ordinateur : tout au centre de la fenêtre, boutons sous le texte. */
@media (min-width: 861px) {
  .repos-inner { justify-content: center; gap: 48px; }
  .repos-body { margin-top: 0; }
}

.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.auth-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.brand-name { font-weight: 800; color: var(--green-900); font-size: 16px; }
.auth-sub { color: var(--text-muted); margin-bottom: 20px; }
/* Session expirée pendant l'utilisation (HUM-47) : message au-dessus du formulaire de connexion. */
.auth-notice { margin: -8px 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--warning-bg); color: var(--warning); font-size: 14px; line-height: 1.4; }
.auth-hint { color: var(--text-muted); font-size: 12px; margin-top: 12px; text-align: center; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field input, .field select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
}
/* Heures et petites valeurs numériques : texte centré dans le champ */
.field input[type=time], .field input.input-center { text-align: center; }
.field input[type=time]::-webkit-date-and-time-value { text-align: center; }
/* Valeur calculée affichée à côté de champs (ex. Durée) : même hauteur, centrée verticalement */
.field-static { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 700; color: var(--green-900); }
.field input:focus, .field select:focus { outline: 2px solid var(--green-600); outline-offset: 1px; background: #fff; }
.auth-step .btn-block { margin-top: 6px; margin-bottom: 8px; }

/* Mot de passe : bouton Afficher / Masquer dans le champ, règles cochées pendant la saisie */
.pw-wrap { position: relative; }
.field .pw-wrap input { padding-right: 84px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  padding: 6px 8px; border: 0; border-radius: 6px; background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--green-600);
}
.pw-toggle:hover { background: var(--bg); }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 12px; color: var(--text-muted); }
.pw-rules li::before { content: '○'; display: inline-block; width: 16px; }
.pw-rules li.ok { color: var(--green-600); }
.pw-rules li.ok::before { content: '✓'; }

/* Vérification en 2 étapes : QR code de l'application d'authentification */
.mfa-qr { display: block; margin: 0 auto 4px; width: 180px; height: 180px; image-rendering: pixelated; }
.mfa-secret { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text); word-break: break-all; user-select: all; }
.auth-or { text-align: center; color: var(--text-muted); font-size: 12px; margin: 4px 0 12px; }
.auth-hint-tight { margin-top: 0; margin-bottom: 14px; }
.auth-remember { margin: 0 0 14px; cursor: pointer; }
.auth-remember input { margin-top: 2px; }
.auth-remember small { display: block; color: var(--text-muted); font-size: 12px; }

/* Sécurité de connexion (code email, passkeys, application) */
.security-line { margin-bottom: 8px; }
.security-list { list-style: none; margin: 8px 0 16px; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
#security-body h4 { margin: 20px 0 8px; }
#security-body .auth-hint { text-align: left; margin: 0 0 12px; }
#security-body .mfa-qr { margin: 8px auto 12px; }
.security-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; }
.security-list li + li { border-top: 1px solid var(--border); }
.security-list small { color: var(--text-muted); }

.profile-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.profile-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  background: var(--bg); text-align: left; width: 100%;
}
.profile-card:hover { border-color: var(--green-700); background: var(--green-100); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-700); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.profile-meta { display: flex; flex-direction: column; }
.profile-name { font-weight: 700; }
.profile-role { font-size: 12px; color: var(--text-muted); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 150px; flex-shrink: 0;
  background: var(--green-900); color: #fff;
  display: flex; flex-direction: column;
  padding: 20px 10px;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 0 8px 18px 8px; }
.sidebar-brand .brand-name { color: #fff; }
/* Compte relié à plusieurs sociétés : bouton sous le nom de l'établissement. */
.org-switch-item { width: 100%; font: inherit; font-weight: 600; cursor: pointer; }
.org-switch-item.active { border-color: var(--green-700); background: var(--green-100); cursor: default; }
.org-switch-item small { display: block; font-weight: 400; color: var(--text-muted); }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 8px;
  color: rgba(255,255,255,.75); text-decoration: none;
  font-weight: 600; font-size: 13px;
  border: none; background: transparent; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--green-700); color: #fff; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }
.sidebar-footer .btn-ghost { color: rgba(255,255,255,.6); }
.sidebar-footer .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* « Voir en tant que… » en cours (site de recette) : bandeau permanent au-dessus de la barre du haut. */
.viewas-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--warning, #b45309); color: #fff; font-size: 14px; text-align: center;
}
.viewas-banner[hidden] { display: none; }
.viewas-banner .viewas-back { background: #fff; color: var(--text); border: none; }
/* Numéro de portable à vérifier (HUM-15) : bandeau orange sous la barre du haut, deux boutons de même taille. */
.phone-check-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 10px 16px 0; padding: 8px 10px 8px 14px; border-radius: 14px;
  background: var(--warning-bg); color: var(--warning); font-size: 13px;
}
.phone-check-banner[hidden] { display: none; }
.phone-check-actions { display: flex; gap: 6px; }
.phone-check-btn { min-width: 96px; justify-content: center; }
/* Pastilles « Vérifié » / « En attente » / « Non vérifié » à côté d'un email ou d'un téléphone (fiche, liste). */
.verif-badge { margin-left: 6px; vertical-align: middle; white-space: nowrap; display: inline-flex; }
.field span.verif-badge, .info-row span.verif-badge { display: inline-flex; width: auto; margin: 0 0 0 6px; font-weight: 400; }
.field .verif-badge .status-mark, .info-row .verif-badge .status-mark,
.field .verif-badge .status-icon, .info-row .verif-badge .status-icon { display: inline-flex; margin: 0; width: auto; }
.field .verif-badge .status-text, .info-row .verif-badge .status-text { display: inline; margin: 0; font-weight: 500; }
/* Liste des salariés sur téléphone (liste façon iPhone) : pas de colonnes Email / Téléphone, le filtre « À vérifier » reste. */
@media (max-width: 860px) { .emp-table .emp-verif-col { display: none !important; } }
.verif-badge-btn { border: none; background: none; padding: 0; cursor: pointer; font: inherit; }
.verif-badge-btn:hover .status-text { text-decoration: underline; }
/* Champ d'un code à 6 chiffres. */
.code-input { text-align: center; letter-spacing: .4em; font-size: 20px; font-variant-numeric: tabular-nums; }
.topbar {
  height: 64px; flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn { border: none; background: transparent; font-size: 17px; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--green-100); }
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px;
  background: var(--bg); border: 1px solid transparent; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--green-100); }
.user-chip:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.user-chip-caret { color: var(--text-muted); flex-shrink: 0; transition: transform .15s; }
.user-chip[aria-expanded="true"] .user-chip-caret { transform: rotate(180deg); }
/* Menu du profil : un bloc sous le bouton, même fond et mêmes arrondis que lui,
   les choix l'un sous l'autre. */
.user-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 100%;
  background: var(--bg); border-radius: 20px; box-shadow: var(--shadow);
  padding: 4px; display: flex; flex-direction: column; gap: 2px;
}
.user-menu-list[hidden] { display: none; }
.user-menu-item {
  display: block; width: 100%; border: none; background: transparent; font: inherit;
  font-weight: 700; font-size: 12.5px; color: var(--text); text-align: left;
  padding: 8px 12px; border-radius: 16px; cursor: pointer; white-space: nowrap;
}
.user-menu-item:hover, .user-menu-item:focus-visible { background: var(--green-100); color: var(--green-900); outline: none; }
.user-menu-item[disabled] { color: var(--text-muted); cursor: default; background: transparent; }
.user-menu-item[aria-current] { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); }
.user-menu-check { color: var(--green-700); flex-shrink: 0; }
.org-chip-icon { color: var(--green-700); flex-shrink: 0; }
/* Bouton du magasin : même forme que celui du profil, sans avatar. */
.org-chip { padding: 4px 12px; min-height: 38px; }
.org-chip[disabled] { cursor: default; opacity: 1; }
.org-chip[disabled]:hover { background: var(--bg); }
.user-chip .avatar { width: 28px; height: 28px; font-size: 11px; }
.user-chip-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip-name { font-weight: 700; font-size: 12.5px; }
.user-chip-role { font-size: 11px; color: var(--text-muted); }

.view-content { flex: 1; padding: 24px; overflow-y: auto; }

/* ---------- shared view bits ---------- */
.view-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.view-header p { color: var(--text-muted); margin-top: 2px; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
/* Bouton d'action sur la ligne des onglets, à droite */
.tabs-action { margin-left: auto; display: flex; align-items: center; padding: 0 0 6px 8px; flex-shrink: 0; }
.tabs-action:empty { display: none; }
.tab-btn {
  border: none; background: transparent; padding: 10px 16px;
  font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent;
  font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.tab-btn.active { color: var(--green-700); border-bottom-color: var(--green-700); }
.tab-btn .badge { margin-left: 6px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.banner-info {
  background: var(--info-bg); color: #2a5a86; border-radius: 10px;
  padding: 12px 16px; font-size: 13px; margin-bottom: 18px; display: flex; gap: 8px; align-items: flex-start;
}
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--border); color: var(--text-muted); }

.role-badge-employe { background: var(--border); color: var(--text-muted); }
.role-badge-manager_rayon { background: var(--info-bg); color: var(--info); }
.role-badge-manager_magasin { background: var(--green-100); color: var(--green-700); }
.role-badge-admin { background: var(--terracotta-100); color: var(--terracotta); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* ---------- Planning grid ---------- */
.planning-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin-bottom: 16px; }
.planning-toolbar #btn-publish { white-space: nowrap; flex-shrink: 0; }
/* Barre d'outils en icônes : le libellé apparaît au survol (data-tip). */
.toolbar-group { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex-shrink: 0; }
.tool-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; flex-shrink: 0; }
/* Bouton d'un réglage actif (ex. tri personnel de l'affichage du planning). */
.tool-btn.is-on { background: var(--green-100); color: var(--green-700); }
.tool-btn:hover:not(:disabled) { background: var(--green-100); color: var(--green-700); }
.tool-btn:disabled { opacity: .35; cursor: default; }
.tool-btn-solo { border: 1px solid var(--border); background: var(--surface); width: 40px; height: 40px; border-radius: 10px; }
.tool-btn.is-locked { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.tool-btn.is-locked:hover { background: var(--green-900); color: #fff; }
.tool-btn[data-tip]:hover::after, .tool-btn[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--green-900); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px;
  white-space: nowrap; z-index: 30; pointer-events: none;
}
.toolbar-spacer { flex: 1; }

/* Fixed width so the box never resizes when the label text length changes
   across Jour/Semaine/Mois — keeps everything to its right stable too. */
.date-nav-box { display: flex; align-items: center; gap: 2px; width: 250px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 3px; }
.date-nav-box .icon-btn { padding: 6px 10px; flex-shrink: 0; }
.date-nav-center { position: relative; display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; }
.date-nav-center:hover .week-label-btn { background: var(--green-100); color: var(--green-700); }
.week-num-sub { font-weight: 600; color: var(--text-muted); font-size: 10px; margin-top: -2px; }

.view-switch { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.switch-btn { border: none; background: transparent; padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--text-muted); }
.switch-btn.active { background: var(--green-700); color: #fff; }
/* Bascule Équipe / Moi dans la barre, entre le cadenas et les outils (26/10/2026) : boutons resserrés. */
.planning-toolbar > .scope-switch { flex-shrink: 0; }
/* Écran trop étroit pour tout sur une ligne : les outils passent dessous plutôt que de sortir de l'écran. */
.planning-toolbar { flex-wrap: wrap; row-gap: 8px; }
.planning-toolbar > .scope-switch .switch-btn { padding: 6px 9px; }
/* Écran d'ordinateur étroit : on resserre pour garder la barre sur une ligne. */
@media (min-width: 861px) and (max-width: 1180px) {
  .planning-toolbar { gap: 6px; }
  .date-nav-box { width: 228px; }
  .date-nav-box .icon-btn { padding: 6px 5px; }
  .week-label-btn { font-size: 12.5px; padding: 4px 2px; }
  .switch-btn { padding: 6px 9px; }
  .tool-btn { width: 30px; height: 30px; }
  .tool-btn-solo { width: 38px; height: 38px; }
}

.week-label-btn { background: none; border: none; font-weight: 700; font-size: 13px; text-align: center; cursor: pointer; padding: 4px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.week-label-btn:hover { background: var(--green-100); color: var(--green-700); }
/* Champ date invisible posé sur le libellé : c'est lui qui reçoit le clic / le toucher. */
/* Calendrier du sélecteur de date du planning (ordinateur) : numéro de semaine en début de ligne. */
.week-cal { position: absolute; top: calc(100% + 8px); left: -34px; z-index: 30; width: 292px; padding: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.week-cal .wc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.week-cal .wc-head strong { text-transform: capitalize; font-size: 13.5px; }
.week-cal .wc-row { display: grid; grid-template-columns: 38px repeat(7, 1fr); gap: 2px; border-radius: 8px; }
.week-cal .wc-row.is-shown { background: var(--green-100); }
.week-cal .wc-dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.week-cal .wc-day, .week-cal .wc-week { height: 32px; border: none; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.week-cal .wc-week { font-size: 11.5px; font-weight: 700; color: var(--green-700); background: var(--bg); }
.week-cal .wc-day.is-out { color: var(--text-muted); font-weight: 400; }
.week-cal .wc-day:hover, .week-cal .wc-week:hover { background: var(--green-700); color: #fff; }
.week-cal .wc-day.is-today { box-shadow: inset 0 0 0 1.5px var(--green-600); }
.week-cal .wc-day.is-picked { background: var(--green-700); color: #fff; }
.week-cal .wc-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.date-picker-overlay { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: none; padding: 0; margin: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }

.planning-table-scroll { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  /* En-tête (jours) et 1re colonne (noms) figés (demande de Vincent, 11/10/2026) : la grille défile dans ce cadre,
     qui ne dépasse jamais la hauteur de l'écran — on voit toujours les jours et les noms, jusqu'au dernier. */
  max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overscroll-behavior: auto; }
/* table-layout: fixed makes column widths come ONLY from the widths set
   below (via the header row) — never from cell content — so the grid's
   structure stays pixel-identical from one week to the next regardless of
   what's actually scheduled. Without this, the browser's default "auto"
   table layout re-measures every column's content on each render and can
   nudge column widths around week to week. */
.planning-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: var(--surface); user-select: none; }
.planning-table th.week-boundary, .planning-table td.week-boundary { border-left: 2px solid var(--green-700); }
.planning-table th { width: 150px; }
.planning-table th:first-child { width: 190px; }
.planning-table th:last-child { width: 110px; }
.planning-table.compact th { width: 74px; }
.planning-table.compact th:first-child { width: 160px; }
.planning-table.compact th:last-child { width: 110px; }
.planning-table.compact td.day-cell { width: 74px; min-height: 54px; height: 54px; padding: 4px; }
/* Vue Mois (retour de Vincent, 21/10/2026) : un shift seul a la même hauteur qu'une absence et s'affiche en entier
   (début, fin à la ligne, poste) ; deux shifts le même jour se partagent cette hauteur, une ligne chacun. */
.planning-table.compact .shift-chip, .planning-table.compact .absence-chip { box-sizing: border-box; height: 46px; min-height: 0; margin-bottom: 2px; overflow: hidden; }
.planning-table.compact .shift-chip { font-size: 10px; padding: 3px 4px; line-height: 1.2; }
.planning-table.compact .shift-chip .shift-time-line { white-space: normal; overflow: visible; text-overflow: clip; }
.planning-table.compact .shift-chip .shift-hours { display: none; }
.planning-table.compact .shift-chip .shift-rayon { font-size: 9px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning-table.compact .shift-chip.sc-multi { height: 22px; padding: 1px 4px; font-size: 8.5px; line-height: 1.1; }
.planning-table.compact .shift-chip.sc-multi .shift-rayon, .planning-table.compact .shift-chip .shift-tasks-badge { display: none; }
.planning-table.compact .absence-chip { font-size: 9px; padding: 3px 4px; line-height: 1.2; }
.planning-table.compact td.day-cell { height: auto; min-height: 54px; }
.planning-table.compact .round-icon-btn { width: 12px; height: 12px; font-size: 7px; }
.planning-table.compact .chip-actions, .planning-table.compact .cell-add-btn { top: 1px; right: 1px; }
.planning-table.compact th { white-space: nowrap; font-size: 10.5px; padding: 6px 4px; }
.planning-table.compact td.emp-col { width: 160px; }
.planning-table th, .planning-table td { border: solid var(--border); border-width: 0 1px 1px 0; padding: 8px; vertical-align: top; }
.planning-table th:last-child, .planning-table td:last-child { border-right-width: 0; }
.planning-table tbody tr:last-child td { border-bottom-width: 0; }
/* Figés : la ligne des jours en haut, la colonne des noms à gauche (le coin reste au-dessus des deux). */
.planning-table thead th { position: sticky; top: -1px; z-index: 4; }
/* Ligne « Total du jour » figée au bas du cadre (HUM-52) */
.planning-table tfoot td { position: sticky; bottom: 0; z-index: 4; background: var(--green-100); border-top: 2px solid #9CC8B3; font-weight: 700; text-align: center; vertical-align: middle; font-size: 12.5px; }
.planning-table tfoot td.emp-col { left: 0; z-index: 5; text-align: left; background: var(--green-100); }
.planning-table .day-total-sub { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-muted); }
.planning-table.compact tfoot td { font-size: 10.5px; padding: 4px 2px; }
.planning-table th:first-child, .planning-table td.emp-col { position: sticky; left: 0; z-index: 3; }
.planning-table thead th:first-child { z-index: 5; }
.planning-table th { background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); text-align: center; vertical-align: middle; }
.planning-table td.emp-col { background: var(--bg); width: 190px; }
.planning-table tbody tr.drag-over-row { outline: 2px dashed var(--terracotta); outline-offset: -2px; }
.planning-table td.day-cell { width: 150px; min-height: 46px; cursor: pointer; position: relative; }
/* Jour actuel : en-tête plein, colonne légèrement teintée, sans bordure (retour de Vincent, 08/10/2026) (les états survol / verrouillé / dépôt, déclarés après, l'emportent). */
.planning-table td.day-cell.today { background: #F1F7F3; }
.planning-table td.day-cell:hover { background: var(--green-100); }
.planning-table th.today, .planning-table th.today.locked { background: var(--green-700); color: #fff; }
/* Semaine verrouillée pour la paie : cases grisées, non modifiables. */
.planning-table td.day-cell.locked, .planning-table td.day-cell.locked:hover { background: #ECEAE4; cursor: not-allowed; }
.planning-table th.locked { background: #E3E0D8; }
.planning-table td.day-cell.locked .shift-chip, .planning-table td.day-cell.locked .absence-chip { opacity: .6; filter: saturate(.5); }
.gantt-track.locked { background-color: #ECEAE4; cursor: not-allowed; }
.gantt-track.locked .gantt-bar { opacity: .6; filter: saturate(.5); }
.planning-table td.day-cell.drag-target { background: var(--terracotta-100); }
.planning-table td.total-cell { width: 110px; text-align: center; vertical-align: middle; background: var(--bg); }
/* Colonne des totaux : total en gras, écart au contrat dessous (pastille + rouge / − orange), vert foncé si égal. */
.tot-main { display: block; font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tot-main.tot-ok { color: var(--green-700); }
.tot-sub { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tot-pill { width: 14px; height: 14px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; font-weight: 700; }
.tot-up { color: var(--danger); } .tot-up .tot-pill { background: var(--danger-bg); }
.tot-dn { color: var(--warning); } .tot-dn .tot-pill { background: var(--warning-bg); }
.planning-table.compact .tot-main { font-size: 12px; }
/* Texte lu par les lecteurs d'écran seulement (ex. « plus » / « moins » à côté d'une pastille). */
/* Attention : son parent doit être positionné (position: relative), sinon ce texte invisible se place par rapport
   à la page et l'allonge (grand espace vide sous la grille, retour de Vincent du 21/10/2026). */
.u-sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.emp-row-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.emp-row-name.clickable-name [data-goto-emp] { cursor: pointer; }
.emp-row-name.clickable-name [data-goto-emp]:hover { color: var(--green-700); }
/* Copier la semaine d'un collaborateur : petit bouton au bout de son nom, visible au survol de sa ligne. */
.row-copy-btn { margin-left: auto; flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .1s; }
.planning-table tr:hover .row-copy-btn, .row-copy-btn:focus-visible { opacity: 1; }
.row-copy-btn:hover { color: var(--green-700); border-color: var(--green-700); }
@media (hover: none) { .row-copy-btn { display: none; } }
/* Lignes à pourvoir du planning (HUM-22) : « + Ligne à pourvoir » sous « Non assigné », menu « ⋯ » toujours visible
   (aussi sur écran tactile), nom coupé proprement, fenêtre « Attribuer à… ». */
.open-row-add { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--green-700); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.open-row-add:hover { text-decoration: underline; }
.planning-table .open-row-menu { opacity: 1; display: inline-flex; font-weight: 700; }
.open-row-label { flex: 1; min-width: 0; }
.open-row-label > div:first-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.open-row-assign { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.open-row-assign-title { font-weight: 700; margin-bottom: 4px; }
.open-row-assign-pick { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.open-row-assign-pick select { flex: 1; min-width: 0; }
.emp-row-sub { font-weight: 500; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.drag-handle { cursor: grab; color: var(--text-muted); font-size: 14px; }

.shift-chip {
  display: block; border-radius: 6px; padding: 4px 5px; margin-bottom: 4px;
  font-size: 11px; font-weight: 700; color: #fff; line-height: 1.3; position: relative; cursor: pointer;
  overflow: hidden; box-sizing: border-box; min-height: 36px;
}
/* Safety net now that the grid uses table-layout:fixed — the column can no
   longer grow to fit an unusually long time range, so clip gracefully
   instead of spilling into the next cell. */
.shift-time-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-chip.armed { outline: 2px solid var(--terracotta); outline-offset: 1px; }
.shift-chip .shift-rayon { font-weight: 500; opacity: .9; display: block; font-size: 10.5px; white-space: normal; }
.shift-chip .shift-hours { font-weight: 500; opacity: .85; }
/* Remarque d'un shift : texte libre, retours à la ligne gardés. */
.shift-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.my-shift-poste.shift-note-text { white-space: pre-wrap; overflow: visible; }
.shift-note-input { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }
/* Remarque d'un shift : pastille jaune en bas à droite (lisible sur toutes les couleurs de poste). */
.shift-note-dot { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: #F5C451; color: #3D2B00;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
/* Shift avec remarque : un peu plus haut, boutons d'action remontés, pour que rien ne recouvre la pastille. */
.shift-chip.has-note { min-height: 42px; }
.shift-chip.has-note .chip-actions { top: 2px; }
.planning-table.compact .shift-chip.has-note { min-height: 0; }
/* Pastille dans une ligne de texte (vues du salarié). */
.shift-note-dot.is-inline { position: static; display: inline-flex; vertical-align: -3px; margin-right: 6px; flex-shrink: 0; box-shadow: none; }
.planning-table.compact .shift-note-dot { right: 2px; bottom: 2px; width: 11px; height: 11px; box-shadow: none; }
.planning-table.compact .shift-note-dot svg { width: 7px; height: 7px; }
/* Pause d'un shift (HUM-50) : étiquette en bas à droite, à droite de la remarque (pastille jaune) s'il y en a une. */
.shift-badges { position: absolute; right: 4px; bottom: 4px; display: flex; align-items: center; gap: 3px; }
.shift-badges .shift-note-dot { position: static; }
/* Le poste passe sous l'étiquette : coupé proprement (…) au lieu d'être recouvert à moitié ; nom complet au survol. */
.shift-chip.has-pause .shift-rayon { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 40px; }
.shift-chip.has-pause.has-note .shift-rayon { padding-right: 60px; }
.planning-table.compact .shift-chip.has-pause .shift-rayon { padding-right: 0; }
.shift-pause-tag { display: inline-flex; align-items: center; gap: 1px; height: 14px; padding: 0 4px 0 3px; border-radius: 7px; background: #fff;
  color: #3A3A3C; font-size: 9px; font-weight: 700; line-height: 1; white-space: nowrap; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.shift-pause-tag svg { width: 9px; height: 9px; }
.shift-pause-tag.is-inline { height: auto; margin-left: 6px; padding: 0 5px; vertical-align: 1px; font-size: 10.5px; background: var(--bg); }
.planning-table.compact .shift-badges { right: 2px; bottom: 2px; gap: 2px; }
.planning-table.compact .shift-pause-tag { height: 11px; padding: 0 3px; font-size: 8px; gap: 1px; box-shadow: none; }
.planning-table.compact .shift-pause-tag svg { width: 7px; height: 7px; }
.shift-tasks-badge { display: block; font-weight: 500; opacity: .9; font-size: 10.5px; margin-top: 2px; white-space: normal; }

/* Shared hover-reveal action cluster for a shift/absence chip (+/✎/✕),
   grouped top-right, small round white buttons — not bigger than the
   cell's own "+" affordance. */
.chip-actions { position: absolute; top: 3px; right: 3px; display: flex; gap: 3px; opacity: 0; transition: opacity .1s; z-index: 2; }
.shift-chip:hover .chip-actions, .absence-chip:hover .chip-actions { opacity: 1; }
.round-icon-btn {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: #fff; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.round-icon-btn:hover { background: var(--green-100); }
.round-icon-btn.danger:hover { background: var(--danger); color: #fff; }
.cell-add-btn { position: absolute; top: 3px; right: 3px; opacity: 0; transition: opacity .1s; z-index: 2; }
.day-cell:hover .cell-add-btn { opacity: 1; }

.absence-chip {
  display: flex; align-items: center; border-radius: 6px; padding: 4px 5px; margin-bottom: 4px;
  font-size: 11px; font-weight: 700; line-height: 1.3; position: relative; cursor: pointer;
  box-sizing: border-box; min-height: 36px;
}
.absence-chip.confirmed { background: var(--text-muted); color: #fff; }
.absence-label { display: block; font-weight: 500; font-size: 10.5px; }

.planning-table td.day-cell.drag-target { background: linear-gradient(to right, var(--info-bg) 50%, var(--terracotta-100) 50%); }
.planning-table td.day-cell.drag-target::before {
  content: 'Copier'; position: absolute; left: 25%; top: 50%; transform: translate(-50%, -50%);
  font-size: 9px; font-weight: 700; color: var(--info); pointer-events: none; z-index: 2; white-space: nowrap;
}
.planning-table td.day-cell.drag-target::after {
  content: 'Déplacer'; position: absolute; left: 75%; top: 50%; transform: translate(-50%, -50%);
  font-size: 9px; font-weight: 700; color: var(--terracotta); pointer-events: none; z-index: 2; white-space: nowrap;
}
.planning-table td.day-cell.drag-target-copy { outline: 2px solid var(--info); outline-offset: -2px; }
.planning-table td.day-cell.drag-target-move { outline: 2px solid var(--terracotta); outline-offset: -2px; }

.radio-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.sort-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; margin: 10px 0; }
.sort-row { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; }
.sort-row.drag-over-row { outline: 2px dashed var(--terracotta); outline-offset: -2px; }
.sort-row .badge { margin-left: auto; }
/* Fenêtre « Ordre des collaborateurs » : rang, nom (équipes dessous), flèches monter / descendre. */
.sort-quick { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.sort-row .sort-rank { width: 22px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sort-row .sort-name { flex: 1; min-width: 0; }
.sort-row .sort-name small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sort-row .icon-btn { width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.sort-row .icon-btn:hover:not(:disabled) { border-color: var(--green-700); color: var(--green-700); }
.sort-row .icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Day view: hourly gantt ---------- */
.gantt-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
/* En-tête et lignes aussi larges que la frise (pas seulement que l'écran) : sinon, quand la vue Jour défile sur le
   côté (téléphone), fonds et traits de séparation s'arrêtent au milieu et la colonne figée des noms finit par partir. */
.gantt-header, .gantt-rows { width: max-content; min-width: 100%; }
.gantt-header { display: flex; border-bottom: 1px solid var(--border); background: var(--bg); }
.gantt-emp-col-header { width: 190px; flex-shrink: 0; padding: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 700; display: flex; flex-direction: column; gap: 4px; }
.gantt-legend { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.gantt-legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.gantt-legend-dot.open { background: var(--green-100); border: 1px solid var(--green-600); }
.gantt-hours { flex: 1; display: grid; grid-template-columns: repeat(24, minmax(34px, 1fr)); min-width: 820px; }
.gantt-hour { padding: 10px 2px; font-size: 10px; color: var(--text-muted); text-align: center; border-left: 1px solid var(--border); }
.gantt-hour-open { background: var(--green-100); color: var(--green-900); font-weight: 700; }
/* Haut de la vue Jour figé (HUM-51) : en-tête des heures et ligne « Présents » restent en haut du cadre, qui défile
   dans les deux sens ; total du jour dans l'en-tête « Total » (HUM-52). */
.gantt-wrap { overflow: auto; overscroll-behavior: auto; }
.gantt-head { position: sticky; top: 0; z-index: 6; width: max-content; min-width: 100%; }
.gantt-total-header .gantt-day-total { display: block; margin-top: 2px; font-size: 13px; color: var(--text); text-transform: none; }
.gantt-total-header .gantt-day-pers { display: block; font-size: 10.5px; font-weight: 600; text-transform: none; }
.gantt-presence .gantt-emp-col-header { padding-top: 4px; padding-bottom: 4px; font-size: 11px; }
.gantt-pres { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 34px; padding-bottom: 2px; border-left: 1px solid var(--border); font-size: 9.5px; color: var(--text-muted); }
.gantt-pres.is-open { background: rgba(31,122,90,.05); }
.gantt-pres-bar { display: block; width: 55%; border-radius: 3px 3px 0 0; background: #9CC8B3; }
.pb1 { height: 2px; } .pb2 { height: 4px; } .pb3 { height: 6px; } .pb4 { height: 8px; } .pb5 { height: 10px; }
.pb6 { height: 12px; } .pb7 { height: 14px; } .pb8 { height: 16px; } .pb9 { height: 18px; } .pb10 { height: 20px; }
.gantt-total-header { width: 70px; flex-shrink: 0; padding: 10px; font-size: 12px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; text-align: center; }
.gantt-rows { display: flex; flex-direction: column; }
.gantt-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: none; }
.gantt-emp-col { width: 190px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--bg); }
/* Colonne des noms figée pendant le défilement des heures, aussi sur ordinateur (29/10/2026) : la vue Jour s'ouvre
   sur les heures d'ouverture, et sans cela les noms sortaient de l'écran par la gauche. */
.gantt-emp-col-header, .gantt-emp-col { position: sticky; left: 0; z-index: 3; }
.gantt-emp-col-header { background: var(--bg); }
.gantt-emp-col [data-goto-emp] { cursor: pointer; }
.gantt-emp-col [data-goto-emp]:hover { color: var(--green-700); }
.gantt-track { flex: 1; min-width: 820px; position: relative; min-height: 56px; background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); background-size: calc(100% / 24) 100%; cursor: pointer; }
.gantt-open-band { position: absolute; top: 0; bottom: 0; background: rgba(44,138,103,.07); pointer-events: none; z-index: 0; }
.gantt-total { width: 70px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; background: var(--bg); }

.gantt-bar { position: absolute; top: 8px; bottom: 8px; z-index: 1; border-radius: 6px; color: #fff; font-size: 10.5px; font-weight: 700; padding: 4px 8px; overflow: hidden; white-space: nowrap; cursor: pointer; }
.gantt-bar-label { display: block; }
.gantt-bar-time { display: block; font-weight: 500; opacity: .85; font-size: 9.5px; }
.gantt-bar-delete { position: absolute; top: 2px; right: 4px; font-size: 10px; cursor: pointer; background: rgba(0,0,0,.25); border-radius: 3px; width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .1s; }
.gantt-bar:hover .gantt-bar-delete { opacity: 1; }
.gantt-bar-delete:hover { background: var(--danger); }

.gantt-absence-bar { position: absolute; left: 0; right: 0; top: 8px; bottom: 8px; z-index: 1; background: var(--border); color: var(--text-muted); border-radius: 6px; display: flex; flex-direction: column; justify-content: center; padding: 4px 12px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
/* Étapes d'une demande d'absence (choix de Vincent, 23/10/2026, maquettes A3 et E2) : bande de couleur à gauche
   + hachures. Déposée = gris ; validée par le manager rayon = orangé ; acceptée = gris plein (inchangé).
   Indisponibilité (plage horaire, classe .indispo) : déposée = gris ; acceptée = rouge hachuré, avec une horloge. */
.absence-chip.pending, .gantt-absence-bar.pending, .team-absence.pending, .my-absence-line.pending, .absence-chip.indispo, .gantt-indispo, .team-absence.indispo, .my-absence-line.indispo {
  border: 0; border-left: 4px solid var(--text-muted); color: var(--text-muted);
  background: var(--surface) repeating-linear-gradient(45deg, rgba(107,114,104,.22) 0 4px, transparent 4px 9px);
}
.absence-chip.approved1, .gantt-absence-bar.approved1, .team-absence.approved1, .my-absence-line.approved1 {
  border-left-color: var(--warning); color: var(--warning);
  background: var(--warning-bg) repeating-linear-gradient(45deg, rgba(180,121,14,.24) 0 4px, transparent 4px 9px);
}
.absence-chip.indispo.confirmed, .gantt-indispo.confirmed, .team-absence.indispo.confirmed, .my-absence-line.indispo.confirmed {
  border-left-color: var(--danger); color: var(--danger);
  background: var(--danger-bg) repeating-linear-gradient(45deg, rgba(196,67,46,.22) 0 4px, transparent 4px 9px);
}
.my-absence-card.pending { border-style: solid; background: var(--surface) repeating-linear-gradient(45deg, rgba(107,114,104,.12) 0 4px, transparent 4px 9px); }
.my-absence-card.approved1 { border-left-color: var(--warning); color: var(--warning); }
.my-absence-card.indispo.confirmed { border-left-color: var(--danger); color: var(--danger); }
/* « Congés de l'équipe » (onglet Demandes d'absence) : période, filtres, regroupement par mois, acceptées en gris. */
.leave-team-head { margin-top: 24px; }
.leave-period { display: flex; gap: 6px; }
.leave-period select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; }
.leave-filters { margin-bottom: 12px; flex-wrap: wrap; }
.leave-team-scroll { overflow-x: auto; }
.leave-team-table td { font-variant-numeric: tabular-nums; }
.leave-team-table tr.leave-month-row td { background: var(--bg); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 7px 14px; }
.leave-team-table tr.leave-done td { color: var(--text-muted); }
.leave-done-badge { font-weight: 500; }
.leave-team-table td.leave-dates { white-space: nowrap; }
.leave-type-sub { display: none; }
@media (max-width: 860px) {
  .leave-team-table th, .leave-team-table td { padding: 9px 8px; }
  .leave-team-table td.leave-dates { white-space: normal; }
  .leave-team-table .leave-col-opt { display: none; }
  .leave-type-sub { display: block; font-size: 11.5px; color: var(--text-muted); }
}
/* Horloge : « quelques heures » (indisponibilité). */
.clock-ico { display: inline-block; flex-shrink: 0; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; vertical-align: -1px; margin-right: 4px; box-sizing: border-box; }
.clock-ico::after { content: ''; position: absolute; left: 3px; top: 1px; width: 1.5px; height: 3px; background: currentColor; }
/* Vue Jour : la bande de l'indisponibilité, sous les shifts, avec son étiquette. */
.gantt-indispo { position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: auto; border-radius: 4px; font-size: 10.5px; font-weight: 700; padding: 3px 6px; box-sizing: border-box; overflow: hidden; white-space: nowrap; }
.gantt-absence-sub { font-weight: 500; font-size: 10px; opacity: .8; }

.agenda-list { display: flex; flex-direction: column; gap: 8px; }
.agenda-item { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.agenda-date { width: 130px; font-weight: 700; text-transform: capitalize; }
.agenda-time { color: var(--text-muted); }
.agenda-tasks { flex-basis: 100%; font-size: 12.5px; color: var(--text-muted); padding-left: 144px; }

.task-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 160px; overflow-y: auto; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.task-row-delete { position: static; background: transparent; color: var(--text-muted); }
.task-row-delete:hover { color: var(--danger); }
.task-row-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--green-700); background: var(--green-100); border-radius: 6px; padding: 1px 5px; margin-left: 4px; }

/* ---------- lists / tables ---------- */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table th { text-align: left; background: var(--bg); font-size: 12px; text-transform: uppercase; color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.clickable:hover { background: var(--bg); cursor: pointer; }

.list-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }

.search-bar { position: relative; max-width: 420px; margin-bottom: 16px; }
.search-bar input { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.search-bar input:focus { outline: 2px solid var(--green-600); outline-offset: 1px; }

/* Liste des salariés : même écart (12px) entre le texte + bouton, la
   recherche et le tableau. */
.emp-list-header { align-items: center; margin-bottom: 12px; }
.emp-list-header p { margin-top: 0; }
.emp-list-search { margin-bottom: 0; flex: 1 1 260px; }
/* Salariés : bandeau d'indicateurs de l'effectif (salaries.js > effectifBandHtml). Ordinateur : une ligne ;
   téléphone : cartes condensées, 3 par ligne (2 quand il n'y en a que 4). */
.kpi-band { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi-band.kpi-n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi-label, .kpi-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kpi-value { font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 21px; font-weight: 700; color: var(--green-900); line-height: 1.15; white-space: nowrap; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); }
.kpi-warn { color: var(--warning); font-weight: 600; }
.kpi-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; margin: 4px 0 1px; background: var(--border); }
.kpi-bar > span { display: block; height: 100%; }
.kpi-bar-cdi { background: var(--green-700); }
.kpi-bar-cdd { background: var(--terracotta); }
.kpi-bar-f { background: #7B61C9; }
.kpi-bar-h { background: var(--info); }
@media (max-width: 860px) {
  .kpi-band { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
  .kpi-band.kpi-n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { padding: 7px 8px; }
  .kpi-label, .kpi-sub { font-size: 10.5px; }
  .kpi-value { font-size: 17px; }
  .kpi-bar { height: 4px; margin: 3px 0 1px; }
}
/* Salariés > Liste : recherche + filtres (salaries.js) */
.emp-filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.emp-filter-btn.is-active { border-color: var(--green-700); color: var(--green-700); }
.emp-filter-select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; }
.emp-filter-reset { font-size: 13px; }
.emp-filter-break { display: none; }
/* Salariés > Liste : sélection et actions groupées (salaries.js) */
.emp-check-col { width: 36px; padding-right: 0 !important; cursor: default; }
.emp-check-col input { width: 17px; height: 17px; accent-color: var(--green-700); cursor: pointer; vertical-align: middle; }
.data-table tr.is-selected td { background: var(--green-100); }
.emp-bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; margin-bottom: 10px; background: var(--green-100); border: 1px solid var(--border); border-radius: var(--radius); }
.emp-bulk-count { font-weight: 700; font-size: 13px; color: var(--green-900); margin-right: 4px; }
.emp-bulk-clear { font-size: 13px; margin-left: auto; }
.bulk-list { margin: 6px 0 12px; padding-left: 18px; max-height: 220px; overflow-y: auto; font-size: 13px; }
.bulk-list li { margin: 3px 0; }
.emp-filter-panel { max-width: 420px; margin: -4px 0 12px; }
@media (max-width: 860px) {
  /* Ligne 1 : recherche + « Filtrer » ; ligne 2 : les listes, côte à côte. */
  .emp-list-search { flex: 1 1 calc(100% - 130px); min-width: 0; }
  .emp-filter-select { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 8px 6px; } /* deux par ligne */
  .emp-filter-break { display: block; flex-basis: 100%; height: 0; }
  .emp-filter-panel { max-width: none; }
}

/* ---------- fiche salarié ---------- */
.back-link { background: none; border: none; color: var(--green-700); font-weight: 700; padding: 0; margin-bottom: 14px; }
.fiche-title-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.fiche-card-wide { width: 100%; box-sizing: border-box; }
.field-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); column-gap: 40px; }
/* Dossier RH : trois champs sur une ligne (contact d'urgence, tailles). Sur téléphone, une colonne,
   sauf .field-grid-inline (valeurs courtes : tailles) qui reste sur une ligne. */
.field-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; }
.field-grid-inline { max-width: 560px; column-gap: 16px; }
/* Champ avec sa case « pas de … » juste en dessous. */
.field-error { margin: -2px 0 8px; font-size: 12px; color: var(--terracotta); }
.field-check .field { margin-bottom: 8px; }
.field-check .checkbox-row { margin: 0 0 14px; }
@media (max-width: 860px) {
  .field-grid-3:not(.field-grid-inline) { grid-template-columns: 1fr; }
}
.fiche-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.fiche-side { display: flex; flex-direction: column; gap: 8px; }
.fiche-side .avatar { width: 64px; height: 64px; font-size: 22px; margin-bottom: 8px; }
.fiche-save-row { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.info-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row span:first-child { color: var(--text-muted); flex-shrink: 0; }
.info-row span:last-child { text-align: right; word-break: break-word; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-600); margin-top: 5px; flex-shrink: 0; }
.timeline-date { font-size: 12px; color: var(--text-muted); }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; background: rgba(22,60,44,.35); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
/* Sélecteur de collaborateurs à cases à cocher (planning.js > mountStaffPicker) : recherche, Tous, Équipes, Employés. */
.staff-picker { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.staff-picker .sp-search { width: 100%; box-sizing: border-box; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 10px 12px; background: var(--bg); font: inherit; }
.staff-picker .sp-search:focus { outline: none; background: #fff; }
.staff-picker .sp-list { max-height: 260px; overflow-y: auto; }
.staff-picker .sp-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-weight: 400; margin: 0; }
.staff-picker .sp-row[hidden] { display: none; }
.staff-picker .sp-row:hover { background: var(--green-100); }
.staff-picker .sp-row input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--green-700); }
.staff-picker .sp-row span { display: block; margin: 0; font-weight: 500; font-size: 13.5px; color: var(--text); }
.staff-picker .sp-row .badge { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.staff-picker .sp-row .badge-success { color: var(--success); }
.staff-picker .sp-row .badge-warning { color: var(--warning); }
.staff-picker .sp-row .sp-sub { font-weight: 400; font-size: 11.5px; color: var(--text-muted); }
.staff-picker .sp-section { padding: 8px 12px 4px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.staff-picker .sp-empty { padding: 14px 12px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 860px) {
  .staff-picker .sp-list { max-height: 44dvh; }
  .staff-picker .sp-row { padding: 11px 12px; }
  .staff-picker .sp-row input { width: 20px; height: 20px; }
}
/* Indisponibilité : carte « Personnaliser la répétition » (planning.js > indispoFieldsHtml). */
.repeat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.repeat-head span { margin: 0; }
.repeat-card { margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.repeat-card[hidden] { display: none; }
.repeat-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 14.5px; margin-bottom: 12px; }
.repeat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.repeat-row[hidden] { display: none; }
.field .repeat-label { width: 86px; flex-shrink: 0; margin: 0; font-weight: 600; font-size: 13px; }
.field .repeat-row input, .field .repeat-row select { width: auto; flex: 1; min-width: 0; background: var(--surface); }
.field .repeat-row .repeat-num { flex: 0 0 64px; }
.repeat-row-dows .repeat-label { width: 100%; }
.dow-pills { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.dow-pill { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0; }
.dow-pill:hover { border-color: var(--green-700); color: var(--green-700); }
.dow-pill.is-on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.repeat-actions { margin-top: 4px; }
.repeat-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-width: 860px) {
  .field .repeat-label { width: 100%; }
  .dow-pill { width: 38px; height: 38px; }
  .dow-pills { gap: 5px; }
}
/* Petit calendrier de période des fenêtres d'absence (planning.js > mountRangeCalendar). */
.range-cal { border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--surface); }
.range-cal .rc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.range-cal .rc-head strong { text-transform: capitalize; font-size: 13.5px; }
.range-cal .rc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.range-cal .rc-dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 2px 0; margin: 0; }
.range-cal .rc-day { position: relative; height: 36px; border: none; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.range-cal .rc-day:hover { background: var(--green-100); }
.range-cal .rc-day.is-rest { color: var(--text-muted); font-weight: 400; background: var(--bg); }
.range-cal .rc-day.is-today { box-shadow: inset 0 0 0 1.5px var(--green-600); }
.range-cal .rc-day.in-range { background: var(--green-100); border-radius: 0; }
.range-cal .rc-day.is-start, .range-cal .rc-day.is-end { background: var(--green-700); color: #fff; }
.range-cal .rc-day.has-absence::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--terracotta); }
.range-cal .rc-day.has-colleague::before { content: ''; position: absolute; left: 50%; top: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--warning); }
.range-cal .rc-day.is-start.has-colleague::before, .range-cal .rc-day.is-end.has-colleague::before { background: #fff; }
.range-cal .rc-legend { display: flex; align-items: center; gap: 6px; margin: 2px 2px 0; font-size: 11.5px; color: var(--text-muted); }
.range-cal .rc-legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); display: inline-block; }
.colleague-notice { margin-top: 8px; border-radius: 8px; padding: 9px 12px; background: var(--warning-bg); font-size: 12.5px; }
.colleague-notice strong { color: var(--warning); }
/* Paramètres > Absences : types à rattacher au catalogue, règles de la convention collective (settings.js). */
.absence-link-notice { margin: 0 0 12px; border-radius: 8px; padding: 9px 12px; background: var(--warning-bg); font-size: 13px; }
.absence-link-notice strong { color: var(--warning); }
.absence-convention { margin-top: 20px; }
/* Paramètres > Règles : heures majorées (settings.js, renderMajorations). */
.majorations-card { max-width: 560px; margin-top: 20px; }
.majorations-block { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.majorations-block h4 { margin: 0 0 8px; font-size: 14px; }
.majorations-block p { margin: 0 0 6px; }
.majorations-block .field-hint { display: block; margin-top: 2px; }
/* Paie selon la convention (HUM-34) : avertissement loi / convention, libellé des heures de pointe. */
.paie-notice { margin: 4px 0 8px; border-radius: 8px; padding: 8px 11px; background: var(--warning-bg); color: var(--warning); font-size: 12.5px; line-height: 1.4; }
.repas-pointe-row { display: grid; grid-template-columns: 70px 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.repas-block { margin-bottom: 14px; }
.absence-convention h4 { margin: 16px 0 8px; font-size: 14px; }
.colleague-notice ul { margin: 4px 0 0; padding-left: 18px; }
.range-cal .rc-summary { margin: 8px 2px 2px; font-size: 12.5px; color: var(--text-muted); font-weight: 400; }
.modal-card:focus { outline: none; } /* curseur posé par openModal sur la fenêtre elle-même */
.modal-card { background: #fff; border-radius: 14px; width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow); }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0; font-size: 13px; }
.modal-card.modal-wide { max-width: 760px; padding: 0 28px 24px; }
.modal-actions-end { justify-content: flex-end; }
.modal-actions-end .btn { flex: 0 0 auto; min-width: 110px; }
.modal-actions-center { justify-content: center; }
.modal-actions-center .btn { flex: 0 0 auto; min-width: 110px; }

/* ---------- création d'un salarié (Salariés > + Ajouter) ---------- */
.create-emp-head { display: flex; align-items: center; gap: 24px; margin: 0 -28px 18px; padding: 20px 28px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.create-emp-head h3 { margin: 0; white-space: nowrap; }
.create-emp-progress { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.create-emp-progress span { display: block; height: 100%; background: var(--green-700); transition: width .25s; }
.create-emp-section { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.create-emp-divider { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 10px; }
.create-emp-required { font-size: 12px; color: var(--text-muted); }
.create-emp-note { font-size: 12.5px; color: var(--text-muted); margin: -4px 0 4px 24px; }
.create-emp-note-flush { margin: 0 0 4px; }
.field-grid-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.field-hint { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
/* Paramètres : informations reprises du répertoire Sirene, en lecture seule. */
.registry-note { margin: 0 0 14px; }
.field input:disabled { color: var(--text); background: var(--bg); cursor: not-allowed; }
.field select:disabled { color: var(--text); opacity: .75; }

/* ---------- accès à l'application (en-tête de fiche salarié) ---------- */
/* Actions de la fiche salarié (invitation, archiver) : une seule ligne, à droite du nom. */
.fiche-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Invitation envoyée, pas encore acceptée : vert atténué, cliquable pour renvoyer. */
.btn-sent { opacity: .62; }
.btn-sent:hover, .btn-sent:focus-visible { opacity: .9; }
.btn-sent:disabled { opacity: .4; }
/* Salariés > Équipes : organigramme (js/modules/equipes.js) */
.emp-list-toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.emp-list-toprow .btn { flex-shrink: 0; white-space: nowrap; }
/* Archivage et registre du personnel (registre.js). */
.exit-banner { align-items: center; flex-wrap: wrap; margin: 12px 0; }
.exit-banner > span { flex: 1 1 260px; }
.register-scroll { overflow-x: auto; }
.register-table td, .register-table th { font-size: 12.5px; vertical-align: top; }
.register-table .badge { white-space: normal; }
.register-cancelled td { color: var(--text-muted); text-decoration: line-through; }
.register-cancelled td:last-child { text-decoration: none; }
.register-actions { display: flex; gap: 8px; }
.register-version { padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.register-version > div { color: var(--text-muted); font-size: 12.5px; margin-top: 3px; }
.org-store { margin-bottom: 28px; }
.org-store-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.team-picker-host { margin-bottom: 12px; }
.org-team-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.org-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.org-team { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.org-team-orphans { border-style: dashed; }
.org-team-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.org-team-head h4 { margin: 0; }
.org-team-label { margin-top: 6px; }
.org-person { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.org-person .avatar { width: 28px; height: 28px; font-size: 11px; flex-shrink: 0; }
.org-person-name { display: flex; flex-direction: column; }
.org-person-sub { font-size: 11px; color: var(--text-muted); }
.org-empty { color: var(--text-muted); font-size: 13px; margin: 0; }
.team-pick-title { font-weight: 600; font-size: 13px; margin-top: 6px; }
.team-pick-help { color: var(--text-muted); font-size: 12px; margin: 2px 0 6px; }

/* Salariés > Organigramme : arbre visuel (js/modules/organigramme.js) */
.org-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.org-alert { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #EBD3A4; background: var(--warning-bg); color: var(--warning); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.org-alert:hover { border-color: var(--warning); }
.org-search { flex: 1; min-width: 200px; max-width: 320px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.org-zoom { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.org-zoom-group { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.org-zoom-btn { border: none; background: transparent; min-width: 34px; height: 32px; font-size: 16px; color: var(--text); }
.org-zoom-btn:hover { background: var(--green-100); }
.org-zoom-level { font-size: 12px; font-weight: 600; min-width: 58px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.org-viewport { --org-line: #9DBFB0; background: #EAF3EE; border: 1px solid var(--border); border-radius: var(--radius); height: calc(100vh - 250px); min-height: 420px; overflow: auto; cursor: grab; }
.org-viewport.is-dragging { cursor: grabbing; user-select: none; }
.org-stage { margin: 0 auto; }
.org-canvas { width: max-content; padding: 28px 24px 40px; transform-origin: 0 0; }
.org-canvas ul { list-style: none; margin: 0; }
.org-canvas li { display: flex; flex-direction: column; align-items: center; }

/* Branches horizontales (direction → magasins → équipes) */
.org-branch { display: flex; justify-content: center; align-items: flex-start; padding: 22px 0 0; position: relative; }
.org-branch::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1.5px solid var(--org-line); }
.org-branch > li { position: relative; padding: 22px 10px 0; }
.org-branch > li::before, .org-branch > li::after { content: ''; position: absolute; top: 0; width: 50%; height: 22px; border-top: 1.5px solid var(--org-line); }
.org-branch > li::before { right: 50%; }
.org-branch > li::after { left: 50%; border-left: 1.5px solid var(--org-line); }
.org-branch > li:first-child::before, .org-branch > li:last-child::after { border: 0; }
.org-branch > li:last-child::before { border-right: 1.5px solid var(--org-line); border-radius: 0 8px 0 0; }
.org-branch > li:first-child::after { border-radius: 8px 0 0 0; }
.org-branch > li:only-child::before { border-radius: 0; }
.org-root { padding-top: 0; gap: 24px; }
.org-root::before, .org-root > li::before, .org-root > li::after { display: none; }
.org-root > li { padding: 0; }

/* Membres d'une équipe : empilés sous la carte */
.org-leaves { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 0 0; position: relative; }
.org-leaves::before { content: ''; position: absolute; top: 0; bottom: 20px; left: 50%; border-left: 1.5px solid var(--org-line); }

.org-card { position: relative; z-index: 1; width: 210px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--team-color, var(--green-700)); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; transition: opacity .15s, box-shadow .15s; }
.org-leaves .org-card { border-top-width: 1px; border-left: 3px solid var(--team-color, var(--border)); padding: 9px 10px; }
.org-card-dashed { border-style: dashed; border-top: 1px dashed var(--text-muted); background: #FBFAF6; }
.org-card-warn { border-top-color: var(--warning); }
.org-card.org-dim { opacity: .35; }
.org-card.org-hit, .org-card.org-flash { box-shadow: 0 0 0 3px var(--terracotta), var(--shadow); }
.org-p { display: flex; flex-direction: column; align-items: center; gap: 5px; border: none; background: none; padding: 2px 4px; border-radius: 8px; font: inherit; color: inherit; width: 100%; }
.org-p .avatar { width: 34px; height: 34px; font-size: 12px; }
.org-p-link { cursor: pointer; }
.org-p-link:hover { background: var(--green-100); }
.org-p-link:hover .org-p-name { color: var(--green-700); }
.org-p-compact, .org-leaves .org-p { flex-direction: row; text-align: left; gap: 9px; }
.org-p-compact .avatar, .org-leaves .org-p .avatar { width: 28px; height: 28px; font-size: 11px; flex-shrink: 0; }
.org-p-text { display: flex; flex-direction: column; min-width: 0; }
.org-p-name { font-weight: 600; font-size: 13px; color: var(--text); }
.org-p-sub { font-size: 11.5px; color: var(--text-muted); }
.org-empty-title { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; color: var(--green-900); }
.org-card-warn .org-empty-title { color: var(--warning); }
.org-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.org-leaves .org-tags { justify-content: flex-start; width: 100%; padding-left: 37px; }
.org-tag { --c: var(--green-700); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 78%, #000); }
.org-count { position: absolute; right: 8px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-muted); }
.org-edit { position: absolute; top: 6px; right: 6px; border: none; background: transparent; color: var(--text-muted); padding: 4px; border-radius: 6px; display: inline-flex; }
.org-edit:hover { background: var(--green-100); color: var(--green-700); }
/* Plusieurs équipes (HUM-17, variante B2) : anneau aux couleurs des équipes, étiquettes avec la part du temps */
.org-ring { position: relative; width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.org-ring svg { position: absolute; inset: 0; width: 36px; height: 36px; }
.org-ring .avatar, .org-leaves .org-p .org-ring .avatar { width: 26px; height: 26px; font-size: 10px; }
.org-shares { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.org-share { --c: var(--green-700); font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--c); color: color-mix(in srgb, var(--c) 82%, #000); background: var(--surface); white-space: nowrap; }
.org-share.is-cur { background: var(--c); color: #fff; }
.org-leaves .org-card { padding-right: 26px; }
.org-share-btn { top: 4px; right: 4px; }
.org-card[draggable="true"] { cursor: grab; }
.org-card.org-dragging { opacity: .45; }
.org-card.org-drop { box-shadow: 0 0 0 3px var(--info), var(--shadow); }
.org-drop-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.org-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.org-choice span { font-size: 13px; color: var(--text-muted); }
.org-choice.is-main { border-color: var(--green-700); background: var(--green-100); }
.org-choice:hover { border-color: var(--green-700); }
.org-share-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin: 12px 0; background: var(--border); }
.org-share-bar span { display: block; height: 10px; }
.org-share-list { display: flex; flex-direction: column; }
.org-share-row { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--border); }
.org-share-check { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 14px; cursor: pointer; }
.org-share-check input { width: 18px; height: 18px; }
.org-share-check em { font-style: normal; color: var(--text-muted); font-size: 12px; }
.org-share-row .fin-unit { width: 96px; flex-shrink: 0; }
.org-share-total { margin: 12px 0 0; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: var(--radius); }
.org-share-total.is-ok { background: var(--success-bg); color: var(--success); }
.org-share-total.is-bad { background: var(--danger-bg); color: var(--danger); }
.org-toggle { position: relative; z-index: 2; margin-top: -10px; display: inline-flex; align-items: center; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.org-toggle:hover:not(:disabled) { border-color: var(--green-700); color: var(--green-700); }
.org-toggle:disabled { cursor: default; }
.org-toggle svg { transition: transform .15s; }
.org-toggle.is-open svg { transform: rotate(180deg); }
.org-toggle + .org-branch, .org-toggle + .org-leaves { margin-top: 0; }
/* Fiche salarié : bandeau des équipes (TeamsView.renderEmployeeTeams) */
.emp-teams { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.emp-teams-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-right: 4px; }
.emp-teams-none { font-size: 13px; color: var(--text-muted); }
.emp-teams-inline { margin: 0; }
/* Fiche salarié : nom de naissance et bloc « Accès aux établissements » (salaries.js) */
.birth-name .checkbox-row { margin: 0 0 14px; }
.access-main { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; margin: 8px 0 12px; font-size: 13px; }
.access-main-label { font-weight: 600; }
.access-main-help { grid-column: 1 / -1; font-size: 12px; color: var(--text-muted); }
.access-scroll { overflow-x: auto; }
.fiche-save-row + #pe-access { margin-top: 6px; }
.access-table td { vertical-align: middle; }
/* Fiche salarié, onglet Contrat en blocs (salaries.js) */
.field-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
@media (max-width: 860px) { .field-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.contrat-hint { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 0; }
.contrat-hint:empty { display: none; }
.contrat-dpae { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contrat-dpae .checkbox-row { margin: 0 0 6px; }
.is-computed input { color: var(--text-muted); background: var(--bg); }
.field .view-switch { display: inline-flex; }
/* Colonnes de largeur fixe : changer une valeur (rôle, poste) ne décale pas les autres colonnes. */
.access-table { table-layout: fixed; min-width: 780px; }
.access-table th:nth-child(1) { width: 18%; }
.access-table th:nth-child(2), .access-table th:nth-child(3), .access-table th:nth-child(4) { width: 20%; }
.access-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); width: 100%; max-width: 210px; }
@media (max-width: 860px) {
  .access-table thead { display: none; }
  .access-table, .access-table tbody, .access-table tr, .access-table td { display: block; width: 100%; }
  .access-table { min-width: 0; }
  .access-select { width: auto; min-width: 170px; }
  .access-table td { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; }
  .access-table td::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
  .access-table .view-switch { flex: 0 0 auto; min-height: 0; }
}
.emp-team-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 8px; }
.emp-team-role { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.emp-team-remove { border: none; background: transparent; color: inherit; padding: 0 2px; font-size: 15px; line-height: 1; opacity: .6; }
.emp-team-remove:hover { opacity: 1; }
.emp-teams .btn-sm { padding: 4px 10px; font-size: 12px; }
/* Paramètres > Droits d'accès (settings.js) */
.perm-card { margin-bottom: 18px; }
.perm-intro { color: var(--text-muted); font-size: 13px; margin: 0 0 14px; }
.perm-table-scroll { overflow-x: auto; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { text-align: left; vertical-align: middle; padding: 6px 8px; }
.perm-table th { font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; border-bottom: 2px solid var(--border); }
.perm-table th.perm-role-head { text-align: center; font-size: 16px; color: var(--green-900); }
.perm-table tr.perm-domain-first td { border-top: 1px solid var(--border); padding-top: 10px; }
.perm-table tr.perm-domain-first:first-child td { border-top: none; }
.perm-domain { font-weight: 700; }
.perm-action { color: var(--text-muted); font-size: 12px; white-space: nowrap; cursor: help; }
.perm-table td.perm-cell { text-align: center; }
.perm-na { color: var(--text-muted); }
.perm-help { color: var(--text-muted); font-size: 12px; margin: 2px 0 0; }
.perm-locked { color: var(--text-muted); }
.perm-fixed { font-size: 11px; }
.perm-cell select { min-width: 130px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12px; }
.perm-log-entry { border-top: 1px solid var(--border); padding: 8px 0; font-size: 13px; }
.perm-log-head { font-weight: 600; }
.perm-log-entry ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-muted); }

@media (max-width: 860px) {
  .org-search { max-width: none; flex-basis: 100%; }
  .org-zoom { margin-left: 0; width: 100%; justify-content: space-between; }
  .org-zoom .btn { display: none; }
  .org-viewport { height: calc(100dvh - 300px); min-height: 360px; }
}
.absence-chip.readonly, .shift-chip.readonly, .gantt-bar.readonly { cursor: default; }
/* Planning salarié : bascule « Mon planning / Mon équipe » */
.emp-scope-switch { margin-bottom: 12px; }

@media (max-width: 860px) {
  .field-grid-compact { grid-template-columns: 1fr; }
  .modal-card.modal-wide { padding: 0 18px 18px; }
  .create-emp-head { margin: 0 -18px 16px; padding: 16px 18px; gap: 14px; }
  .fiche-title-row { flex-wrap: wrap; }
  .fiche-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
}

/* ---------- toast ---------- */
.session-warning { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 210; display: flex; align-items: center; gap: 12px;
  max-width: calc(100% - 32px); padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--warning-bg); color: var(--warning);
  font-size: 14px; box-shadow: var(--shadow); }
.session-warning[hidden] { display: none; }
@media (max-width: 859px) { .session-warning { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--green-900); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); max-width: 320px; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

/* ---------- settings ---------- */
.settings-list { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.settings-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.settings-row-label { flex: 1; font-weight: 600; }
/* Fenêtre « Modèles de semaine » : pastilles et boutons sur une seule ligne, deux boutons de même taille,
   toujours côte à côte ; si la place manque, ils passent ensemble sous le nom du modèle. */
.tpl-row { flex-wrap: wrap; }
.tpl-info { flex: 1 1 180px; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.tpl-info .settings-row-label { flex: 1 1 auto; overflow-wrap: anywhere; }
.tpl-btns { display: flex; gap: 8px; margin-left: auto; }
.tpl-btns .btn { min-width: 104px; }
.tpl-row .badge, .tpl-row .btn, .tpl-actions .btn { white-space: nowrap; }
.label-short { display: none; }
.color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.color-swatch-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }

/* ---------- vault ---------- */
.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.vault-file { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; gap: 10px; align-items: flex-start; }
.vault-file-name { font-weight: 700; font-size: 13px; }
.vault-file-meta { font-size: 12px; color: var(--text-muted); }

/* ---------- Planning salarié : vues Semaine / Jour ---------- */
.my-week-summary { display: flex; gap: 10px; margin-bottom: 12px; }
.my-week-summary > div { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.my-week-summary-value { font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 700; color: var(--green-900); }
.my-week-summary-value span { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.my-week-summary-label { font-size: 12px; color: var(--text-muted); }

.my-week-list { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.my-day-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; min-height: 64px; color: var(--text); font-size: 14px;
}
.my-day-card:hover { border-color: var(--green-600); }
.my-day-card.today { border-color: var(--green-700); box-shadow: inset 3px 0 0 var(--green-700); }
.my-day-date { width: 58px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.my-day-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.my-day-num { font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 700; color: var(--green-900); }
.my-day-today { font-size: 9px; font-weight: 700; color: var(--green-700); text-transform: uppercase; margin-top: 2px; }
.my-day-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.my-day-hours { font-weight: 700; font-size: 13px; color: var(--green-900); flex-shrink: 0; }
.my-shift-line { display: flex; align-items: center; flex-wrap: wrap; column-gap: 8px; min-width: 0; }
.my-shift-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.my-shift-time { font-weight: 700; white-space: nowrap; }
.my-shift-poste { flex-basis: 100%; padding-left: 18px; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-absence-line { display: inline-block; align-self: flex-start; background: var(--text-muted); color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; }
.my-day-off { color: var(--text-muted); font-size: 13px; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; max-width: 720px; }
.week-strip-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 0; color: var(--text);
}
.week-strip-day.today .week-strip-num { color: var(--green-700); }
.week-strip-day.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.week-strip-day.active .week-strip-dow, .week-strip-day.active .week-strip-num { color: #fff; }
.week-strip-dow { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.week-strip-num { font-size: 16px; font-weight: 700; }
.week-strip-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.week-strip-dot.shift { background: var(--terracotta); }
.week-strip-dot.absence { background: var(--text-muted); }
.week-strip-day.active .week-strip-dot.shift, .week-strip-day.active .week-strip-dot.absence { background: #fff; }

.my-day-detail { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.my-shift-card, .my-absence-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--green-700); border-radius: var(--radius); padding: 14px 16px; }
.my-absence-card { border-left-color: var(--text-muted); }
.my-shift-card-time { font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 24px; font-weight: 700; color: var(--green-900); }
.my-shift-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; color: var(--text-muted); font-size: 13px; }
.my-shift-poste-badge { color: #fff; font-weight: 700; font-size: 12px; border-radius: 20px; padding: 2px 10px; }
.my-shift-tasks { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.my-shift-tasks-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.my-shift-tasks ul { margin: 0; padding-left: 18px; }
.my-shift-tasks li { padding: 2px 0; }
.my-day-total { text-align: right; color: var(--text-muted); font-size: 13px; }
.my-day-total strong { color: var(--green-900); }
.my-day-empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

.day-timeline { margin-top: 14px; }
.day-timeline-track { position: relative; height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.day-timeline-open { position: absolute; top: 0; bottom: 0; background: var(--green-100); }
.day-timeline-shift { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; }
.day-timeline-ticks { position: relative; height: 16px; margin-top: 3px; }
.day-timeline-ticks span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); }
.day-timeline-ticks span:first-child { transform: none; }
.day-timeline-ticks span:last-child { transform: translateX(-100%); }
.day-timeline-legend { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Notifications (cloche de la barre du haut) ---------- */
.notif-btn { position: relative; border: none; background: transparent; color: var(--green-900); padding: 8px; border-radius: 8px; display: flex; align-items: center; }
.notif-btn:hover { background: var(--green-100); }
.notif-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--terracotta); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.notif-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.notif-switch { margin-top: 4px; }
.notif-item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.notif-item:hover { border-color: var(--green-700); }
/* Archiver une notification d'un clic (21/10/2026) : bouton à droite de chaque notification, toujours visible
   (pas révélé au survol), 40 px pour le doigt ; « Tout archiver » à côté des onglets. */
.notif-row { display: flex; align-items: stretch; gap: 8px; }
.notif-row .notif-item { flex: 1; min-width: 0; }
.notif-archive-btn { flex-shrink: 0; width: 40px; min-height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.notif-archive-btn:hover { color: var(--green-700); border-color: var(--green-700); }
.notif-toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.notif-toprow .notif-switch { margin-top: 4px; }
.notif-archive-all { display: inline-flex; align-items: center; gap: 6px; }
.notif-item.archived { opacity: .75; }
.notif-item.unread { border-color: var(--terracotta); background: var(--terracotta-100); }
.notif-title { font-weight: 700; margin-bottom: 4px; }
.notif-line { font-size: 13px; padding: 1px 0; }
.notif-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }

/* ---------- Planning, vue Jour « Équipe » (téléphone, pour qui gère le planning) : cartes par équipe ---------- */
.team-day { display: flex; flex-direction: column; gap: 7px; }
.team-section-head { display: flex; justify-content: space-between; gap: 8px; margin: 10px 2px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.team-section-head:first-child { margin-top: 0; }
.team-card { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: var(--radius); padding: 9px 11px; min-height: 58px; }
.team-card.can-add { cursor: pointer; }
.team-card.is-open { border-style: dashed; border-left-style: solid; }
.team-card .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.team-open-avatar { background: var(--text-muted); }
.team-card-who { flex: 1; min-width: 0; }
.team-card-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-card-day { flex-shrink: 0; max-width: 55%; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.team-shift { cursor: pointer; }
.team-shift.readonly { cursor: default; }
.team-shift-time { font-weight: 700; font-size: 15px; color: var(--green-900); white-space: nowrap; display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.team-shift-poste { display: inline-block; max-width: 100%; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.team-absence { display: inline-block; max-width: 100%; background: var(--text-muted); color: #fff; border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.team-absence[data-absence-req] { cursor: pointer; }
.team-none { color: var(--text-muted); font-size: 12.5px; }
.team-add-btn { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); color: var(--green-700); font-size: 15px; font-weight: 600; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.team-add-btn:hover { background: var(--green-100); border-color: var(--green-600); }
.team-indispo { font-size: 11.5px; color: var(--text-muted); }

/* ---------- Navigation téléphone ---------- */
.bottom-nav { display: none; }
.more-menu { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.more-menu-title { text-align: center; }
.more-menu-item { display: block; text-align: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); text-decoration: none; font-weight: 600; }

/* Écrans tactiles : pas de survol, donc pas de boutons +/✎/✕ qui
   masqueraient les horaires. Toucher une case vide = ajouter, toucher un
   shift ou une absence = ouvrir sa fiche (voir wireCellInteractions). */
@media (hover: none) {
  .chip-actions, .cell-add-btn, .gantt-bar-delete { display: none; }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .fiche-grid { grid-template-columns: 1fr; }

  /* Shell : barre du haut compacte + onglets en bas, marges pour l'encoche */
  /* L'écran est une colonne de hauteur fixe : barre du haut, contenu qui défile, barre du bas.
     La page elle-même ne défile jamais — une barre « position: fixed » se décrochait sur iPhone
     en arrivant en bas de page (rebond de défilement, barre d'outils du navigateur). */
  /* Colonne posée sur tout l'écran (position fixe, bords à 0) plutôt qu'une hauteur en 100dvh : sur iPhone en
     application installée, après le clavier (code de connexion…), 100dvh restait réduit et la page restait décalée
     vers le haut — barre du bas remontée au milieu avec du vide dessous, haut de l'écran sous la barre d'état
     (retour de Biocoop Thonon, 21/10/2026). Les bords suivent l'écran réel, et la page n'a plus rien à faire défiler. */
  .app-shell { position: fixed; top: 0; right: 0; bottom: 0; left: 0; flex-direction: column; height: auto; min-height: 0; overflow: hidden; }
  html, body { overscroll-behavior: none; }
  .main-col { flex: 1 1 auto; min-height: 0; }
  .topbar { height: auto; min-height: 52px; flex-shrink: 0; padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); z-index: 20; }
  .topbar h2 { font-size: 18px; }
  .user-chip { padding: 0; background: none; }
  .user-chip-meta, .user-chip-caret { display: none; }
  /* Téléphone : pas la place dans la barre du haut ; « Changer de société » est dans « Plus ». */
  .org-menu { display: none; }
  .view-content { min-height: 0; padding: 14px 16px 24px; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  /* Texte descriptif masqué (place), mais on garde les boutons d'action */
  .view-header { margin-bottom: 10px; }
  .view-header > div > p { display: none; }
  .view-header:not(:has(button)) { display: none; }
  .tabs { margin-bottom: 12px; overflow-x: auto; }
  .tab-btn { padding: 10px 12px; white-space: nowrap; }

  .bottom-nav {
    display: flex; flex-shrink: 0; position: relative; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav-item {
    flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
    min-height: 56px; padding: 6px 2px; border: none; background: none;
    font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 12.5px; font-weight: 700; color: var(--text-muted); text-decoration: none;
    border-top: 3px solid transparent;
  }
  .bottom-nav-item.active { color: var(--green-700); border-top-color: var(--green-700); }

  /* Barre d'outils du planning : navigation de date pleine largeur */
  .planning-toolbar { gap: 8px; flex-wrap: wrap; }
  .date-nav-box { width: 100%; }
  .date-nav-box .icon-btn { padding: 10px 14px; }
  .week-label-btn { font-size: 14px; }
  /* 2e ligne = Jour/Semaine/Mois + cadenas (42px + 8px d'écart), rien d'autre */
  .view-switch { flex: 1 1 calc(100% - 50px); min-height: 42px; }
  /* 2e ligne avec la bascule Équipe / Moi : Jour / Semaine / Mois, bascule, cadenas (vue Semaine) — 21/10/2026.
     Le cadenas ne sert qu'en vue Semaine : masqué en vue Jour pour laisser la place à Frise / Équipe / Moi. */
  .planning-toolbar.has-scope > .view-switch:not(.scope-switch) { flex: 1 1 auto; min-width: 0; }
  .planning-toolbar.has-scope .switch-btn { padding: 8px 6px; }
  .planning-toolbar > .scope-switch { flex: 0 0 auto; }
  .planning-toolbar > .scope-switch .switch-btn { flex: 0 0 auto; padding: 8px 9px; }
  .planning-toolbar.is-day > #btn-lock { display: none; }
  .switch-btn { flex: 1; padding: 8px 6px; }
  .toolbar-spacer { display: none; }
  .tool-btn-solo { width: 42px; height: 42px; }
  /* Icônes + bouton Publier sur une même ligne, sur toute la largeur */
  .toolbar-group { flex: 1 1 auto; min-height: 42px; gap: 0; justify-content: space-between; }
  .toolbar-group .tool-btn { flex: 1 1 24px; width: 24px; min-width: 24px; height: 34px; }
  .planning-toolbar #btn-publish { flex: 0 0 auto; min-height: 42px; padding: 4px 12px; font-size: 13px; }

  /* Un bouton près d'un titre reste à côté du titre, jamais dessous */
  .list-toolbar { flex-wrap: nowrap; }
  .list-toolbar > h3, .list-toolbar > div:first-child { flex: 1; min-width: 0; font-size: 16px; }
  .list-toolbar .btn, .tabs-action .btn, .emp-list-toprow .btn { flex-shrink: 0; white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .tpl-btns { flex: 1 1 100%; }
  .tpl-btns .btn { flex: 1; }
  .emp-list-toprow .view-switch { flex: 0 1 auto; min-width: 0; min-height: 0; overflow-x: auto; }
  .emp-list-toprow .switch-btn { flex: 0 1 auto; padding: 8px 7px; white-space: nowrap; }
  /* Exception : une rangée de filtres est trop large pour tenir à côté du titre → dessous, sur toute la largeur */
  .list-toolbar:has(> .view-switch) { flex-wrap: wrap; }
  .list-toolbar:has(> .view-switch) > h3 { flex-basis: 100%; }
  .list-toolbar > .view-switch { flex: 1 1 100%; min-height: 0; overflow-x: auto; }
  .list-toolbar > .view-switch .switch-btn { white-space: nowrap; padding: 8px 8px; }

  /* Grille manager : reste utilisable, 1re colonne figée pendant le défilement */
  .planning-table-scroll { max-height: calc(100dvh - 150px); }
  .planning-table th { width: 118px; font-size: 10.5px; letter-spacing: 0; padding: 8px 4px; }
  .planning-table th:first-child, .planning-table td.emp-col { width: 126px; }
  .planning-table td.day-cell { width: 118px; }
  .planning-table .drag-handle, .planning-table td.emp-col .avatar { display: none; }
  /* Lignes salariés : prénom + nom sur une ligne, poste dessous en plus petit, fin coupée (…) si
     ça dépasse → toutes les lignes ont la même hauteur. */
  .planning-table td.emp-col { vertical-align: middle; padding: 8px 6px; }
  .planning-table td.day-cell { height: 40px; }
  /* Absence sur une seule ligne (fin coupée) : sinon elle passait sur 3 lignes et grandissait la ligne ; le détail s'ouvre au toucher */
  .planning-table .absence-chip { min-width: 0; overflow: hidden; }
  .planning-table .absence-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .emp-row-name > div, .gantt-emp-col > div { flex: 1; min-width: 0; }
  .emp-row-name > div > div:first-child, .gantt-emp-col > div > div:first-child { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .emp-row-sub { max-width: none; font-size: 10.5px; }
  .gantt-emp-col-header, .gantt-emp-col { width: 126px; position: sticky; left: 0; z-index: 3; }
  /* Vue Jour : fond opaque sur l'en-tête figé, sinon les heures défilaient en transparence sous « Employés » */
  .gantt-emp-col-header { background: var(--bg); }
  .gantt-emp-col .avatar { display: none; }

  /* Fenêtres : en feuille depuis le bas de l'écran */
  .modal-root { align-items: flex-end; padding: 0; }
  .modal-card { max-width: none; border-radius: 16px 16px 0 0; max-height: 92dvh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .toast-root { left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }

  /* Champs en 16px : évite le zoom automatique d'iOS au focus */
  input, select, textarea, .field input, .field select { font-size: 16px; }
  /* Champs de formulaire tous à la même hauteur et alignés. iOS donne aux
     champs date / heure une taille et une largeur minimales propres, qui
     les faisaient dépasser et se chevaucher. */
  .field { min-width: 0; }
  .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), .field select {
    display: block; box-sizing: border-box; width: 100%; min-width: 0; height: 44px; padding-top: 0; padding-bottom: 0; margin: 0; line-height: normal;
  }
  /* line-height = hauteur du champ : sans ça iOS colle la date / l'heure en haut ; couleur du texte normale (pas le bleu iOS) */
  .field-static { height: 44px; padding-top: 0; padding-bottom: 0; }
  .field input[type=date], .field input[type=time] { -webkit-appearance: none; appearance: none; line-height: 42px; color: var(--text); }
  .field input[type=date] { text-align: left; }
  .field input::-webkit-date-and-time-value { margin: 0; line-height: 42px; }
  .field input[type=date]::-webkit-date-and-time-value { text-align: left; }
  .field-static { min-height: 44px; }
  .field input.input-center { padding-left: 8px; padding-right: 8px; }
  /* Heure : pas d'icône d'horloge (elle tronquait « 09:00 » dans les colonnes étroites), toucher le champ suffit */
  .field input[type=time] { padding-left: 8px; padding-right: 8px; }
  .field input[type=time]::-webkit-calendar-picker-indicator { display: none; }

  /* Tableaux de liste : marges resserrées pour tenir dans l'écran */
  .data-table th, .data-table td { padding: 10px 8px; }
  /* Tableau plus large que l'écran : il défile dans son cadre au lieu de déborder de la page */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table .badge { white-space: nowrap; }

  .agenda-date { width: auto; }
  .agenda-tasks { padding-left: 0; }
}

/* PWA lancée depuis l'écran d'accueil (iOS barre de statut translucide) */
@media (display-mode: standalone) {
  .auth-screen { padding-top: calc(24px + env(safe-area-inset-top)); }
}

/* ---------------- Impression du planning (bouton « Imprimer ») ----------------
   planning.js construit #print-root puis ajoute body.print-planning : seule
   cette copie s'imprime, en paysage, une semaine par page. */
#print-root { display: none; }
@media print {
  /* Paysage, mais format de feuille libre (A4, Letter…) : imposer « A4 » masquait le choix du format dans Chrome et le PDF
     ouvert dans Aperçu (macOS) ne suivait plus la feuille choisie (retour de Vincent, 03/11/2026). La grille prend toute la largeur. */
  @page { size: landscape; margin: 8mm; }
  /* Feuille d'heures signée (timesheets.js > printSheet) : A4 portrait. */
  @page sheet { size: A4 portrait; margin: 14mm; }
  #print-root.print-sheet { page: sheet; font-size: 11px; }
  #print-root.print-sheet .data-table { width: 100%; border-collapse: collapse; }
  #print-root.print-sheet .data-table th, #print-root.print-sheet .data-table td { border: 1px solid #ccc; padding: 5px 6px; text-align: left; vertical-align: top; }
  #print-root.print-sheet .print-sign { margin-top: 14px; padding: 10px; border: 1px solid #999; }
  #print-root.print-sheet .print-sign code { font-size: 9px; word-break: break-all; }
  #print-root.print-sheet .print-history { margin-top: 12px; font-size: 10px; color: #444; }
  #print-root.print-sheet .print-history ul { margin: 4px 0 0 16px; padding: 0; }
  body.print-planning { background: #fff; }
  body.print-planning > *:not(#print-root) { display: none !important; }
  body.print-planning #print-root { display: block; font-size: 10px; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-root .print-section + .print-section { break-before: page; }
  #print-root .print-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; }
  /* Humalo sur le planning imprimé (HUM-21) : bandeau logo | magasin et semaine | date, et « Humalo » pâle, seul, dans le coin bas droit de chaque page. */
  #print-root .print-section { position: relative; }
  #print-root .print-brandbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1.5px solid #163C2C; padding-bottom: 4px; }
  #print-root .print-brand { display: flex; align-items: center; gap: 6px; font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px; font-weight: 800; color: #163C2C; }
  #print-root .print-brand .humalo-mark { width: 22px; height: 22px; }
  #print-root .print-center { text-align: center; }
  #print-root .print-brandbar .print-meta { text-align: right; }
  #print-root .print-signature { position: fixed; right: 0; bottom: 0; font-family: 'Bricolage Grotesque', sans-serif; font-size: 12px; font-weight: 800; color: #163C2C; opacity: .35; }
  #print-root .print-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 15px; font-weight: 700; }
  #print-root .print-period { font-size: 12px; font-weight: 600; margin-top: 2px; }
  #print-root .print-meta { font-size: 9px; color: #555; }
  #print-root .empty-state { display: none; }
  #print-root.print-register .data-table { width: 100%; border-collapse: collapse; }
  #print-root.print-register .data-table th, #print-root.print-register .data-table td { border: 1px solid #999; padding: 3px 5px; text-align: left; vertical-align: top; font-size: 9px; }
  #print-root.print-register .register-scroll { overflow: visible; }

  /* !important : la hauteur du cadre à l'écran est posée par fitToScreen (HUM-51) et la frise imprimée en est une copie. */
  #print-root .planning-table-scroll, #print-root .gantt-wrap { overflow: visible; max-height: none !important; border: none; }
  #print-root .planning-table tfoot td, #print-root .gantt-head { position: static; }
  #print-root .planning-table th, #print-root .planning-table td.emp-col { position: static; }
  #print-root .planning-table { border: 1px solid var(--border); }
  /* min-width: 0 : la largeur minimale de l'écran (1040 px, theme-apple.css) dépassait la feuille sur Chrome et coupait la colonne des heures (retour de Vincent, 03/11/2026). */
  #print-root .planning-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; border-radius: 0; overflow: visible; }
  #print-root .planning-table thead { display: table-header-group; }
  #print-root .planning-table tr { break-inside: avoid; }
  #print-root .planning-table th { width: auto; font-size: 9px; padding: 4px 3px; }
  #print-root .planning-table th:first-child { width: 17%; }
  #print-root .planning-table th:last-child { width: 9%; }
  #print-root .planning-table td { padding: 3px; }
  #print-root .planning-table td.emp-col, #print-root .planning-table td.day-cell, #print-root .planning-table td.total-cell { width: auto; }
  #print-root .planning-table td.day-cell { height: auto; min-height: 0; }
  #print-root .emp-row-name { gap: 4px; }
  #print-root .avatar { display: none; }
  #print-root .emp-row-sub { white-space: normal; }
  #print-root .shift-chip, #print-root .absence-chip { font-size: 8.5px; padding: 2px 3px; margin-bottom: 2px; min-height: 0; }
  #print-root .absence-chip.confirmed { background: #e6e6e6; color: #333; }
  /* Shift imprimé : barre de couleur en bordure et texte décalé à sa droite (Safari imprime mal l'ombre intérieure du thème, retour de Vincent 03/11/2026). */
  #print-root .shift-chip { box-shadow: none; border-left: 4px solid var(--c, #8E8E93); border-radius: 4px; padding-left: 5px; }
  #print-root td.day-cell.locked, #print-root th.locked, #print-root .gantt-track.locked { background-color: transparent; }
  #print-root .locked .shift-chip, #print-root .locked .absence-chip, #print-root .locked .gantt-bar { opacity: 1; filter: none; }

  #print-root .gantt-wrap { overflow: visible; border-radius: 0; }
  #print-root .gantt-hours, #print-root .gantt-track { min-width: 0; }
  #print-root .gantt-hours { grid-template-columns: repeat(24, minmax(0, 1fr)); }
  #print-root .gantt-hour { font-size: 8px; padding: 6px 0; }
  #print-root .gantt-emp-col, #print-root .gantt-emp-col-header { width: 150px; }
  #print-root .gantt-row { break-inside: avoid; }
}

/* Finances : masse salariale et budget (js/modules/finances.js) */
.fin-toolbar h3 { margin: 0; }
.fin-year { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fin-year .btn { padding: 4px 10px; font-size: 16px; line-height: 1; }
.fin-range { color: var(--text-muted); font-size: 13px; }
.fin-warning { background: var(--warning-bg); border: 1px solid #EBD3A4; color: var(--text); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.fin-warning strong { color: var(--warning); }
.fin-link { border: none; background: none; padding: 0; color: var(--green-700); font-weight: 600; text-decoration: underline; font-size: inherit; }
.fin-link.is-danger { color: var(--danger); }
.fin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Budget initial et révisions */
.fin-history td { vertical-align: top; }
.fin-history tr.is-current td { background: var(--green-100); }
.fin-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--bg); font-size: 12px; white-space: nowrap; }
.fin-pill.is-current { background: var(--green-700); color: #fff; }
.fin-what { display: flex; flex-wrap: wrap; gap: 4px; }
.fin-trace { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.fin-acts { display: flex; gap: 12px; margin-top: 4px; font-size: 12.5px; }
.fin-up { color: var(--green-700); }
.fin-down { color: var(--danger); }
.fin-rev-modes { margin-bottom: 6px; flex-wrap: wrap; }
.fin-rev-preview { display: grid; gap: 6px; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.fin-rev-preview > div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; font-size: 13px; }
.fin-rev-preview span { color: var(--text-muted); }
.fin-rev-preview strong { font-variant-numeric: tabular-nums; }
.fin-rev-preview em { font-style: normal; font-size: 12px; color: var(--text-muted); }
.fin-rev-preview em.fin-up { color: var(--green-700); }
.fin-rev-preview em.fin-down { color: var(--danger); }
.fin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fin-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.fin-tile-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.fin-tile-value { font-family: 'Bricolage Grotesque', sans-serif; font-size: 24px; font-weight: 700; color: var(--green-900); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.fin-tile-sub { font-size: 12px; color: var(--text-muted); }
.fin-card { margin-bottom: 14px; }
.fin-card h4 { margin-bottom: 12px; }
.fin-card .list-toolbar h4 { margin: 0; }
.fin-empty, .fin-hint, .fin-note { color: var(--text-muted); font-size: 13px; }
.fin-hint { margin-bottom: 10px; }
.fin-note { margin-top: 4px; }
.fin-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; }
.fin-gauge-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fin-gauge-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.fin-gauge-status { font-size: 11.5px; font-weight: 700; }
.fin-gauge-status.is-ok { color: var(--success); }
.fin-gauge-status.is-over { color: var(--danger); }
.fin-gauge-value { font-family: 'Bricolage Grotesque', sans-serif; font-size: 20px; font-weight: 700; color: var(--green-900); margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.fin-gauge-value span { font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.fin-gauge-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.fin-bar { height: 8px; border-radius: 4px; background: var(--green-100); overflow: hidden; }
.fin-bar-fill { height: 100%; border-radius: 4px; background: var(--green-700); }
.fin-bar-fill.is-over { background: var(--danger); }
.fin-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.fin-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fin-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fin-swatch.is-done, .fin-chart-bar.is-done { background: var(--green-700); }
.fin-swatch.is-planned, .fin-chart-bar.is-planned { background: repeating-linear-gradient(45deg, #A9CDB9 0 4px, #CFE4D7 4px 8px); }
.fin-swatch.is-ref { height: 0; border-radius: 0; border-top: 2px dashed var(--terracotta); width: 18px; }
.fin-chart { position: relative; padding-left: 64px; }
.fin-chart-plot { position: relative; height: 200px; margin-bottom: 24px; }
.fin-chart-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.fin-chart-tick span { position: absolute; right: 100%; margin-right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-chart-ref { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--terracotta); z-index: 2; pointer-events: none; }
.fin-chart-cols { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.fin-chart-col { flex: 1; position: relative; display: flex; justify-content: center; border-radius: 6px; outline: none; cursor: default; }
.fin-chart-col:hover, .fin-chart-col:focus-visible { background: rgba(31,111,84,.07); }
.fin-chart-stack { width: 60%; max-width: 34px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.fin-chart-bar { width: 100%; min-height: 2px; }
.fin-chart-stack > .fin-chart-bar:first-child { border-radius: 4px 4px 0 0; }
.fin-chart-x { position: absolute; top: 100%; margin-top: 6px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.fin-chart-tip { position: absolute; top: -6px; background: var(--green-900); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 3; pointer-events: none; }
.fin-table-scroll { overflow-x: auto; }
.fin-table { font-size: 13px; }
.fin-table th, .fin-table td { padding: 9px 12px; white-space: nowrap; }
.fin-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.fin-future td { color: var(--text-muted); }
.fin-current td { background: #F4F9F5; }
.fin-badge { background: var(--green-100); color: var(--green-700); margin-left: 6px; }
.fin-muted { color: var(--text-muted); }
.fin-ca-input { width: 110px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); text-align: right; font-variant-numeric: tabular-nums; }
.fin-ca-input:focus { outline: 2px solid var(--green-600); outline-offset: 1px; }
.fin-team { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.fin-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); display: inline-block; flex-shrink: 0; }
.fin-mini { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 150px; }
.fin-mini .fin-bar { width: 100%; height: 6px; }
.fin-budget-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.fin-budget-table th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); text-align: center; padding: 4px 6px; }
.fin-budget-table td { padding: 4px 6px; }
.fin-budget-table td:first-child { white-space: nowrap; }
.fin-budget-table input { width: 100%; min-width: 90px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.modal-wide > h3:first-child { margin-top: 22px; }
.fin-tile { border-left: 3px solid var(--border); }
.fin-tile.is-ok { border-left-color: var(--success); }
.fin-tile.is-over { border-left-color: var(--danger); }
.fin-tile-status { font-size: 11.5px; font-weight: 700; margin-bottom: 2px; }
.fin-tile.is-ok .fin-tile-status { color: var(--success); }
.fin-tile.is-over .fin-tile-status { color: var(--danger); }
.fin-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.fin-grid-2 .fin-card { margin-bottom: 0; }
.fin-grid-2 .fin-card, .fin-traj-chart { container-type: inline-size; }
@container (max-width: 560px) { .fin-x-rest { display: none; } }
.fin-swatch.is-ca, .fin-chart-bar.is-ca { background: var(--info); }
.fin-swatch.is-over, .fin-chart-bar.is-over { background: var(--danger); }
.fin-swatch.is-line-real, .fin-swatch.is-line-proj, .fin-swatch.is-line-env, .fin-swatch.is-line-rev { height: 0; width: 18px; border-radius: 0; border-top: 3px solid var(--green-700); }
.fin-swatch.is-line-proj { border-top: 3px dotted var(--green-600); }
.fin-swatch.is-line-env { border-top: 2px dashed var(--terracotta); }
.fin-swatch.is-line-rev { border-top: 2px dashed var(--info); }
.fin-chart-plot-tall { height: 240px; }
/* Enveloppe en marches, budget initial, drapeaux des révisions (lot 2, 01/11/2026) */
.fin-swatch.is-line-init { height: 0; width: 18px; border-radius: 0; border-top: 2px dashed var(--text-muted); }
.fin-line-svg .is-init { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 3 5; }
.fin-chart-flag { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border); z-index: 1; pointer-events: none; }
.fin-chart-flag span { position: absolute; bottom: 6px; left: 4px; font-size: 10.5px; color: var(--terracotta); font-weight: 600; white-space: nowrap; background: var(--surface); padding: 0 3px; }
/* Masse salariale mois par mois : barres de l'exercice et du précédent, repère de l'enveloppe du mois */
.fin-chart-pair { width: 60%; max-width: 34px; height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.fin-chart-pair.is-pair { width: 80%; max-width: 52px; }
.fin-chart-pair .fin-chart-stack { width: 100%; max-width: none; }
.fin-swatch.is-prev, .fin-chart-bar.is-prev { background: #C9DDD0; }
.fin-chart-pair .fin-chart-stack > .fin-chart-bar:last-child { border-radius: 0; }
.fin-chart-pair .fin-chart-stack > .fin-chart-bar:first-child { border-radius: 4px 4px 0 0; }
.fin-chart-mark { position: absolute; left: 6%; right: 6%; border-top: 2px dashed var(--terracotta); z-index: 2; pointer-events: none; }
.fin-unit { position: relative; display: block; }
.fin-unit::after { content: attr(data-unit); position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; pointer-events: none; }
.fin-unit input { width: 100%; padding-right: 30px; padding-left: 30px; }
.fin-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.fin-months th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; }
.fin-months td, .fin-months th { white-space: nowrap; }
/* Trois repères */
.fin-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fin-cmp { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.fin-cmp.is-current { border-color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-700); }
.fin-cmp-k { font-size: 12.5px; color: var(--text-muted); font-weight: 600; padding-right: 90px; }
.fin-cmp-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fin-cmp-d { font-size: 12.5px; color: var(--text-muted); }
.fin-cmp-mark { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.fin-cmp-mark.is-ok { background: var(--success-bg); color: var(--success); }
.fin-cmp-mark.is-over { background: var(--danger-bg); color: var(--danger); }
.fin-cmp-mark.is-info { background: var(--info-bg); color: var(--info); }
.fin-line-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 1; pointer-events: none; }
.fin-line-svg polyline { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.fin-line-svg .is-real { stroke: var(--green-700); stroke-width: 3; }
.fin-line-svg .is-proj { stroke: var(--green-600); stroke-width: 2.5; stroke-dasharray: 2 5; }
.fin-line-svg .is-env { stroke: var(--terracotta); stroke-width: 2; stroke-dasharray: 7 5; }
.fin-line-svg .is-rev { stroke: var(--info); stroke-width: 2; stroke-dasharray: 7 5; }
.fin-chart-today { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--text-muted); z-index: 1; pointer-events: none; }
.fin-chart-today span { position: absolute; top: -4px; left: 4px; font-size: 10.5px; color: var(--text-muted); white-space: nowrap; background: var(--surface); padding: 0 3px; }
.fin-traj { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 24px; align-items: start; }
.fin-ca-steps { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 12px; margin-bottom: 12px; }
.fin-ca-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.fin-ca-row:last-child { border-bottom: none; }
.fin-ca-row span { color: var(--text-muted); }
.fin-ca-row strong { font-variant-numeric: tabular-nums; }
.fin-ca-row em { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--text-muted); }
.fin-adjust { border-radius: var(--radius); padding: 14px; background: var(--bg); border-left: 4px solid var(--border); }
.fin-adjust.is-ok { background: var(--success-bg); border-left-color: var(--success); }
.fin-adjust.is-over { background: var(--danger-bg); border-left-color: var(--danger); }
.fin-adjust-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.fin-adjust.is-ok .fin-adjust-title { color: var(--success); }
.fin-adjust.is-over .fin-adjust-title { color: var(--danger); }
.fin-adjust-value { font-family: 'Bricolage Grotesque', sans-serif; font-size: 26px; font-weight: 700; color: var(--green-900); margin: 2px 0; font-variant-numeric: tabular-nums; }
.fin-adjust-value span { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.fin-adjust-sub { font-size: 13px; margin-bottom: 8px; }
.fin-adjust-lines { font-size: 12.5px; color: var(--text); line-height: 1.6; }
.fin-trend-hint { margin: 10px 0 0; }
.fin-hbars { display: flex; flex-direction: column; gap: 12px; }
.fin-hbar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.fin-hbar-head span:first-child { font-weight: 600; }
.fin-hbar-head span:last-child { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-hbar-track { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.fin-hbar-fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--text-muted); min-width: 2px; }
@media (max-width: 860px) {
  .fin-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-tile-value { font-size: 19px; }
  .fin-chart { padding-left: 52px; }
  .fin-x-rest { display: none; }
  .fin-grid-2, .fin-traj { grid-template-columns: minmax(0, 1fr); }
  .fin-chart-tip { white-space: normal; max-width: 100%; }
}

/* Paramètres > Journal d'activité (settings.js, renderJournal) */
.journal-filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.journal-filters .field { flex: 1 1 220px; margin: 0; }
.journal-scroll { overflow-x: auto; }
.journal-table td { vertical-align: top; font-size: 13px; }
.journal-date { white-space: nowrap; color: var(--text-muted); }
.journal-detail { color: var(--text-muted); min-width: 180px; }
/* Noms des salariés d'une consultation, dépliés au clic (settings.js, journalNames) */
.journal-noms { margin-top: 4px; }
.journal-noms summary { cursor: pointer; color: var(--green-700); }
.journal-noms p { margin: 4px 0 0; color: var(--text); }
#journal-more { margin-top: 10px; }

/* Page « Bientôt disponible » d'un module pas encore en service (renderComingSoon, main.js) */
.soon { max-width: 860px; margin: 24px auto 40px; }
.soon-head { text-align: center; padding: 36px 24px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.soon-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-100); color: var(--green-700); }
.soon-badge { display: block; width: fit-content; margin: 16px auto 10px; padding: 3px 12px; border-radius: 20px; background: var(--terracotta-100); color: var(--terracotta); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.soon-title { font-family: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--green-900); margin: 0 auto 10px; max-width: 620px; }
.soon-lead { font-size: 15.5px; line-height: 1.55; color: var(--text); max-width: 600px; margin: 0 auto; }
.soon-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.soon-point { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.soon-point h3 { font-size: 15px; margin-bottom: 6px; }
.soon-point p { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.soon-note { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 18px; padding: 0 16px; }
@media (max-width: 860px) {
  .soon { margin-top: 8px; }
  .soon-head { padding: 28px 18px 22px; }
  .soon-title { font-size: 23px; }
  .soon-points { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Documents : éditeur de modèles et de contrats (documents.js, documents-editor.js) ---------- */
.doc-edit-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-name-input { flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-weight: 600; }
.doc-kind-select { padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; }
.doc-edit-actions { display: flex; gap: 8px; margin-left: auto; }
.doc-edit-hint { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 12px; max-width: 860px; }
.doc-editor { max-width: 860px; }
.doc-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px 10px 0 0; border-bottom: none; }
.doc-tool { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); font-size: 14px; cursor: pointer; }
.doc-tool:hover { border-color: var(--green-600); }
.doc-tool-select { height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; max-width: 100%; }
/* Panneau des champs à droite du texte (modèles) : liste complète, par groupe, avec recherche. */
.doc-editor.has-fields { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 270px; column-gap: 16px; align-items: start; }
.doc-editor.has-fields > .doc-toolbar, .doc-editor.has-fields > .doc-page { grid-column: 1; }
.doc-fields { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 0; max-height: calc(100vh - 150px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
/* HUM-60 : sur ordinateur, c'est la fenêtre qui défile, pas .view-content ; son « overflow-y: auto » en faisait pourtant
   le cadre de référence de position: sticky, et la barre d'outils comme la colonne des champs partaient avec le texte.
   Sur l'écran d'un éditeur de document, le cadre ne coupe plus rien : les deux restent en haut de la fenêtre. Sur
   téléphone (860px et moins), seul .view-content défile (mobile.md) : la règle ne s'y applique pas. */
/* Liste des champs ouverte par « @ » (HUM-60) : posée sous le curseur par documents-editor.js (left / top). */
.doc-at { position: fixed; z-index: 60; max-height: 300px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); padding: 6px; }
.doc-at-title { color: var(--text-muted); font-size: 11px; padding: 2px 6px 6px; }
.doc-at-list { overflow-y: auto; min-height: 0; }
.doc-at-item { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; border: 0; background: none; border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.doc-at-item.active, .doc-at-item:hover { background: var(--green-100); }
.doc-at-group { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
@media (min-width: 861px) {
  .view-content:has(.doc-editor) { overflow: visible; }
  .doc-fields { top: 12px; max-height: calc(100vh - 24px); }
}
.doc-fields-title { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; margin-bottom: 8px; }
.doc-fields-search { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font: inherit; font-size: 13px; }
.doc-fields-search:focus { outline: none; border-color: var(--green-600); }
.doc-fields-hint, .doc-fields-none { color: var(--text-muted); font-size: 11.5px; line-height: 1.4; margin: 7px 0 4px; }
.doc-fields-list { overflow-y: auto; min-height: 0; }
.doc-fields-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 10px 0 5px; }
.doc-field-btn { display: block; width: 100%; text-align: left; margin: 0 0 4px; padding: 6px 9px; border: 1px solid var(--green-600); border-radius: 7px; background: var(--green-100); color: var(--green-900); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.doc-field-btn:hover { background: #d3e8da; }
.doc-page { background: #fff; color: #111; border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 44px 52px; min-height: 420px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5; outline: none; overflow-wrap: anywhere; }
.doc-page[contenteditable="false"] { border-radius: 10px; }
.doc-page:focus { border-color: var(--green-600); }
.doc-block { margin: 0 0 8px; min-height: 1.5em; text-align: justify; white-space: pre-wrap; }
.doc-block[data-type="title"] { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 18px; }
.doc-block[data-type="heading"] { font-size: 15px; font-weight: 700; text-align: left; margin-top: 16px; }
.doc-block[data-type="subheading"] { font-weight: 700; text-align: left; margin-top: 10px; margin-bottom: 4px; }
.doc-block[data-type="li"] { position: relative; padding-left: 22px; margin-bottom: 5px; }
.doc-block[data-type="li"]::before { content: "•"; position: absolute; left: 6px; }
/* Alignement choisi dans la barre d'outils : après les styles, il s'applique à tous (titre, article, paragraphe). */
.doc-block[data-align="left"] { text-align: left; }
.doc-block[data-align="center"] { text-align: center; }
.doc-block[data-align="right"] { text-align: right; }
.doc-block[data-align="justify"] { text-align: justify; }
.doc-field { display: inline-block; padding: 0 7px; margin: 0 1px; border-radius: 6px; background: var(--green-100); color: var(--green-900); border: 1px solid var(--green-600); font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; cursor: default; user-select: all; }
.doc-filled { background: #FFF6CC; border-radius: 3px; }
.docs-row-actions { white-space: nowrap; text-align: right; }
.docs-missing { margin: 4px 0 12px; align-items: flex-start; }
.docs-missing ul { margin: 6px 0 10px; padding-left: 18px; }
.docs-missing li span { color: var(--text-muted); font-size: 12px; }
@media (max-width: 860px) {
  .doc-page { padding: 22px 16px; font-size: 13.5px; }
  .doc-edit-actions { width: 100%; justify-content: flex-end; }
  .doc-editor.has-fields { display: flex; flex-direction: column; }
  .doc-fields { order: -1; position: static; max-height: 230px; margin-bottom: 10px; }
  .doc-fields-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .doc-fields-group { display: contents; }
  .doc-fields-group-title { width: 100%; margin: 6px 0 0; }
  .doc-field-btn { display: inline-block; width: auto; margin: 0; }
  .docs-row-actions { white-space: normal; }
}
/* ---------- Formations (js/modules/formations.js, .claude/rules/formations.md) ----------
   Statut toujours écrit ET forme propre : fond plein vert = faite, cadre en pointillé bleu = prévue,
   fond rouge = obligatoire à faire, fond orangé = à renouveler (jamais la couleur seule). */
.fo-st { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 3px 8px; border-radius: 6px; font-size: 12px; line-height: 1.25; border: 1px solid transparent; min-width: 82px; }
.fo-st b { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.fo-st-faite { background: var(--success-bg); color: var(--success); }
.fo-st-faite b::before { content: '✓ '; }
.fo-st-prevue { background: var(--surface); color: var(--info); border: 1.5px dashed var(--info); }
.fo-st-prevue b::before { content: '◷ '; }
.fo-st-afaire { background: var(--danger-bg); color: var(--danger); }
.fo-st-afaire b::before { content: '! '; }
.fo-st-expiree { background: var(--warning-bg); color: var(--warning); }
.fo-st-expiree b::before { content: '↻ '; }
.fo-fiche { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.fo-card { margin-bottom: 14px; }
.fo-card .list-toolbar { margin-bottom: 6px; }
.fo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.fo-row:first-of-type { border-top: 0; }
.fo-row-title b { display: block; }
.fo-row-title span { font-size: 12px; color: var(--text-muted); }
.fo-row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fo-missing { font-size: 12px; font-weight: 600; color: var(--warning); }
.fo-empty { color: var(--text-muted); font-size: 13px; padding: 4px 0; }
.fo-kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; margin: 10px 0 0; font-size: 13px; }
.fo-kv dt { color: var(--text-muted); }
.fo-kv dd { margin: 0; font-weight: 600; text-align: right; }
.fo-secret { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.fo-secret code { font-size: 13px; letter-spacing: 1px; user-select: all; }
.fo-check { display: flex; align-items: center; gap: 8px; }
.fo-check input { width: auto; }
.fo-some { margin: -4px 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.fo-some-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 4px 0 6px; }
.fo-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.fo-cat { padding: 0; margin-bottom: 14px; overflow: hidden; }
.fo-cat-title { margin: 0; padding: 12px 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.fo-cat-title span { float: right; }
.fo-cat-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 80px minmax(0, 1.2fr) 100px 190px; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.fo-cat-row:last-child { border-bottom: 0; }
.fo-cat-head { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.fo-cat-name { font-weight: 600; }
.fo-who { font-size: 12px; }
.fo-cat-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* Dépôt en masse des attestations */
.fo-bulk-help { margin: 4px 0 12px; max-width: 760px; }
.fo-bulk-folder { margin: 6px 0 14px; text-align: center; }
.fo-bulk { padding: 0; overflow: hidden; margin-bottom: 14px; }
.fo-bulk-row { display: grid; grid-template-columns: 28px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.3fr) 140px 76px 150px; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; }
.fo-bulk-row:first-child { border-top: 0; }
.fo-bulk-head { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.fo-bulk-row select, .fo-bulk-row input[type=date], .fo-bulk-row input[type=number] { width: 100%; min-width: 0; padding: 6px 8px; font-size: 13px; }
.fo-bulk-file { min-width: 0; overflow-wrap: anywhere; }
.fo-bulk-file b { display: block; font-weight: 600; }
.fo-bulk-file small, .fo-bulk-state small { display: block; color: var(--text-muted); font-size: 11.5px; }
.fo-bulk-bar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 20px; }
/* Tableau de suivi (menu Formations) */
.fo-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fo-kpi { padding: 12px 14px; }
.fo-kpi b { display: block; font-size: 22px; }
.fo-kpi span { font-size: 12.5px; color: var(--text-muted); }
.fo-kpi-danger b { color: var(--danger); }
.fo-kpi-info b { color: var(--info); }
.fo-kpi-warning b { color: var(--warning); }
.fo-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.fo-search { flex: 0 1 240px; margin-bottom: 0; }
.fo-drop { margin: 0; padding: 16px; }
.fo-only { font-size: 13px; color: var(--text-muted); }
.fo-filters-gap { flex: 1; }
.fo-grid-wrap { overflow: auto; max-height: calc(100vh - 290px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.fo-grid { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.fo-grid th, .fo-grid td { padding: 6px 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--bg); background: var(--surface); text-align: left; vertical-align: middle; }
.fo-grid thead th { position: sticky; z-index: 2; background: var(--bg); font-weight: 600; }
.fo-grid-fam th { top: 0; height: 30px; text-align: center; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; border-top: 3px solid var(--border); }
.fo-grid-course th { top: 33px; width: 140px; min-width: 140px; max-width: 140px; height: 46px; font-size: 12px; vertical-align: bottom; text-align: center; }
.fo-th-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fo-grid-course th small { display: block; color: var(--text-muted); font-weight: 400; }
.fo-grid .fo-grid-name { position: sticky; left: 0; z-index: 1; min-width: 190px; box-shadow: 1px 0 0 var(--border); }
.fo-grid thead .fo-grid-name { z-index: 3; vertical-align: middle; }
.fo-grid td.fo-grid-name span { display: block; font-size: 11.5px; color: var(--text-muted); }
.fo-fam-elearning_obligatoire { border-top-color: var(--danger) !important; }
.fo-fam-presentiel { border-top-color: var(--green-600) !important; }
.fo-fam-distanciel { border-top-color: var(--info) !important; }
.fo-fam-elearning_specifique { border-top-color: #8A7BC4 !important; }
.fo-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; font-size: 13px; color: var(--text); cursor: pointer; text-align: left; }
.fo-name:hover { text-decoration: underline; }
.fo-ratio { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.fo-ratio.ok { background: var(--success-bg); color: var(--success); }
.fo-ratio.ko { background: var(--danger-bg); color: var(--danger); }
.fo-att { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; }
.fo-att .icon { width: 11px; height: 11px; }
.fo-att-dl { border: 0; background: none; padding: 0; font-family: inherit; cursor: pointer; }
.fo-att-dl:hover { text-decoration: underline; }
.fo-docs { margin-top: 16px; }
.fo-docs .data-table { margin-top: 8px; }
.fo-att-list { display: flex; flex-direction: column; gap: 6px; }
.fo-att-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.fo-att-item > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fo-att-item > span > .icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); }
.fo-att-item small { display: block; font-size: 11.5px; color: var(--text-muted); }
.fo-att.ok { color: var(--green-700); }
.fo-att.ko { color: var(--warning); }
.fo-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
/* Tableau de suivi : une tuile par case (pictogramme au-dessus, date dessous), vide si non concerné. */
.fo-grid td.fo-tile-td { padding: 3px; }
.fo-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 42px; padding: 3px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 11.5px; line-height: 1.2; white-space: nowrap; }
button.fo-tile { cursor: pointer; }
button.fo-tile:hover { box-shadow: inset 0 0 0 2px currentColor; }
.fo-tile .icon { width: 16px; height: 16px; }
.fo-tile-faite { background: var(--success-bg); color: var(--success); }
.fo-tile-prevue { background: var(--info-bg); color: var(--info); }
.fo-tile-afaire { background: var(--danger-bg); color: var(--danger); }
.fo-tile-expiree { background: var(--warning-bg); color: var(--warning); }
.fo-tile-none { color: var(--border); }
.fo-tile-mini { display: inline-flex; width: 22px; min-height: 22px; padding: 0; border-radius: 6px; }
.fo-tile-mini .icon { width: 13px; height: 13px; }
.fo-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.fo-bar { display: block; width: 100%; max-width: 160px; height: 4px; margin-top: 5px; border-radius: 2px; background: var(--border); overflow: hidden; }
.fo-bar i { display: block; height: 100%; background: var(--success); }
.fo-emp-card { margin-bottom: 10px; padding: 12px 14px; }
.fo-emp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.fo-card-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.fo-card-line > span:first-child small { display: block; color: var(--text-muted); font-size: 11.5px; }
.fo-card-line .fo-st { flex-shrink: 0; }
@media (max-width: 860px) {
  .fo-fiche { grid-template-columns: 1fr; }
  .fo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fo-bulk-head { display: none; }
  .fo-bulk-row { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); }
  .fo-bulk-row > span:nth-child(n+3) { grid-column: 2 / -1; }
  .fo-bulk-row > span:nth-child(5) { grid-column: 2; }
  .fo-bulk-row > span:nth-child(6) { grid-column: 3; }
  .fo-bulk-row > span:first-child { grid-row: 1; }
  .fo-filters .emp-filter-select, .fo-search { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .fo-row { grid-template-columns: minmax(0, 1fr) auto; }
  .fo-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .fo-cat-row { grid-template-columns: minmax(0, 1fr) auto; }
  .fo-cat-head { display: none; }
  .fo-cat-row > span:nth-child(3), .fo-cat-row > span:nth-child(4) { grid-column: 1 / -1; font-size: 12px; }
  .fo-cat-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ============================================================================
   Classes utilitaires « u-… » (06/10/2026). La CSP de app.humalo.fr interdit les attributs style="…" :
   un réglage ponctuel s'écrit avec ces classes (class="u-mt-22 u-c-text-muted"), jamais avec style="…"
   (refusé par tests/controle-xss.py). Une classe = une déclaration, nom = propriété abrégée + valeur.
   !important : même priorité qu'avait l'attribut style. Valeur calculée (couleur d'un poste, largeur d'une
   barre) : attributs data-s-… posés par applyDynStyles (js/main.js).
   ============================================================================ */
.u-ai-center { align-items: center !important; }
.u-ai-flex-end { align-items: flex-end !important; }
.u-ai-flex-start { align-items: flex-start !important; }
.u-bg-bg { background: var(--bg) !important; }
.u-bg-danger-bg { background: var(--danger-bg) !important; }
.u-bg-none { background: none !important; }
.u-bg-warning-bg { background: var(--warning-bg) !important; }
.u-b-0 { border: 0 !important; } .u-b-1-solid-border { border: 1px solid var(--border) !important; }
.u-bl-3-solid-green-600 { border-left: 3px solid var(--green-600) !important; }
.u-br-10 { border-radius: 10px !important; } .u-br-6 { border-radius: 6px !important; } .u-br-8 { border-radius: 8px !important; }
.u-bt-1-solid-border { border-top: 1px solid var(--border) !important; }
.u-bs-border-box { box-sizing: border-box !important; }
.u-c-555 { color: #555 !important; }
.u-c-danger { color: var(--danger) !important; }
.u-c-green-700 { color: var(--green-700) !important; }
.u-c-success { color: var(--success) !important; }
.u-c-text { color: var(--text) !important; }
.u-c-text-muted { color: var(--text-muted) !important; }
.u-c-warning { color: var(--warning) !important; }
.u-cursor-pointer { cursor: pointer !important; }
.u-d-block { display: block !important; } .u-d-flex { display: flex !important; } .u-d-grid { display: grid !important; }
.u-flex-1 { flex: 1 !important; } .u-flex-2 { flex: 2 !important; }
.u-fd-column { flex-direction: column !important; }
.u-fwrap-wrap { flex-wrap: wrap !important; }
.u-shrink-0 { flex-shrink: 0 !important; }
.u-ff-inherit { font-family: inherit !important; }
.u-fs-10 { font-size: 10px !important; }
.u-fs-10-5 { font-size: 10.5px !important; }
.u-fs-11 { font-size: 11px !important; }
.u-fs-11-5 { font-size: 11.5px !important; }
.u-fs-12 { font-size: 12px !important; }
.u-fs-12-5 { font-size: 12.5px !important; }
.u-fs-13 { font-size: 13px !important; }
.u-fs-18 { font-size: 18px !important; }
.u-fw-400 { font-weight: 400 !important; }
.u-fw-500 { font-weight: 500 !important; }
.u-fw-600 { font-weight: 600 !important; }
.u-fw-700 { font-weight: 700 !important; }
.u-gap-10 { gap: 10px !important; }
.u-gap-16 { gap: 16px !important; }
.u-gap-18 { gap: 18px !important; }
.u-gap-4 { gap: 4px !important; }
.u-gap-5 { gap: 5px !important; }
.u-gap-6 { gap: 6px !important; }
.u-gap-6-14 { gap: 6px 14px !important; }
.u-gap-8 { gap: 8px !important; }
.u-gtc-auto-1fr { grid-template-columns: auto 1fr !important; }
.u-h-48 { height: 48px !important; }
.u-jc-space-between { justify-content: space-between !important; }
.u-lh-1-15 { line-height: 1.15 !important; }
.u-m-0 { margin: 0 !important; }
.u-m-0-0-10 { margin: 0 0 10px !important; }
.u-m-0-0-12 { margin: 0 0 12px !important; }
.u-m-10-0 { margin: 10px 0 !important; }
.u-m-18-0-6 { margin: 18px 0 6px !important; }
.u-m-4-0 { margin: 4px 0 !important; }
.u-m-6-0-0-18 { margin: 6px 0 0 18px !important; }
.u-m-8-0 { margin: 8px 0 !important; }
.u-m-8-0-12 { margin: 8px 0 12px !important; }
.u-m-8-0-4 { margin: 8px 0 4px !important; }
.u-m-n4-0-10 { margin: -4px 0 10px !important; }
.u-m-n6-0-12 { margin: -6px 0 12px !important; }
.u-m-n8-0-14 { margin: -8px 0 14px !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-10 { margin-bottom: 10px !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-14 { margin-bottom: 14px !important; }
.u-mb-24 { margin-bottom: 24px !important; }
.u-mb-3 { margin-bottom: 3px !important; }
.u-mb-4 { margin-bottom: 4px !important; }
.u-mb-6 { margin-bottom: 6px !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-ml-6 { margin-left: 6px !important; } .u-ml-8 { margin-left: 8px !important; } .u-ml-auto { margin-left: auto !important; }
.u-mr-auto { margin-right: auto !important; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-10 { margin-top: 10px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-14 { margin-top: 14px !important; }
.u-mt-2 { margin-top: 2px !important; }
.u-mt-22 { margin-top: 22px !important; }
.u-mt-26 { margin-top: 26px !important; }
.u-mt-3 { margin-top: 3px !important; }
.u-mt-4 { margin-top: 4px !important; }
.u-mt-5 { margin-top: 5px !important; }
.u-mt-6 { margin-top: 6px !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-maxw-none { max-width: none !important; }
.u-minw-0 { min-width: 0 !important; }
.u-opacity-0-85 { opacity: .85 !important; }
.u-ox-auto { overflow-x: auto !important; }
.u-p-0 { padding: 0 !important; }
.u-p-10-12 { padding: 10px 12px !important; }
.u-p-12-14 { padding: 12px 14px !important; }
.u-p-20-10 { padding: 20px 10px !important; }
.u-p-9-12 { padding: 9px 12px !important; }
.u-pb-5 { padding-bottom: 5px !important; }
.u-pt-12 { padding-top: 12px !important; } .u-pt-14 { padding-top: 14px !important; } .u-pt-5 { padding-top: 5px !important; }
.u-ta-left { text-align: left !important; } .u-ta-right { text-align: right !important; }
.u-ws-nowrap { white-space: nowrap !important; } .u-ws-pre-wrap { white-space: pre-wrap !important; }
.u-w-100p { width: 100% !important; }
.u-w-34 { width: 34px !important; }
.u-w-48 { width: 48px !important; }
.u-w-56 { width: 56px !important; }
.u-w-74 { width: 74px !important; }
.u-w-92 { width: 92px !important; }
.u-m-14-0 { margin: 14px 0 !important; }
.u-m-8-0-0 { margin: 8px 0 0 !important; }
/* Un élément masqué par l'attribut hidden le reste, même avec une classe u-d-… */
[hidden] { display: none !important; }
/* Feuille d'heures : saisie de la correction d'un jour (affichée quand « conforme » est décoché). */
.ts-fix-box { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Fenêtre « À faire » à l'ouverture (js/a-faire.js, 12/11/2026). */
.todo-h { margin: 0 0 4px; }
.todo-lead { margin: 0 0 12px; color: var(--text-muted); font-size: 14px; }
.todo-list { display: flex; flex-direction: column; }
.todo-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.todo-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--warning-bg); color: var(--warning); }
.todo-ico-correction, .todo-ico-absence { background: var(--info-bg); color: var(--info); }
.todo-text { flex: 1; min-width: 0; }
.todo-title { font-weight: 700; }
.todo-sub { font-size: 14px; }
.todo-by { font-size: 12.5px; color: var(--text-muted); }
.todo-open { flex: none; }
.todo-foot { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); text-align: center; }
.ts-fix-why { flex: 1 1 100%; min-width: 0; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--warning); border-radius: 6px; font: inherit; font-size: 12.5px; }

/* Téléphone : indicatif du pays + numéro (phoneFieldHtml, main.js) */
.phone-input { display: flex; gap: 8px; }
.phone-input select { flex: 0 0 auto; width: auto; max-width: 46%; }
.phone-input input { flex: 1 1 auto; min-width: 0; }

/* Import d'un fichier de salariés (import-salaries.js) */
.emp-list-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* Exporter en Excel à la carte (HUM-41, js/modules/export-salaries.js) : « Qui » à gauche, « Quoi » à droite. */
.xp-modal { max-width: 980px; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.xp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.xp-head h3 { margin: 0; }
.xp-saved { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.xp-chip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.xp-chip button { border: none; background: none; font: inherit; color: var(--text); cursor: pointer; padding: 6px 4px; display: inline-flex; }
.xp-chip .xp-chip-go { padding: 6px 6px 6px 12px; font-size: 13px; font-weight: 600; color: var(--green-700); }
.xp-chip .xp-chip-x { color: var(--text-muted); }
.xp-chip .xp-chip-x:last-child { padding-right: 10px; }
.xp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); max-height: 60vh; overflow: auto; }
.xp-who, .xp-what { padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.xp-who { border-right: 1px solid var(--border); }
.xp-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.xp-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 14.5px; cursor: pointer; }
.xp-choice.is-on { border-color: var(--green-700); background: var(--green-100); }
.xp-sub { display: flex; flex-direction: column; padding-left: 12px; }
.xp-people-list { display: flex; flex-direction: column; max-height: 220px; overflow: auto; margin-top: 6px; }
.xp-check { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.xp-check input, .xp-choice input { width: 16px; height: 16px; accent-color: var(--green-700); flex-shrink: 0; }
.xp-n { margin-left: auto; color: var(--text-muted); font-size: 13px; }
.xp-saved .xp-n { margin-left: 0; }
.xp-search { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; width: 100%; }
.xp-block { border: 1px solid var(--border); border-radius: 12px; }
.xp-block summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: 14.5px; }
.xp-block summary::-webkit-details-marker { display: none; }
.xp-count { margin-left: auto; font-weight: 400; color: var(--text-muted); font-size: 13px; }
.xp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 0 14px 10px; }
.xp-lock { font-size: 11px; font-weight: 700; color: var(--warning); background: var(--warning-bg); border-radius: 999px; padding: 1px 7px; }
.xp-confirm { margin: 0 22px 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--warning-bg); font-size: 14px; }
.xp-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.xp-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg); }
.xp-summary { display: flex; flex-direction: column; gap: 6px; min-width: 260px; flex: 1; }
.xp-file { margin: 0; max-width: 420px; }
.xp-file .fin-unit input { padding-left: 12px; padding-right: 52px; }
.xp-foot-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .xp-cols { grid-template-columns: minmax(0, 1fr); max-height: none; }
  .xp-who { border-right: none; border-bottom: 1px solid var(--border); }
  .xp-fields { grid-template-columns: minmax(0, 1fr); }
}
.modal-card.modal-wide.modal-import { max-width: 980px; }
.import-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 22px; }
.import-head h3 { margin: 0; }
.import-step { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.import-scroll { max-height: 46vh; overflow: auto; margin-top: 12px; }
.import-table td, .import-table th { padding: 8px 10px; font-size: 13px; vertical-align: top; }
.import-table select { width: 100%; min-width: 200px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; }
.import-sample { color: var(--text-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-notes div + div { margin-top: 3px; }
.import-error { color: var(--danger); font-weight: 600; }
.import-encoding { max-width: 320px; }
.import-todo { margin: 6px 0; font-size: 13px; }
/* L'import se fait sur ordinateur : bouton masqué sur téléphone. */
@media (max-width: 860px) { #emp-import-btn { display: none; } }

/* Rapport de paie (js/modules/rapport.js) */
.rapport-toolbar { flex-wrap: wrap; gap: 10px; }
.rapport-month { display: flex; align-items: center; gap: 8px; }
.rapport-month strong { min-width: 120px; text-align: center; text-transform: capitalize; }
.rapport-period { margin: 4px 0 10px; }
.rapport-controls { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }
.rapport-controls.has-warn { background: var(--warning-bg); border-color: #EBD3A4; }
.rapport-controls summary { cursor: pointer; }
.rapport-group { border-top: 1px solid #EBD3A4; padding: 6px 0; }
.rapport-controls > summary + .rapport-group { margin-top: 8px; }
.rapport-group > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.rapport-group > summary::-webkit-details-marker { display: none; }
.rapport-group > summary::before { content: '›'; font-size: 16px; line-height: 1; width: 10px; color: var(--warning); transition: transform .15s; }
.rapport-group[open] > summary::before { transform: rotate(90deg); }
.rapport-group-n { background: var(--warning); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 22px; text-align: center; }
.rapport-group-info .rapport-group-n { background: #9A9D96; }
.rapport-group-t { flex: 1; font-weight: 600; }
.rapport-group-link { font-size: 12px; color: var(--green-700); white-space: nowrap; }
.rapport-group-body { padding: 6px 0 2px 30px; line-height: 1.6; max-height: 220px; overflow-y: auto; }
.rapport-infos { margin-top: 8px; color: var(--text-muted); }
.rapport-infos > summary { cursor: pointer; }
.rapport-infos .rapport-group { color: var(--text); }
.rapport-warn strong { color: var(--warning); }
.rapport-info { color: var(--text-muted); }
.rapport-tag { display: inline-block; font-size: 11px; font-weight: 700; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.rapport-table-wrap { overflow-x: auto; }
.rapport-table th { white-space: normal; min-width: 72px; font-size: 11.5px; vertical-align: bottom; }
.rapport-plus { font-size: 11px; font-weight: 700; color: var(--danger); }
.rapport-neg { color: var(--warning); font-weight: 600; }
.rapport-history { margin-top: 18px; font-size: 13px; }
.rapport-history h3 { font-size: 14px; margin: 0 0 6px; }
.rapport-history ul { margin: 0; padding-left: 18px; color: var(--text-muted); }
.rapport-actions { display: flex; gap: 8px; }
.rapport-period strong { color: var(--text); }
.rapport-payfit { font-size: 13.5px; max-height: 60vh; overflow-y: auto; }
.rapport-payfit h4 { font-size: 13px; margin: 12px 0 4px; }
.rapport-payfit ul { margin: 0; padding-left: 18px; }
/* Calendrier de sélection des semaines (deux mois glissants ; un seul sur téléphone) */
.list-toolbar.rapport-toolbar { flex-wrap: nowrap; }
.rapport-actions .btn { white-space: nowrap; }
.rapport-month strong { min-width: 150px; }
.rapport-single { display: none; }
.rapport-cal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin: 2px 0 8px; max-width: 760px; }
.rapport-cal-title { font-size: 13px; font-weight: 600; text-align: center; text-transform: capitalize; margin-bottom: 4px; }
.rapport-cal-head, .rapport-cal-week { display: grid; grid-template-columns: 78px repeat(7, minmax(0, 1fr)); align-items: center; }
.rapport-cal-head span { font-size: 11px; color: var(--text-muted); text-align: center; }
.rapport-cal-week { width: 100%; border: 0; background: none; padding: 5px 0; margin: 1px 0; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; border-radius: 6px; }
.rapport-cal-week:hover { background: rgba(0, 0, 0, .04); }
.rapport-cal-week.on { background: var(--green-100); color: var(--green-900); }
.rapport-cal-week .d { text-align: center; }
.rapport-cal-week .d.out { color: var(--text-muted); opacity: .6; }
.rapport-cal-no { display: flex; align-items: center; gap: 4px; padding-left: 4px; font-weight: 600; }
.rapport-box { width: 13px; height: 13px; border: 1.5px solid #B9B6AC; border-radius: 4px; flex-shrink: 0; margin: 1px; }
.rapport-check { color: var(--green-700); flex-shrink: 0; }
.rapport-lock { flex-shrink: 0; }
.rapport-lock-open { color: var(--warning); }
.rapport-lock-ok { color: var(--green-700); }
.rapport-lock-ex { color: #9A9D96; }
.rapport-cal-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.rapport-cal-foot span { display: inline-flex; align-items: center; gap: 4px; }
.rapport-cal-foot .btn { margin-left: auto; }
@media (max-width: 860px) {
  .list-toolbar.rapport-toolbar { flex-wrap: wrap; row-gap: 8px; }
  .rapport-toolbar .rapport-month { flex: 1 1 100%; min-width: 0; gap: 6px; }
  .rapport-toolbar .rapport-month strong { flex: 1; min-width: 0; text-align: center; }
  .rapport-toolbar .rapport-actions { flex: 1 1 100%; }
  .rapport-toolbar .rapport-actions .btn { flex: 1; }
  .rapport-range { display: none; }
  .rapport-single { display: inline; }
  .rapport-cal { grid-template-columns: minmax(0, 1fr); }
  .rapport-cal-side { display: none; }
  .rapport-cal-title { display: none; }
  .rapport-cal-week { padding: 8px 0; font-size: 13.5px; }
}

/* ---------- Documents : nombre de pages et aperçu du brouillon (HUM-33, documents.js) ---------- */
.doc-pages { align-self: center; color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }
.modal-card.modal-wide.doc-preview-modal { max-width: 860px; }
.doc-preview-head { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.doc-preview-head h3 { margin: 0; flex: 1; }
.doc-preview-pages { max-height: 70vh; overflow-y: auto; background: var(--bg); border-radius: 10px; padding: 14px; margin-top: 10px; }
.doc-preview-page { display: block; width: 100%; height: auto; margin: 0 auto 14px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.doc-manual-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.6; }

/* Onglet Demandes d'absence (HUM-46, maquette validée par Vincent le 13/11/2026) : filtres, cartes à traiter,
   lignes rangées par mois, étapes d'une demande pour le salarié. */
.abs-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.abs-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.abs-kind { padding: 4px 11px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.abs-kind.active { border-color: var(--green-700); color: var(--green-700); background: var(--green-100); }
.abs-list { display: flex; flex-direction: column; gap: 8px; }
.abs-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.abs-card:hover { border-color: var(--green-700); }
.abs-card-main { flex: 1; min-width: 0; }
.abs-card-who { font-weight: 700; margin-right: 6px; }
.abs-card-when { margin-top: 2px; }
.abs-card-when b { font-weight: 600; }
.abs-card-also { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--warning); }
.abs-card-hint { margin-top: 2px; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.abs-card-acts { display: flex; gap: 6px; flex-shrink: 0; }
.abs-card-chevron { flex-shrink: 0; font-size: 22px; line-height: 1; color: var(--text-muted); }
.abs-card-chevron.is-phone { display: none; }
.abs-type { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: #EDEDF0; color: #3A3A3C; white-space: nowrap; }
.abs-type-conges { background: #E3F0FB; color: #0A5BA8; }
.abs-type-indispo { background: #FFF4E0; color: #8A5200; }
.abs-type-autres { background: #FDECEC; color: #A51C1C; }
.abs-month { margin: 10px 0 0; font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.abs-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.abs-row:hover { border-color: var(--green-700); }
.abs-row-who { font-weight: 700; white-space: nowrap; }
.abs-row-when { flex: 1; min-width: 0; font-size: 13px; }
.abs-row-when b { font-weight: 600; }
.abs-row-reason { display: block; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.abs-row-status { flex-shrink: 0; }
.abs-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; font-size: 11.5px; color: var(--text-muted); }
.abs-step-dot { width: 9px; height: 9px; border-radius: 50%; background: #D1D1D6; }
.abs-step-dot.is-done { background: var(--green-700); }
.abs-step-dot.is-now { background: #FF9F0A; }
.abs-step-line { width: 14px; height: 2px; background: #D1D1D6; }
@media (max-width: 860px) {
  .abs-card { flex-wrap: nowrap; }
  .abs-card:has(.abs-card-acts:not(.is-open)) { flex-wrap: wrap; }
  .abs-card-acts { width: 100%; justify-content: flex-end; }
  .abs-card-acts.is-open { display: none; }
  .abs-card-chevron.is-phone { display: block; }
  .abs-row { flex-wrap: wrap; }
  .abs-row-when { flex-basis: 100%; order: 3; }
}

/* Champ date vide (HUM-59) : Safari affiche la date du jour en gris dans un champ vide, ce qui se lit comme une date
   saisie. Classe `is-empty` posée par le module (fin de période d'essai, salaries.js). */
input[type="date"].is-empty:not(:focus)::-webkit-datetime-edit { color: transparent; }
