/* =============================================================================
   ExtrAdmin — ui.css : couche d'harmonisation visuelle et ergonomique
   -----------------------------------------------------------------------------
   POURQUOI CE FICHIER ?
   app.css contient ~85 versions de corrections empilées (V1 → V85), souvent en
   !important et parfois contradictoires. Plutôt que de tout réécrire (risque de
   casser un écran), ce fichier est chargé APRÈS app.css et impose une règle
   unique pour chaque élément : un seul style de bouton, de champ, de tableau,
   de carte, de titre… sur toutes les pages et pour tous les profils.

   COMMENT LE MODIFIER ?
   - Les couleurs, arrondis, ombres sont définis UNE seule fois dans :root
     (section 0). Changer --brand change le vert partout.
   - Chaque section est numérotée ; cherchez le numéro pour trouver le bloc.
   - Après une modification, augmentez ?v= dans layouts/header.php.

   SOMMAIRE
   0. Variables (couleurs, tailles)          7. Tableaux
   1. Base (fond, police, titres, liens)     8. Badges et statuts
   2. Cadre de l'application (menu, pied)    9. Messages d'alerte
   3. En-tête de page                        10. Utilitaires (remplace Bootstrap)
   4. Cartes, panneaux, titres de section    11. Tableaux de bord
   5. Boutons                                12. Pages spécifiques
   6. Formulaires                            13. Adaptation mobile
   ============================================================================= */


/* =============================================================================
   0. VARIABLES
   ============================================================================= */
:root{
  /* Couleurs de marque (identité existante conservée : vert foncé + cuivre) */
  --brand:#0f342a;          /* vert foncé : menu, boutons principaux */
  --brand-600:#1d4d3e;      /* survol des boutons */
  --brand-50:#ecf4f0;       /* fond vert très clair (éléments actifs, boutons doux) */
  --accent:#94602a;         /* cuivre : liens d'action, repères */
  --accent-50:#fbf3ea;

  /* Neutres */
  --bg:#f3f5f4;             /* fond de page, uni pour une lecture reposante */
  --surface:#ffffff;        /* fond des cartes */
  --surface-2:#f8faf9;      /* fond secondaire (en-têtes de tableaux, encadrés) */
  --line:#e2e7e4;           /* bordures */
  --line-strong:#cfd7d3;    /* bordures des champs */
  --text:#1c2723;           /* texte principal */
  --muted:#5f6b66;          /* texte secondaire */
  --subtle:#8a958f;         /* texte discret (aides, dates) */

  /* États (succès / attention / danger / info) : fond clair + texte foncé */
  --ok:#1f7a4d;     --ok-50:#e9f6ef;
  --warn:#9a6212;   --warn-50:#fdf4e3;
  --danger:#b42318; --danger-50:#fdeeec;
  --info:#285f8f;   --info-50:#eaf2fa;

  /* Formes */
  --radius:12px;            /* cartes */
  --radius-sm:8px;          /* boutons, champs */
  --shadow:0 1px 2px rgba(16,24,20,.04), 0 2px 8px rgba(16,24,20,.04);
  --focus:0 0 0 3px rgba(29,77,62,.18);

  /* Police : Inter si disponible, sinon police du système */
  --font:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Largeur du menu latéral */
  --sidebar-w:248px;
}


/* =============================================================================
   1. BASE
   ============================================================================= */
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:var(--font) !important;
  font-size:15px;
  line-height:1.5;
  color:var(--text);
  background:var(--bg) !important;
  background-image:none !important;   /* retire le quadrillage de fond (bruit visuel) */
  overflow-x:hidden;
}
h1,h2,h3,h4{ color:var(--text); letter-spacing:-.01em; }
h1{ font-size:28px !important; line-height:1.2 !important; font-weight:700 !important; margin:4px 0 6px !important; }
h2{ font-size:18px; line-height:1.3; font-weight:650; }
h3{ font-size:16px; font-weight:600; }
p{ margin:0 0 10px; }
a{ color:var(--brand-600); }
.muted{ color:var(--muted) !important; }
.small,small{ font-size:13px; }
:focus-visible{ outline:none; box-shadow:var(--focus); border-radius:6px; }


/* =============================================================================
   2. CADRE DE L'APPLICATION (menu latéral, zone principale, pied de page)
   -----------------------------------------------------------------------------
   Logique : tout ce qui sert à naviguer est dans le menu à gauche
   (rubriques, notifications avec compteur, profil, déconnexion, aide).
   La zone de droite est entièrement consacrée au contenu.
   ============================================================================= */

/* L'ancien bandeau d'infos et l'ancien header ne sont plus utilisés. */
body.is-app .topbar-info,
body.is-app .app-main > .topbar{ display:none !important; }

body.is-app .app-shell{
  display:block !important;
  padding-top:0 !important;
  min-height:100vh;
}

