/* css/main.css */

:root {
  --olive-clair: #8B9A6B;
  --olive-soutenu: #6B7D4A;
  --indigo-clair: #5C6BC0;
  --indigo-soutenu: #3949AB;
  --orange: #F7931E;
  --rouge-terre: #C75B3B;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --valid-bg: #e8f5e9;
  --valid-border: #4caf50;
  --danger: #e53935;
  --radius: 8px;
  --radius-pill: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 0.5rem; }
.logo { height: 36px; }
.app-title { font-size: 1.1rem; font-weight: 600; }

#app-nav { display: flex; gap: 1rem; }
#app-nav a {
  text-decoration: none;
  color: var(--text-light);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}
#app-nav a.active, #app-nav a:hover {
  background: var(--bg);
  color: var(--text);
}

.view { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--indigo-soutenu); color: white; }
.btn-secondary { background: transparent; color: var(--text-light); border: 1px solid var(--border); }
.btn-success { background: var(--valid-border); color: white; }
.btn-danger { background: var(--danger); color: white; }

.toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  color: white;
  font-weight: 500;
  z-index: 1000;
  transition: opacity 0.3s;
}
.toast-info { background: var(--indigo-soutenu); }
.toast-success { background: var(--valid-border); }
.toast-error { background: var(--danger); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  header { flex-wrap: wrap; gap: 0.5rem; }
  #app-nav { order: 3; width: 100%; justify-content: center; }
  .view { padding: 0.5rem; }
}

.error-text { color: var(--danger); font-size: 0.85rem; margin-top: 0.75rem; }
.success-text { color: var(--success, #28a745); font-size: 0.85rem; margin-top: 0.75rem; }
.info-text { color: var(--indigo-clair, #6c757d); font-size: 0.85rem; margin-top: 0.75rem; font-style: italic; }
.row-error { background-color: rgba(220, 53, 69, 0.08); }
.row-error td:last-child { color: var(--danger); font-size: 0.8rem; }

/* ===== Login (refonte charte M&1F) ===== */
:root {
  --m1f-primary: #12295c;
  --m1f-primary-container: #2b4074;
  --m1f-secondary: #8d4f00;
  --m1f-secondary-container: #fe9824;
  --m1f-surface: #f8f9ff;
  --m1f-surface-lowest: #ffffff;
  --m1f-on-surface: #0d1c2e;
  --m1f-on-surface-variant: #44464f;
  --m1f-outline: #757780;
  --m1f-outline-variant: #c5c6d1;
}

.login-page {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 680px;
  display: flex;
  background: var(--m1f-surface);
  color: var(--m1f-on-surface);
  font-family: 'Poppins', sans-serif;
  overflow: hidden;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 24px,
    rgba(43, 64, 116, 0.08) 24px,
    rgba(43, 64, 116, 0.08) 28px
  );
  background-size: 200% 200%;
  animation: login-hatching 60s linear infinite;
}

@keyframes login-hatching {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.login-ticker-strip {
  position: relative;
  width: 80px;
  background: var(--m1f-primary-container);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  z-index: 2;
}

@media (min-width: 768px) {
  .login-ticker-strip { width: 128px; }
}

.login-ticker-logo {
  flex-shrink: 0;
  padding: 20px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  background: var(--m1f-primary-container);
  width: 100%;
}

.login-ticker-logo img {
  max-width: 100%;
  max-height: 64px;
  height: auto;
  filter: brightness(0) invert(1);
}

.login-ticker-mask {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent);
          mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent);
}

.login-ticker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  padding: 64px 0;
  animation: login-ticker-scroll 30s linear infinite;
}

.login-ticker span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--m1f-secondary-container);
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

@keyframes login-ticker-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.login-brand .login-logo {
  width: 100%;
  max-width: 220px;
  height: auto;
  margin-bottom: 16px;
}

.login-brand .login-visuel {
  width: 100%;
  max-width: 420px;
  height: auto;
  margin-bottom: 24px;
  display: block;
}

.login-brand h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--m1f-primary);
  margin: 0;
}

.login-subtitle {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--m1f-on-surface-variant);
  margin-top: 8px;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--m1f-surface-lowest);
  border: 1px solid rgba(197, 198, 209, 0.3);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .login-card { padding: 48px; }
}

.login-card-accent {
  position: absolute;
  top: 0;
  right: 0;
  width: 96px;
  height: 96px;
  background: rgba(254, 152, 36, 0.05);
  border-bottom-left-radius: 100%;
  margin-top: -32px;
  margin-right: -32px;
}

.login-card form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login-field label {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--m1f-primary);
}

.login-forgot {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--m1f-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-forgot:hover { text-decoration: underline; }

.login-input-wrap {
  position: relative;
}

.login-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--m1f-outline);
  font-size: 20px;
  pointer-events: none;
}

.login-input-wrap input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: var(--m1f-surface);
  border: 1px solid rgba(117, 119, 128, 0.5);
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: var(--m1f-on-surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input-wrap input:focus {
  border-color: var(--m1f-secondary-container);
  box-shadow: 0 0 0 2px var(--m1f-secondary-container);
}

.login-submit {
  margin-top: 8px;
  width: 100%;
  padding: 16px;
  background: var(--m1f-secondary-container);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}

.login-submit:hover {
  background: var(--m1f-secondary);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.login-submit:active { transform: scale(0.98); }

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--m1f-outline-variant);
  padding: 8px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(197, 198, 209, 0.3);
}

.login-divider span {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.login-footer {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.login-footer-links {
  display: flex;
  gap: 32px;
}

.login-footer-links a {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: var(--m1f-on-surface-variant);
  text-decoration: none;
  transition: color 0.15s;
}

.login-footer-links a:hover { color: var(--m1f-secondary); }

.login-footer p {
  font-size: 10px;
  color: var(--m1f-outline);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  max-width: 20rem;
  line-height: 1.6;
}

.login-deco {
  position: absolute;
  bottom: 40px;
  right: 40px;
  font-size: 120px;
  color: var(--m1f-primary);
  opacity: 0.2;
  pointer-events: none;
  user-select: none;
  font-variation-settings: 'FILL' 1;
}

#view-login.view {
  max-width: none;
  padding: 0;
  margin: 0;
}

/* Selection parcours */
.parcours-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.parcours-card { cursor: pointer; transition: box-shadow 0.2s; }
.parcours-card:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.parcours-card-name { font-weight: 600; font-size: 1.05rem; }
.parcours-card-entreprise { color: var(--text-light); font-size: 0.9rem; }
.parcours-card-modules { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; }

/* Selection parcours — Header */
.selection-header { margin-bottom: 1rem; }
.selection-title-row { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; }
.selection-title { font-size: 1.5rem; font-weight: 700; }
.selection-count { font-size: 0.9rem; color: var(--text-light); }
.selection-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; align-items: start; }
.selection-list-col { min-width: 0; }
.selection-empty { text-align: center; padding: 2rem; color: var(--text-light); }
.selection-filter-info { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; }

