/* ===================================================================
   Rapports d'activité — feuille de style principale (CSS custom)
   =================================================================== */

/* ---------- Système de thème (variables) ----------
   Palette neutre + un seul accent, en variante claire et sombre. La bascule
   se fait via [data-theme] sur <html> (voir le script inline dans head.ejs
   qui le positionne avant le premier rendu, pour éviter le flash de contenu
   non stylé) ; à défaut de choix explicite mémorisé, on suit
   prefers-color-scheme. Tout composant de l'appli doit consommer CES
   variables (jamais une couleur en dur) pour rester cohérent entre les deux
   thèmes. */
:root {
  /* Surfaces : 0 = fond de page, 1 = carte/panneau standard, 2 = élément
     élevé (popover, modale) — distinct de 1 uniquement en sombre, pour
     donner une sensation de profondeur sans ombre portée forte. */
  --surface-0: #f4f5f7;
  --surface-1: #ffffff;
  --surface-2: #ffffff;

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  /* Accent unique de l'appli (boutons primaires, liens, focus, éléments actifs).
     --accent-rgb (composantes r,g,b séparées) sert aux anneaux de focus en
     rgba(), une teinte hexadécimale seule ne pouvant pas se décomposer en CSS. */
  --accent: #2f5ac7;
  --accent-rgb: 47, 90, 199;
  --accent-hover: #24459c;
  --accent-contrast: #ffffff;

  /* Rôles sémantiques : chaque paire bg/text sert aux badges de statut et
     alertes. "accent" sert de 4e couleur de sens (ex. statut "planifiée"). */
  --bg-accent: #e0e7ff;
  --text-accent: #3730a3;

  --bg-success: #ecfdf5;
  --text-success: #047857;
  --border-success: #a7f3d0;

  --bg-danger: #fef2f2;
  --text-danger: #b91c1c;
  --border-danger: #fecaca;
  /* Remplissage plein (bouton destructif) : volontairement constant entre
     les deux thèmes (un rouge saturé reste lisible sur les deux fonds),
     contrairement à --text-danger qui s'éclaircit en sombre pour rester
     lisible en tant que TEXTE sur fond sombre. */
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --danger-contrast: #ffffff;

  --bg-warning: #fff7ed;
  --text-warning: #9a3412;
  --border-warning: #fed7aa;

  /* Typographie : deux graisses seulement (direction visuelle validée). */
  --font-sans: 'Bookman Old Style', Georgia, 'Times New Roman', Times, serif;
  --font-size-base: 15px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;

  /* Ajustés pour matcher la référence visuelle validée : coins nettement
     arrondis sur les cartes (~12px), plus légers sur les champs/boutons
     (~8px) — voir le chantier de calibrage visuel de /tasks. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);

  --sidebar-width: 240px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-0: #0f1420;
    --surface-1: #171d2b;
    --surface-2: #1f2738;

    --border: #2a3247;
    --border-strong: #3a4359;

    --text-primary: #e5e7eb;
    --text-secondary: #b6bdcf;
    --text-muted: #8891a5;

    --accent: #5b82e0;
    --accent-rgb: 91, 130, 224;
    --accent-hover: #7b9aea;
    --accent-contrast: #ffffff;

    --bg-accent: rgba(91, 130, 224, 0.18);
    --text-accent: #a8c0f5;

    --bg-success: rgba(16, 185, 129, 0.16);
    --text-success: #34d399;
    --border-success: rgba(16, 185, 129, 0.35);

    --bg-danger: rgba(239, 68, 68, 0.16);
    --text-danger: #f87171;
    --border-danger: rgba(239, 68, 68, 0.35);

    --bg-warning: rgba(245, 158, 11, 0.16);
    --text-warning: #fbbf24;
    --border-warning: rgba(245, 158, 11, 0.35);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.32);
  }
}

:root[data-theme="dark"] {
  --surface-0: #0f1420;
  --surface-1: #171d2b;
  --surface-2: #1f2738;

  --border: #2a3247;
  --border-strong: #3a4359;

  --text-primary: #e5e7eb;
  --text-secondary: #b6bdcf;
  --text-muted: #8891a5;

  --accent: #5b82e0;
  --accent-rgb: 91, 130, 224;
  --accent-hover: #7b9aea;
  --accent-contrast: #ffffff;

  --bg-accent: rgba(91, 130, 224, 0.18);
  --text-accent: #a8c0f5;

  --bg-success: rgba(16, 185, 129, 0.16);
  --text-success: #34d399;
  --border-success: rgba(16, 185, 129, 0.35);

  --bg-danger: rgba(239, 68, 68, 0.16);
  --text-danger: #f87171;
  --border-danger: rgba(239, 68, 68, 0.35);

  --bg-warning: rgba(245, 158, 11, 0.16);
  --text-warning: #fbbf24;
  --border-warning: rgba(245, 158, 11, 0.35);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--surface-0);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-medium);
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

/* ---------- Layout applicatif (sidebar + contenu) ---------- */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background-color: var(--surface-1);
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-3);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  padding: var(--space-1) var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3);
}

