/* ManageNot visual refresh. Opt-in only: accueil and the shared dossier lists.
   Keep business status classes, table preferences and all existing controls. */
body.mn-modern {
  --mn-ink: #192e4d;
  --mn-muted: #56677d;
  --mn-blue: #203e71;
  /* 30/10/2026 (SR) : contraste. Bordure a 1,24:1 sur blanc avant, 1,5:1
     maintenant ; --mn-trait sert aux champs et boutons (3,37:1, seuil 3:1). */
  --mn-line: #b9c9de;
  --mn-trait: #7f8da1;
  --mn-zebre: #f4f8fc;
  --mn-soft: #edf3fb;
  --mn-bg: #f4f6fa;
  --mn-nav-height: 112px;
  background: var(--mn-bg);
  color: var(--mn-ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding-top: var(--mn-nav-height) !important;
}
.mn-modern h1, .mn-modern h2, .mn-modern h3, .mn-modern h4,
.mn-modern h5, .mn-modern input, .mn-modern select, .mn-modern button {
  font-family: inherit;
}
.mn-modern :is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid #527cb7;
  outline-offset: 3px;
}
.mn-modern > .w3-content {
  max-width: none !important;
  width: calc(100% - 40px);
  padding-top: 16px !important;
}
/* 2026-10-10 (SR) : les règles de la barre du haut (couleurs, boutons, menus, passage
   sur deux lignes) ne sont plus ici : elles sont dans inc.navigation.php, pour que la
   barre soit la même sur TOUTES les pages et pas seulement l'accueil et les listes. */
.mn-modern #navDemo + br { display: none; }
.mn-modern #ancre_listedestaches { scroll-margin-top: calc(var(--mn-nav-height) + 20px); }
/* Common controls: overrides are limited to styled UI buttons, not status cells. */
.mn-modern :is(.ad-btn, .gd-btn, .gd-btn-ghost) {
  border-radius: 8px;
  box-shadow: none;
  min-height: 38px;
  font-weight: 600;
  font-size: 13px;
}
.mn-modern :is(.ad-btn, .gd-btn):where(:not(.ad-btn-ghost):not(.ad-btn-overdue):not(.gd-btn-ghost)) {
  background: var(--mn-blue) !important;
  color: #fff !important;
}
.mn-modern :is(.ad-btn-ghost, .gd-btn-ghost),
.mn-modern .ad-notif__actions .ad-btn,
.mn-modern .gd-strip__actions .gd-btn:not(.js-open-filters) {
  background: #fff !important;
  color: var(--mn-blue) !important;
  border: 1px solid var(--mn-line);
}
.mn-modern :is(.ad-btn, .gd-btn, .gd-btn-ghost):hover { filter: brightness(.96); }
.mn-modern :is(.ad-page, .gd-page) :is(.w3-input, .w3-select, .w3-input-date),
/* 2026-09-29 (SR) : cases à cocher et boutons radio exclus (sinon hautes de 36 px,
   la case restait en haut et le texte de la tâche descendait d'une ligne sur l'accueil) */
.mn-modern .dataTables_wrapper :is(input:not([type="checkbox"]):not([type="radio"]), select) {
  background: #fff;
  color: var(--mn-ink);
  border: 1px solid #cdd6e3;
  border-radius: 7px;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 14px;
  max-width: 100%;
}
.mn-modern .dataTables_wrapper :is(.dataTables_filter, .dataTables_length) { color: var(--mn-muted); font-size: 13px; margin-bottom: 12px; }
.mn-modern .dataTables_wrapper .dataTables_filter input { width: 170px; }
.mn-modern .dataTables_wrapper :is(.dataTables_info, .dataTables_paginate) { font-size: 12px; padding-top: 14px; color: var(--mn-muted); }
.mn-modern .dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 7px; }
.mn-modern .dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--mn-soft); border-color: var(--mn-line); }
/* Home: retain the full dashboards, role-specific panels and notification actions. */
/* 30/10/2026 (SR) : accueil compacte. Le bandeau « Bonjour ... » est maintenant
   dans cette rangee (accueil.php), donc les marges verticales sont reduites. */
.mn-home .ad-top-row { gap: 10px 20px; margin-bottom: 10px; }
.mn-home .ad-top-row::before, .mn-home .ad-top-row::after { display: none; }
/* Moins d espace perdu entre la barre du haut et le bandeau « Bonjour ... ».
   (0,3,0) : passe devant le padding-top de .mn-modern > .w3-content. */