/* Bouton oeil archives */
.eye-toggle {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 1.1rem; cursor: pointer; padding: 0.15rem 0.5rem;
  color: var(--text-muted); transition: all 0.15s; line-height: 1;
}
.eye-toggle:hover { border-color: var(--indigo-clair); color: var(--indigo-soutenu); }
.eye-toggle.eye-active { background: var(--indigo-soutenu); color: white; border-color: var(--indigo-soutenu); }

/* Selection — Recherche */
.selection-search {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.9rem; outline: none; margin-top: 0.5rem;
}
.selection-search:focus { border-color: var(--indigo-clair); }
.selection-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-light);
}

/* Selection — Onglets statut */
.statut-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.statut-tab {
  padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); font-size: 0.78rem; cursor: pointer; color: var(--text-light);
  transition: all 0.15s;
}
.statut-tab:hover { border-color: var(--indigo-clair); color: var(--indigo-soutenu); }
.statut-tab.active { background: var(--indigo-soutenu); color: white; border-color: var(--indigo-soutenu); }

/* Selection — Header + Recherche */
.selection-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.selection-header h2 { margin: 0; font-size: 1.2rem; }
.selection-count { font-weight: 400; color: var(--text-muted); font-size: 0.9rem; }
.search-input {
  padding: 0.45rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.88rem; width: 260px; max-width: 50vw;
  outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--indigo-clair); }

/* Selection — Filtres par statut */
.filter-bar { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.filter-pill {
  padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); font-size: 0.78rem; cursor: pointer; color: var(--text-light);
  transition: all 0.15s; display: flex; align-items: center; gap: 0.3rem;
}
.filter-pill:hover { border-color: var(--indigo-clair); color: var(--indigo-soutenu); }
.filter-pill.filter-active { background: var(--indigo-soutenu); color: white; border-color: var(--indigo-soutenu); }
.filter-count { font-size: 0.7rem; opacity: 0.7; }

/* Selection — Cartes parcours */
.parcours-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.parcours-card { cursor: pointer; transition: box-shadow 0.2s, transform 0.15s; padding: 0.75rem; }
.parcours-card:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); transform: translateY(-1px); }
.parcours-card.selected { box-shadow: 0 0 0 2px var(--indigo-clair); }
.parcours-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.15rem; }
.parcours-card-name { font-weight: 600; font-size: 0.95rem; }
.parcours-card-entreprise { color: var(--text-light); font-size: 0.82rem; }
.parcours-card-dates { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
.parcours-card-analyse { font-size: 0.7rem; margin-top: 0.2rem; display: flex; align-items: center; gap: 0.3rem; }
.analyse-risque-mini {
  font-weight: 700; font-size: 0.65rem; text-transform: uppercase;
  padding: 0.1rem 0.4rem; border-radius: var(--radius-pill);
}
.analyse-date-mini { font-size: 0.62rem; color: var(--text-muted); }

/* Flags administratifs (toggles) */
.flags-panel { display: flex; flex-direction: column; gap: 0.25rem; }
.flag-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; cursor: pointer; padding: 0.2rem 0.3rem;
  border-radius: 4px; transition: background 0.15s;
}
.flag-toggle:hover { background: var(--bg); }
.flag-toggle input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--valid-border);
  cursor: pointer; flex-shrink: 0;
}
.flag-label { flex: 1; color: var(--text); }
.flag-etape { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; }
.parcours-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Pastilles P/S1/S2/S3 */
.pastilles-row { display: flex; gap: 3px; flex-shrink: 0; }
.pastille {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 700; color: #fff;
}
.past-vert { background: #4caf50; }
.past-orange { background: var(--orange); }
.past-gris { background: #ddd; color: #999; }

/* Pastilles suivis (P/S1/S2/S3) */
.pill-container { display: flex; gap: 4px; margin-top: 0.3rem; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 20px; border-radius: 3px; font-size: 0.65rem; font-weight: 700;
  cursor: pointer; transition: transform 0.1s;
}
.pill:hover { transform: scale(1.15); }
.pill-vert { background: var(--valid-border); color: white; }
.pill-orange { background: var(--orange); color: white; }
.pill-gris { background: #e0e0e0; color: #999; }
.pill-popover {
  position: fixed; z-index: 600; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 0.4rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.pill-popover-action {
  padding: 0.35rem 0.75rem; border: none; border-radius: 4px; font-size: 0.78rem;
  cursor: pointer; text-align: left; background: none;
}
.pill-popover-action:hover { background: var(--bg); }
.action-planifie { color: var(--orange); }
.action-realise { color: var(--valid-border); }
.action-annuler { color: var(--danger); }

/* Agenda accordion */
.agenda-accordion { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; }
.agenda-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 1rem; border: none; background: none; cursor: pointer; font-size: 0.9rem; font-weight: 500; }
.agenda-toggle-chevron { transition: transform 0.2s; font-size: 0.7rem; }
.agenda-accordion.open .agenda-toggle-chevron { transform: rotate(180deg); }
.agenda-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.agenda-accordion.open .agenda-body { max-height: 500px; }
.agenda-list { padding: 0 1rem 0.5rem; }
.agenda-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border-light); cursor: pointer; font-size: 0.82rem; }
.agenda-item:last-child { border-bottom: none; }
.agenda-item:hover { background: var(--bg); }
.agenda-item-date { color: var(--text-light); min-width: 140px; font-size: 0.78rem; }
.agenda-item-name { flex: 1; }
.agenda-item-type { font-size: 0.7rem; padding: 2px 6px; border-radius: var(--radius-pill); font-weight: 500; }
.type-pres { background: #e8eaf6; color: var(--indigo-soutenu); }
.type-s1 { background: #fff3e0; color: #e65100; }
.type-s2 { background: #e8f5e9; color: #2e7d32; }
.type-s3 { background: #fce4ec; color: #c62828; }

/* Panneau analyse (droite) */
.analyse-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); position: sticky; top: 60px; max-height: calc(100vh - 80px); overflow-y: auto; }
.analyse-panel-empty { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.analyse-panel-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.analyse-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.analyse-panel-name { font-weight: 600; font-size: 1.05rem; display: block; }
.analyse-panel-entreprise { font-size: 0.8rem; color: var(--text-light); margin-top: 0.1rem; }
.analyse-panel-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-light); align-self: flex-start; }
.analyse-panel-body { padding: 0.75rem 1rem; }
.analyse-section { margin-bottom: 1rem; }
.analyse-section-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); font-weight: 600; margin-bottom: 0.4rem; }
.analyse-timeline { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.analyse-timeline-step { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.analyse-timeline-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }
.analyse-timeline-dot.done { background: var(--valid-border); color: white; }
.analyse-timeline-dot.planned { background: var(--orange); color: white; }
.analyse-timeline-dot.pending { background: #e0e0e0; color: #999; }
.analyse-timeline-date { font-size: 0.65rem; color: var(--text-light); }
.analyse-timeline-arrow { color: var(--border); font-size: 0.9rem; margin: 0 0.15rem; }
.analyse-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.analyse-info-item { padding: 0.3rem 0; }
.analyse-info-label { font-size: 0.7rem; color: var(--text-light); }
.analyse-info-value { font-size: 0.85rem; font-weight: 500; }
.analyse-placeholder { font-size: 0.82rem; color: var(--text-light); padding: 0.5rem; background: var(--bg); border-radius: var(--radius); }

@media (max-width: 900px) {
  .selection-layout { grid-template-columns: 1fr; }
  .analyse-panel { position: static; max-height: none; }
}

/* Grille saisie */
.grille-header { margin-bottom: 1rem; }
.grille-info { font-size: 1.1rem; margin-bottom: 0.5rem; }
.grille-nav { display: flex; align-items: center; gap: 1rem; }
.grille-semaine { font-weight: 600; font-size: 1rem; }
.grille-table-wrapper { overflow-x: auto; }
.grille-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.grille-table th, .grille-table td { border: 1px solid var(--border); padding: 0.4rem; text-align: center; vertical-align: top; }
.grille-table th { background: var(--bg); font-size: 0.8rem; font-weight: 600; position: relative; }

/* Poignee redimensionnement colonnes */
.col-resize-handle {
  position: absolute; right: -3px; top: 0; width: 6px; height: 100%;
  cursor: col-resize; z-index: 5;
}
.col-resize-handle:hover, .col-resize-handle.active { background: var(--indigo-clair); opacity: 0.4; }
.col-module { text-align: left; font-weight: 500; width: 140px; min-width: 60px; font-size: 0.72rem; }
.col-dj { font-size: 0.75rem; color: var(--text-light); min-width: 60px; }
.col-jour { min-width: 100px; }

/* Cellules grille — slider */
.cellule { position: relative; min-height: 36px; text-align: center; vertical-align: middle; cursor: pointer; }
.cellule:hover:not(.validated) { background: rgba(92, 107, 192, 0.04); }

/* Affichage dans la cellule */
.cellule-display { padding: 4px 2px; }
.cellule-valeur { font-weight: 800; font-size: 1.05rem; }
.cellule-vide { font-size: 0.9rem; color: var(--border); font-weight: 300; }
.cellule:hover .cellule-vide { color: var(--indigo-clair); }
.cellule-afest-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--olive-soutenu); margin-left: 3px; vertical-align: super;
}