.sidebar-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background-color: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.55rem var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: 0.88rem;
}

.nav-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
}

.nav-link-icon svg {
  width: 100%;
  height: 100%;
}

.nav-link:hover {
  background-color: var(--surface-0);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link-active {
  background-color: var(--bg-accent);
  color: var(--text-accent);
}

.nav-link-active:hover {
  background-color: var(--bg-accent);
  color: var(--text-accent);
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: var(--font-weight-medium);
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.theme-toggle-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.theme-toggle-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* L'icône affichée annonce le thème VERS LEQUEL on bascule au clic. */
.theme-toggle-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-icon-sun {
  display: inline-flex;
}

:root[data-theme="dark"] .theme-toggle-icon-moon {
  display: none;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  padding: var(--space-1) var(--space-2);
}

.sidebar-user-wrap {
  position: relative;
}

/* Le bloc utilisateur sert aussi de déclencheur du menu de profil
   (.card-menu-trigger, câblage générique dans main.js) : un <button> reprend
   ici exactement l'apparence de .sidebar-user (élément+classe pour battre la
   spécificité de la règle .card-menu-trigger prévue pour le petit bouton
   "⋯" des cartes), avec juste un fond au survol/à l'ouverture en plus. */
button.sidebar-user {
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

button.sidebar-user:hover,
button.sidebar-user[aria-expanded='true'] {
  background-color: var(--surface-0);
}

.sidebar-user-name {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  font-size: 0.9rem;
}

.sidebar-user-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-link-logout {
  color: var(--text-danger);
}

.app-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}

.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  padding: 0.4rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.mobile-toggle svg {
  width: 100%;
  height: 100%;
}

.main-content {
  flex: 1;
  padding: 2rem;
}

.app-footer {
  padding: 1rem 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.page-header {
  margin-bottom: 1.5rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.breadcrumb-link,
.breadcrumb-static {
  color: var(--text-muted);
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

.breadcrumb-sep {
  color: var(--border-strong);
}

.text-muted {
  color: var(--text-muted);
}

.empty-state {
  background-color: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* ---------- Alertes / messages flash ---------- */

.alert {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.alert p {
  margin: 0;
}

.alert p + p {
  margin-top: 0.25rem;
}

.alert-success {
  background-color: var(--bg-success);
  border-color: var(--border-success);
  color: var(--text-success);
}

.alert-error {
  background-color: var(--bg-danger);
  border-color: var(--border-danger);
  color: var(--text-danger);
}

.alert-warning {
  background-color: var(--bg-warning);
  border-color: var(--border-warning);
  color: var(--text-warning);
}

/* ---------- Formulaires ---------- */

.form,
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 420px;
}

.form-narrow {
  max-width: 380px;
}

label {
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  margin-top: 0.75rem;
}

input,
select,
textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface-1);
  color: var(--text-primary);
}

.password-field {
  position: relative;
}

.password-field-input {
  width: 100%;
  padding-right: 2.4rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--surface-0);
}

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

/* Ligne d'actions alignée à droite (ex. bouton d'ajout compact en pied de
   formulaire, plutôt qu'un bouton étiré sur toute la largeur). */
.form-actions-end {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-block {
  width: 100%;
}

.form button[type="submit"] {
  margin-top: 1.25rem;
  align-self: flex-start;
}

/* ---------- Page de connexion ---------- */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  /* Fond volontairement fixe (indépendant du thème clair/sombre) : la page
     de connexion n'a pas de bascule de thème (pas encore de session), un
     fond de marque constant reste plus lisible qu'un gris qui varierait. */
  background-color: #1b2233;
  margin: 0;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background-color: var(--surface-1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.auth-title {
  margin-bottom: 1.25rem;
}

/* ---------- Tableaux ---------- */

.table-wrapper {
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background-color: var(--surface-0);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Datatable (recherche/tri/pagination JS — public/js/datatable.js) ---------- */

.datatable-search {
  margin-bottom: 0.75rem;
}

.datatable-search-input {
  width: 100%;
  max-width: 320px;
}

.data-table th.datatable-sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.datatable-sortable:hover {
  color: var(--text-secondary);
}

.datatable-sort-indicator {
  display: inline-block;
  margin-left: 0.3rem;
  opacity: 0.35;
}

.datatable-sort-indicator::after {
  content: '\2195';
}

.data-table th.datatable-sort-asc .datatable-sort-indicator,
.data-table th.datatable-sort-desc .datatable-sort-indicator {
  opacity: 1;
  color: var(--accent);
}

.data-table th.datatable-sort-asc .datatable-sort-indicator::after {
  content: '\2191';
}

.data-table th.datatable-sort-desc .datatable-sort-indicator::after {
  content: '\2193';
}

.data-table tr.datatable-row-last td {
  border-bottom: none;
}

.datatable-no-results td {
  text-align: center;
  color: var(--text-muted);
  padding: 1.25rem;
}

.datatable-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.datatable-page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  background-color: var(--surface-0);
  color: var(--text-muted);
  text-transform: capitalize;
}

/* Sens des couleurs de statut, cohérent partout : vert = terminé,
   jaune = en cours, rouge = reporté/en retard, bleu (accent) = planifié. */
.badge-en_cours,
.badge-progress-en_cours {
  background-color: var(--bg-warning);
  color: var(--text-warning);
}

.badge-terminee,
.badge-progress-finalise {
  background-color: var(--bg-success);
  color: var(--text-success);
}

.badge-reportee {
  background-color: var(--bg-danger);
  color: var(--text-danger);
}

.badge-planifiee,
.badge-progress-phase_initiale {
  background-color: var(--bg-accent);
  color: var(--text-accent);
}

/* "En pause" est un statut qui appelle l'attention (projet à l'arrêt) —
   couleur danger, cohérent avec la teinte rose/rouge du référentiel
   PROJECT_PROGRESS_STATUTS d'origine (#F791A4), pas un simple neutre. */
.badge-progress-en_pause {
  background-color: var(--bg-danger);
  color: var(--text-danger);
}

/* Suivi des orientations CODIR : même sens vert/jaune/rouge que les badges
   ci-dessus, appliqué au select lui-même (pas de badge séparé, l'orientation
   n'a qu'un seul statut affiché à la fois) — data-statut posé côté serveur
   au rendu et resynchronisé en JS au changement (voir codir/edit.ejs). Reste
   neutre tant qu'aucun statut n'est choisi (data-statut="").
   L'alerte de traînage (badge-progress-en_pause) vit dans une cellule
   séparée du tableau : jamais de conflit visuel avec cette couleur. */
select.codir-statut-select[data-statut="TE"] {
  background-color: var(--bg-success);
  color: var(--text-success);
  border-color: var(--text-success);
}

select.codir-statut-select[data-statut="PE"] {
  background-color: var(--bg-accent);
  color: var(--text-accent);
  border-color: var(--text-accent);
}

select.codir-statut-select[data-statut="NE"] {
  background-color: var(--bg-danger);
  color: var(--text-danger);
  border-color: var(--text-danger);
}

/* Bouton de suppression d'une orientation ajoutée pendant la séance en cours
   d'édition — jamais affiché pour une orientation héritée d'une séance
   antérieure (voir codir/edit.ejs, restriction meeting_emission_id). */
.btn-delete-orientation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  margin-left: 0.4rem;
  border: none;
  background: transparent;
  color: var(--text-danger);
  cursor: pointer;
  vertical-align: middle;
  border-radius: 4px;
}

.btn-delete-orientation svg {
  width: 14px;
  height: 14px;
}

.btn-delete-orientation:hover {
  background-color: var(--bg-danger);
}

/* ---------- Cartes (formulaires, projets, tâches) ---------- */

.card {
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.form-wide {
  max-width: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}

.form-grid label {
  margin-top: 0;
}

/* Chaque colonne est un <div><label>...</label><input|select|textarea>...</div> :
   la grille répartit bien les DIVS en colonnes égales, mais un input/select
   n'est pas block-level et ne s'étire pas tout seul pour remplir sa cellule
   (contrairement à un enfant direct de .form, qui s'étire via le
   align-items:stretch du flex parent) — sans ce width:100%, les champs
   restent à leur largeur naturelle étroite, collés à gauche de leur
   colonne, ce qui donne l'impression d'un grand vide entre deux champs
   pourtant bien dans deux colonnes égales. */
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
}

/* Variante empilée de .form-grid : une seule colonne pleine largeur plutôt
   que la répartition auto-fit — pour des champs (ex. listes d'activités)
   dont le contenu est trop long pour tenir lisiblement à côté d'un autre. */
.form-grid-stack {
  grid-template-columns: 1fr;
}

/* Sous-titre de groupe à l'intérieur d'une carte (ex. distinguer "Activités
   réalisées" d'"Activités en instance" dans un même bloc service). */
.card-subtitle {
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 1rem 0 0.5rem;
}

/* ---------- Autocomplétion ---------- */

.autocomplete-wrapper {
  position: relative;
}

/* Le textarea est enveloppé dans .autocomplete-wrapper (pour positionner la
   liste de suggestions) : ce wrapper s'étire bien sur toute la largeur du
   formulaire (enfant direct de .form, flex + align-items:stretch), mais le
   textarea qu'il contient n'hérite pas de cet étirement — un textarea ne
   remplit pas son conteneur par défaut, contrairement au wrapper lui-même.
   Sans ce width:100%, le champ garde sa largeur intrinsèque (~20 colonnes),
   laissant un vide à droite alors que .form-grid au-dessus occupe, lui,
   toute la largeur (répartie en 2 colonnes remplies). */
.autocomplete-wrapper textarea {
  width: 100%;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 2px 0 0;
  padding: 0.25rem 0;
  list-style: none;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  z-index: 15;
  /* Transparent aux clics par défaut : la liste peut visuellement recouvrir
     un bouton situé juste en dessous (ex. "Ajouter la tâche", rapproché du
     textarea dans la nouvelle mise en page). Sans ça, un clic dont le
     mousedown tombe sur cette zone vide et le mouseup sur le bouton
     fraîchement démasqué (la liste se referme au blur, voir le JS) ne
     déclenche AUCUN évènement "click" — mousedown et mouseup sur deux
     éléments différents ne synthétisent pas de clic, un comportement
     standard des navigateurs. Seules les lignes cliquables (li) redeviennent
     interactives ci-dessous ; la ligne "Aucune suggestion" (sans action)
     reste transparente pour laisser le clic traverser jusqu'au bouton. */
  pointer-events: none;
}

.suggestions-list li {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  pointer-events: auto;
}

.suggestions-list li:hover {
  background-color: var(--surface-0);
}

.suggestions-list li.suggestions-empty {
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
  pointer-events: none;
}

.suggestions-list li.suggestions-empty:hover {
  background-color: transparent;
}

/* ---------- Navigation de semaine ---------- */

.week-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.week-jump-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.week-jump-form input[type='date'] {
  padding: 0.5rem 0.6rem;
}

.btn-secondary {
  background-color: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--surface-0);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--danger-contrast);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

/* Action positive/succès mise en avant (ex. "Exécuté" sur les cartes de
   tâche) — même paire de teintes que les badges de statut "terminée". */
.btn-success {
  background-color: var(--bg-success);
  color: var(--text-success);
  border: 1px solid var(--border-success);
}

.btn-success:hover {
  background-color: var(--border-success);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.close-week-form {
  margin-bottom: 2rem;
}

/* ---------- Tâches groupées par pôle ---------- */

/* Rail d'accent coloré (couleur propre au pôle, --pole-accent posée en style
   inline depuis la vue — même variable/mécanisme que .pole-option dans la
   popup de sélection) + étiquette en pastille : délimite visuellement
   chaque section sans emboîter les cartes de tâches dans une carte
   supplémentaire (elles ont déjà leur propre fond/bordure). */
.pole-section {
  --pole-accent: #6b7280;
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--pole-accent);
}

.pole-title {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  margin: 0 0 1rem;
  padding: 0.3rem 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--font-weight-medium);
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.task-card {
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s ease;
}

.task-card-saved {
  border-color: var(--border-success);
}

/* Actions rapides mises en avant : chacune occupe la moitié de la carte
   plutôt qu'une largeur naturelle alignée à gauche. */
.task-quick-actions {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
  flex-wrap: wrap;
}

.task-quick-actions .btn {
  flex: 1 1 0;
}

.badge-reconduction-off {
  display: inline-block;
  margin-bottom: 0.5rem;
  background-color: var(--bg-danger);
  color: var(--text-danger);
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.task-card-header-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.task-card-user {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Menu "⋯" (actions secondaires d'une carte de tâche) ---------- */

.card-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.card-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.card-menu-trigger svg {
  width: 16px;
  height: 16px;
}

.card-menu-trigger:hover,
.card-menu-trigger[aria-expanded="true"] {
  background-color: var(--surface-0);
  color: var(--text-primary);
}

.card-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 210px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.35rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.card-menu[hidden] {
  display: none;
}

/* Variante pour un déclencheur en bas d'écran (menu de profil de la
   sidebar) : ouvre vers le haut plutôt que vers le bas, pour ne pas sortir
   du viewport. */
.card-menu-up {
  top: auto;
  bottom: calc(100% + 4px);
}

.card-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: var(--font-weight-normal);
  color: var(--text-primary);
  cursor: pointer;
}

.card-menu-item-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.card-menu-item-icon svg {
  width: 100%;
  height: 100%;
}

.card-menu-item:hover {
  background-color: var(--surface-0);
}

.card-menu-item-danger {
  color: var(--text-danger);
}

.card-menu-item-danger .card-menu-item-icon {
  color: var(--text-danger);
}

.card-menu-item-danger:hover {
  background-color: var(--bg-danger);
}

.card-menu-divider {
  height: 1px;
  background-color: var(--border);
  margin: 0.3rem 0.2rem;
}

.task-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 0.5rem 0 0.15rem;
}

.task-card-text {
  margin: 0;
  white-space: pre-wrap;
}

.task-inline-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  max-width: none;
  gap: 0.25rem;
}

/* .form définit display:flex avec la même spécificité que la règle
   navigateur [hidden] { display:none } ; comme les styles auteur gagnent
   toujours face aux styles UA, [hidden] seul ne suffit pas à replier un
   formulaire qui porte la classe .form (ou .task-inline-form) : il faut
   une règle explicite plus spécifique pour reprendre la main. */
.form[hidden],
.task-inline-form[hidden] {
  display: none;
}

.task-inline-form label {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

/* Groupe "Exécuté"/"Reste à faire" affiché conditionnellement (voir le JS de
   tasks.ejs). Même display:flex;flex-direction:column que .form lui-même :
   sans ça, le label (inline par défaut) et le textarea (inline-block par
   défaut) ne s'empilent pas proprement en dehors d'un contexte flex — c'est
   uniquement le fait d'être enfants directs de .form (flex) qui les rendait
   block ailleurs dans ce même formulaire. */
.task-field-group {
  display: flex;
  flex-direction: column;
}

.task-field-group[hidden] {
  display: none;
}

/* Section "Détails" repliable (statut / observation / indicateur) — <details>
   natif : pas de JS requis pour l'ouverture/fermeture, et les champs qu'il
   contient sont toujours soumis avec le formulaire même repliés. */
.task-details {
  margin-top: 0.5rem;
}

.task-details-summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  list-style: none;
  padding: 0.4rem 0;
  font-size: 0.78rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.task-details-summary::-webkit-details-marker {
  display: none;
}

.task-details-chevron {
  display: inline-flex;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--text-muted);
  /* Fermé : pointe vers la droite ("déplier"). Ouvert : pointe vers le bas,
     alignée sur le contenu qu'elle révèle. */
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}

.task-details-chevron svg {
  width: 100%;
  height: 100%;
}

.task-details[open] .task-details-chevron {
  transform: rotate(0deg);
}

.task-details-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.2rem;
}

.task-inline-form-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.task-save-indicator {
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-success);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.task-save-indicator.visible {
  opacity: 1;
}

.task-card-error {
  font-size: 0.8rem;
  color: var(--text-danger);
  background-color: var(--bg-danger);
  border: 1px solid var(--border-danger);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  margin: 0.5rem 0 0;
}

/* ---------- Sélecteur de pôle (popup) ---------- */

.pole-trigger {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.task-card-pole-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pole-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
}

.pole-modal-backdrop[hidden] {
  display: none;
}

.pole-modal {
  background-color: var(--surface-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pole-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}

.pole-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pole-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
}

.pole-modal-close:hover {
  color: var(--text-primary);
}

.pole-modal-body {
  padding: 1.25rem 1.4rem 1.5rem;
  overflow-y: auto;
}

.pole-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.pole-option {
  --pole-accent: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--pole-accent);
  border-radius: var(--radius-md);
  background-color: var(--surface-1);
  cursor: pointer;
  font: inherit;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.pole-option:hover {
  border-color: var(--pole-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.pole-option-selected {
  box-shadow: 0 0 0 2px var(--pole-accent);
}

.pole-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--surface-0);
  color: var(--pole-accent);
}

.pole-option-name {
  font-size: 0.85rem;
}

.pole-option-soustype {
  padding: 0.85rem 0.75rem;
}

.pole-modal-back {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.9rem;
}

.pole-modal-back:hover {
  text-decoration: underline;
}

.pole-modal-soustype-intro {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Clôture de semaine ---------- */

.close-week-row-excluded {
  opacity: 0.5;
}

.close-week-row-excluded td {
  text-decoration: line-through;
}

.close-week-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.close-week-next-week {
  margin-top: 2rem;
}

.close-week-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 1.5rem;
}

.close-week-added-wrap {
  margin-top: 1rem;
}

.close-week-added-title {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.close-week-added-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.close-week-added-item {
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}

.close-week-added-pole {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.close-week-added-form.task-inline-form {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.close-week-added-controlled {
  font-size: 0.78rem;
  font-style: italic;
}

/* ---------- Projets ---------- */

.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ---------- Filtre de la liste des projets (JS, /projects) ---------- */

.project-filter-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-filter-header .card-title {
  margin: 0;
}

.project-filter-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.project-filter-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-filter-group-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.project-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  max-width: 360px;
}

.project-filter-options label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: var(--font-weight-normal);
  font-size: 0.9rem;
  cursor: pointer;
}

.project-filter-options input {
  width: auto;
}

.project-card {
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 1.1rem;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.project-cards-inactive .project-card {
  opacity: 0.7;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.project-card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.project-card > p {
  margin: 0.2rem 0;
}

.project-card-text {
  font-size: 0.85rem;
}

.project-progress-current {
  margin: 0.4rem 0;
}

.project-progress-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0;
}

.btn-link-style {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
}

.btn-link-style:hover {
  text-decoration: underline;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: var(--font-weight-medium);
  margin-top: 1rem;
}

.checkbox-label input {
  width: auto;
}

/* ---------- Reclassification des tâches (type_activite NULL) ---------- */

.reclass-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.reclass-row-main {
  flex: 1 1 320px;
}

.reclass-row-desc {
  margin: 0 0 0.25rem;
  font-weight: var(--font-weight-medium);
}

.reclass-row-meta {
  margin: 0;
  font-size: 0.82rem;
}

.reclass-row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reclass-row-chain {
  flex-basis: 100%;
  margin-top: 0;
  font-size: 0.85rem;
  font-weight: var(--font-weight-normal);
  color: var(--text-muted);
}

/* ---------- Champ couleur (hex + picker natif + comparaison Actuelle/Nouvelle) ---------- */

.color-field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-field-row .color-hex-input {
  flex: 1;
}

.color-hex-input.color-hex-input-invalid {
  border-color: var(--danger);
}

.color-field-row .color-native-input {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0.2rem;
  cursor: pointer;
}

.color-compare {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.6rem;
}

.color-swatch-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.color-swatch-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.color-swatch {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Absence de couleur (nouveau pôle, ou champ vidé) : motif hachuré plutôt
   qu'un simple fond blanc/gris, pour ne jamais se lire comme "la couleur
   choisie est blanche/grise". */
.color-swatch-empty {
  background-color: var(--surface-0);
  background-image: repeating-linear-gradient(
    45deg,
    var(--border) 0,
    var(--border) 3px,
    transparent 3px,
    transparent 8px
  );
}

/* ---------- Tableau de bord ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  margin-bottom: 0;
}

.kpi-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.kpi-value {
  margin: 0;
  font-size: 2.1rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.1;
}

.kpi-status-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kpi-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.progress-bar-track {
  margin-top: 0.6rem;
  height: 10px;
  border-radius: 999px;
  background-color: var(--surface-0);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

/* Variantes sémantiques, alignées sur les mêmes 4 couleurs que les badges de
   statut de progression (phase_initiale=accent, en_cours=warning,
   en_pause=danger, finalise=success) — utilisées sur les cartes de projet. */
.progress-bar-fill-success {
  background-color: var(--text-success);
}

.progress-bar-fill-warning {
  background-color: var(--text-warning);
}

.progress-bar-fill-danger {
  background-color: var(--text-danger);
}

.progress-bar-fill-accent {
  background-color: var(--accent);
}

.progress-bar-track-sm {
  height: 6px;
  margin-top: 0.4rem;
}

.overdue-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.overdue-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  background-color: var(--surface-0);
  border-radius: var(--radius-sm);
}

.overdue-item-text {
  flex: 1;
  min-width: 0;
}

.overdue-item-title {
  margin: 0;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overdue-item-meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-status-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.project-status-counter {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  text-align: center;
  background-color: var(--surface-0);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.project-status-counter .count {
  display: block;
  font-size: 1.6rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
}

.attention-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.attention-list li {
  margin-bottom: 0.3rem;
}

.dashboard-chart {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  height: 170px;
  padding-top: 1.5rem;
}

.dashboard-chart-bar-wrap {
  display: flex;
  flex: 1;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.dashboard-chart-bar {
  width: 100%;
  max-width: 44px;
  border-radius: 4px 4px 0 0;
  background-color: var(--accent);
  min-height: 2px;
}

.dashboard-chart-value {
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
}

.dashboard-chart-label {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .app-topbar {
    display: flex;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 20;
    box-shadow: var(--shadow-md);
  }

  .app-layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-content {
    padding: 1.25rem;
  }

  .app-footer {
    padding: 1rem 1.25rem;
  }
}

/* ---------- Suppression définitive (rapports, séances CODIR) ---------- */
/* .btn-delete-permanent ne porte aucun style ici : c'est un pur sélecteur
   JS (voir partials/delete-confirm-modal.ejs) — l'apparence vient de
   .btn.btn-danger, déjà posé sur chaque bouton en même temps. */

.delete-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 32, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.delete-confirm-overlay:not([hidden]) {
  display: flex;
}

.delete-confirm-box {
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  max-width: 28rem;
  width: 100%;
}

.delete-confirm-box h3 {
  margin: 0 0 0.75rem;
  color: var(--text-danger);
}

.delete-confirm-code {
  font-family: 'Courier New', monospace;
  background-color: var(--surface-0);
  border: 1px solid var(--border-strong);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  display: inline-block;
}

#delete-confirm-input {
  width: 100%;
  margin-top: 0.5rem;
  box-sizing: border-box;
}

.delete-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