.mn-modern.mn-home > .w3-content.ad-page { padding-top: 6px !important; }
.mn-home .ad-welcome {
  flex: 1 1 340px;
  min-width: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.mn-home .ad-welcome-hi { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.6px; color: var(--mn-ink); }
.mn-home .ad-welcome-text { color: var(--mn-muted); font-size: 13.5px; line-height: 1.35; }
.mn-home .ad-top-search { flex: 0 1 420px; min-width: 260px; }
.mn-home .ad-search { padding: 4px; border: 1px solid var(--mn-line); border-radius: 10px; background: #fff; }
.mn-home .ad-search .ad-search__input { border: 0 !important; min-height: 36px; }
.mn-home .ad-search__btn { min-width: 42px; }
.mn-home .ad-recents { min-width: 0; }
.mn-home .ad-top-right { flex: 1 1 100%; margin: 0; padding: 0; }
.mn-home .ad-notif {
  max-width: none;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--mn-line);
  border-left: 3px solid #fcc200;
  border-radius: 10px;
  box-shadow: none;
}
.mn-home .ad-notif:has(.ad-notif__empty) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.mn-home .ad-notif:has(.ad-notif__empty) .ad-notif__header { gap: 10px; }
.mn-home .ad-notif:has(.ad-notif__empty) .ad-notif__list { border: 0; background: transparent; padding: 0; }
.mn-home .ad-notif:has(.ad-notif__empty) .ad-notif__actions { margin-left: auto; }
.mn-home .ad-notif__empty { color: var(--mn-muted); padding: 0; font-size: 13px; }
.mn-home .ad-notif__actions .ad-btn { min-height: 32px; font-size: 12px; }
.mn-home .ad-dashboard { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 16px; overflow: visible; }
.mn-home .ad-dashboard::before, .mn-home .ad-dashboard::after { display: none; }
.mn-home .ad-dashboard > .ad-column { display: contents; }
.mn-home .ad-dashboard > .ad-strip { grid-column: 1 / -1; margin: 0; padding: 0; }
.mn-home #ad-signatures-card { grid-column: 1 / -1; }
.mn-home .ad-card { min-width: 0; background: #fff; border: 1px solid var(--mn-line); border-radius: 12px; box-shadow: none; padding: 16px; }
.mn-home .ad-card__header { gap: 12px; margin-bottom: 18px; }
.mn-home .ad-dashboard-title { padding-top: 0; font-size: 22px; font-weight: 650; color: var(--mn-ink); }
.mn-home .ad-title { font-size: 17px; font-weight: 650; color: var(--mn-ink); }
.mn-home .ad-subtitle, .mn-home .ad-muted { font-size: 13px; color: var(--mn-muted); }
.mn-home .ad-kicker { color: var(--mn-muted); }
.mn-home .ad-table-wrap { border: 0; border-radius: 0; }
.mn-home #datatable3 { min-width: 500px; }
.mn-home #datatable2 { min-width: 1150px; }
.mn-home :is(#datatable2, #datatable3, .ad-task-table) thead th {
  background: #e7eff9 !important;
  color: var(--mn-blue) !important;
  border-bottom: 2px solid #93a9c6 !important;
  font-size: 12px;
  font-weight: 600 !important;
  padding: 12px 14px;
}
.mn-home :is(#datatable2, #datatable3) tbody td { padding: 11px 14px; font-size: 13px; color: var(--mn-ink); border-bottom: 1px solid #dce5f0; }
.mn-home :is(#datatable2, #datatable3) tbody tr { background: #fff; }
.mn-home :is(#datatable2, #datatable3, .ad-task-table) tbody tr:nth-child(even) > td { background: var(--mn-zebre, #f4f8fc); }
/* champs et boutons : la bordure doit se voir (3:1), pas seulement se deviner */
.mn-home :is(input[type="text"], input[type="date"], input[type="search"], select, textarea) {
  border-color: var(--mn-trait, #7f8da1);
}
.mn-home :is(#datatable2, #datatable3) tbody tr:hover { background: #f3f7fc; }
.mn-home :is(#datatable2, #datatable3) th:first-child { text-align: left; }
.mn-home #datatable3 tbody td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.mn-home .ad-total { padding-top: 12px; border-top: 1px solid var(--mn-line); font-size: 13px; text-align: left; }
/* Dossier list: keep column order/width preferences and existing status colours. */
.mn-dossiers .gd-strip { padding: 8px 0 12px; border: 0; background: transparent; box-shadow: none; gap: 18px; }
.mn-dossiers .gd-strip__title { min-width: 0; }
.mn-dossiers .gd-strip__title .gd-title { transform: none; padding: 0; font-size: 26px; font-weight: 650; color: var(--mn-ink); }
.mn-dossiers .gd-chip { font-size: 12px; }
.mn-dossiers .gd-card { background: #fff; border: 1px solid var(--mn-line); border-radius: 12px; padding: 20px; box-shadow: none; }
.mn-dossiers .gd-limit-banner:not(.loading) { background: var(--mn-soft); border-color: var(--mn-line); color: var(--mn-blue); font-size: 12px; }
.mn-dossiers .gd-limit-banner { margin-bottom: 20px; }
.mn-dossiers .dataTables_scroll { min-width: var(--mn-table-min, 1100px); }
.mn-dossiers .gd-table-wrap { padding-bottom: 10px; }
.mn-dossiers .gd-card #datatable,
.mn-dossiers .gd-card .dataTables_scrollHead table { border: 0 !important; }
.mn-dossiers .gd-card :is(#datatable, .dataTables_scrollHead table) thead th {
  background: #f3f6fa !important;
  color: var(--mn-muted) !important;
  font-weight: 600 !important;
  text-align: center !important;
  border: 0;
  border-bottom: 1px solid var(--mn-line) !important;
  padding: 12px 10px;
  font-size: 12px;
}
.mn-dossiers .gd-card #datatable tbody td { padding: 11px 10px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--mn-line); line-height: 1.45; }
.mn-dossiers .gd-card #datatable textarea { font-size: 13px; line-height: 1.45; }
.mn-dossiers .gd-sum-emol { white-space: normal !important; }
.mn-dossiers .gd-filter-drawer { top: calc(var(--mn-nav-height) + 12px); height: calc(100dvh - var(--mn-nav-height) - 24px); border-color: var(--mn-line); }
.mn-dossiers .gd-field { border: 0; background: #f5f7fa; border-radius: 8px; }
.mn-dossiers .gd-filter-header .gd-title { padding-top: 0; }
.mn-modern > footer { background: transparent !important; border-top: 1px solid var(--mn-line); color: var(--mn-muted); }
@media (max-width: 1199px) {
  .mn-home .ad-dashboard { grid-template-columns: minmax(0,1fr); }
  .mn-home .ad-welcome { flex-basis: 100%; }
  .mn-home .ad-top-search { flex: 1 1 100%; }
}
@media (max-width: 700px) {
  .mn-modern > .w3-content { width: calc(100% - 28px); padding-top: 14px !important; }
  .mn-home .ad-card, .mn-dossiers .gd-card { padding: 14px; }
  .mn-home .ad-welcome-hi { font-size: 25px; }
  .mn-home .ad-notif:has(.ad-notif__empty) .ad-notif__actions { margin-left: 0; }
  .mn-modern .dataTables_wrapper .dataTables_filter { text-align: left; }
  .mn-dossiers .gd-col-item { flex-wrap: wrap; }
  .mn-dossiers .gd-col-l { max-width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .mn-modern .gd-filter-drawer { transition: none; }
}

/* =========================================================================
   29/10/2026 — Pages de paramétrage, RH, configuration des indicateurs et
   congés. Elles étaient restées au style d'origine. Rien n'est réécrit dans
   le HTML : ces règles s'appuient sur le balisage existant (w3-content,
   w3-container, w3-panel, w3-row/w3-section, w3-third/w3-twothird, w3-table)
   et ne s'appliquent qu'aux pages qui portent la classe .mn-admin.
   ========================================================================= */
.mn-admin > .w3-content {
  max-width: 1180px !important;
  width: calc(100% - 40px);
  padding-top: 8px !important;
}

/* --- Titres de section --- */
.mn-admin h3 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.3px;
  color: var(--mn-ink);
  border: 0 !important;
  padding: 0;
  margin: 28px 0 14px;
}
.mn-admin h3:first-of-type { margin-top: 8px; }
.mn-admin > .w3-content > .w3-container { padding: 0 !important; }

/* --- Cartes : un bloc de formulaire, une liste --- */
.mn-admin .w3-panel:not(.w3-row):not(.w3-red):not(.w3-green):not(.w3-pale-red):not(.w3-pale-green),
.mn-admin .w3-responsive {
  background: #fff;
  border: 1px solid var(--mn-line);
  border-radius: 12px;
  padding: 20px 22px !important;
  margin: 0 0 24px !important;
  box-shadow: 0 1px 2px rgba(25, 46, 77, .05);
  max-width: none !important;
  width: auto !important;
}
.mn-admin .w3-responsive .w3-panel,
.mn-admin .w3-panel .w3-responsive {
  border: 0; box-shadow: none; padding: 0 !important; margin: 0 !important;
}
.mn-admin .w3-panel form.w3-container,
.mn-admin .w3-responsive form.w3-container { padding: 0 !important; }

/* --- Bandeau de message --- */
.mn-admin .w3-panel.w3-red, .mn-admin .w3-panel.w3-green {
  border-radius: 10px; border: 0; padding: 14px 18px !important; margin-bottom: 20px !important;
}

/* --- Lignes de formulaire : libellé à gauche, champ à droite --- */
.mn-admin .w3-row.w3-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 20px;
  margin: 0 0 18px !important;
}
.mn-admin .w3-row.w3-section::before,
.mn-admin .w3-row.w3-section::after { display: none; }
.mn-admin .w3-row.w3-section > .w3-third {
  float: none; flex: 0 0 250px; max-width: 250px; width: auto;
  color: var(--mn-muted); font-weight: 600; font-size: 13px;
  padding: 9px 0 0 0;
}
.mn-admin .w3-row.w3-section > .w3-twothird {
  float: none; flex: 1 1 340px; max-width: none; width: auto; padding: 0;
}
.mn-admin .w3-row.w3-section > .w3-twothird br { line-height: 2.1; }
.mn-admin .w3-row.w3-section input[type="radio"],
.mn-admin .w3-row.w3-section input[type="checkbox"] { margin-right: 7px; }

/* --- Champs --- */
.mn-admin :is(.w3-input, .w3-select, .w3-input-date, input[type="text"], input[type="email"],
               input[type="password"], input[type="number"], input[type="date"], select, textarea) {
  background: #fff;
  color: var(--mn-ink);
  border: 1px solid #cdd6e3 !important;
  border-radius: 7px;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 14px;
  max-width: 100%;
}
.mn-admin textarea { min-height: 90px; }
.mn-admin :is(input, select, textarea):focus { border-color: #527cb7 !important; }

/* --- Boutons --- */
.mn-admin .w3-button, .mn-admin button, .mn-admin input[type="submit"] {
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: none;
}
.mn-admin hr { border: 0; border-top: 1px solid var(--mn-line); margin: 22px 0; }

/* --- Tableaux --- */
.mn-admin table.w3-table, .mn-admin table.w3-table-all { border-collapse: separate; border-spacing: 0; width: 100%; }
.mn-admin table.w3-table-all { border: 0; }
.mn-admin :is(table.w3-table, table.w3-table-all) :is(thead th, tr:first-child th) {
  background: var(--mn-soft) !important;
  color: var(--mn-ink);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  border: 0 !important;
  border-bottom: 1px solid var(--mn-line) !important;
  padding: 11px 12px;
  text-align: left;
}
.mn-admin :is(table.w3-table, table.w3-table-all) td {
  border: 0 !important;
  border-bottom: 1px solid var(--mn-line) !important;
  padding: 10px 12px;
  vertical-align: middle;
}
.mn-admin :is(table.w3-table, table.w3-table-all):not(#pl_table) tbody tr:hover td { background: #f8fbff; }
.mn-admin :is(table.w3-table, table.w3-table-all) tbody tr:last-child td { border-bottom: 0 !important; }

/* --- Espace RH : même fond que le reste de l'application --- */
.mn-admin.mn-rh { background: var(--mn-bg) !important; }

/* Sous-titres : meme traitement que h3, sans le soulignement d'origine. */
.mn-admin :is(h4, h5) {
  font-size: 15px;
  font-weight: 650;
  color: var(--mn-ink);
  border: 0 !important;
  text-decoration: none;
  margin: 4px 0 14px;
}
.mn-admin :is(h4, h5) u { text-decoration: none; }

/* Marqueurs de disponibilite (jours travailles) : pastilles discretes
   plutot que des pleins aplats de couleur. */
.mn-admin .w3-green {
  background: #e8f5ec !important;
  color: #1c6b38 !important;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-block;
  margin: 2px 0;
}
.mn-admin .w3-panel.w3-green { border-radius: 10px; padding: 14px 18px !important; }

/* -------------------------------------------------------------------------
   29/10/2026 (correctif) — les lignes de formulaire n'utilisent pas toutes
   le meme couple de colonnes : w3-third/w3-twothird, mais aussi
   w3-quarter/w3-rest et w3-half. Sans regle de flex sur ces trois-la, elles
   se repliaient sur leur contenu et le champ ne faisait plus que 180 px,
   avec la moitie de la carte vide a droite.
   ------------------------------------------------------------------------- */
.mn-admin .w3-row.w3-section > :is(.w3-third, .w3-quarter) {
  float: none;
  flex: 0 0 230px;
  max-width: 230px;
  width: auto;
  color: var(--mn-muted);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 0 0 0 !important;
  text-align: left !important;   /* uniformise : certaines pages alignaient a droite */
}
.mn-admin .w3-row.w3-section > :is(.w3-twothird, .w3-rest, .w3-half) {
  float: none;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  width: auto;
  padding: 0;
  overflow: visible;
}

/* Le champ occupe toute sa colonne — sauf les cases a cocher et les radios. */
.mn-admin .w3-row.w3-section :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
  width: 100%;
  box-sizing: border-box;
}

/* Corps de message : on ne gagne rien a le garder etroit. */
.mn-admin textarea {
  width: 100%;
  min-height: 190px;
  line-height: 1.5;
  resize: vertical;
  border: 1px solid #cdd6e3 !important;
}
.mn-admin textarea[rows] { min-height: 0; }
.mn-admin textarea[name*="corps"], .mn-admin textarea[name*="message"], .mn-admin textarea[name*="mail"] {
  min-height: 300px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

/* -------------------------------------------------------------------------
   29/10/2026 (correctif) — gestion-indicateur.php groupe ses collaborateurs
   par quatre dans des <div class="w3-row w3-panel">. Traitees comme des
   cartes, ces lignes donnaient cinq blocs blancs separes par du vide. Une
   ligne de grille n'est pas une carte : c'est le conteneur qui en est une.
   ------------------------------------------------------------------------- */
.mn-admin .w3-row.w3-container.w3-light-grey {
  background: #fff !important;
  border: 1px solid var(--mn-line);
  border-radius: 12px;
  padding: 16px 20px !important;
  margin: 0 0 22px !important;
  box-shadow: 0 1px 2px rgba(25, 46, 77, .05);
}
.mn-admin .w3-row.w3-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* la grille ne vaut que pour les lignes qui portent vraiment des colonnes :
   sans cela, la ligne de titre passait en flex et remontait son bouton. */
.mn-admin .w3-row.w3-panel:has(> .w3-quarter) { display: flex; flex-wrap: wrap; }
/* Ligne de titre : seulement pour les lignes SANS colonne de mise en page.
   Appliquee trop largement, elle ecartait les deux demi-colonnes de
   rh-accueil.php et cassait sa mise en page. */
.mn-admin .w3-row.w3-panel:not(:has(> .w3-quarter)):not(:has(> .w3-half)):not(:has(> .w3-third)):not(:has(> .w3-twothird)):not(:has(> .w3-col)):not(:has(> .w3-rest)) {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; padding: 2px 0 12px !important;
}
.mn-admin .w3-row.w3-panel > .w3-quarter {
  float: none;
  flex: 1 1 25%;
  max-width: 25%;
  min-width: 180px;
  padding: 3px 14px 3px 0;
  font-size: 13.5px;
  color: var(--mn-ink);
  display: flex;
  align-items: center;
  gap: 7px;
}
.mn-admin .w3-row.w3-panel > .w3-quarter input[type="checkbox"] { margin: 0; flex: 0 0 auto; }

/* Lignes alternees : la grille se lit a l horizontale, une ligne sur deux
   est teintee et le pas vertical est resserre. */
.mn-admin .w3-row.w3-panel:has(> .w3-quarter) {
  padding: 0 10px !important;
  border-radius: 6px;
}
.mn-admin .w3-row.w3-panel:has(> .w3-quarter):nth-child(even) {
  background: #f3f7fc !important;
}

/* Meme lecture horizontale dans les tableaux de donnees. */
.mn-admin :is(table.w3-table, table.w3-table-all):not(#pl_table) tbody tr:nth-child(even) td { background: #f8fbff; }
.mn-admin :is(table.w3-table, table.w3-table-all):not(#pl_table) tbody tr:hover td { background: #eef5ff; }
.mn-admin :is(table.w3-table, table.w3-table-all) td { padding: 8px 12px; }
.mn-admin :is(table.w3-table, table.w3-table-all) :is(thead th, tr:first-child th) { padding: 9px 12px; }