/* Legende */
.grille-legende {
  display: flex; gap: 1rem; padding: 0.4rem 0; font-size: 0.75rem; color: var(--text-light);
}
.legende-item { display: flex; align-items: center; gap: 4px; }
.legende-dot { position: static; vertical-align: middle; }

/* Slider popup */
.slider-popup {
  display: none; position: absolute; z-index: 20;
  left: 50%; top: 100%; transform: translateX(-50%);
  background: white; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; min-width: 170px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
.slider-popup::before {
  content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px; background: white; border-left: 1px solid var(--border); border-top: 1px solid var(--border);
}
.slider-popup.open { display: block; }

.duree-slider {
  width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, #8B9A6B, #5C6BC0, #F7931E, #C75B3B);
  border-radius: 3px; outline: none; margin: 6px 0;
}
.duree-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: white; border: 2px solid var(--indigo-soutenu); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.duree-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: white; border: 2px solid var(--indigo-soutenu); cursor: pointer;
}

.slider-valeur {
  font-weight: 800; font-size: 1.2rem; text-align: center;
  margin: 4px 0; color: var(--indigo-soutenu);
}

.slider-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px; gap: 8px;
}
.afest-check-slider {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: var(--text-light); cursor: pointer;
}
.afest-check-slider input { width: 13px; height: 13px; accent-color: var(--olive-soutenu); }
.btn-effacer {
  border: none; background: none; color: var(--text-light); font-size: 0.72rem;
  cursor: pointer; padding: 2px 6px; border-radius: 3px;
}
.btn-effacer:hover:not([disabled]) { background: #fee; color: #c33; }
.btn-effacer[disabled] { opacity: 0.3; cursor: not-allowed; }

/* Cellule validee */
.cellule.validated {
  background: var(--valid-bg) !important;
  position: relative;
}
.cellule.validated::after {
  content: '\2713'; position: absolute; top: 2px; right: 4px;
  font-size: 0.6rem; color: var(--valid-border); font-weight: 700;
}

/* Totaux */
.totaux-row td { font-weight: 600; background: var(--bg); font-size: 0.85rem; }
.total-jour { font-size: 0.9rem; }
.totaux-modules td {
  font-size: 0.78rem; color: var(--text-light); padding: 0.5rem;
  background: var(--surface); text-align: left;
}
.module-total {
  white-space: nowrap; display: inline-block;
  padding: 0.2rem 0.5rem; margin-right: 0.25rem;
  background: var(--bg); border-radius: 3px; font-size: 0.78rem;
}
.module-total.has-hours { background: var(--indigo-clair); color: white; }
.module-total.has-hours strong { color: white; }
.module-total-grand {
  display: inline-block; padding: 0.2rem 0.6rem;
  background: var(--indigo-soutenu); color: white;
  border-radius: 3px; font-weight: 600; font-size: 0.82rem;
}
.module-total-grand strong { color: white; }

/* Actions */
.grille-actions {
  display: flex; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap;
  padding-top: 1rem; border-top: 1px solid var(--border);
}

/* Recapitulatif mensuel */
.recap-mensuel { margin-top: 1.5rem; }
.recap-titre {
  font-size: 0.95rem; font-weight: 700; color: var(--text);
  margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.02em;
}
.recap-table-wrapper { overflow-x: auto; }
.recap-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  background: var(--surface);
}
.recap-table th, .recap-table td {
  border: 1px solid var(--border); padding: 0.3rem 0.5rem; text-align: center;
  white-space: nowrap;
}
.recap-table thead th {
  background: #6B4226; color: white; font-weight: 600; font-size: 0.72rem; position: relative;
}
.recap-col-module { text-align: left; width: 140px; min-width: 60px; font-size: 0.68rem; }
.recap-col-prevu { width: 45px; font-size: 0.65rem; }
.recap-col-realise { width: 45px; font-size: 0.65rem; }
.recap-col-mois { min-width: 42px; }
.recap-module-nom { text-align: left; font-weight: 500; text-transform: uppercase; font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; }
.recap-prevu { font-weight: 600; background: var(--bg); }
.recap-realise { font-weight: 700; }
.recap-mois-val { font-size: 0.75rem; }