/* --- Menu latéral ---------------------------------------------------------- */
body.is-app .sidebar{
  position:fixed !important;
  top:0 !important; left:0 !important; bottom:0 !important;
  width:var(--sidebar-w) !important;
  display:flex; flex-direction:column;
  background:var(--brand) !important;
  color:#fff;
  overflow-y:auto;
  z-index:900 !important;
  box-shadow:none !important;
}
body.is-app .sidebar-brand{
  display:flex; align-items:center; gap:10px;
  padding:18px 20px !important;
  font-size:19px !important; font-weight:700;
  color:#fff !important; text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,.10);
}
body.is-app .brand-mark{
  width:32px !important; height:32px !important; border-radius:8px !important;
  background:#fff !important; color:var(--brand) !important;
  display:grid; place-items:center; font-size:17px !important; font-weight:800;
}
body.is-app .sidebar-nav{
  display:flex !important; flex-direction:column; gap:2px;
  padding:8px 12px 16px !important;
}
/* Titre de rubrique ("Pilotage", "À traiter"…) */
.nav-group-label{
  margin:16px 10px 6px;
  font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
  color:rgba(255,255,255,.55);
}
body.is-app .sidebar-nav a{
  position:relative;
  display:flex !important; align-items:center; gap:12px;
  padding:9px 12px !important;
  border-radius:var(--radius-sm) !important;
  color:rgba(255,255,255,.86) !important;
  font-size:14.5px !important; font-weight:500 !important;
  text-decoration:none;
  background:transparent !important;
}
body.is-app .sidebar-nav a i{ width:18px; text-align:center; font-size:15px; opacity:.85; }
body.is-app .sidebar-nav a:hover{ background:rgba(255,255,255,.08) !important; color:#fff !important; }
/* Lien de la page en cours : fond clair + barre cuivre à gauche */
body.is-app .sidebar-nav a.active{
  background:rgba(255,255,255,.14) !important;
  color:#fff !important; font-weight:600 !important;
}
body.is-app .sidebar-nav a.active::before{
  content:""; position:absolute; left:-12px; top:8px; bottom:8px; width:3px;
  border-radius:0 3px 3px 0; background:#d9a464;
}
/* Pastille de compteur (notifications non lues) */
.nav-badge{
  margin-left:auto;
  min-width:20px; height:20px; padding:0 6px;
  display:inline-grid; place-items:center;
  border-radius:999px; background:#d9a464; color:#2b1a06;
  font-size:11.5px; font-weight:700; line-height:1;
}

/* Bas du menu : utilisateur connecté + aide */
body.is-app .sidebar-bottom{
  margin-top:auto !important;
  padding:12px !important;
  border-top:1px solid rgba(255,255,255,.10);
}
.sidebar-user{
  display:flex; align-items:center; gap:10px;
  padding:8px; border-radius:var(--radius-sm);
  background:rgba(255,255,255,.06);
}
.sidebar-avatar{
  flex:0 0 34px; width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center;
  background:#d9a464; color:#2b1a06; font-weight:700; font-size:13px;
}
.sidebar-user-text{ min-width:0; display:flex; flex-direction:column; line-height:1.25; }
.sidebar-user-text strong{ font-size:13.5px; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-text small{ font-size:12px; color:rgba(255,255,255,.65); }
body.is-app .sidebar-logout{
  margin-left:auto; flex:0 0 34px; width:34px; height:34px;
  display:grid !important; place-items:center; padding:0 !important;
  border-radius:var(--radius-sm) !important;
  color:rgba(255,255,255,.8) !important; text-decoration:none;
}
body.is-app .sidebar-logout:hover{ background:rgba(255,255,255,.12) !important; color:#fff !important; }
.sidebar-help{
  display:flex; flex-direction:column; gap:3px;
  padding:12px 8px 2px; font-size:12px; color:rgba(255,255,255,.55);
}
.sidebar-help a{ color:rgba(255,255,255,.8) !important; text-decoration:none; display:flex; gap:8px; align-items:center; }
.sidebar-help a i{ width:14px; font-size:11px; opacity:.7; }
.sidebar-help a:hover{ color:#fff !important; text-decoration:underline; }

/* --- Zone principale -------------------------------------------------------- */
body.is-app .app-main{
  display:flex !important; flex-direction:column;
  min-height:100vh;
  margin-left:var(--sidebar-w) !important;
  width:auto !important;
}
body.is-app .app-main > .container{
  flex:1 0 auto;
  width:100% !important;
  max-width:1360px !important;           /* évite des lignes trop longues sur grand écran */
  margin:0 auto !important;
  padding:32px 36px 40px !important;
}
body.is-app .app-main > .container > :last-child{ margin-bottom:0 !important; }

/* --- Pied de page : discret, en bas du contenu (plus de bandeau fixe) ------- */
.footer{
  position:static !important;
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:6px 18px;
  padding:16px 36px !important;
  background:transparent !important; box-shadow:none !important;
  border-top:1px solid var(--line);
  color:var(--subtle) !important; font-size:12.5px;
}
.footer a{ color:var(--muted) !important; font-weight:500; text-decoration:none; }
.footer a:hover{ color:var(--brand) !important; text-decoration:underline; }
.footer-contact{ display:flex; gap:8px; align-items:center; font-weight:400; }

/* Barre mobile et voile : masqués sur ordinateur */
.mobile-bar,.sidebar-backdrop{ display:none; }

/* --- Pages publiques (connexion, demande d'accès…) -------------------------- */
body.is-public .container{ padding-bottom:40px !important; }
body.is-public .footer{ justify-content:center; padding:16px !important; }


/* =============================================================================
   3. EN-TÊTE DE PAGE (sur-titre + titre + boutons d'action à droite)
   ============================================================================= */
.page-head{
  display:flex !important; align-items:flex-end !important; justify-content:space-between;
  flex-wrap:wrap; gap:16px 24px;
  margin:0 0 24px !important; padding:0 !important;
}
.page-head > div:first-child{ min-width:0; flex:1 1 380px; }
.page-head .muted{ margin:0; font-size:15px; max-width:760px; }
/* Groupe de boutons de l'en-tête : alignés, même hauteur, retour à la ligne propre */
.page-head > div:last-child:not(:first-child),
.page-head-actions,.session-top-actions,.of-head-actions,.document-head-actions{
  display:flex !important; flex-wrap:wrap; align-items:center; gap:8px !important;
}
.page-head form{ margin:0; }

/* Sur-titres : un seul style pour .eyebrow, .section-kicker, .alert-kicker */
.eyebrow,.section-kicker,.alert-kicker,.summary-label{
  font-size:11.5px !important; font-weight:600 !important;
  letter-spacing:.08em !important; text-transform:uppercase;
  color:var(--accent) !important;
}


/* =============================================================================
   4. CARTES, PANNEAUX ET TITRES DE SECTION
   ============================================================================= */
.card,.panel,.session-essential-panel,.client-card,.contact-highlight-card,
.mission-bootstrap .panel{
  background:var(--surface) !important;
  border:1px solid var(--line) !important;
  border-radius:var(--radius) !important;
  box-shadow:var(--shadow) !important;
}
.panel,.session-essential-panel{ padding:22px 24px; margin-bottom:20px; }
/* Espacement vertical régulier entre blocs successifs */
.container > .panel + .panel,.container > section + section{ margin-top:0; }
.container > section,.container > .panel{ margin-bottom:20px; }

/* Titre de section : sur-titre + titre + description, puis action à droite */
.section-head{
  display:flex !important; justify-content:space-between; align-items:flex-start !important;
  gap:12px 20px; flex-wrap:wrap; margin-bottom:16px;
}
.section-head h2,.section-title{
  margin:2px 0 4px !important; font-size:18px !important; font-weight:650 !important;
  border-left:0 !important; padding-left:0 !important;           /* retire la barre V83 */
}
.section-head .muted{ margin-left:0 !important; font-size:14px; }
/* "Voir toutes →" et liens d'action : couleur cuivre homogène */
.card-action,.secondary-link:not(.button),.table-link,.section-head > a:not(.button){
  color:var(--accent) !important; font-weight:600; text-decoration:none;
}
.section-head > a:not(.button):hover,.table-link:hover{ text-decoration:underline; }

/* Encadré repliable (details/summary) */
details > summary{ cursor:pointer; }
.compact-details > summary{ font-weight:600; color:var(--brand-600); }


/* =============================================================================
   5. BOUTONS
   -----------------------------------------------------------------------------
   3 niveaux seulement, partout :
   - Principal (vert plein)   : l'action attendue sur la page (Enregistrer, Envoyer…)
   - Secondaire (blanc bordé) : Retour, Annuler, Modifier, Voir…
   - Danger (rouge doux)      : Supprimer, Refuser, Désactiver…
   ============================================================================= */
.button,.btn,.session-top-button,.danger-button,
button[type=submit]:not([class]),input[type=submit]{
  display:inline-flex !important; align-items:center; justify-content:center; gap:8px;
  min-height:38px; padding:8px 16px !important;
  border:1px solid transparent !important; border-radius:var(--radius-sm) !important;
  font-family:inherit; font-size:14px !important; font-weight:600 !important; line-height:1.2 !important;
  text-decoration:none !important; white-space:nowrap;
  cursor:pointer; box-shadow:none !important;
  transition:background-color .15s, border-color .15s, color .15s;
  width:auto;
}
/* Principal */
.button,.button.primary,.btn-primary,button[type=submit]:not([class]),input[type=submit]{
  background:var(--brand) !important; color:#fff !important; border-color:var(--brand) !important;
}
.button:hover,.button.primary:hover,.btn-primary:hover,button[type=submit]:not([class]):hover{
  background:var(--brand-600) !important; border-color:var(--brand-600) !important; color:#fff !important;
}
/* Secondaire */
.button.secondary,.button.secondary-link,.button.secondary-button,.btn-secondary,.btn-soft,
.btn-secondary-soft,.btn-outline-secondary,.btn-primary-soft,.button.of-action,
.session-top-button.return,.session-top-button.folder,.session-top-button.edit{
  background:var(--surface) !important; color:var(--text) !important; border-color:var(--line-strong) !important;
}
.button.secondary:hover,.button.secondary-link:hover,.button.secondary-button:hover,.btn-secondary:hover,
.btn-soft:hover,.btn-secondary-soft:hover,.btn-outline-secondary:hover,.btn-primary-soft:hover,
.button.of-action:hover,.session-top-button.return:hover,.session-top-button.folder:hover,.session-top-button.edit:hover{
  background:var(--surface-2) !important; border-color:var(--brand-600) !important; color:var(--brand) !important;
}
/* Danger */
.danger-button,.button.danger-button,.btn-soft-danger,.session-top-button.delete,.button.refusal-submit{
  background:var(--surface) !important; color:var(--danger) !important; border-color:#efc4bf !important;
}
.danger-button:hover,.button.danger-button:hover,.btn-soft-danger:hover,.session-top-button.delete:hover,.button.refusal-submit:hover{
  background:var(--danger-50) !important; border-color:var(--danger) !important; color:var(--danger) !important;
}
/* Désactivé */
.button:disabled,.btn:disabled,button[type=submit]:disabled{ opacity:.5; cursor:not-allowed; }
/* Le bouton "primary" ne prend toute la largeur que sur les écrans de connexion */
.button.primary{ width:auto !important; }
.auth-card .button.primary,.button.primary.auth-login-submit,.auth-next-step .button{ width:100% !important; min-height:46px; }


/* =============================================================================
   6. FORMULAIRES
   ============================================================================= */
/* Libellés de champs : gris foncé partout (le cuivre est réservé aux sur-titres
   et aux liens d'action). Sélecteur volontairement "fort" pour passer devant
   les anciennes règles de app.css et des <style> internes aux pages. */
label,.form-label,
body.is-app .container label:not(.choice-row label),
body.is-app .container .form-label{
  color:#344054 !important; font-size:13.5px !important; font-weight:600 !important;
}
/* Liens dans les tableaux (références de session…) : vert de marque */
td a:not(.button):not(.btn){ color:var(--brand-600); }
/* ":is(...)" regroupe les types de champs ; ":not(.auth-login-shell *)" exclut l'écran
   de connexion, qui a son propre design (icônes placées dans les champs). */
:is(input[type=text],input[type=email],input[type=tel],input[type=password],input[type=number],
input[type=date],input[type=datetime-local],input[type=time],input[type=url],input[type=search],
input:not([type]),select,textarea,.form-control,.form-select):not(.auth-login-shell *){
  display:block; width:100% !important; max-width:100%;
  min-height:40px; margin-top:6px;
  padding:9px 12px !important;
  background:#fff !important; color:var(--text) !important;
  border:1px solid var(--line-strong) !important; border-radius:var(--radius-sm) !important;
  font-family:inherit !important; font-size:14.5px !important; font-weight:400 !important; line-height:1.4;
  box-shadow:none !important;
  transition:border-color .15s, box-shadow .15s;
}
textarea,textarea.form-control{ min-height:110px; resize:vertical; }
select,.form-select{
  appearance:none; -webkit-appearance:none;
  padding-right:36px !important;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%235f6b66' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat:no-repeat !important; background-position:right 12px center !important;
}
input::placeholder,textarea::placeholder{ color:#9aa49f !important; font-weight:400 !important; }
:is(input,select,textarea):focus:not(.auth-login-shell *){
  outline:none !important; border-color:var(--brand-600) !important; box-shadow:var(--focus) !important;
}
input[readonly],.readonly-field,input:disabled,select:disabled{
  background:var(--surface-2) !important; color:var(--muted) !important;
}
/* Cases à cocher et boutons radio : taille normale, alignés avec leur texte */
input[type=checkbox],input[type=radio]{
  display:inline-block !important; width:18px !important; height:18px !important; min-height:0 !important;
  margin:0 8px 0 0 !important; padding:0 !important; vertical-align:-3px;
  accent-color:var(--brand);
}
.checkbox-line,.check-line,.closure-check,.form-check{
  display:flex !important; align-items:flex-start; gap:4px; margin:12px 0 !important;
  font-weight:500 !important;
}
.form-check-input{ flex:0 0 auto; margin-top:2px !important; }
.form-check-label{ font-weight:500 !important; color:var(--text) !important; }
/* Champ fichier : bouton "Parcourir" aux couleurs de l'application */
input[type=file]{
  display:block; width:100%; margin-top:6px; padding:6px !important;
  border:1px dashed var(--line-strong); border-radius:var(--radius-sm); background:#fff;
  font-size:13.5px; color:var(--muted);
}
input[type=file]::file-selector-button{
  margin-right:10px; padding:6px 12px; border:1px solid var(--line-strong); border-radius:6px;
  background:var(--surface-2); color:var(--text); font-weight:600; cursor:pointer;
}
/* Texte d'aide sous un champ */
.form-text,.section-help,.field-help{ display:block; margin-top:5px; font-size:12.5px !important; color:var(--subtle) !important; font-weight:400 !important; }

/* Grille de formulaire automatique : 2 colonnes (1 sur mobile) */
.form-grid-2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 18px; }
.form-grid-2 > .span-2{ grid-column:1 / -1; }


/* =============================================================================
   7. TABLEAUX
   ============================================================================= */
.table-wrap,.table-responsive{
  overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius); background:#fff;
}
table{ width:100%; border-collapse:collapse; }
th,td{ padding:12px 14px !important; border-bottom:1px solid var(--line) !important; font-size:14px !important; text-align:left; vertical-align:middle; }
th{
  background:var(--surface-2) !important; color:var(--muted) !important;
  font-size:12px !important; font-weight:600 !important; letter-spacing:.04em; text-transform:uppercase;
  white-space:nowrap;
}
tbody tr:last-child td{ border-bottom:0 !important; }
tbody tr{ transition:background-color .12s; }
tbody tr:hover td{ background:#f6f9f7; }
td a{ font-weight:600; }


/* =============================================================================
   8. BADGES ET STATUTS (pastilles arrondies, même gabarit partout)
   ============================================================================= */
.status-badge,.session-phase-badge,.request-status,.doc-status,.account-request-status,
.assistant-state,.reference-doc-status{
  display:inline-flex !important; align-items:center; gap:6px;
  padding:3px 10px !important; border-radius:999px !important;
  font-size:12.5px !important; font-weight:600 !important; line-height:1.4 !important;
  white-space:nowrap;
}
.status-badge{ background:var(--brand-50); color:var(--brand-600); border:1px solid #cfe2d8; }
.session-phase-badge.preparation{ background:var(--info-50) !important; color:var(--info) !important; border:1px solid #cfe0f0 !important; }
.session-phase-badge.suivi{ background:var(--brand-50) !important; color:var(--brand-600) !important; border:1px solid #cfe2d8 !important; }
.session-phase-badge.a_cloturer{ background:var(--warn-50) !important; color:var(--warn) !important; border:1px solid #f0d9a8 !important; }
.session-phase-badge.cloturee,.session-phase-badge.cloture{ background:#eef0ef !important; color:var(--muted) !important; border:1px solid var(--line) !important; }
/* Lignes de sessions : fond blanc, l'état est porté par la pastille (plus lisible
   que des lignes entières colorées). */
.of-session-table tbody tr[class*="session-phase-row-"],
.sessions-table-row[class*="session-phase-row-"]{ background:#fff !important; }


/* =============================================================================
   9. MESSAGES D'ALERTE (succès, attention, erreur, info)
   ============================================================================= */
.alert{
  display:block; padding:12px 16px !important; margin:0 0 16px !important;
  border:1px solid transparent; border-left-width:4px !important; border-radius:var(--radius-sm) !important;
  font-size:14px;
}
.alert.success,.alert-success,.success-message{ background:var(--ok-50) !important; color:#14532d !important; border-color:#bfe3cf !important; border-left-color:var(--ok) !important; }
.alert.warning,.alert-warning,.alert-soft{ background:var(--warn-50) !important; color:#6b4510 !important; border-color:#f0d9a8 !important; border-left-color:var(--warn) !important; }
.alert.danger,.alert-danger,.validation-error,.danger-message{ background:var(--danger-50) !important; color:#7a1d14 !important; border-color:#f3c7c2 !important; border-left-color:var(--danger) !important; }
.alert.info,.alert-info,.alert-light{ background:var(--info-50) !important; color:#1f4767 !important; border-color:#cfe0f0 !important; border-left-color:var(--info) !important; }


/* =============================================================================
   10. UTILITAIRES — remplacent la partie de Bootstrap utilisée par
   sessions/show.php et sessions/edit.php (Bootstrap n'est plus chargé :
   son lien était cassé et il aurait de toute façon modifié tout le site).
   ============================================================================= */
.row{ display:flex; flex-wrap:wrap; margin:0 -9px; }
.row > [class*="col"]{ padding:0 9px; min-width:0; }
.row.g-2{ margin:0 -5px; row-gap:10px; } .row.g-2 > [class*="col"]{ padding:0 5px; }
.row.g-3{ row-gap:18px; }
.col-12{ flex:0 0 100%; } .col-5{ flex:0 0 41.66%; } .col-7{ flex:0 0 58.33%; }
.col-md-4{ flex:0 0 33.33%; } .col-md-6,.col-lg-6{ flex:0 0 50%; }
.container-fluid{ padding:0; }
.d-flex{ display:flex !important; } .flex-wrap{ flex-wrap:wrap; }
.align-items-center{ align-items:center; } .align-items-start{ align-items:flex-start; } .align-items-end{ align-items:flex-end; }
.justify-content-between{ justify-content:space-between; }
.gap-3{ gap:14px; }
.mb-0{ margin-bottom:0 !important; } .mb-1{ margin-bottom:4px !important; } .mb-2{ margin-bottom:8px !important; } .mb-3{ margin-bottom:16px !important; }
.mt-1{ margin-top:4px !important; } .mt-2{ margin-top:8px !important; } .mt-3{ margin-top:16px !important; }
.p-3{ padding:14px !important; } .py-2{ padding-top:8px; padding-bottom:8px; } .py-3{ padding-top:14px !important; padding-bottom:14px !important; }
.pt-2{ padding-top:8px; } .pb-2{ padding-bottom:8px; } .px-3{ padding-left:14px; padding-right:14px; }
.h-100{ height:100%; }
.border{ border:1px solid var(--line) !important; } .border-top{ border-top:1px solid var(--line) !important; } .border-bottom{ border-bottom:1px solid var(--line) !important; }
.border-start.border-warning{ border-left:4px solid var(--warn) !important; }
.rounded-3{ border-radius:var(--radius-sm) !important; }
.text-secondary,.small-muted{ color:var(--muted) !important; }
.small-muted{ font-size:13px; }
.text-success{ color:var(--ok) !important; }
.fw-semibold{ font-weight:600 !important; } .fs-4{ font-size:22px; }
.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
/* .card + .card-body (Bootstrap) : la marge intérieure est portée par .card-body */
.card:has(> .card-body),details.card{ padding:0 !important; }
.card-body{ padding:20px 24px; }
.card-header{ padding:14px 24px; border-bottom:1px solid var(--line); background:var(--surface-2); font-weight:600; border-radius:var(--radius) var(--radius) 0 0; }
.table{ width:100%; } .table-sm td,.table-sm th{ padding:9px 12px !important; }


/* =============================================================================
   11. TABLEAUX DE BORD
   ============================================================================= */
/* Cartes indicateurs : ce qui demande une action ressort (cuivre), le reste est neutre */
.dashboard-kpi-group .card{ border-left-width:1px !important; transition:border-color .15s, transform .15s; }
.dashboard-kpi-group .card:hover{ border-color:var(--brand-600) !important; transform:translateY(-1px); }
.dashboard-attention-card.has-attention{ border-left:4px solid var(--accent) !important; background:linear-gradient(0deg,#fff,#fff) !important; }
.dashboard-attention-card.has-attention .big-number{ color:var(--accent) !important; }
.dashboard-attention-card.is-clear .big-number{ color:var(--muted) !important; }
.dashboard-card-icon{ background:var(--brand-50) !important; color:var(--brand-600) !important; }
.dashboard-kpi-group-head .eyebrow{ color:var(--muted) !important; }
.big-number{ font-weight:700 !important; }
/* Barre de filtres ("Afficher : Toutes / En préparation…") */
.session-filter-bar{ background:transparent !important; border:0 !important; padding:0 !important; gap:8px !important; }
.session-filter{
  padding:6px 12px !important; border-radius:999px !important; font-size:13px !important; font-weight:600 !important;
  border:1px solid var(--line-strong) !important; background:#fff !important; color:var(--muted) !important; text-decoration:none;
}
.session-filter:hover{ border-color:var(--brand-600) !important; color:var(--brand) !important; }
.session-filter.active,.session-filter.is-active,.session-filter[aria-current]{
  background:var(--brand) !important; border-color:var(--brand) !important; color:#fff !important;
}
.filter-title{ font-size:13px !important; color:var(--muted) !important; font-weight:600 !important; }
/* Cartes d'accès rapide de l'espace OF */
.of-action-card{ border-radius:var(--radius) !important; border:1px solid var(--line) !important; background:#fff !important; box-shadow:var(--shadow); }
.of-action-card:hover{ border-color:var(--brand-600) !important; }
.of-action-card.primary{ border-left:4px solid var(--brand) !important; }
.of-action-card.attention{ border-left:4px solid var(--accent) !important; background:var(--accent-50) !important; }


/* =============================================================================
   12. PAGES SPÉCIFIQUES
   ============================================================================= */
/* --- Fiche session : frise des phases --------------------------------------- */
.phase-panel{ padding:18px 24px !important; }
.phase-current{ margin-top:12px !important; padding-top:12px; border-top:1px solid var(--line); font-size:14px; color:var(--muted); }
.phase-step.current .phase-dot{ background:var(--brand) !important; border-color:var(--brand) !important; color:#fff !important; }
.phase-step.complete .phase-dot{ background:var(--brand-50) !important; border-color:#9cc4b0 !important; color:var(--brand-600) !important; }

/* --- Fiche session : identification ------------------------------------------ */
.session-essential-item{ border-left:3px solid var(--brand) !important; }
.session-essential-item .summary-value{ font-weight:600 !important; color:var(--text) !important; }
.session-essential-sub .summary-label{ color:var(--subtle) !important; }
.session-essential-sub .summary-value{ color:var(--text) !important; }
.contact-highlight-title{ color:var(--accent) !important; font-size:11.5px !important; letter-spacing:.08em !important; }

/* --- Formulaire de demande (espace OF) ------------------------------------- */
.request-form{ max-width:980px !important; }
.request-form h2{ margin-top:28px !important; padding-top:20px; border-top:1px solid var(--line); }
.request-form h2:first-of-type{ margin-top:0 !important; padding-top:0; border-top:0; }

/* --- Modification de session : grille 2 colonnes ---------------------------- */
.session-edit-bs .card{ margin-bottom:20px; }
.session-edit-bs .card-header{ color:var(--text) !important; font-size:15px; }
.session-edit-bs .row{ row-gap:4px; }
.action-bar{
  position:sticky; bottom:0; z-index:5;
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  margin-top:8px; padding:14px 0;
  background:linear-gradient(to top, var(--bg) 70%, rgba(243,245,244,0));
}



/* --- Lien "← Retour" placé au-dessus d'un titre de page ---------------------- */
.back-link{
  display:inline-flex; align-items:center; gap:6px; margin-bottom:10px;
  font-size:13.5px; font-weight:600; color:var(--muted) !important; text-decoration:none;
}
.back-link:hover{ color:var(--brand) !important; }

/* --- Formulaire de demande : choix INTRA / INTER en cartes cliquables --------- */
.choice-row{ display:flex; flex-wrap:wrap; gap:10px !important; margin-bottom:6px; }
.choice-row label{
  display:flex !important; align-items:center; gap:2px; margin:0 !important;
  padding:10px 16px !important; border:1px solid var(--line-strong) !important; border-radius:var(--radius-sm) !important;
  background:#fff; cursor:pointer; color:var(--text) !important;
}
.choice-row label:hover{ border-color:var(--brand-600) !important; }
/* La carte cochée est mise en évidence (":has" = "qui contient une case cochée") */
.choice-row label:has(input:checked){ border-color:var(--brand) !important; background:var(--brand-50); box-shadow:inset 0 0 0 1px var(--brand); }

/* --- Coordonnées (client, formateur) : grille sur 12 colonnes -------------------
   Entreprise = ligne entière ; Civilité (étroite) + Nom + Prénom ;
   Téléphone + E-mail + Fonction. Sur mobile : une colonne. */
.contact-card{ padding:18px 20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-2); margin-bottom:8px; }
.contact-grid{ display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:0 16px; }
.contact-grid > label{ grid-column:span 4; margin:8px 0 !important; }
.contact-grid > label:has(input[name="client_name"]){ grid-column:span 12; }
.contact-grid > label:has(select){ grid-column:span 2; }
.contact-grid > label:has(select) + label,
.contact-grid > label:has(select) + label + label{ grid-column:span 5; }
.contact-card > label{ margin:8px 0 0 !important; }
.contact-card textarea{ min-height:80px; }

/* --- Dépôt de documents : 2 colonnes régulières ------------------------------- */
.upload-grid{ grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:12px !important; }
.upload-grid label{ margin:0 !important; padding:14px !important; border:1px solid var(--line) !important; border-radius:var(--radius-sm) !important; background:var(--surface-2); }
.request-summary{ border-left:4px solid var(--brand) !important; background:var(--brand-50) !important; border-radius:var(--radius-sm); }
.request-summary ol{ margin:8px 0 0; padding-left:20px; color:var(--muted); }

@media (max-width:760px){
  .contact-grid > label,.contact-grid > label:has(select),
  .contact-grid > label:has(select) + label,.contact-grid > label:has(select) + label + label{ grid-column:1 / -1; }
  .upload-grid{ grid-template-columns:1fr !important; }
}


/* --- Petits formulaires en ligne (tâches, contact client, dates…) ------------- */
.task-form-grid{ display:grid !important; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)) !important; gap:0 16px !important; }
.task-form-grid > label{ margin:8px 0 !important; }
/* Textes d'aide sous un champ : discrets, jamais en gras ni en couleur vive */
form small,label small,.task-edit-form small{
  display:block; margin-top:5px; color:var(--subtle) !important; font-size:12.5px !important; font-weight:400 !important; line-height:1.45;
}
/* Actions repliables ("✎ Modifier les dates", "✎ Renommer la formation") : boutons secondaires */
.compact-action > summary{
  list-style:none; display:inline-flex !important; align-items:center; gap:6px;
  min-height:38px; padding:8px 14px !important;
  background:#fff !important; color:var(--text) !important;
  border:1px solid var(--line-strong) !important; border-radius:var(--radius-sm) !important;
  font-size:14px !important; font-weight:600 !important; box-shadow:none !important; cursor:pointer;
}
.compact-action > summary::-webkit-details-marker{ display:none; }
.compact-action > summary:hover,.compact-action[open] > summary{ border-color:var(--brand-600) !important; color:var(--brand) !important; background:var(--surface-2) !important; }
/* Bloc "attention" (ex. "Messagerie de l'OF non prête") = même rendu qu'une alerte orange */
.attention-panel{
  padding:12px 16px !important; border:1px solid #f0d9a8 !important; border-left:4px solid var(--warn) !important;
  border-radius:var(--radius-sm) !important; background:var(--warn-50) !important; color:#6b4510;
}
.attention-panel .muted{ color:#7a5a2a !important; margin:4px 0 0; }


/* --- Messagerie : compteurs en onglets + recherche sur une ligne ---------------- */
.mail-message-summary{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.mail-message-counter{
  display:inline-flex; align-items:center; gap:8px; padding:7px 14px;
  border:1px solid var(--line-strong); border-radius:999px; background:#fff;
  color:var(--muted) !important; text-decoration:none !important; font-size:13.5px; font-weight:600;
}
.mail-message-counter strong{
  min-width:22px; height:22px; padding:0 6px; display:inline-grid; place-items:center;
  border-radius:999px; background:var(--surface-2); color:var(--text); font-size:12px;
}
.mail-message-counter:hover{ border-color:var(--brand-600); color:var(--brand) !important; }
.mail-message-counter.active{ background:var(--brand); border-color:var(--brand); color:#fff !important; }
.mail-message-counter.active strong{ background:rgba(255,255,255,.18); color:#fff; }
.mail-message-search{ display:flex; gap:8px; align-items:center; margin-bottom:16px; }
.mail-message-search input[type=search]{ margin-top:0 !important; flex:1; }


/* --- Lecture d'un message (mail-messages/show.php) --------------------------------
   Avant : ces classes n'avaient aucun style, le libellé et la valeur se
   suivaient sans espace ("OrganismeCDO FORMATION").
   Maintenant : une fiche en 3 colonnes (libellé au-dessus, valeur en dessous),
   puis le contenu du message dans un encadré aéré, facile à lire. */
.mail-message-detail-grid{
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 28px;
  padding-bottom:18px; border-bottom:1px solid var(--line);
}
.mail-message-detail-grid > div{ min-width:0; display:flex; flex-direction:column; gap:4px; }
/* Libellé : petit, gris, en majuscules */
.mail-message-detail-grid > div > span:first-child{
  font-size:11.5px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--subtle);
}
/* Valeur : texte normal, coupée proprement si l'adresse e-mail est très longue */
.mail-message-detail-grid > div > strong{
  font-size:14.5px; font-weight:600; color:var(--text); overflow-wrap:anywhere; line-height:1.4;
}
/* Identifiant technique (Message-ID) : discret, en petit, sur sa propre ligne */
.mail-message-identifiers{
  display:flex; flex-wrap:wrap; gap:8px 24px; padding:12px 0 18px;
  font-size:12.5px; color:var(--subtle);
}
.mail-message-identifiers strong{ white-space:nowrap; font-size:11.5px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--subtle); }
.mail-message-identifiers br{ display:none; }   /* libellé et valeur sur la même ligne */
.mail-message-identifiers code{
  margin-left:6px; padding:2px 6px; border-radius:6px; background:var(--surface-2);
  font-size:12px; color:var(--muted); overflow-wrap:anywhere;
}
/* Contenu du message : encadré, interligne confortable, largeur de lecture limitée */
.mail-message-content-head{ margin-bottom:8px; }
.mail-message-content{
  padding:20px 24px; border:1px solid var(--line); border-radius:var(--radius-sm);
  background:var(--surface-2);
  font-size:15px; line-height:1.7; color:var(--text);
  max-width:80ch;                       /* ~80 caractères par ligne : lecture plus facile */
  overflow-wrap:anywhere;               /* les longs liens ne débordent pas */
}
/* Bloc "Ce message ne relève pas de votre travail ?" */
.mail-message-action,.mail-message-future-note{
  margin-top:20px !important; padding:16px 18px !important;
  border:1px solid var(--line) !important; border-radius:var(--radius-sm); background:#fff;
}
/* Statut du message (liste et détail) : pastille de couleur */
.mail-status{ display:inline-flex; padding:2px 10px; border-radius:999px; font-size:12.5px; font-weight:600; }
.mail-status.a_traiter{ background:var(--warn-50); color:var(--warn); }
.mail-status.traite{ background:var(--ok-50); color:var(--ok); }
.mail-status.ignore{ background:#eef0ef; color:var(--muted); }
.mail-status.transfere{ background:var(--info-50); color:var(--info); }
@media (max-width:760px){
  .mail-message-detail-grid{ grid-template-columns:1fr 1fr; }
  .mail-message-content{ padding:16px; }
}


/* --- Bouton compact (.btn-sm) : même style, plus fin, pour les listes ----------
   Utilisation : class="button btn-sm" (principal) ou "button secondary btn-sm". */
.button.btn-sm,.btn.btn-sm{
  min-height:34px; padding:6px 14px !important; gap:7px;
  font-size:13.5px !important; border-radius:8px !important;
}
.button.btn-sm i{ font-size:12px; }

/* --- Page Notifications : boutons alignés, espacés, sans soulignement ---------- */
.notification-actions{ display:flex; align-items:center; gap:10px !important; flex-wrap:wrap; margin-top:12px; }
.notification-actions form{ margin:0; }
.notification-actions .button{ text-decoration:none !important; }
.notification-mail-ok,.notification-mail-warning{
  display:inline-flex !important; align-items:center; gap:6px; margin-top:10px !important;
  font-size:12.5px !important; color:var(--subtle) !important;
}
.notification-mail-warning{ color:var(--warn) !important; }

/* =============================================================================
   13. ADAPTATION MOBILE ET TABLETTE (≤ 960 px)
   -----------------------------------------------------------------------------
   Le menu latéral se range : il s'ouvre avec le bouton ☰ de la barre du haut.
   ============================================================================= */
@media (max-width:960px){
  .mobile-bar{
    position:sticky; top:0; z-index:800;
    display:flex; align-items:center; gap:12px;
    height:56px; padding:0 12px;
    background:var(--brand); color:#fff;
  }
  .mobile-menu-toggle{
    width:40px; height:40px; display:grid; place-items:center;
    border:0; border-radius:var(--radius-sm); background:transparent; color:#fff; font-size:18px; cursor:pointer;
  }
  .mobile-menu-toggle:hover{ background:rgba(255,255,255,.1); }
  .mobile-brand{ display:flex; align-items:center; gap:8px; font-weight:700; font-size:17px; }
  .mobile-bell{ position:relative; margin-left:auto; width:40px; height:40px; display:grid; place-items:center; color:#fff; font-size:17px; text-decoration:none; }
  .mobile-bell .nav-badge{ position:absolute; top:2px; right:0; margin:0; min-width:18px; height:18px; font-size:10.5px; }

  /* Menu latéral caché hors écran, glisse quand body.nav-open */
  body.is-app .sidebar{
    top:0 !important; width:280px !important; max-width:85vw;
    transform:translateX(-100%); transition:transform .22s ease;
    position:fixed !important;
    min-height:0 !important;
  }
  body.is-app.nav-open .sidebar{ transform:none; box-shadow:0 0 40px rgba(0,0,0,.25) !important; }
  body.is-app .sidebar-nav{ display:flex !important; }          /* annule l'ancienne grille 2 colonnes */
  .sidebar-backdrop:not([hidden]){ display:block; position:fixed; inset:0; z-index:850; background:rgba(10,20,16,.45); }

  body.is-app .app-main{ margin-left:0 !important; }
  body.is-app .app-main > .container{ padding:22px 16px 32px !important; }
  .footer{ padding:14px 16px !important; justify-content:center; text-align:center; }

  h1{ font-size:23px !important; }
  .panel,.session-essential-panel,.card-body{ padding:16px !important; }
  .col-md-4,.col-md-6,.col-lg-6{ flex:0 0 100%; }
  .page-head{ align-items:flex-start !important; }
}
@media (max-width:640px){
  .form-grid-2{ grid-template-columns:1fr; }
  .page-head > div:last-child:not(:first-child),.session-top-actions{ width:100%; }
  th,td{ padding:10px !important; }
  /* Tableaux sur téléphone : pas de retour à la ligne dans les cellules,
     le tableau défile horizontalement (plus lisible que des lignes très hautes) */
  td{ white-space:nowrap; }
  /* Fiche session : les 8 informations sur 2 colonnes plutôt qu'une longue liste */
  .session-essential-sub{ grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:16px !important; }
}