/* Mois courant surligne */
.recap-mois-courant { background: rgba(107, 66, 38, 0.1) !important; border-left: 2px solid #6B4226; border-right: 2px solid #6B4226; }
thead .recap-mois-courant { background: #8B5A3C !important; }

/* Clic sur mois recap */
.recap-mois-click { cursor: pointer; transition: background 0.2s; }
.recap-mois-click:hover { background: #8B5A3C !important; color: white; }

/* Couleurs avancement */
.recap-vert { background: #d4edda; color: #155724; }
.recap-jaune { background: #fff3cd; color: #856404; }
.recap-orange { background: #ffe0cc; color: #984c0c; }

.recap-total-row td { background: var(--bg); font-weight: 700; border-top: 2px solid var(--text); }

@media (max-width: 768px) {
  .col-module { min-width: 80px; }
  .col-jour { min-width: 80px; }
}

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 2px solid var(--border); }
.tab {
  padding: 0.5rem 1rem; border: none; background: none; cursor: pointer;
  font-size: 0.9rem; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--indigo-soutenu); border-bottom-color: var(--indigo-soutenu); font-weight: 500; }

/* Import zones */
.import-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center; transition: border-color 0.2s;
}
.import-zone.drag-over { border-color: var(--indigo-clair); background: rgba(92, 107, 192, 0.05); }
.import-zone p { margin: 0.5rem 0; color: var(--text-light); }

/* Signature */
.signature-recap { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.signature-recap th, .signature-recap td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; font-size: 0.85rem; }
.signature-recap th { background: var(--bg); }
.signature-zones { display: flex; gap: 2rem; margin: 1.5rem 0; flex-wrap: wrap; }
.signature-zone { flex: 1; min-width: 250px; }
.signature-zone h3 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.signature-zone canvas { border: 1px solid var(--border); border-radius: var(--radius); cursor: crosshair; touch-action: none; max-width: 100%; }
.btn-sm { font-size: 0.75rem; padding: 0.25rem 0.5rem; margin-top: 0.25rem; }
.signature-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Recap */
.recap-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.recap-nav { display: flex; align-items: center; gap: 0.75rem; }
.recap-mois { font-weight: 600; font-size: 1.1rem; }
.recap-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.recap-table th, .recap-table td { border: 1px solid var(--border); padding: 0.3rem 0.5rem; text-align: center; font-size: 0.8rem; }
.recap-table th { background: var(--bg); font-weight: 600; }
.recap-jour { text-align: left; font-weight: 500; }
.recap-dj { font-size: 0.75rem; color: var(--text-light); }
.recap-total { font-weight: 600; }

/* Fiche de presence reglementaire */
.fiche-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.fiche-nav-groupe { display: flex; gap: 0; }
.fiche-nav-groupe .btn { border-radius: 0; }
.fiche-nav-groupe .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.fiche-nav-groupe .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.fiche-nav-groupe .btn.active { background: #6B4226; color: white; border-color: #6B4226; }
.fiche-nav-periode { display: flex; align-items: center; gap: 0.75rem; }
.fiche-periode-label { font-weight: 600; font-size: 1rem; min-width: 200px; text-align: center; }

.fiche-presence { background: white; padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); }
.fiche-entete { text-align: center; margin-bottom: 1rem; border-bottom: 2px solid #D4A017; padding-bottom: 0.75rem; }
.fiche-titre { font-size: 1.2rem; font-weight: 700; text-transform: uppercase; margin: 0 0 0.25rem 0; color: #333; }
.fiche-note { font-size: 0.7rem; color: #666; font-style: italic; margin: 0; }

.fiche-infos { margin-bottom: 1rem; }
.fiche-infos-table { border-collapse: collapse; width: 100%; }
.fiche-infos-table td { padding: 0.15rem 0.5rem; font-size: 0.85rem; }
.fiche-info-label { font-weight: 600; color: #555; white-space: nowrap; width: 100px; }
.fiche-info-val { color: #222; }

.fiche-table { width: 100%; border-collapse: collapse; margin-bottom: 0; font-size: 0.8rem; }
.fiche-table th { background: #D4A017; color: white; font-weight: 600; padding: 0.35rem 0.4rem; border: 1px solid #B8860B; font-size: 0.75rem; text-align: center; }
.fiche-table td { border: 1px solid #ccc; padding: 0.25rem 0.4rem; vertical-align: middle; }
.fiche-col-date { width: 80px; }
.fiche-col-dj { width: 70px; }
.fiche-col-module { min-width: 120px; }
.fiche-col-duree { width: 50px; text-align: center; }
.fiche-col-formateur { width: 110px; }
.fiche-col-sig-stag { width: 130px; }
.fiche-col-sig-form { width: 130px; }
.fiche-date { font-weight: 600; font-size: 0.78rem; white-space: nowrap; }
.fiche-dj { font-size: 0.75rem; color: #555; text-align: center; }
.fiche-module { font-size: 0.78rem; }
.fiche-duree { text-align: center; font-weight: 600; }
.fiche-formateur { font-size: 0.75rem; color: #444; }
.fiche-formateur-radios { display: flex; flex-direction: column; gap: 2px; }
.fiche-radio-label { display: flex; align-items: center; gap: 4px; font-size: 0.72rem; cursor: default; }
.fiche-radio-label input[type="radio"] { margin: 0; width: 12px; height: 12px; accent-color: #6B4226; }
.fiche-sig { min-height: 25px; }
.fiche-row-empty td { height: 22px; }

.fiche-sig-row td { border-left: none; border-right: none; padding: 0; }
.fiche-sig-zone { display: flex; justify-content: space-around; padding: 0.5rem 0; }
.fiche-sig-box { width: 42%; border: 1px solid #aaa; padding: 0.4rem 0.6rem; min-height: 50px; border-radius: 4px; }
.fiche-sig-label { font-size: 0.72rem; color: #555; }

.fiche-week-sep { height: 10px; }
.fiche-total-periode { text-align: right; margin-top: 0.75rem; font-size: 0.95rem; padding: 0.5rem; background: #f5f0eb; border-radius: var(--radius); }

/* ========== DETAIL OVERLAY (carte dossier) ========== */

.detail-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 2rem; z-index: 1000;
  overflow-y: auto;
}
.detail-overlay.hidden { display: none; }

.detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  width: 380px; max-width: 95vw;
  padding: 1.25rem;
  position: relative;
}

.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.detail-nom { font-size: 1.15rem; }
.detail-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--text-light); padding: 0 0.25rem; line-height: 1;
}
.detail-close:hover { color: var(--text); }

.detail-section { margin-bottom: 1rem; }
.detail-section-title { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 0.4rem; }

.detail-infos-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem;
}
.detail-infos-grid .detail-label { font-size: 0.72rem; color: var(--text-muted); }
.detail-infos-grid strong { font-size: 0.88rem; }

.detail-module { padding: 0.25rem 0; font-size: 0.85rem; color: var(--text); }
.detail-module-h { color: var(--text-muted); font-size: 0.78rem; }
.detail-empty { color: var(--text-muted); font-size: 0.82rem; font-style: italic; }

/* Avancement P/S1/S2/S3 */
.av-row { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.av-step { display: flex; flex-direction: column; align-items: center; }
.av-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
}
.av-vert { background: #4caf50; }
.av-orange { background: var(--orange); }
.av-gris { background: #ccc; color: #888; }
.av-date { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }
.av-connector { color: var(--border); font-size: 0.7rem; margin: 0 0.15rem; align-self: center; }

/* Bouton grille */
.detail-btn-grille {
  width: 100%; margin-top: 0.75rem; padding: 0.6rem; font-size: 0.9rem;
  background: var(--olive-soutenu); color: #fff; border: none; border-radius: var(--radius);
  cursor: pointer;
}
.detail-btn-grille:hover { background: var(--olive-clair); }

/* ========== ANALYSE ========== */

.analyse-container { min-height: 60px; }

.analyse-placeholder {
  color: var(--text-muted); font-size: 0.82rem; font-style: italic;
  text-align: center; padding: 0.5rem 0;
}

.analyse-btn {
  display: block; margin: 0.5rem auto 0; padding: 0.5rem 1.5rem;
  background: var(--olive-soutenu); color: #fff; border: none;
  border-radius: var(--radius); cursor: pointer; font-size: 0.85rem;
}
.analyse-btn:hover { background: var(--olive-clair); }

.analyse-loading {
  display: flex; align-items: center; gap: 0.5rem;
  justify-content: center; padding: 1rem 0;
  font-size: 0.82rem; color: var(--text-muted);
}

.analyse-spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--olive-soutenu); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.analyse-erreur {
  background: #fce4ec; padding: 0.75rem; border-radius: var(--radius);
  font-size: 0.82rem; color: #c62828;
}
.analyse-retry {
  margin-top: 0.5rem; font-size: 0.78rem; padding: 0.25rem 0.75rem;
}
.analyse-relancer {
  display: block; margin: 0.75rem auto 0; font-size: 0.78rem; padding: 0.3rem 1rem;
}

/* Module virtuel Evaluation */
.module-eval {
  font-style: italic; color: var(--indigo-soutenu);
}
.module-eval-total {
  font-style: italic;
}
.detail-module-eval {
  font-style: italic; color: var(--indigo-soutenu);
  border-top: 1px dashed var(--border);
  padding-top: 0.3rem; margin-top: 0.3rem;
}

.analyse-result { font-size: 0.82rem; }

.analyse-header {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.analyse-emoji { font-size: 1.3rem; }
.analyse-risque {
  font-weight: 700; font-size: 0.78rem; text-transform: uppercase;
  padding: 0.15rem 0.5rem; border-radius: var(--radius-pill);
}
.risque-aucun { background: #e8f5e9; color: #2e7d32; }
.risque-faible { background: #e8f5e9; color: #388e3c; }
.risque-moyen { background: #fff3e0; color: #e65100; }
.risque-eleve { background: #fbe9e7; color: #d84315; }
.risque-critique { background: #ffcdd2; color: #b71c1c; }
.risque-inconnu { background: #f5f5f5; color: #757575; }
.analyse-date { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }

.analyse-etape {
  font-weight: 600; font-size: 0.85rem; color: var(--indigo-soutenu);
  margin-bottom: 0.4rem;
}

.analyse-docs {
  font-family: monospace; font-size: 0.75rem;
  background: #f5f5f5; padding: 0.3rem 0.5rem; border-radius: 4px;
  margin-bottom: 0.4rem;
}

.analyse-diagnostic {
  line-height: 1.45; margin-bottom: 0.5rem;
  white-space: pre-wrap;
}

.analyse-main {
  font-size: 0.8rem; margin-bottom: 0.4rem;
  padding: 0.2rem 0.5rem; background: #f5f0eb; border-radius: 4px;
}

.analyse-actions { margin-bottom: 0.5rem; }
.analyse-actions ul { padding-left: 1.2rem; margin-top: 0.2rem; }
.analyse-actions li { margin-bottom: 0.2rem; }

.analyse-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.analyse-tag {
  font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: var(--radius-pill);
}
.analyse-tag-ok { background: #e8f5e9; color: #2e7d32; }
.analyse-tag-risk { background: #fff3e0; color: #e65100; }

.analyse-gmail, .analyse-neo4j {
  border-top: 1px solid var(--border-light);
  padding-top: 0.4rem; margin-top: 0.4rem; font-size: 0.78rem;
}
.analyse-gmail strong, .analyse-neo4j strong { font-size: 0.75rem; color: var(--text-muted); }
.analyse-mail-line { font-size: 0.72rem; color: var(--text-light); padding: 0.1rem 0; }
.analyse-dernier-mail { font-size: 0.75rem; margin: 0.2rem 0; }
.analyse-docs-detectes { font-size: 0.72rem; color: var(--text-muted); }
.analyse-autres { font-size: 0.72rem; color: var(--text-light); }

/* ============================================================
   Phase flags system — dynamic ORION steps by phase
   ============================================================ */

.flags-phase-current {
  margin-bottom: 0.6rem;
}

.flags-phase-titre {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--indigo-soutenu);
  background: rgba(92, 107, 192, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.35rem;
}

.flags-historique {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  padding-top: 0.35rem;
}

.flags-historique-summary {
  font-size: 0.72rem;
  color: var(--indigo-clair);
  cursor: pointer;
  list-style: none;
  padding: 0.2rem 0;
  transition: color 0.2s;
}
.flags-historique-summary::-webkit-details-marker { display: none; }
.flags-historique-summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 0.3rem;
  font-size: 0.6rem;
  transition: transform 0.2s;
}
.flags-historique[open] > .flags-historique-summary::before {
  transform: rotate(90deg);
}
.flags-historique-summary:hover {
  color: var(--indigo-soutenu);
}

.flags-phase-prev-group {
  margin-top: 0.35rem;
  padding-left: 0.2rem;
}

.flags-phase-prev-titre {
  display: inline-block;
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.25rem;
}

.flag-toggle-prev {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  opacity: 0.55;
  cursor: default;
}
.flag-toggle-prev input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--valid-border);
  flex-shrink: 0;
  pointer-events: none;
}
.flag-toggle-prev .flag-label {
  color: var(--text-light);
}
.flag-toggle-prev .flag-etape {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* ============================================================
   Comments section — private notes for AI agent
   ============================================================ */

.commentaires-section {
  margin-top: 0.75rem;
  padding: 0.6rem;
  background: #fafbfc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}

.commentaires-liste {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}
.commentaires-liste::-webkit-scrollbar {
  width: 4px;
}
.commentaires-liste::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.commentaire-item {
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
  border-left: 3px solid var(--indigo-clair);
  background: var(--surface);
  border-radius: 0 4px 4px 0;
  transition: border-color 0.2s;
}
.commentaire-item:last-child {
  margin-bottom: 0;
}
.commentaire-item:hover {
  border-left-color: var(--indigo-soutenu);
}

.commentaire-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.commentaire-date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.commentaire-author {
  font-size: 0.65rem;
  color: var(--indigo-clair);
  font-weight: 600;
}

.commentaire-message {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
  white-space: pre-wrap;
}

.commentaire-empty {
  font-size: 0.76rem;
  font-style: italic;
  color: var(--text-muted);
  padding: 0.5rem 0;
  text-align: center;
}

.commentaire-ajout {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.commentaire-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 4rem;
  max-height: 10rem;
  overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.commentaire-textarea:focus {
  outline: none;
  border-color: var(--indigo-clair);
  box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.15);
}
.commentaire-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.commentaire-ajout button {
  align-self: flex-end;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--surface);
  background: var(--indigo-clair);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.commentaire-ajout button:hover {
  background: var(--indigo-soutenu);
}

.commentaire-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--surface);
  background: var(--indigo-clair);
  border-radius: 9px;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* ============================================================
   Enhanced timeline connector — between P/S1/S2/S3 dots
   ============================================================ */

.analyse-timeline-connector {
  flex-shrink: 0;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  margin: 0 0.1rem;
  align-self: center;
  transition: background 0.2s;
}
.analyse-timeline-connector.done {
  background: var(--valid-border);
}
.analyse-timeline-connector.planned {
  background: var(--orange);
}
.analyse-timeline-connector.pending {
  background: transparent;
  border-top: 2px dashed var(--border);
}

/* ============================================================
   Planning previsionnel — Gantt bar design
   ============================================================ */

.planning-header { margin-bottom: 1.5rem; }
.planning-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.2rem; }
.planning-subtitle { font-size: 0.85rem; color: var(--text-light); }

.planning-empty { text-align: center; padding: 3rem 1rem; color: var(--text-light); }
.planning-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.planning-modules { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.planning-actions { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; }

/* Availability bar — global week availability */
.avail-bar {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.avail-bar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.avail-bar-grid {
  display: flex;
  gap: 0;
}
.avail-month {
  flex: 1;
  min-width: 0;
}
.avail-month-label {
  font-size: 0.58rem;
  color: var(--text-light);
  text-align: center;
  text-transform: capitalize;
  font-weight: 500;
  margin-bottom: 4px;
}
.avail-month-cells {
  display: flex;
  gap: 2px;
}
.avail-cell {
  flex: 1;
  height: 24px;
  background: #e8f5e9;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid rgba(0,0,0,0.04);
}
.avail-cell:hover {
  background: #c8e6c9;
}
.avail-cell.blocked {
  background: repeating-linear-gradient(
    45deg,
    #e0e0e0,
    #e0e0e0 3px,
    #bdbdbd 3px,
    #bdbdbd 6px
  );
  border-color: #bdbdbd;
  cursor: pointer;
}
.avail-cell.blocked:hover {
  background: repeating-linear-gradient(
    45deg,
    #d5d5d5,
    #d5d5d5 3px,
    #aaa 3px,
    #aaa 6px
  );
}

@media (max-width: 768px) {
  .avail-cell { height: 18px; }
  .avail-bar { padding: 0.75rem; }
  .avail-month-label { font-size: 0.5rem; }
}

/* Recap table */
.planning-recap {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.planning-recap-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #6A1B9A;
  margin-bottom: 0.75rem;
}

/* Module card */
.mod-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.mod-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }

.mod-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.mod-name { font-weight: 600; font-size: 0.95rem; }
.mod-hours { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }

.mod-heures-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.8rem;
}
.mod-heures-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-light);
  font-weight: 500;
}
.mod-heures-input {
  width: 55px;
  padding: 0.2rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  text-align: center;
}
.mod-heures-input:focus { outline: none; border-color: #6A1B9A; }
.mod-heures-reste {
  margin-left: auto;
  font-size: 0.78rem;
  color: #6A1B9A;
}

/* Gantt bar */
.gantt-row {
  position: relative;
  height: 48px;
  margin-bottom: 0.75rem;
}
.gantt-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 36px;
  background: var(--bg);
  border-radius: 6px;
  display: flex;
}
.gantt-cell {
  flex: 1;
  border-right: 1px solid rgba(0,0,0,0.04);
  position: relative;
}
.gantt-cell:last-child { border-right: none; }
.gantt-cell-label {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  color: var(--text-light);
  text-transform: capitalize;
  white-space: nowrap;
  font-weight: 500;
}
.gantt-cell.active .gantt-cell-label {
  color: #6A1B9A;
  font-weight: 700;
}
.gantt-cell.emarge {
  background: rgba(0, 0, 0, 0.06);
}
.gantt-cell.emarge .gantt-cell-label {
  color: var(--text-light);
  font-weight: 600;
  font-style: italic;
}
.gantt-emarge {
  position: absolute;
  top: 0;
  height: 36px;
  border-radius: 6px 0 0 6px;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,0.06), rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.02) 3px, rgba(0,0,0,0.02) 6px);
  z-index: 1;
  pointer-events: none;
}

/* Active bar overlay */
.gantt-active {
  position: absolute;
  top: 0;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  cursor: default;
}
.gantt-active-fill {
  width: 100%; height: 100%;
  opacity: 0.18;
}
.gantt-active-curve {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100%;
}
.gantt-active-curve svg { width: 100%; height: 100%; display: block; }

/* Drag handles */
.gantt-handle {
  position: absolute;
  top: 0;
  width: 14px;
  height: 36px;
  cursor: col-resize;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gantt-handle::after {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: rgba(255,255,255,0.8);
  box-shadow: 0 0 4px rgba(0,0,0,0.15);
  transition: height 0.15s, background 0.15s;
}
.gantt-handle:hover::after {
  height: 22px;
  background: white;
}
.gantt-handle-start { left: -2px; border-radius: 6px 0 0 6px; }
.gantt-handle-end { right: -2px; border-radius: 0 6px 6px 0; }

/* Info line */
.gantt-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
  padding-top: 16px;
}
.gantt-info-range { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }
.gantt-info-duration {
  font-size: 0.7rem;
  color: #6A1B9A;
  font-weight: 600;
  background: rgba(106, 27, 154, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Courbe chips */
.courbe-row {
  display: flex;
  gap: 6px;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.courbe-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-light);
}
.courbe-chip:hover { background: rgba(247, 147, 30, 0.1); color: #F7931E; }
.courbe-chip.selected { border-color: currentColor; font-weight: 600; }
.courbe-chip svg { flex-shrink: 0; }

.courbe-desc {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-light);
  margin-top: 0.35rem;
}

/* Planning result table */
.planning-result { margin-top: 1.5rem; }
.planning-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.78rem;
}
.planning-table th, .planning-table td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.5rem;
  text-align: center;
  white-space: nowrap;
}
.planning-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
}
.planning-table td:first-child { text-align: left; font-weight: 500; min-width: 140px; }
.planning-table .total-row td { font-weight: 700; background: var(--bg); }
.planning-cell-light { background: #e8f5e9; }
.planning-cell-medium { background: #fff9c4; }
.planning-cell-heavy { background: #ffe0b2; }
.planning-cell-over { background: #ffcdd2; color: var(--danger); font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
  .mod-card { padding: 0.75rem; }
  .gantt-cell-label { font-size: 0.5rem; }
  .courbe-chip { padding: 4px 6px; font-size: 0.65rem; }
  .courbe-chip svg { display: none; }
}

/* ============================================================
   POST-IT NOTES FEATURE
   Classes alignees sur js/notes.js (Notes + NotesModal)
   La police 'Patrick Hand' est chargee via <link> dans index.html
   ============================================================ */

/* ---------- Panel container (#notes-panel) ----------
   Fond blanc pour que les post-it aient l'air "deposes" sur l'ecran.
*/
#notes-panel {
  background: #ffffff;
  border-radius: 8px;
  padding: 14px 12px 18px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  min-height: calc(100vh - 180px);
  overflow-y: auto;
}
#notes-panel .notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #FFEB3B;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
#notes-panel .notes-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--indigo-soutenu, #3949AB);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.notes-add-qualiopi {
  background: #BA68C8;
  color: white;
  padding: 5px 12px;
  border: none;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.notes-add-qualiopi:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 3px 10px rgba(142, 36, 170, 0.4);
}

/* ---------- Filter chips ---------- */
.notes-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.notes-chip {
  border-radius: 10px;
  font-size: 10px;
  padding: 3px 9px;
  cursor: pointer;
  border: 2px solid #ddd;
  background: white;
  color: #666;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.notes-chip:hover { opacity: 0.85; }
.notes-chip.active { background: var(--indigo-soutenu, #3949AB); color: white; border-color: var(--indigo-soutenu, #3949AB); }
.notes-chip[data-filter="admin"].active { background: #FDD835; color: #7a5c00; border-color: #FBC02D; }
.notes-chip[data-filter="pedago"].active { background: #43A047; color: white; border-color: #2E7D32; }
.notes-chip[data-filter="qualiopi"].active { background: #8E24AA; color: white; border-color: #6A1B9A; }
.notes-chip[data-filter="attente"].active { background: #29B6F6; color: white; border-color: #039BE5; }
.notes-chip[data-filter="stale"].active { background: #FB8C00; color: white; border-color: #EF6C00; }
.notes-chip[data-filter="archivee"].active { background: #757575; color: white; border-color: #424242; }
.chip-count {
  display: inline-block;
  min-width: 16px;
  padding: 0 4px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-size: 9px;
  text-align: center;
}
.notes-chip.active .chip-count { background: rgba(255, 255, 255, 0.3); }

/* ---------- Grid + empty ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
  padding: 8px 0;
}
.notes-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 12px;
  font-style: italic;
}

/* ---------- Post-it card ---------- */
.post-it {
  position: relative;
  padding: 16px 8px 6px;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  cursor: default;
  overflow: hidden;
}
.post-it:hover {
  transform: rotate(0) scale(1.03) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18), 0 10px 20px rgba(0, 0, 0, 0.14);
  z-index: 5;
}
.post-it:nth-child(odd)  { transform: rotate(-1.8deg); }
.post-it:nth-child(even) { transform: rotate(1.3deg); }
.post-it:nth-child(3n)   { transform: rotate(-0.8deg); }
.post-it::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 38px;
  height: 12px;
  margin-left: -19px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
/* Couleurs post-it brand (canary / lime / ultra violet / neon orange) */
.post-it.admin    {
  background: linear-gradient(135deg, #FEFE7B 0%, #FFF159 60%, #FEE100 100%);
  color: #2a2a2a;
}
.post-it.pedago   {
  background: linear-gradient(135deg, #E3F98A 0%, #C2F04C 60%, #A6D900 100%);
  color: #2a2a2a;
}
.post-it.qualiopi {
  background: linear-gradient(135deg, #D6B3EE 0%, #B47DC8 60%, #9145B7 100%);
  color: white;
}
.post-it.attente {
  background: linear-gradient(135deg, #D6F0FF 0%, #A7DBFF 60%, #7CC4F5 100%);
  color: #1a3a4a;
}
.post-it.stale {
  background: linear-gradient(135deg, #FFC080 0%, #FF9040 60%, #FF6B00 100%);
  color: #2a2a2a;
  animation: post-it-pulse-stale 3s infinite;
}
.post-it.archivee   { opacity: 0.45; filter: grayscale(0.5); }
.post-it.in-transit { opacity: 0.5; pointer-events: none; transition: opacity 0.2s ease; }
@keyframes post-it-pulse-stale {
  0%, 100% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(251, 140, 0, 0.2); }
  50%      { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 6px 16px rgba(251, 140, 0, 0.5); }
}

/* ---------- Post-it header ---------- */
.post-it-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.post-it-cat {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.7;
  flex-shrink: 0;
}
.post-it.qualiopi .post-it-cat { opacity: 0.95; }
/* Badge "!" sur le post-it : masque — l'indicateur est sur la carte salarie. */
.stale-badge { display: none; }

/* ---------- Post-it action buttons (visibles au hover uniquement) ---------- */
.post-it-actions {
  margin-left: auto;
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.post-it:hover .post-it-actions,
.post-it:focus-within .post-it-actions {
  opacity: 1;
}
.post-it-actions button {
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s ease, transform 0.1s ease;
  color: inherit;
}
.post-it-actions button:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.15);
}
.post-it.qualiopi .post-it-actions button       { background: rgba(255, 255, 255, 0.2); }
.post-it.qualiopi .post-it-actions button:hover { background: rgba(255, 255, 255, 0.4); }
.post-it-validate:hover { color: #1b5e20; }
.post-it-delete:hover   { color: #b71c1c; }

/* ---------- Target + content + footer ---------- */
.post-it-target {
  font-size: 9px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.7);
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  align-self: flex-start;
  margin-bottom: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-it.qualiopi .post-it-target { color: white; background: rgba(255, 255, 255, 0.2); }
.post-it.stale    .post-it-target { background: rgba(255, 255, 255, 0.7); color: #7a3500; }
.post-it-content {
  font-family: 'Patrick Hand', cursive;
  font-size: 15px;
  line-height: 1.22;
  color: #2a2a2a;
  flex: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  cursor: text;
}
.post-it.qualiopi .post-it-content { color: white; }
.post-it-edit-textarea {
  width: 100%;
  min-height: 70px;
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  line-height: 1.25;
  background: rgba(255, 255, 255, 0.35);
  border: 2px dashed rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 4px;
  color: inherit;
  resize: vertical;
  outline: none;
}
.post-it.qualiopi .post-it-edit-textarea { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.5); color: white; }
.post-it-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  opacity: 0.55;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
}
.post-it.qualiopi .post-it-foot { border-top-color: rgba(255, 255, 255, 0.3); }
.post-it-author { font-weight: 700; }
.post-it-date { font-variant-numeric: tabular-nums; }

/* ============================================================
   NOTES MODAL
   ============================================================ */
.notes-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99;
}
.notes-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-1.5deg);
  background: linear-gradient(135deg, #FFEB3B, #FDD835);
  width: 380px;
  max-width: 92vw;
  padding: 22px 24px 18px;
  border-radius: 2px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
}
.notes-modal.qualiopi-bg {
  background: linear-gradient(135deg, #BA68C8, #8E24AA);
  color: white;
}
.notes-modal.attente-bg {
  background: linear-gradient(135deg, #B3E5FC, #81D4FA);
  color: #1a3a4a;
}
.notes-modal::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 60px;
  height: 16px;
  margin-left: -30px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(-3deg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.notes-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.notes-modal-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}
.notes-modal.qualiopi-bg .notes-modal-head h3 { opacity: 0.95; }
.notes-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: inherit;
  cursor: pointer;
  line-height: 1;
  opacity: 0.65;
}
.notes-modal-close:hover { opacity: 1; }
.notes-modal-target {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 12px;
}
.notes-modal.qualiopi-bg .notes-modal-target { background: rgba(255, 255, 255, 0.2); color: white; }
.notes-modal-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.notes-modal-toggle button {
  flex: 1;
  padding: 7px 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.notes-modal-toggle button.active {
  background: white;
  color: var(--indigo-soutenu, #3949AB);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.notes-modal-textarea {
  width: 100%;
  min-height: 110px;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  outline: none;
  font-family: 'Patrick Hand', cursive;
  font-size: 20px;
  line-height: 1.3;
  padding: 8px 10px;
  border-radius: 4px;
  resize: vertical;
  color: inherit;
}
.notes-modal.qualiopi-bg .notes-modal-textarea { background: rgba(255, 255, 255, 0.2); color: white; }
.notes-modal.qualiopi-bg .notes-modal-textarea::placeholder { color: rgba(255, 255, 255, 0.7); }
.notes-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.2);
}
.notes-modal.qualiopi-bg .notes-modal-foot { border-top-color: rgba(255, 255, 255, 0.3); }

/* ============================================================
   UNDO TOAST (apres validation)
   ============================================================ */
.undo-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 200;
  font-size: 13px;
}
.undo-btn {
  background: transparent;
  color: #FFEB3B;
  border: 1px solid #FFEB3B;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.15s ease;
}
.undo-btn:hover { background: rgba(255, 235, 59, 0.2); }

/* ============================================================
   INTEGRATION PANEAU LATERAL + CARTE + COMMENTAIRES
   ============================================================ */

/* Layout 3 colonnes quand M&1F (notes panel + liste + detail)
   - min-width:0 sur tous les tracks pour empecher le contenu de forcer
     l'elargissement de sa colonne (evite le chevauchement avec le detail)
   - auto-fill minmax pour les cartes : responsif, s'adapte a la largeur dispo
*/
.selection-layout.with-notes {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 340px;
  gap: 0.75rem;
  align-items: start;
}
.selection-layout.with-notes .selection-list-col,
.selection-layout.with-notes .notes-panel-col,
.selection-layout.with-notes .analyse-panel {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.selection-layout.with-notes .parcours-list {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.6rem;
}
@media (max-width: 1400px) {
  .selection-layout.with-notes {
    grid-template-columns: 220px minmax(0, 1fr) 320px;
    gap: 0.6rem;
  }
}
@media (max-width: 1180px) {
  .selection-layout.with-notes { grid-template-columns: 1fr; }
  .selection-layout.with-notes .notes-panel-col { order: -1; max-height: 260px; }
}
.notes-panel-col {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notes-panel-col #notes-panel {
  flex: 1;
  min-height: 0;
}

/* Bouton 📝 sur la carte parcours */
.parcours-card { position: relative; }
.parcours-card.has-stale-note {
  border-left: 3px solid #FB8C00;
  box-shadow: 0 0 0 1px rgba(251, 140, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Etiquette "note ancienne" visible en haut a gauche de la carte */
.stale-note-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #FFB74D, #FB8C00);
  color: white;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: 0 1px 3px rgba(251, 140, 0, 0.35);
  pointer-events: none;
  animation: stale-tag-pulse 2.5s infinite;
}
@keyframes stale-tag-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
/* Quand une stale-tag est presente, on pousse un peu le nom pour ne pas le recouvrir */
.parcours-card.has-stale-note .parcours-card-top { padding-top: 14px; }
.quick-note-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFEB3B;
  border: 2px solid #FDD835;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.parcours-card:hover .quick-note-btn,
.parcours-card:focus-within .quick-note-btn { opacity: 1; }
.quick-note-btn:hover {
  transform: scale(1.15) rotate(-8deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Pastille categorie sur commentaire valide depuis note */
.commentaire-cat-pastille {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
  vertical-align: middle;
}
.commentaire-cat-pastille.admin  { background: #FFEB3B; color: #7a5c00; }
.commentaire-cat-pastille.pedago { background: #76D275; color: #1b5e20; }
.commentaire-item.cat-admin  { border-left: 3px solid #FDD835; padding-left: 8px; }
.commentaire-item.cat-pedago { border-left: 3px solid #43A047; padding-left: 8px; }

/* Toggle categorie dans la saisie commentaire */
.commentaire-cat-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.cat-toggle-btn {
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #ddd;
  background: white;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cat-toggle-btn[data-cat="admin"].active  { background: #FFEB3B; color: #7a5c00; border-color: #FDD835; }
.cat-toggle-btn[data-cat="pedago"].active { background: #76D275; color: #1b5e20; border-color: #43A047; }

/* ---------- Notes dans le panneau detail d'un dossier ---------- */
.detail-notes-section { margin-bottom: 0.75rem; }
.detail-notes-section .analyse-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.detail-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px 2px;
  background: #ffffff;
  border-radius: 6px;
}
.detail-notes-grid .post-it {
  min-height: 78px;
  padding: 14px 8px 6px;
}
.detail-notes-grid .post-it .post-it-content { font-size: 14px; }
.detail-notes-grid .post-it::before {
  width: 28px;
  height: 9px;
  margin-left: -14px;
  top: -4px;
}
.detail-notes-empty {
  text-align: center;
  padding: 10px;
  color: #999;
  font-size: 11px;
  font-style: italic;
}
}

/* ==========================================================
   Bandeau de selection salarie (sticky sous la navbar)
   ========================================================== */
#selection-banner {
  position: sticky;
  top: 57px;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
#selection-banner.hidden { display: none; }

.banner-phase-indicator {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--text-muted);
  flex-shrink: 0;
}
#selection-banner.banner-initial    .banner-phase-indicator { background: var(--text-muted); }
#selection-banner.banner-s1_vers_s2 .banner-phase-indicator { background: var(--orange); }
#selection-banner.banner-s2_vers_s3 .banner-phase-indicator { background: var(--indigo-soutenu); }
#selection-banner.banner-cloture    .banner-phase-indicator { background: var(--valid-border); }

.banner-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.banner-line1 {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.banner-name { white-space: nowrap; }
.banner-separator { color: var(--text-muted); font-weight: 400; }
.banner-entreprise {
  color: var(--text-light);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.banner-line2 {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}

.banner-pastilles {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.banner-back {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s ease;
}
.banner-back:hover { background: var(--border); }

@media (max-width: 768px) {
  #selection-banner {
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0.5rem;
    top: 0;
  }
  .banner-line1 { font-size: 0.9rem; }
  .banner-back { order: 10; margin-left: auto; }
}

/* ==========================================================
   Placeholder "aucun salarie selectionne"
   ========================================================== */
.empty-selection {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}
.empty-selection-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}
.empty-selection p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

