/* =====================================================================
   Gestion CMA — habillage « Espace » (même design que le projet GescoCkss)
   Surcouche de présentation : aucune page, aucun contrôle ni aucun code
   n'est modifié. Se superpose à Bootstrap 3 et à simple-sidebar.css.
   ===================================================================== */

:root {
  --esp-bg: #f4f6fb;
  --esp-surface: #ffffff;
  --esp-border: #e5e9f2;
  --esp-text: #1f2a44;
  --esp-muted: #6b7690;
  --esp-nav: #0f172a;
  --esp-nav-hover: #1e293b;
  --esp-accent: #2563eb;
  --esp-accent-soft: #e8efff;
  --esp-success: #16a34a;
  --esp-danger: #b42318;
  --esp-radius: 12px;
  --esp-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .06);
  --esp-side: 270px;
  --esp-top: 58px;
  --esp-select-w: 14rem;   /* largeur unique des listes déroulantes */
}

/* ---------- Base ---------- */
/* Bootstrap 3 fixe la racine à 10 px ; les unités rem de cette feuille supposent 16 px. */
html { font-size: 16px; }
html body.espace .form-horizontal .form-group { margin-left: 0; margin-right: 0; }
html body.espace .login-card .form-control, html body.espace .login-card input, html body.espace .login-card select { width: 100%; max-width: none; display: block; }
html body.espace .login-card input[type="checkbox"] { display: inline-block; width: auto; }
html body.espace {
  background: var(--esp-bg);
  color: var(--esp-text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  padding-top: 0;
  -webkit-font-smoothing: antialiased;
}
body.espace h1, body.espace h2, body.espace h3, body.espace h4, body.espace h5 { font-family: inherit; color: var(--esp-text); letter-spacing: -.005em; }
body.espace h1 { font-size: 1.7rem; font-weight: 700; }
body.espace h2 { font-size: 1.4rem; font-weight: 700; }
body.espace h3 { font-size: 1.2rem; font-weight: 700; margin: 0 0 1rem; }
body.espace h4 { font-size: 1.05rem; font-weight: 700; }
body.espace a { color: var(--esp-accent); }
body.espace a:hover, body.espace a:focus { color: #1d4ed8; }
body.espace hr { border-top-color: var(--esp-border); }
body.espace footer p { color: var(--esp-muted); font-size: .85rem; }
body.espace .text-muted, body.espace .help-block { color: var(--esp-muted); }
body.espace .text-danger { color: var(--esp-danger); }

/* ---------- Barre du haut ---------- */
html body.espace .navbar-inverse.espace-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--esp-top); min-height: var(--esp-top); margin: 0; z-index: 1030;
  background: linear-gradient(90deg, #0b1220, var(--esp-nav));
  border: 0; border-bottom: 1px solid rgba(255, 255, 255, .06); border-radius: 0; box-shadow: none;
}
html body.espace .espace-topbar .container { width: 100%; max-width: none; padding-left: 1.5rem; padding-right: 1.5rem; }
html body.espace .espace-topbar .navbar-header { height: var(--esp-top); }
html body.espace .espace-topbar .navbar-brand { height: var(--esp-top); padding: 0 1rem 0 0; line-height: var(--esp-top); font-size: 1.1rem; font-weight: 600; color: #fff; letter-spacing: .2px; }
html body.espace .espace-topbar .navbar-nav > li > a {
  color: #aab4c8; padding: .35rem .75rem; margin: 11px 2px; line-height: 1.5; border-radius: 8px; transition: all .15s; background: transparent;
}
html body.espace .espace-topbar .navbar-nav > li > a:hover,
html body.espace .espace-topbar .navbar-nav > li > a:focus { color: #fff; background: rgba(255, 255, 255, .08); }
html body.espace .espace-topbar .navbar-toggle { margin-top: 12px; border-color: rgba(255, 255, 255, .3); }
html body.espace .espace-topbar .navbar-toggle .icon-bar { background: #fff; }
html body.espace .espace-topbar .navbar-nav > .open > a,
html body.espace .espace-topbar .navbar-nav > .open > a:hover,
html body.espace .espace-topbar .navbar-nav > .open > a:focus { color: #fff; background: rgba(255, 255, 255, .08); }
html body.espace .espace-topbar .caret { margin-left: .2rem; }
@media (min-width: 768px) {
  html body.espace .espace-topbar .dropdown-menu {
    min-width: 13rem; margin-top: 4px; padding: .35rem; background: var(--esp-surface); border: 1px solid var(--esp-border);
    border-radius: 12px; box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
  }
  html body.espace .espace-topbar .dropdown-menu > li > a { padding: .5rem .75rem; border-radius: 8px; color: var(--esp-text); }
  html body.espace .espace-topbar .dropdown-menu > li > a:hover,
  html body.espace .espace-topbar .dropdown-menu > li > a:focus { color: var(--esp-accent); background: var(--esp-accent-soft); }
}
@media (max-width: 767px) {
  html body.espace .espace-topbar .navbar-collapse { background: var(--esp-nav); border: 0; box-shadow: none; }
}

/* ---------- Zone de contenu (hors pages à menu latéral) ---------- */
html body.espace .body-content { padding: calc(var(--esp-top) + 1.5rem) 2rem 1rem; }
html body.espace .body-content:has(#wrapper) { padding: var(--esp-top) 0 0; }

/* ---------- Titres : une seule hiérarchie sur tout le site ----------
   Titre de page (h2 / h3)  >  titre de carte (panel-heading)  >  titre de section (h4)
   Les pages utilisaient h2 ou h3 indifféremment pour le titre de page, et le titre des cartes était plus petit que les sous-titres. */
html body.espace .body-content :is(h2, h3):not(.home-section-title):not(.modal-title):not(.home-card-head *):not(.panel-heading *):not(.login-card *) {
  font-size: 1.3rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; text-align: left; margin: 1.5rem 0 1rem;
}
html body.espace .body-content :is(h2, h3):not(.home-section-title):not(.modal-title):not(.home-card-head *):not(.panel-heading *):not(.login-card *):first-child { margin-top: 0; }
html body.espace .panel-heading { font-size: 1.05rem; font-weight: 700; line-height: 1.3; text-align: left; }
html body.espace .panel-heading :is(h1, h2, h3, h4, h5) { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; letter-spacing: 0; }
html body.espace .body-content h4:not(.modal-title):not(.well h4):not(.panel-heading h4) { font-size: 1rem; font-weight: 700; line-height: 1.3; text-align: left; margin: 1.25rem 0 .6rem; }
html body.espace .body-content h4:not(.modal-title):not(.well h4):not(.panel-heading h4):first-child { margin-top: 0; }

/* ---------- Menu latéral ---------- */
html body.espace #sidebar-wrapper {
  position: fixed; top: var(--esp-top); bottom: 0; left: var(--esp-side); height: auto; width: 0; margin-left: calc(var(--esp-side) * -1);
  background: var(--esp-nav); color: #aab4c8; box-shadow: none; z-index: 1000;
  overflow-y: auto !important; overflow-x: hidden !important; padding-bottom: 1rem;
}
html body.espace #wrapper.toggled #sidebar-wrapper { width: var(--esp-side); }
/* Position « relative » (et non « absolute ») : le contenu reste dans le flux, le pied de page passe donc après lui, y compris sur mobile */
html body.espace #page-content-wrapper { position: relative; width: 100%; height: auto; padding: 1.25rem 1.25rem 1rem; background: transparent; }
html body.espace #wrapper.toggled #page-content-wrapper { position: relative; margin-right: calc(var(--esp-side) * -1); }
@media (min-width: 768px) {
  html body.espace #wrapper { padding-left: var(--esp-side); }
  html body.espace #wrapper.toggled { padding-left: 0; }
  html body.espace #sidebar-wrapper { width: var(--esp-side); }
  html body.espace #wrapper.toggled #sidebar-wrapper { width: 0; }
  html body.espace #page-content-wrapper { position: relative; padding: 1.5rem 2rem 1rem; min-height: calc(100vh - var(--esp-top)); }
  html body.espace #wrapper.toggled #page-content-wrapper { position: relative; margin-right: 0; }
}

/* Largeur fixe du menu : le texte ne se remet pas en forme pendant l'animation d'ouverture/fermeture */
html body.espace .sidebar-nav { position: static; box-sizing: border-box; width: var(--esp-side); margin: 0; padding: 1.25rem .75rem; list-style: none; }
html body.espace .sidebar-nav li { line-height: 1.4; text-indent: 0; }
html body.espace .sidebar-nav > .sidebar-brand { height: auto; font-size: 1.1rem; line-height: 1.3; padding: 0 .75rem .9rem; margin-bottom: .75rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
html body.espace .sidebar-nav > .sidebar-brand a {
  display: block; position: relative; padding: 0 0 0 .8rem; margin: 0; background: none; color: #fff; font-weight: 700; letter-spacing: -.005em;
}
html body.espace .sidebar-nav > .sidebar-brand a::before { content: ""; position: absolute; left: 0; top: .15em; bottom: .15em; width: 3px; border-radius: 3px; background: var(--esp-accent); }
html body.espace .sidebar-nav > .sidebar-brand a:hover { background: none; color: #fff; }
html body.espace .sidebar-nav li a {
  display: flex; align-items: flex-start; gap: .65rem; margin: 2px 0; padding: .55rem .75rem;
  color: #c3cbdb; text-decoration: none; border-radius: 8px; transition: background .15s, color .15s;
}
html body.espace .sidebar-nav li a span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }  /* les libellés longs passent à la ligne au lieu d'être coupés */
html body.espace .sidebar-nav li a i { font-size: 1.05rem; line-height: 1.4; width: 1.2rem; text-align: center; color: #8793ad; flex: 0 0 auto; transition: color .15s; }
html body.espace .sidebar-nav li a:hover, html body.espace .sidebar-nav li a:focus { color: #fff; background: var(--esp-nav-hover); text-decoration: none; }
html body.espace .sidebar-nav li a:focus-visible { outline: 2px solid #93b4ff; outline-offset: -2px; }
html body.espace .sidebar-nav li a:hover i { color: #fff; }
html body.espace .sidebar-nav li a.active { color: #fff; background: var(--esp-accent); font-weight: 600; box-shadow: 0 2px 8px rgba(37, 99, 235, .35); }
html body.espace .sidebar-nav li a.active i { color: #fff; }
html body.espace .sidebar-nav li a:empty { display: none; }
html body.espace .sidebar-nav > li:not(.sidebar-brand):not(:has(a)):not(:has(hr)):not(:has(img)) { display: none; } /* entrées vides (« ... ») */
html body.espace .sidebar-nav hr { border-color: rgba(255, 255, 255, .1); margin: .9rem .5rem; }
html body.espace .sidebar-nav h4 { margin: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #6f7c96; }
html body.espace .sidebar-nav > img, html body.espace .sidebar-nav img[id$="Image1"] {
  display: block; box-sizing: border-box; width: 100% !important; max-width: none; height: auto !important; margin: 0 0 .9rem; background: #fff; border-radius: 10px; padding: 6px;  /* le logo occupe toute la largeur des entrées du menu */
}
/* Barre de défilement discrète du menu */
html body.espace #sidebar-wrapper { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
html body.espace #sidebar-wrapper::-webkit-scrollbar { width: 6px; }
html body.espace #sidebar-wrapper::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 6px; }
html body.espace #sidebar-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }
/* Petit écran : le menu ouvert recouvre le contenu */
@media (max-width: 767px) {
  html body.espace #wrapper.toggled #sidebar-wrapper { box-shadow: 8px 0 24px rgba(15, 23, 42, .35); }
}

/* Bouton d'affichage du menu */
html body.espace #menu-toggle {
  display: inline-block; margin-bottom: 1rem; padding: .4rem .8rem; color: var(--esp-text);
  background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 10px; text-decoration: none; line-height: 1.4; box-shadow: var(--esp-shadow);
}
/* Même emplacement et même espacement du bouton sous toutes les sections (certaines pages ajoutent un <br /> derrière) */
html body.espace #menu-toggle { display: block; width: -moz-fit-content; width: fit-content; }
html body.espace #menu-toggle + br { display: none; }
html body.espace #menu-toggle:hover { background: var(--esp-accent-soft); color: var(--esp-accent); }

/* ---------- Cartes et panneaux ---------- */
html body.espace .panel, html body.espace .well, html body.espace .jumbotron {
  background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: var(--esp-radius); box-shadow: var(--esp-shadow);
}
html body.espace .well { padding: 1.15rem 1.25rem; }
html body.espace .jumbotron { padding: 1.75rem 2rem; background: linear-gradient(135deg, #ffffff 0%, var(--esp-accent-soft) 100%); }
html body.espace .jumbotron h1 { font-size: 2rem; }
html body.espace .panel-heading, html body.espace .panel-default > .panel-heading {
  background: transparent; color: var(--esp-text); font-weight: 700; font-size: 1.05rem; padding: .85rem 1.25rem; border-bottom: 1px solid var(--esp-border); border-radius: var(--esp-radius) var(--esp-radius) 0 0;
}
html body.espace .panel-body { padding: 1.15rem 1.25rem; overflow-x: auto; }
/* Cartes (panel / well / jumbotron) : même espacement entre cartes, même largeur et hauteur automatique.
   Les width / height / max-width en ligne des pages (380 px, 109 px, 85 px…) laissaient des cartes de tailles inégales ou du contenu coupé. */
html body.espace .panel, html body.espace .well, html body.espace .jumbotron { margin-bottom: 1.25rem; }
html body.espace .panel[style*="width"], html body.espace .panel[style*="max-width"] { width: 100% !important; max-width: none !important; }
html body.espace .panel[style*="height"], html body.espace .well[style*="height"] { height: auto !important; min-height: 0 !important; }
html body.espace .panel > .panel-body > :last-child, html body.espace .well > :last-child { margin-bottom: 0; }
html body.espace .panel-body > .table:last-child, html body.espace .panel-body > table:last-child { margin-bottom: 0; }
html body.espace .panel.panel-body { padding: 1.15rem 1.25rem; }  /* carte déclarée « panel panel-body » sans en-tête */
html body.espace .panel-primary > .panel-heading { background: var(--esp-accent); color: #fff; }

/* ---------- Boutons ---------- */
html body.espace .btn, html body.espace input[type="submit"]:not(.btn), html body.espace input[type="button"]:not(.btn), html body.espace input[type="reset"]:not(.btn),
html body.espace button:not(.btn):not(.navbar-toggle):not(.close):not(.ui-button):not([class*="fc-"]) {
  border-radius: 8px; font-weight: 500; padding: .42rem .95rem; line-height: 1.4; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
html body.espace .btn-default,
html body.espace input[type="submit"]:not(.btn), html body.espace input[type="button"]:not(.btn), html body.espace input[type="reset"]:not(.btn),
html body.espace button:not(.btn):not(.navbar-toggle):not(.close):not(.ui-button):not([class*="fc-"]) {
  background: #fff; border: 1px solid #d5dbe8; color: #44506a;
}
html body.espace .btn-default:hover, html body.espace .btn-default:focus,
html body.espace input[type="submit"]:not(.btn):hover, html body.espace input[type="button"]:not(.btn):hover, html body.espace input[type="reset"]:not(.btn):hover,
html body.espace button:not(.btn):not(.navbar-toggle):not(.close):not(.ui-button):not([class*="fc-"]):hover { background: #f1f4fa; border-color: #c5cee0; color: var(--esp-text); }
html body.espace .btn-primary { background: var(--esp-accent); border-color: var(--esp-accent); color: #fff; }
html body.espace .btn-primary:hover, html body.espace .btn-primary:focus { background: #1d4ed8; border-color: #1d4ed8; }
html body.espace .btn-success { background: var(--esp-success); border-color: var(--esp-success); }
html body.espace .btn-danger { background: #dc2626; border-color: #dc2626; }
html body.espace .btn-info { background: #0891b2; border-color: #0891b2; }
html body.espace .btn-xs, html body.espace .btn-sm { padding: .25rem .6rem; }

/* Boutons : même hauteur, même rayon, même police et mêmes espacements partout.
   Les Height / BackColor / ForeColor en ligne des pages sont écrasés ; les Width en ligne sont conservés (alignement des groupes de boutons et boutons à icône). */
html body.espace :is(.btn, input[type="submit"], input[type="button"], input[type="reset"], button):not(.navbar-toggle):not(.close):not(.ui-button):not([class*="fc-"]):not(.btn-xs):not(.btn-sm):not(.tile-btn *):not(.login-card *):not(.navbar *):not(.ui-datepicker *):not(.ui-dialog *) {
  box-sizing: border-box; height: 2.35rem !important; min-height: 2.35rem; padding-top: 0; padding-bottom: 0; font-size: .9rem; line-height: 1.3;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin: 0 .35rem .35rem 0; border-radius: 8px;
}
html body.espace :is(.btn-xs, .btn-sm):not(.tile-btn *):not(.login-card *):not(.navbar *) {
  box-sizing: border-box; height: 1.95rem !important; min-height: 1.95rem; padding-top: 0; padding-bottom: 0; font-size: .8rem; line-height: 1.3;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin: 0 .25rem .25rem 0; border-radius: 8px;
}
/* Liens en « btn-primary » / « btn-default » sans la classe « btn » : mêmes dimensions que les autres boutons */
html body.espace a[class*="btn-"]:not(.btn) { border: 1px solid transparent; padding-left: .6rem; padding-right: .6rem; text-decoration: none; cursor: pointer; }
html body.espace a.btn-primary:not(.btn) { color: #fff; }
/* Couleurs imposées dans les pages (BackColor) : on revient à la couleur principale */
html body.espace :is(.btn, input[type="submit"], input[type="button"]):is([style*="background-color" i]):not(.tile-btn *):not(.btn-danger) {
  background: var(--esp-accent) !important; border-color: var(--esp-accent) !important; color: #fff !important; font-weight: 500 !important;
}

/* ---------- Formulaires ---------- */
html body.espace .form-control, html body.espace select, html body.espace textarea,
html body.espace input[type="text"], html body.espace input[type="password"], html body.espace input[type="email"],
html body.espace input[type="number"], html body.espace input[type="date"], html body.espace input[type="time"], html body.espace input[type="search"],
html body.espace input[type="datetime"], html body.espace input[type="datetime-local"], html body.espace input[type="month"], html body.espace input[type="tel"], html body.espace input[type="url"] {
  border: 1px solid #d5dbe8; border-radius: 8px; background-color: #fff; color: var(--esp-text); box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
html body.espace .form-control, html body.espace input[type="text"], html body.espace input[type="password"], html body.espace input[type="email"],
html body.espace input[type="number"], html body.espace input[type="date"], html body.espace select,
html body.espace input[type="datetime"], html body.espace input[type="datetime-local"], html body.espace input[type="month"], html body.espace input[type="tel"], html body.espace input[type="url"] { padding: .4rem .65rem; }
html body.espace .form-control:focus, html body.espace select:focus, html body.espace textarea:focus, html body.espace input:focus {
  border-color: var(--esp-accent); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); outline: 0;
}
/* Listes déroulantes (DropDownList) : même hauteur, même remplissage et même flèche partout.
   Les Height / Width en ligne des pages sont écrasés pour la hauteur ; la largeur d'origine est conservée avec un minimum lisible. */
html body.espace select:not([multiple]):not([size]):not(.ui-datepicker-month):not(.ui-datepicker-year) {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  box-sizing: border-box; height: 2.35rem !important; min-height: 2.35rem; min-width: 11rem; max-width: 100%;  /* la largeur unique est fixée par la règle suivante */
  padding: .35rem 2rem .35rem .65rem; line-height: 1.4; vertical-align: middle; text-overflow: ellipsis; cursor: pointer;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7690' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 12px;
}
/* Largeur unique pour toutes les listes (filtres, formulaires et grilles) */
html body.espace select:not([multiple]):not([size]):not(.ui-datepicker-month):not(.ui-datepicker-year) {
  width: var(--esp-select-w) !important; min-width: 0;
}
html body.espace select:not([multiple]):not([size]):disabled { background-color: #f1f4fa; color: var(--esp-muted); cursor: not-allowed; }
html body.espace select:not([multiple]):not([size]):hover:not(:disabled) { border-color: #c5cee0; }
html body.espace label, html body.espace .control-label { font-weight: 600; font-size: .85rem; color: var(--esp-muted); }
html body.espace input[type="checkbox"], html body.espace input[type="radio"] { accent-color: var(--esp-accent); }
html body.espace .checkbox label, html body.espace .radio label { font-weight: 500; color: var(--esp-text); font-size: .95rem; }
html body.espace .alert { border: 0; border-radius: 10px; box-shadow: var(--esp-shadow); }

/* ---------- Messages : une seule présentation partout ----------
   - alertes Bootstrap : même forme, couleurs douces par gravité
   - libellés de message des pages (asp:Label en rouge : lblMsg, lblMessage…) : bandeau d'erreur, masqué quand il est vide
   - messages des validateurs : petit texte rouge sous le champ
   - résumé de validation : bandeau d'erreur */
html body.espace .alert { padding: .75rem 1rem; border-left: 4px solid transparent; font-size: .92rem; line-height: 1.45; margin-bottom: 1rem; }
html body.espace .alert-danger  { color: #912018; background: #fdecea; border-left-color: #d92d20; }
html body.espace .alert-success { color: #0a5c36; background: #e6f6ec; border-left-color: #16a34a; }
html body.espace .alert-info    { color: #1e4a8a; background: #e8f1ff; border-left-color: #3b82f6; }
html body.espace .alert-warning { color: #7a4b00; background: #fff4e0; border-left-color: #f59e0b; }
html body.espace #page-content-wrapper span[id][style*="color:Red" i]:not([style*="visibility"]):not([style*="display"]),
html body.espace .body-content span[id$="lblMsg"], html body.espace .body-content span[id$="lblMsg1"], html body.espace .body-content span[id$="lblMessage"] {
  display: block; margin: .6rem 0; padding: .6rem .9rem; border-left: 4px solid #d92d20; border-radius: 8px; background: #fdecea;
  color: #912018 !important; font-size: .9rem !important; font-weight: 500; line-height: 1.4; text-align: left;
}
html body.espace .body-content span[id][style*="color:Red" i]:empty, html body.espace .body-content span[id$="lblMsg"]:empty,
html body.espace .body-content span[id$="lblMsg1"]:empty, html body.espace .body-content span[id$="lblMessage"]:empty { display: none !important; }
/* Validateurs (RequiredFieldValidator…) : texte d'erreur compact, même rouge que les autres messages */
html body.espace span[id][style*="color:Red" i][style*="visibility"], html body.espace span[id][style*="color:Red" i][style*="display"] {
  color: var(--esp-danger) !important; font-size: .8rem; font-weight: 500; line-height: 1.3;
}
html body.espace .text-danger, html body.espace .validation-summary-errors { color: var(--esp-danger); }
html body.espace .text-success { color: #0a5c36; }
html body.espace .text-info { color: #1e4a8a; }
html body.espace div[id*="ValidationSummary"]:has(li) { margin: .6rem 0; padding: .6rem .9rem .6rem 1.9rem; border-left: 4px solid #d92d20; border-radius: 8px; background: #fdecea; color: #912018; font-size: .9rem; }
html body.espace .label, html body.espace .badge { border-radius: 999px; }

/* ---------- Tableaux et grilles (GridView / DetailsView / FormView) ---------- */
html body.espace table[rules], html body.espace table[border="1"], html body.espace .table {
  width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--esp-border) !important; border-radius: var(--esp-radius);
}
html body.espace table[rules] th, html body.espace table[border="1"] th, html body.espace .table > thead > tr > th {
  background: #f1f4fa; color: var(--esp-muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: .65rem .75rem; border: 0 !important; border-bottom: 1px solid var(--esp-border) !important; text-align: left; white-space: nowrap;
}
html body.espace table[rules] td, html body.espace table[border="1"] td, html body.espace .table > tbody > tr > td {
  padding: .55rem .75rem; vertical-align: middle; border: 0 !important; border-bottom: 1px solid var(--esp-border) !important;
}
html body.espace table[rules] tr:hover td, html body.espace .table-hover > tbody > tr:hover > td { background: #fafbff; }
html body.espace table[rules] tr:last-child td { border-bottom: 0 !important; }
html body.espace .table-striped > tbody > tr:nth-of-type(odd) { background: #fafbff; }
html body.espace table[rules] a { text-decoration: none; font-weight: 500; }
html body.espace table[rules] a[href*="Edit$"], html body.espace table[rules] a[href*="Update$"], html body.espace table[rules] a[href*="Cancel$"],
html body.espace table[rules] a[href*="Delete$"], html body.espace table[rules] a[href*="Select$"] {
  display: inline-block; padding: .15rem .55rem; margin-left: .25rem; border: 1px solid var(--esp-border); border-radius: 6px; font-size: .8rem; background: #fff;
}
html body.espace table[rules] a[href*="Delete$"] { color: var(--esp-danger); border-color: #f3c7c2; }
html body.espace table[rules] a[href*="Update$"] { color: #fff; background: var(--esp-accent); border-color: var(--esp-accent); }
html body.espace table[rules] a:hover { background: var(--esp-accent-soft); }
html body.espace table[rules] td input[type="text"], html body.espace table[rules] td select { width: 100%; min-width: 4.5rem; max-width: 18rem; padding: .25rem .5rem; }
html body.espace table[rules] td input[style*="text-align"] { width: 5.5rem; display: inline-block; text-align: right; }
html body.espace .pagination > li > a, html body.espace .pagination > li > span { border-radius: 6px; margin: 0 2px; border-color: var(--esp-border); }
html body.espace .pagination > .active > a, html body.espace .pagination > .active > span { background: var(--esp-accent); border-color: var(--esp-accent); }
html body.espace .nav-tabs { border-bottom: 1px solid var(--esp-border); margin-bottom: 1rem; }
html body.espace .nav-tabs > li > a { color: var(--esp-muted); font-weight: 500; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
html body.espace .nav-tabs > li.active > a, html body.espace .nav-tabs > li.active > a:hover { color: var(--esp-accent); border: 0; border-bottom: 2px solid var(--esp-accent); background: transparent; }

/* Grilles ASP.NET mises en forme avec les anciens styles automatiques (bgcolor, cellspacing) */
html body.espace table[cellspacing][id] {
  width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--esp-border); border-radius: var(--esp-radius);
}
html body.espace table[cellspacing][id] tr, html body.espace table[cellspacing][id] tr[bgcolor] { background: transparent; }
html body.espace table[cellspacing][id] th {
  background: #f1f4fa !important; color: var(--esp-muted) !important; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: .65rem .75rem; border: 0; border-bottom: 1px solid var(--esp-border); text-align: left; white-space: nowrap;
}
html body.espace table[cellspacing][id] th a { color: inherit !important; text-decoration: none; }
html body.espace table[cellspacing][id] td { padding: .55rem .75rem; vertical-align: middle; border: 0; border-bottom: 1px solid var(--esp-border); color: var(--esp-text); }
html body.espace table[cellspacing][id] tr[bgcolor="White"] td, html body.espace table[cellspacing][id] tr[bgcolor="white"] td { background: #fff; }
html body.espace table[cellspacing][id] tr[bgcolor]:not([bgcolor="White"]):not([bgcolor="white"]) td { background: #fafbff; }
html body.espace table[cellspacing][id] tr:hover td { background: #f3f7ff; }
html body.espace table[cellspacing][id] tr:last-child td { border-bottom: 0; }
html body.espace table[cellspacing][id] td a { text-decoration: none; font-weight: 500; }
html body.espace table[cellspacing][id] a[href*="Edit$"], html body.espace table[cellspacing][id] a[href*="Update$"], html body.espace table[cellspacing][id] a[href*="Cancel$"],
html body.espace table[cellspacing][id] a[href*="Delete$"], html body.espace table[cellspacing][id] a[href*="Select$"] {
  display: inline-block; padding: .15rem .55rem; margin-left: .25rem; border: 1px solid var(--esp-border); border-radius: 6px; font-size: .8rem; background: #fff;
}
html body.espace table[cellspacing][id] a[href*="Delete$"] { color: var(--esp-danger); border-color: #f3c7c2; }
html body.espace table[cellspacing][id] a[href*="Update$"] { color: #fff; background: var(--esp-accent); border-color: var(--esp-accent); }
html body.espace table[cellspacing][id] td input[type="text"], html body.espace table[cellspacing][id] td select { width: 100%; min-width: 4.5rem; max-width: 18rem; padding: .25rem .5rem; }
html body.espace table[cellspacing][id] td table td, html body.espace table[cellspacing][id] td table { border: 0; background: transparent; }

/* Grilles de données (GridView = tableau avec une ligne d'en-têtes th[scope="col"]) : toutes à la largeur de leur conteneur,
   même taille de texte, même remplissage, mêmes bordures ; les largeurs fixes des pages (365 px, 400 px, 600 px…) laissaient des bords droits irréguliers. */
html body.espace #page-content-wrapper table:has(> tbody > tr > th[scope="col"]),
html body.espace .home-card-body table:has(> tbody > tr > th[scope="col"]) {
  width: 100% !important; max-width: 100%; font-size: .9rem !important; border-collapse: collapse; table-layout: auto;
}
html body.espace table:has(> tbody > tr > th[scope="col"]) > tbody > tr > th { vertical-align: middle; line-height: 1.3; }
html body.espace table:has(> tbody > tr > th[scope="col"]) > tbody > tr > td { vertical-align: middle; font-size: inherit; line-height: 1.35; }
html body.espace table:has(> tbody > tr > th[scope="col"]) > tbody > tr > td > a:not([class*="btn"]) { white-space: nowrap; }
/* Ligne du pied de grille (pagination) : centrée et sans bordure intérieure */
html body.espace table:has(> tbody > tr > th[scope="col"]) > tbody > tr > td > table { width: auto !important; margin: .35rem auto; }
html body.espace table:has(> tbody > tr > th[scope="col"]) > tbody > tr > td > table td { border: 0 !important; padding: 0 .15rem !important; }

/* Fiches et formulaires d'enregistrement (DetailsView / FormView) : même largeur, colonne des libellés alignée,
   champs de même largeur et de même hauteur, commandes (Modifier, Nouveau, Enregistrer…) de même style. */
html body.espace #page-content-wrapper table[id]:is([rules], [cellspacing]):not([title]):not(.rep-table):not(:has(> tbody > tr > th[scope="col"])) {
  width: 100% !important; max-width: 42rem; font-size: .92rem;
}
html body.espace #page-content-wrapper table[id]:is([rules], [cellspacing]):not([title]):not(.rep-table):not(:has(> tbody > tr > th[scope="col"])) > tbody > tr > td:first-child:not(:last-child) {
  width: 36%; font-size: .85rem; font-weight: 600; color: var(--esp-muted); vertical-align: middle;
}
html body.espace #page-content-wrapper table[id]:is([rules], [cellspacing]):not([title]):not(.rep-table):not(:has(> tbody > tr > th[scope="col"])) > tbody > tr > td > :is(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="tel"], input[type="url"], select, textarea) {
  width: 100% !important; max-width: 20rem;
}
/* Champs de saisie : même hauteur que les listes déroulantes et les boutons */
html body.espace :is(input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], input[type="tel"], input[type="url"], input[type="datetime"], input[type="datetime-local"], input[type="month"]):not(.ui-datepicker *) {
  box-sizing: border-box; height: 2.35rem !important; line-height: 1.4; vertical-align: middle;
}
/* Commandes « Nouveau » / « Insérer » des fiches : même présentation que Modifier / Mettre à jour / Annuler */
html body.espace table[rules] a[href*="New$"], html body.espace table[cellspacing][id] a[href*="New$"],
html body.espace table[rules] a[href*="Insert$"], html body.espace table[cellspacing][id] a[href*="Insert$"] {
  display: inline-block; padding: .15rem .55rem; margin-left: .25rem; border: 1px solid var(--esp-border); border-radius: 6px; font-size: .8rem; font-weight: 500; background: #fff; text-decoration: none;
}
html body.espace table[rules] a[href*="Insert$"], html body.espace table[cellspacing][id] a[href*="Insert$"] { color: #fff; background: var(--esp-accent); border-color: var(--esp-accent); }

/* Calendrier ASP.NET (pages d'absences et de présence) — même style que GescoCkss */
html body.espace table[title="Calendrier"][id][cellspacing] {
  width: 100% !important; max-width: 20rem; height: auto !important; border: 1px solid var(--esp-border) !important; border-radius: 12px;
  border-collapse: separate; border-spacing: 0; background: #fff !important; box-shadow: var(--esp-shadow); overflow: hidden; font-size: .85rem;
}
html body.espace table[title="Calendrier"][id][cellspacing] td, html body.espace table[title="Calendrier"][id][cellspacing] th { text-align: center; padding: .35rem .2rem; border: 0 !important; background: transparent; font-family: inherit !important; }
html body.espace table[title="Calendrier"][id][cellspacing] > tbody > tr:first-child > td { background: var(--esp-nav) !important; color: #fff !important; padding: .6rem; }
html body.espace table[title="Calendrier"][id][cellspacing] > tbody > tr:first-child td, html body.espace table[title="Calendrier"][id][cellspacing] > tbody > tr:first-child a { color: #fff !important; font-weight: 600; text-decoration: none; }
html body.espace table[title="Calendrier"][id][cellspacing] th { background: #f1f4fa !important; color: var(--esp-muted) !important; font-weight: 600; font-size: .72rem; text-transform: uppercase; }
html body.espace table[title="Calendrier"][id][cellspacing] td a { display: block; border-radius: 8px; padding: .3rem 0; color: var(--esp-text) !important; text-decoration: none; }
html body.espace table[title="Calendrier"][id][cellspacing] td a:hover { background: var(--esp-accent-soft); }
html body.espace table[title="Calendrier"][id][cellspacing] > tbody > tr:not(:first-child) > td[style*="background"] { background: transparent !important; }
html body.espace table[title="Calendrier"][id][cellspacing] td[style*="background"] a, html body.espace table[title="Calendrier"][id][cellspacing] td[bgcolor] a { color: var(--esp-text) !important; }
html body.espace table[title="Calendrier"][id][cellspacing] td[style*="#009999"] a, html body.espace table[title="Calendrier"][id][cellspacing] td[style*="rgb(0, 153, 153)"] a { background: var(--esp-accent); color: #fff !important; font-weight: 700; }
html body.espace table[title="Calendrier"][id][cellspacing] tr:hover td { background: transparent; }

/* Contenu large : défile dans la zone principale au lieu d'être coupé */
html body.espace #page-content-wrapper { overflow-x: auto; }
/* Barres de filtres dans un « well » : tableau sur toute la largeur, listes déroulantes bornées (évite le défilement horizontal) */
html body.espace #page-content-wrapper table:not([id]):not(.rep-table):has(> tbody > tr > td > select) { width: 100% !important; }
/* Barres de filtres : les listes se partagent la largeur de la barre (14 rem au maximum, 8 rem au minimum) au lieu de la déborder */
html body.espace #page-content-wrapper table:not([id]):not(.rep-table):has(> tbody > tr > td > select) select { width: 100% !important; min-width: 8rem; max-width: var(--esp-select-w); }
html body.espace #page-content-wrapper table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:first-child > td:not(:has(select, input, a, button)) {
  font-size: .85rem; font-weight: 600; color: var(--esp-muted); line-height: 1.3; vertical-align: bottom; padding-bottom: .15rem;
}
html body.espace #page-content-wrapper table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { padding-right: .75rem; }
html body.espace #page-content-wrapper table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(a:not(.btn)) { font-size: .9rem; line-height: 1.3; vertical-align: middle; white-space: nowrap; }
html body.espace #page-content-wrapper .well { overflow-x: auto; }  /* fenêtre étroite : la barre défile dans la carte plutôt que de déplacer toute la page */
/* Colonnes Bootstrap 3 à largeur fixe : on les empile quand la zone de contenu est trop étroite (menu latéral ouvert) */
@media (max-width: 1279px) {
  html body.espace #page-content-wrapper [class*="col-md-"] { float: none; width: 100%; left: auto !important; margin-left: 0; }
  html body.espace #page-content-wrapper [class*="col-md-"] + [class*="col-md-"] { margin-top: 1rem; }
}
html body.espace .well h4 { margin: 0 0 .35rem; font-size: .95rem; font-weight: 600; color: var(--esp-text); }
html body.espace .well h4:last-child { margin-bottom: 0; }

/* Tableaux de mise en page (sans identifiant) : cellules respirables, contrôles alignés */
html body.espace #page-content-wrapper table:not([id]):not(.rep-table) > tbody > tr > td,
html body.espace #page-content-wrapper table:not([id]):not(.rep-table) > tr > td { padding: .25rem .5rem; vertical-align: middle; }
/* En-têtes (libellés) alignés sur les cellules : le libellé et la liste déroulante en dessous partent du même bord gauche */
html body.espace #page-content-wrapper table:not([id]):not(.rep-table) > tbody > tr > th,
html body.espace #page-content-wrapper table:not([id]):not(.rep-table) > tr > th { padding: .25rem .5rem; vertical-align: bottom; text-align: left; }
/* Libellés de champs : même taille, même graisse, même couleur et même alignement partout
   (cellules « Année Adémique », « Classe », « Rechercher »… dont la taille était fixée à medium / large dans les pages) */
html body.espace #page-content-wrapper table:not([id]):not(.rep-table) > tbody > tr > th,
html body.espace #page-content-wrapper table:not([id]):not(.rep-table) > tr > th { font-size: .85rem; font-weight: 600; color: var(--esp-muted); line-height: 1.3; white-space: nowrap; }
html body.espace #page-content-wrapper td[style*="font-size" i]:not(:has(*)):not([colspan]) {
  font-size: .85rem !important; font-weight: 600; color: var(--esp-muted); line-height: 1.3; text-align: left; vertical-align: bottom; white-space: nowrap;
}
html body.espace label, html body.espace .control-label { line-height: 1.3; margin-bottom: .3rem; }
html body.espace #page-content-wrapper table:not([id]):not(.rep-table) td > span[id] { display: inline-block; }
/* Boutons de tableau de bord (pages Default des sections) */
html body.espace #page-content-wrapper table input[type="submit"][name*="Button"] { margin: 3px 4px; }

/* ---------- Page de connexion et pages sans menu ---------- */
.login-card { max-width: 440px; margin: 1.5rem auto; }
.login-card .login-logo { display: block; margin: 0 auto 1rem; max-height: 80px; width: auto; }
.login-card > img:not(.login-logo) { display: block; margin: 1rem auto 0; }
.login-card h1 { text-align: center; font-size: 1.6rem; margin: 0 0 .25rem; }
.login-card .login-sub { text-align: center; color: var(--esp-muted); margin-bottom: 1.25rem; }
.login-card .card-box { background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: var(--esp-radius); box-shadow: var(--esp-shadow); padding: 1.5rem; }
.login-card .form-group { margin-bottom: 1.25rem; }
.login-card .btn-primary { width: 100%; padding: .6rem; }

/* Pages de compte (Connexion, Inscrire, Gérer le compte, Association externe) : même carte centrée, champs empilés,
   libellés au-dessus des champs, messages d'erreur sous le champ sans réserver de place. */
.login-card h2, .login-card h3 { text-align: center; font-size: 1.6rem; font-weight: 700; margin: 0 0 1rem; }
.login-card h4 { text-align: left; font-size: 1rem; font-weight: 700; margin: 0 0 .75rem; }
.login-card hr { margin: 0 0 1.25rem; }
.login-card .row { margin-left: 0; margin-right: 0; }
.login-card [class*="col-md-"] { float: none; width: 100%; padding-left: 0; padding-right: 0; }
.login-card .col-md-offset-2 { margin-left: 0; }
.login-card .form-horizontal .control-label, .login-card .control-label { display: block; text-align: left; padding-top: 0; margin-bottom: .35rem; }
.login-card .form-group > span.text-danger, .login-card .form-group > div > span.text-danger { display: block; height: 0; overflow: visible; margin-top: .3rem; font-size: .8rem; line-height: 1.2; }
.login-card .form-group > div > span.text-danger[style*="display:none"], .login-card .form-group > span.text-danger[style*="display:none"] { margin: 0; }
/* Message d'erreur affiché : il prend sa place sous le champ au lieu de chevaucher le libellé suivant */
.login-card .form-group span.text-danger[style*="visibility: visible"], .login-card .form-group span.text-danger[style*="display: inline"] { height: auto; margin-bottom: .25rem; }
.login-card p.text-danger, .login-card p.text-success, .login-card p.text-info { text-align: left; margin: 0 0 1rem; }
.login-card .form-group .btn { width: 100%; padding: .6rem; height: auto !important; margin: 0; }
.login-card .form-group .btn-default { color: #fff; background: var(--esp-accent); border-color: var(--esp-accent); }
.login-card .form-group .btn-default:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.login-card .card-box .table { margin-bottom: 1rem; }
.login-card #socialLoginList { margin-top: 1rem; }

/* ---------- Accès rapides ---------- */
.espace-tile { display: block; text-decoration: none !important; color: inherit; height: 100%; }
.espace-tile .tile {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; height: 100%;
  background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: var(--esp-radius); box-shadow: var(--esp-shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.espace-tile:hover .tile { transform: translateY(-2px); border-color: var(--esp-accent); box-shadow: 0 8px 22px rgba(37, 99, 235, .15); }
.espace-tile .tile > i {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: var(--esp-accent-soft); color: var(--esp-accent); font-size: 1.3rem;
}
.espace-tile .tile > span { font-weight: 600; color: var(--esp-text); }
/* Accès rapides des pages Default de Direction / Reception : mêmes cartes que l'accueil (les boutons asp:Button sont conservés) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.tiles .tile-btn { position: relative; --tone: #2563eb; --tone-soft: #e8efff; }
.tiles .tile-btn:nth-child(5n+2) { --tone: #15803d; --tone-soft: #e3f6ea; }
.tiles .tile-btn:nth-child(5n+3) { --tone: #b45309; --tone-soft: #fdf1dc; }
.tiles .tile-btn:nth-child(5n+4) { --tone: #be185d; --tone-soft: #fde7f1; }
.tiles .tile-btn:nth-child(5n+5) { --tone: #6d28d9; --tone-soft: #efe8fd; }
.tiles .tile-btn input[type="submit"] {
  display: block; width: 100%; max-width: none; height: 100%; min-height: 128px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4.6rem .9rem 1rem 1.15rem !important;
  font-weight: 600; font-size: .88rem; color: var(--esp-text) !important; line-height: 1.3 !important; background: var(--esp-surface) !important;
  border: 1px solid var(--esp-border) !important; border-radius: 14px !important; box-shadow: var(--esp-shadow); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tiles .tile-btn input[type="submit"]:hover, .tiles .tile-btn input[type="submit"]:focus { transform: translateY(-3px); border-color: var(--tone) !important; box-shadow: 0 10px 26px rgba(16, 24, 40, .12); }
.tiles .tile-btn > i {
  position: absolute; left: 1.15rem; top: 1.15rem; width: 46px; height: 46px;
  display: grid; place-items: center; border-radius: 12px; background: var(--tone-soft); color: var(--tone); font-size: 1.35rem; pointer-events: none;
}
.tiles .tile-btn::after {
  content: "\f138"; font-family: "bootstrap-icons"; position: absolute; top: 1rem; right: 1rem; color: var(--tone); pointer-events: none;
  opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s;
}
.tiles .tile-btn:hover::after { opacity: 1; transform: none; }

/* ---------- Bulletins et rapports (HTML, sans RDLC) ---------- */
.report-host { margin: 0 0 1.25rem; }
.report-toolbar { margin-bottom: 1rem; text-align: right; }
/* Relevé affiché à l'écran dans #dvContents (pages Bulletin1…) : tableau de mise en page « en-tête à gauche, notes à droite » remis en feuille :
   en-tête (école + logo), titre, identité de l'élève, grille des notes pleine largeur, puis moyennes. Le contenu et les contrôles ne changent pas. */
html body.espace #dvContents:has(> table > tbody > tr > td[rowspan]) {
  background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: var(--esp-radius); box-shadow: var(--esp-shadow); padding: 1.5rem 1.75rem; margin-bottom: 1.25rem;
}
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) { display: block; width: 100% !important; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; row-gap: 1rem; align-items: start; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr { display: contents; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr > td { display: block; padding: 0; border: 0; min-width: 0; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr:nth-child(1) > td:nth-child(1) { grid-column: 1; grid-row: 1; }       /* école */
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr:nth-child(1) > td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; } /* logo */
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr:nth-child(2) > td:nth-child(1) { grid-column: 1 / -1; grid-row: 2; text-align: center; }  /* titre */
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr:nth-child(2) > td:nth-child(2) { display: none; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr:nth-child(3) > td { grid-column: 1 / -1; grid-row: 3; }                       /* élève */
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr:nth-child(1) > td:nth-child(3) { grid-column: 1 / -1; grid-row: 4; }            /* notes */
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) > tbody > tr:nth-child(4) > td { grid-column: 1 / -1; grid-row: 5; }                       /* moyennes */
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) h2 { margin: 0; text-align: center; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) h4 { margin: 0 0 .35rem; font-size: 1.05rem; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) table.auto-style1 { width: auto !important; max-width: 100%; }
html body.espace #dvContents > table:has(> tbody > tr > td[rowspan]) table.auto-style1 td { padding: .15rem 1rem .15rem 0; border: 0; background: transparent; }

/* Rangée de navigation entre bulletins (boutons « Bulletins 8ème… », « Bulletins 7ème… », lien « Bulletins de fin d'année ») :
   sortie du tableau de filtres pour que celui-ci ne soit pas élargi par des boutons de 246 px. */
.page-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: 0 0 1rem; }
.page-switch .btn, .page-switch input[type="submit"] { margin: 0; }
.page-switch input[type="submit"] { width: auto !important; }  /* la largeur imposée (246 px) coupait « …SEC_3 » */

/* Une carte qui ne contient qu'un rapport (bulletin, relevé…) devient transparente : la barre « Imprimer » et les feuilles A4
   se détachent directement du fond de page, au lieu d'une feuille dans une carte. */
html body.espace .panel:has(> .report-host), html body.espace .panel:has(> * > .report-host) {
  background: transparent; border: 0; box-shadow: none; overflow: visible; margin-bottom: 0;
}
html body.espace .panel:has(> .report-host) > .report-host .rep-sheet:first-of-type { margin-top: 0; }
.report-empty { background: #fff8e6; border: 1px solid #f2dfa7; color: #7a5b00; padding: 14px 18px; border-radius: 10px; }
.rep-sheet {
  background: #fff; color: #111; max-width: 210mm; margin: 0 auto 22px; padding: 16mm 15mm;
  border: 1px solid var(--esp-border); border-radius: var(--esp-radius); box-shadow: var(--esp-shadow); font-size: 12.5px;
  page-break-after: always; break-after: page;
}
.rep-sheet.rep-wide { max-width: 297mm; }
.rep-sheet:last-child { page-break-after: auto; break-after: auto; }
.rep-header { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #1f3a5f; padding-bottom: 8px; }
.rep-logo { height: 64px; width: auto; }
.rep-school { flex: 1; text-align: center; }
.rep-school h1 { margin: 0; font-size: 1.15rem !important; letter-spacing: .03em; text-transform: uppercase; color: #1f3a5f !important; }
.rep-school div { font-size: 11px; color: var(--esp-muted); }
.rep-title { text-align: center; font-weight: 700; letter-spacing: .08em; margin: 12px 0 2px; font-size: 1.05rem; }
.rep-subtitle { text-align: center; margin-bottom: 8px; color: #333; }
.rep-identity { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; }
.rep-text { line-height: 1.7; margin: 10px 0; }
.rep-note { font-size: 11.5px; color: #333; margin: 8px 0; }
.rep-notes { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 8px 0; }
html body .rep-table { width: 100%; border: 1px solid #333 !important; border-radius: 0; margin: 8px 0; font-size: 12.5px; background: #fff; }
html body .rep-table th, html body .rep-table td { border: 1px solid #999 !important; padding: 4px 7px !important; background: #fff !important; text-transform: none; letter-spacing: 0; color: #111; font-size: inherit; }
html body .rep-table thead th { background: #eef2f8 !important; font-size: .76rem; letter-spacing: .04em; }
html body .rep-table tfoot td { background: #f6f8fb !important; }
html body .rep-table tr.total td { font-weight: 700; }
html body .rep-table .num { text-align: right; white-space: nowrap; }
html body .rep-table .strong { font-weight: 700; }
html body .rep-table .low { color: var(--esp-danger); }
html body .rep-table .small { font-size: 11px; }
html body .rep-table th small { display: block; font-weight: 400; color: var(--esp-muted); }
html body .rep-matrix { font-size: 11.5px; }
/* Rapport de fin d'année : 4 colonnes par matière (T1, T2, T3, FIN_AN) + Total, Barème, MoyAn -> tableau large, défilement horizontal à l'écran, nom de l'élève figé à gauche */
.rep-sheet.rep-annual { max-width: none; padding: 12mm 10mm; }
.rep-annual .rep-scroll { overflow-x: auto; margin: 8px 0; }
html body .rep-annual-t { width: auto; min-width: 100%; margin: 0; font-size: 11px; border-collapse: separate; border-spacing: 0; }
html body .rep-annual-t th, html body .rep-annual-t td { padding: 3px 6px !important; }
html body .rep-annual-t th.grp { text-align: center; }
html body .rep-annual-t th.nm, html body .rep-annual-t td.nm { text-align: left; white-space: nowrap; min-width: 15rem; position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 #999; }
html body .rep-annual-t thead th.nm { background: #eef2f8 !important; }
html body .rep-annual-t .fin { border-right: 2px solid #1f3a5f !important; font-weight: 700; }
html body .rep-annual-t tfoot td.nm { background: #f6f8fb !important; }
@page annual { size: A3 landscape; margin: 8mm; }
@media print {
  .rep-sheet.rep-annual { page: annual; max-width: none; padding: 0; border: 0; box-shadow: none; }
  .rep-annual .rep-scroll { overflow: visible; }
  html body .rep-annual-t { font-size: 5.4pt; min-width: 0; width: 100%; }
  html body .rep-annual-t th, html body .rep-annual-t td { padding: 1px 1px !important; }
  html body .rep-annual-t th.nm, html body .rep-annual-t td.nm { min-width: 0; position: static; box-shadow: none; }
}
.rep-remark { margin: 12px 0; }
.rep-remark span { display: inline-block; border-bottom: 1px solid #555; width: 70%; height: 1em; vertical-align: bottom; }
.rep-signatures { display: flex; justify-content: flex-end; gap: 3rem; margin-top: 40px; }
.rep-signatures div { min-width: 14rem; border-top: 1px solid #000; text-align: center; padding-top: 4px; font-size: 12px; }

/* Bulletin d'étape (mensuel) : tableau à deux zones, d'après la maquette de l'école.
   Tout est en « em » et la taille de police suit la largeur de la feuille (cqw) : le bulletin remplit toute la largeur disponible
   et garde les proportions de la maquette à l'écran comme à l'impression. */
.rep-sheet.bm-sheet { max-width: none; width: 100%; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; margin: 0 0 1.5rem; font-family: Arial, Helvetica, sans-serif; container-type: inline-size; }
html body .bm-table { table-layout: fixed; width: 100%; border: 1px solid #000 !important; margin: 0; font-size: 13.5px; font-size: clamp(12px, 1.8cqw, 21px); line-height: 1.15; background: #fff !important; }
html body .bm-table th, html body .bm-table td { border: 0 !important; padding: .3em .45em !important; vertical-align: middle; line-height: 1.15; background: #fff !important; text-transform: none; letter-spacing: 0; color: #111; }
html body .bm-table thead th, html body .bm-table tfoot td { background: #fff !important; }
/* fine double ligne du haut */
html body .bm-table tr.bm-top th { padding: 0 !important; height: .22em; line-height: 0; font-size: 0; border-bottom: 1px solid #000 !important; }
/* en-tête */
html body .bm-table tr.bm-heads th { height: 2.6em; font-size: 1.07em; font-weight: 400; text-align: left; border-bottom: 1px solid #000 !important; }
html body .bm-table tr.bm-heads th.bm-h-small { font-size: 1em; }
html body .bm-table tr.bm-heads th.bm-h-bold { font-weight: 700; }
html body .bm-table tr.bm-heads th:nth-child(n+3) { border-left: 1px solid #000 !important; }
.bm-logo { height: 2.3em; width: auto; display: block; }
/* séparateurs verticaux */
html body .bm-table .bm-left { border-right: 1px solid #000 !important; vertical-align: top; text-align: left; }
html body .bm-table td.bm-subject, html body .bm-table td.num, html body .bm-table td.bm-comment { border-left: 1px solid #000 !important; }
html body .bm-table td.num { text-align: right; padding-right: .4em !important; }
html body .bm-table td.bm-comment { font-style: italic; }
/* enseignant : toujours sur une seule ligne */
html body .bm-table td.bm-teacher { font-style: italic; font-size: .95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: .35em !important; padding-right: .15em !important; }
/* zone de gauche */
html body .bm-table td.bm-info { padding: .6em .5em !important; line-height: 1.4; }
.bm-info > div { margin-bottom: 1.5em; }
.bm-info > div:last-child { margin-bottom: 0; }
.bm-title { text-align: center; font-weight: 700; }
html body .bm-table td.bm-info .bm-address, html body .bm-table td.bm-info .bm-summary, html body .bm-table td.bm-life, html body .bm-table td.bm-extra { text-align: justify; text-justify: inter-word; }
.bm-student b { font-size: 1.03em; }
/* pied de page */
html body .bm-table tfoot td { height: 8.2em; font-weight: 400; vertical-align: top; border-top: 1px solid #000 !important; font-size: .95em; line-height: 1.4; }
html body .bm-table tfoot td.bm-sign { vertical-align: bottom; padding-bottom: 1em !important; }
html body .bm-table tfoot td.bm-sign:not(.bm-left) { border-left: 1px solid #000 !important; }
.bm-line { display: block; border-top: 1px solid #000; padding-top: .25em; margin-right: 6%; white-space: nowrap; line-height: 1.2; }
html body .bm-table .bm-left .bm-line { color: #444; }
/* Impression : deux bulletins par page A4 (l'un sous l'autre) */
@media print {
  .rep-sheet.bm-sheet { page-break-after: auto; break-after: auto; page-break-inside: avoid; break-inside: avoid; margin: 0 0 7mm; }
  .rep-sheet.bm-sheet:nth-of-type(2n) { page-break-after: always; break-after: page; margin-bottom: 0; }
  .rep-sheet.bm-sheet:last-of-type { page-break-after: auto; break-after: auto; }
  html body .bm-table { font-size: 1.5cqw; }
}

/* Bulletin de fin d'année : panneau élève à gauche, notes par trimestre à droite (d'après la maquette de l'école).
   Même principe que le bulletin d'étape : « em » + taille de police proportionnelle à la largeur (cqw), pleine largeur. */
.rep-sheet.ba-sheet { max-width: none; width: 100%; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; margin: 0 0 1.5rem; font-family: Arial, Helvetica, sans-serif; container-type: inline-size; }
html body .ba-table { table-layout: fixed; width: 100%; border: 1px solid #000 !important; margin: 0; font-size: 11px; font-size: clamp(11px, 1.85cqw, 19px); line-height: 1.2; background: #fff !important; }
html body .ba-table th, html body .ba-table td { border: 1px solid #999 !important; padding: .4em .35em !important; vertical-align: middle; line-height: 1.2; background: #fff !important; text-transform: none; letter-spacing: 0; color: #111; font-size: inherit; font-weight: 400; }
html body .ba-table thead th { height: 2.2em; padding-top: .25em !important; padding-bottom: .25em !important; font-size: .85em; text-align: center; border-bottom: 1px solid #000 !important; background: #fff !important; }
html body .ba-table thead th.ba-h-bold { font-size: 1em; font-weight: 700; }
.ba-logo { height: 1.7em; width: auto; display: block; }
html body .ba-table .ba-left { border: 0 !important; border-right: 1px solid #000 !important; text-align: left; }
html body .ba-table thead th.ba-left { border-bottom: 1px solid #000 !important; }
html body .ba-table td.ba-info { vertical-align: top; padding: .4em .5em !important; line-height: 1.3; font-size: .95em; }
.ba-c { text-align: center; font-weight: 700; }
html body .ba-table td.ba-info .ba-l:not(.ba-c) { text-align: justify; text-justify: inter-word; }
html body .ba-table tfoot td.ba-note { text-align: justify; text-justify: inter-word; }
.ba-rule { border-bottom: 1px solid #000; margin: .55em 0 .5em; }
html body .ba-table td.ba-subject { text-align: left; padding-left: .4em !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .ba-table td.num { text-align: right; padding-right: .4em !important; }
html body .ba-table tr.ba-avg td { font-weight: 700; font-style: italic; }
html body .ba-table tfoot td { background: #fff !important; font-size: .88em; vertical-align: top; border-top: 1px solid #000 !important; border-bottom: 0 !important; line-height: 1.3; }
html body .ba-table tfoot td.ba-note { border-left: 0 !important; border-right: 1px solid #000 !important; padding: .4em .5em !important; text-align: left; }
html body .ba-table tfoot td.ba-sign { vertical-align: bottom; height: 3.8em; padding-bottom: .7em !important; }
.ba-line { border-top: 1px solid #000; width: 62%; margin: 0 auto; text-align: center; font-weight: 700; padding-top: .25em; white-space: nowrap; }
/* Barres de filtres des pages de rapports et de bulletins (année, période, classe, étudiant, actions) : carte professionnelle, champs répartis
   sur toute la largeur, action principale à droite, liens secondaires en boutons discrets. Présentation seulement : le tableau d'origine et ses
   contrôles (listes, liens, boutons) sont inchangés et gardent leurs identifiants et leurs événements. */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) .well:has(> table:not([id])) {
  background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 14px;
  box-shadow: var(--esp-shadow); padding: 1.1rem 1.25rem; margin: 0 0 1rem;
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) .well:has(> table:not([id])) > table { border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; background: transparent !important; border-radius: 0 !important; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) { display: block; width: 100% !important; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) .well:has(> table:not([id])) { display: block; }

/* grille : une colonne par champ ; les lignes de l'ancien tableau (navigation, étiquettes, contrôles) deviennent les rangées de la grille */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody {
  display: grid; column-gap: 1.1rem; row-gap: .4rem; align-items: end; width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 0 minmax(11rem, .8fr);              /* 5 colonnes : année, période, classe, (matière), action */
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:first-child > td:nth-child(6)) > tbody {
  grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(2, minmax(0, 1.4fr)) 0;      /* 6 colonnes avec rangée de navigation (bulletins mensuels) */
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:first-child > td:nth-child(6)):not(:has(> tbody > tr:nth-child(3))) > tbody {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .5fr) minmax(0, 1.3fr) minmax(0, 1fr);   /* 6 colonnes : relevés (étudiant, version anglaise/française) */
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr { display: contents; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { display: block; min-width: 0; height: auto; padding: 0 !important; overflow: hidden; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(1) > td { grid-row: 1; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(2) > td { grid-row: 2; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(3) > td { grid-row: 3; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(4) > td { grid-row: 4; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(select), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(a), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(input) { overflow: visible; }

/* bulletins mensuels (rangée de navigation + 3 rangées) : navigation en haut à droite, « Afficher » juste à côté des filtres */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)):has(> tbody > tr:first-child > td:nth-child(6)) > tbody { grid-template-columns: repeat(3, minmax(0, 1fr)) repeat(3, minmax(0, 1.1fr)); }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(1) > td:nth-child(4) { grid-column: 4; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(1) > td:nth-child(5) { grid-column: 5; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(2) > td:nth-child(5) { grid-row: 1; grid-column: 6; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(3) > td:nth-child(5) { grid-column: 4; }

/* étiquettes des champs */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { font-size: .95rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--esp-muted); line-height: 1.3; white-space: normal; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(select), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(a), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(input) { text-transform: none; letter-spacing: 0; font-weight: 400; white-space: normal; }

/* listes déroulantes */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) select {
  width: 100% !important; max-width: none !important; height: 2.75rem !important; padding: 0 .85rem !important; font-size: 1rem !important; color: var(--esp-text);
  background-color: #fff; border: 1px solid #cdd5e6 !important; border-radius: 10px !important; box-shadow: none !important; transition: border-color .15s, box-shadow .15s;
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) select:hover { border-color: #9fb0d4 !important; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) select:focus { outline: 0; border-color: var(--esp-accent) !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16) !important; }

/* action principale (Afficher / Actualiser) */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbShow"], html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbSave"] {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 2.75rem; box-sizing: border-box; padding: 0 1.2rem; border-radius: 10px;
  font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; text-decoration: none; white-space: nowrap;
  background: var(--esp-accent); color: #fff !important; border: 1px solid var(--esp-accent); box-shadow: 0 1px 2px rgba(37, 99, 235, .35); transition: background .15s;
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbShow"]:hover, html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbSave"]:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* actions secondaires : liens (version anglaise, bulletins de fin d'année…) et boutons de navigation */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) a:not([id$="lkbShow"]):not([id$="lkbSave"]), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) input[type="submit"] {
  display: flex; align-items: center; justify-content: center; width: 100% !important; height: auto; min-height: 2.9rem; box-sizing: border-box; padding: .4rem .8rem; margin: 0;
  font-size: .88rem; font-weight: 600; letter-spacing: 0; text-transform: none; text-decoration: none; text-align: center; line-height: 1.2; white-space: normal; overflow: visible;
  color: var(--esp-accent) !important; background: #fff; border: 1px solid #cdd5e6; border-radius: 10px; box-shadow: none; cursor: pointer; transition: background .15s, border-color .15s;
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) a:not([id$="lkbShow"]):not([id$="lkbSave"]):hover, html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) input[type="submit"]:hover { background: var(--esp-accent-soft); border-color: var(--esp-accent); }

/* fenêtres moins larges : disposition compacte (3 colonnes de champs, navigation sur une rangée, action principale pleine largeur) */
@media (max-width: 1300px) {
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)):has(> tbody > tr:first-child > td:nth-child(6)) > tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(1) > td:nth-child(-n+3), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(1) > td:nth-child(6),
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(2) > td:nth-child(4), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(3) > td:nth-child(4) { display: none; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(1) > td:nth-child(4) { grid-column: 1; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(1) > td:nth-child(5) { grid-column: 2; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(2) > td:nth-child(5) { grid-column: 3; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):has(> tbody > tr:nth-child(3)) > tbody > tr:nth-child(3) > td:nth-child(5) { grid-row: 4; grid-column: 1 / -1; }
}
@media (max-width: 1150px) {
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):not(:has(> tbody > tr:nth-child(3))):has(> tbody > tr:first-child > td:nth-child(5)):not(:has(> tbody > tr:first-child > td:nth-child(6))) > tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):not(:has(> tbody > tr:nth-child(3))):has(> tbody > tr:first-child > td:nth-child(5)):not(:has(> tbody > tr:first-child > td:nth-child(6))) > tbody > tr > td:nth-child(4) { display: none; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):not(:has(> tbody > tr:nth-child(3))):has(> tbody > tr:first-child > td:nth-child(5)):not(:has(> tbody > tr:first-child > td:nth-child(6))) > tbody > tr:nth-child(1) > td:nth-child(5) { display: none; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select):not(:has(> tbody > tr:nth-child(3))):has(> tbody > tr:first-child > td:nth-child(5)):not(:has(> tbody > tr:first-child > td:nth-child(6))) > tbody > tr:nth-child(2) > td:nth-child(5) { grid-row: 3; grid-column: 1 / -1; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { white-space: normal; font-size: .85rem; }
  html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(select), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(a), html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(input) { font-size: 1rem; }
}

/* boutons « Télécharger / Imprimer » : alignés sur le même bord droit que la barre de filtres */
.report-toolbar { margin-bottom: .9rem; }


/* en-tête de la carte « Sélection » : icône filtre + titre + trait de séparation (comme dans les maquettes) */
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select)::before, html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) .well:has(> table:not([id]))::before {
  content: "Sélection"; display: block; margin: -1.1rem -1.25rem 1.15rem; padding: .95rem 1.25rem .95rem 3.2rem; border-bottom: 1px solid var(--esp-border);
  font-size: 1.05rem; font-weight: 700; line-height: 1.2; letter-spacing: 0; text-transform: none; white-space: normal; color: var(--esp-text);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 2.2h12L9.4 7.8v5.4l-2.8 1.3V7.8z' fill='none' stroke='%232563eb' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 1.3rem center / 1.15rem 1.15rem;
}
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) .well:has(> table:not([id])) > table::before { display: none !important; }
html body.espace #page-content-wrapper:is(.gs-fp, :has(.report-host)) table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { width: auto !important; }

/* pages de saisie : quatre champs répartis, boutons d'action à la suite */
html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; grid-auto-columns: minmax(9rem, 15rem); }
/* actions (Enregistrer, Ajouter les élèves, Mettre à jour…) : rangée sous les quatre champs ; la note explicative passe dessous */
html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:nth-child(n+5) { grid-row: 3 !important; grid-column: auto !important; }
html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(1) > td:nth-child(n+5):not(:has(a)) { grid-row: 4 !important; grid-column: 1 / -1 !important; font-size: .85rem; font-weight: 400; color: var(--esp-muted); margin-top: -.1rem; }
html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(1) > td:nth-child(n+5):empty { display: none; }

/* ===== Pages de rapport et de saisie des notes : en-tête, cartes de statistiques, bandeau, boutons d'action (d'après les maquettes) ===== */
.gs-page-head { margin: 0 0 1.25rem; }
.gs-page-head h1 { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.15; color: var(--esp-text); letter-spacing: -.01em; }
.gs-page-head p { margin: .3rem 0 0; font-size: 1.05rem; color: var(--esp-muted); }

/* Pages de saisie (Prof, Direction, Réception) sur petit écran : champs empilés, libellé au-dessus de chaque champ (pairFilterLabels dans page-chrome.js) */
@media (max-width: 767px) {
  html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody, html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr { display: block !important; }
  html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { display: block !important; grid-row: auto !important; grid-column: auto !important; width: 100% !important; height: auto !important; margin: 0 0 .8rem !important; }
  html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td.gs-lab, html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:empty { display: none !important; }
  html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .25rem; font-size: .85rem; font-weight: 500; color: var(--esp-muted); }
  html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(> a[id$="lkbPrint"]) { display: flex !important; }
}

/* GridView avec une hauteur imposée en ligne (ex. Biblio/Livres : 1081 px) : les lignes s'étiraient quand il y a peu de résultats -> hauteur selon le contenu */
html body.espace #page-content-wrapper table[id][style*="height:"]:not([style*="height:auto"]) { height: auto !important; }

/* Biblio : lignes alternées gris foncé (#CCCCCC) et ligne sélectionnée bleu foncé imposées en ligne par les GridView -> teintes légères du site */
html body.espace tr[style*="background-color:#CCCCCC" i], html body.espace tr[style*="background-color:Gainsboro" i], html body.espace tr[style*="background-color:#DCDCDC" i] { background-color: #f6f8fc !important; }
html body.espace tr[style*="background-color:#000099" i] { background-color: var(--esp-accent-soft) !important; color: var(--esp-text) !important; }
html body.espace tr[style*="background-color:#000099" i] a { color: var(--esp-accent) !important; }

/* Prof/EvaluationClasse : Imprimer + PDF + Word sur une seule ligne (empilés dans la 4e colonne, ils agrandissaient la carte de sélection) */
html body.espace #page-content-wrapper.gs-fp-saisie table.gs-filterbar > tbody > tr > td:has(> a[id$="lkbPrint"]), html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]) > tbody > tr > td:has(> a[id$="lkbPrint"]) { display: flex !important; flex-wrap: nowrap; align-items: flex-end; gap: .5rem; overflow: visible; }
html body.espace #page-content-wrapper.gs-fp-saisie table:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(> a[id$="lkbPrint"]) > a { width: auto !important; max-width: calc((100% - 1rem) / 3) !important; min-width: 0 !important; flex: 1 1 0; padding-left: .4rem !important; padding-right: .4rem !important; white-space: nowrap; }

/* Admin : icône « + » des années / étapes plus discrète (138 px en ligne), tableau des rôles aligné en haut */
html body.espace #page-content-wrapper input[src*="icons8_calendar_plus"] { width: 4.5rem !important; height: auto !important; }
html body.espace #page-content-wrapper table:has(select[id$="ddlUser"]) { width: 100% !important; max-width: 60rem; }
html body.espace #page-content-wrapper table:has(select[id$="ddlUser"]) > tbody > tr > td { vertical-align: top !important; }
@media (max-width: 767px) {
  html body.espace #page-content-wrapper table:has(select[id$="ddlUser"]) > tbody > tr { display: block; }
  html body.espace #page-content-wrapper table:has(select[id$="ddlUser"]) > tbody > tr > td { display: block; width: 100% !important; border-top: 0; }
}

/* Réception/ClasseEleves : sélection, affectation des élèves (gauche) et liste de la classe à imprimer (droite) */
html body.espace #page-content-wrapper .ce-msg { display: block; margin: 0 0 .85rem; font-weight: 600; }
html body.espace #page-content-wrapper .ce-msg:empty { display: none; }
html body.espace #page-content-wrapper .ce-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.1rem; }
html body.espace #page-content-wrapper .ce-fields::before, html body.espace #page-content-wrapper .ce-fields::after { display: none; }  /* clearfix de .panel-body : deviendrait une cellule du flex */
html body.espace #page-content-wrapper .ce-layout > .panel > .panel-body { overflow-x: auto; }
html body.espace #page-content-wrapper .ce-field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 0 1 16rem; }
html body.espace #page-content-wrapper .ce-field.ce-grow { flex: 1 1 14rem; }
html body.espace #page-content-wrapper .ce-field.ce-act { flex: 0 0 auto; flex-direction: row; align-items: center; gap: .5rem; }  /* contient aussi les boutons PDF / Word ajoutés par report-export.js */
html body.espace #page-content-wrapper .ce-label { font-size: .95rem; font-weight: 500; line-height: 1.3; color: var(--esp-muted); }
html body.espace #page-content-wrapper .ce-field select { width: 100% !important; max-width: none !important; height: 2.75rem !important; padding: 0 .85rem !important; font-size: 1rem !important; color: var(--esp-text); background-color: #fff; border: 1px solid #cdd5e6 !important; border-radius: 10px !important; box-shadow: none !important; }
html body.espace #page-content-wrapper .ce-field select:focus { outline: 0; border-color: var(--esp-accent) !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16) !important; }
html body.espace #page-content-wrapper .ce-act a { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; box-sizing: border-box; padding: 0 1.1rem; margin: 0; border-radius: 10px; font-size: .98rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; }
html body.espace #page-content-wrapper .ce-act a[id$="lkbShow"] { background: var(--esp-accent); border: 1px solid var(--esp-accent); color: #fff !important; box-shadow: 0 1px 2px rgba(37, 99, 235, .35); }
html body.espace #page-content-wrapper .ce-act a[id$="lkbShow"]:hover { background: #1d4ed8; border-color: #1d4ed8; }
html body.espace #page-content-wrapper .ce-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
html body.espace #page-content-wrapper .ce-layout > .panel { margin-bottom: 0; }
html body.espace #page-content-wrapper .ce-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
html body.espace #page-content-wrapper .ce-head a { display: inline-flex; align-items: center; padding: .3rem .85rem; border: 1px solid #cdd5e6; border-radius: 10px; background: #fff; font-size: .9rem; font-weight: 600; text-decoration: none; }
html body.espace #page-content-wrapper .ce-head a:hover { background: var(--esp-accent-soft); border-color: var(--esp-accent); }
html body.espace #page-content-wrapper .ce-layout .table { width: 100% !important; margin: 0; }
html body.espace #page-content-wrapper .ce-layout .table select { width: 100% !important; min-width: 8rem; max-width: 14rem; }
html body.espace #page-content-wrapper .ce-layout .table input[id$="btnSave"] { margin-left: .5rem; padding: .3rem .8rem; border-radius: 8px; font-size: .85rem; font-weight: 600; background: var(--esp-accent); border: 1px solid var(--esp-accent); color: #fff; cursor: pointer; }
html body.espace #page-content-wrapper div[id="divPrint"] { overflow: auto !important; height: auto !important; max-height: 70vh; }
html body.espace #page-content-wrapper div[id="divPrint"] .table td:nth-child(2), html body.espace #page-content-wrapper div[id="divPrint"] .table th:nth-child(2) { white-space: nowrap; min-width: 12rem; }
html body.espace #page-content-wrapper div[id="divPrint"] .table td:empty { min-width: 2.2rem; }  /* colonnes vides conservées pour l'impression (pointage à la main) */
html body.espace #page-content-wrapper .ce-year { margin: 0 0 .6rem; font-size: .95rem; color: var(--esp-muted); }
html body.espace #page-content-wrapper .ce-listbar { margin: 0 0 1rem; }
@media (max-width: 1199px) { html body.espace #page-content-wrapper .ce-layout { grid-template-columns: minmax(0, 1fr); } }

/* anciennes pages (Direction) : titre nu et bandeau « logo + titre souligné » alignés sur le titre des pages de rapport */
html body.espace #page-content-wrapper .gs-pagetitle, html body.espace .gs-pagetitle { margin: 0 0 1.25rem; font-size: 2rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--esp-text); }
html body.espace table.gs-oldhead { width: auto !important; margin: 0 0 1rem; border: 0; background: transparent; }
html body.espace table.gs-oldhead td { border: 0 !important; padding: 0 1rem 0 0 !important; vertical-align: middle; background: transparent; }
html body.espace table.gs-oldhead img { width: 3.4rem; height: auto; }
html body.espace table.gs-oldhead span, html body.espace table.gs-oldhead label { font-size: 1.6rem !important; font-weight: 800 !important; line-height: 1.2; text-decoration: none !important; letter-spacing: -.01em; color: var(--esp-text); }
/* recherche (Enseignants, Inscription) : champ et bouton loupe sur la même ligne ; note « Fonction » discrète */
html body.espace #page-content-wrapper input[id$="txtSearch"] { display: inline-block; width: calc(100% - 3.6rem) !important; min-width: 8rem; vertical-align: middle; }
html body.espace input[id$="txtSearch"] + a.btn { vertical-align: middle; margin-left: .35rem; }
html body.espace span[id$="_Label6"] { font-size: .85rem; line-height: 1.35; color: var(--esp-muted) !important; }
/* Réception/RappTot : « Actualiser » et « Moyennes par niveau » côte à côte (empilés, ils agrandissaient la rangée et éloignaient les libellés des champs) */
html body.espace #page-content-wrapper table.gs-filterbar > tbody > tr > td:has(> a[id$="lkbShow"]):has(> input[id$="btMoysNiveau"]) { display: flex !important; gap: .5rem; align-items: stretch; white-space: nowrap; }
html body.espace #page-content-wrapper table.gs-filterbar > tbody > tr > td:has(> a[id$="lkbShow"]):has(> input[id$="btMoysNiveau"]) > a, html body.espace #page-content-wrapper table.gs-filterbar > tbody > tr > td:has(> a[id$="lkbShow"]):has(> input[id$="btMoysNiveau"]) > input { width: auto !important; flex: 0 1 auto; min-width: 0; min-height: 2.75rem; padding: .3rem .6rem; font-size: .82rem; }
/* note « Fonction » : sur sa propre rangée sous les champs (elle chevauchait le champ de recherche dans la barre de filtres) */
html body.espace #page-content-wrapper table.gs-filterbar > tbody > tr > td:has(> span[id$="_Label6"]) { grid-row: 3 !important; grid-column: 1 / span 6 !important; height: auto !important; overflow: visible; margin-top: .6rem; }
/* Réception/Enseignants : la rangée des champs a une cellule de plus que celle des libellés (colonne « Print ») -> alignement explicite libellé / champ */
html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody { grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1.4fr) auto auto !important; }
html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(1) > td:nth-child(1), html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(2) > td:nth-child(1) { grid-column: 1 !important; }
html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(1) > td:nth-child(3) { grid-column: 2 / span 2 !important; }
html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(2) > td:nth-child(3) { grid-column: 2 / span 2 !important; }
html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(1) > td:nth-child(5), html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(2) > td:nth-child(5) { grid-column: 4 !important; }
html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(2) > td:nth-child(6) { grid-column: 5 !important; }
html body.espace #page-content-wrapper table.gs-filterbar:has(> tbody > tr:nth-child(2) > td:nth-child(3) > a[id$="lkbPrint"]) > tbody > tr:nth-child(2) > td:nth-child(7) { grid-column: 6 !important; }
/* boutons « Nouvelle inscription » / « Annuler » dont la taille (79 x 36 px) et les couleurs sont imposées en ligne : texte entier, couleurs du site */
html body.espace a.btn[id$="lkbNew"][style*="width"], html body.espace a.btn[id$="lkbAnl"][style*="width"] {
  display: inline-flex !important; align-items: center; justify-content: center; min-height: 2.75rem; box-sizing: border-box;
  width: auto !important; height: auto !important; min-width: 79px; padding: .55rem 1.1rem; white-space: nowrap; line-height: 1.2; font-weight: 600; border-radius: 10px;
  background: var(--esp-accent) !important; border-color: var(--esp-accent) !important; color: #fff !important;
}
html body.espace a.btn[id$="lkbAnl"][style*="width"] { background: #fff !important; color: var(--esp-accent) !important; border-color: #cdd5e6 !important; }
/* RappTot : bornes « supérieur / inférieur » (deux champs de 43 px et un libellé souligné sur quatre lignes) */
html body.espace table:has(input[id$="txtSearchs"]) td[colspan] { white-space: nowrap !important; text-decoration: none !important; font-size: .95rem !important; }
html body.espace table:has(input[id$="txtSearchs"]) td[colspan] strong { font-weight: 500; color: var(--esp-muted); text-decoration: none; }
html body.espace #page-content-wrapper table:has(input[id$="txtSearchs"]) input[id$="txtSearchs"], html body.espace #page-content-wrapper table:has(input[id$="txtSearchs"]) input[id$="txtSearch"] { width: 5.5rem !important; min-width: 5.5rem !important; max-width: none !important; height: 2.75rem !important; padding: 0 .7rem; text-align: center; }
/* calendrier de l'horaire : en-têtes de jours sur deux lignes plutôt que superposés */
html body.espace .fc-day-header { white-space: normal !important; font-size: .82rem !important; padding: 6px 2px !important; text-align: center; line-height: 1.25; }

/* navigation des pages Bulletin (Direction) : deux rangées d'onglets segmentés — type de bulletin, puis groupe de classes */
.bul-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 1.1rem; }
.bul-seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; background: #e9edf5; border-radius: 12px; }
.bul-seg a { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 9px; font-size: .95rem; font-weight: 600; line-height: 1.2; color: var(--esp-muted); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.bul-seg a:hover, .bul-seg a:focus { color: var(--esp-text); text-decoration: none; background: rgba(255, 255, 255, .6); }
.bul-seg a.on, .bul-seg a.on:hover { background: #fff; color: var(--esp-accent); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
@media (max-width: 700px) { .bul-seg { display: flex; } .bul-seg a { flex: 1 1 auto; justify-content: center; white-space: normal; text-align: center; } }

.gs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; margin: 0 0 1.25rem; }
.gs-kpi { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 14px; box-shadow: var(--esp-shadow); min-width: 0; }
.gs-kpi-icon { flex: 0 0 3.4rem; width: 3.4rem; height: 3.4rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; font-size: 1.5rem; }
.gs-kpi-label { font-size: .98rem; color: var(--esp-muted); line-height: 1.25; }
.gs-kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.15; color: var(--esp-text); }
.gs-kpi-sub { font-size: .85rem; color: var(--esp-muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-kpi > div:last-child { min-width: 0; }
.gs-kpi-text { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.gs-kpi-sub + .gs-kpi-value { margin-top: .1rem; }
.gs-kpi-blue .gs-kpi-icon { background: #e8efff; color: #2563eb; }
.gs-kpi-green .gs-kpi-icon { background: #e3f6ea; color: #16a34a; }
.gs-kpi-amber .gs-kpi-icon { background: #fff1d6; color: #d97706; }
.gs-kpi-violet .gs-kpi-icon { background: #efe8ff; color: #7c3aed; }

.gs-lock { display: flex; align-items: center; gap: .85rem; margin: 0 0 1.25rem; padding: 1rem 1.25rem; background: #fff3cd; border: 1px solid #f2dfa7; border-radius: 12px; color: #5c4400; }
.gs-lock .bi { font-size: 1.15rem; }

/* carte « Notes » (grille de saisie) : titre = matière · période, renseigné par page-chrome.js */
html body.espace #page-content-wrapper.gs-fp-saisie #dvContents { background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 14px; box-shadow: var(--esp-shadow); padding: 0 1.25rem 1rem; margin: 0 0 1rem; overflow-x: auto; }
html body.espace #page-content-wrapper.gs-fp-saisie #dvContents::before { content: attr(data-title); display: block; margin: 0 -1.25rem 1rem; padding: .95rem 1.25rem; border-bottom: 1px solid var(--esp-border); font-size: 1.05rem; font-weight: 700; color: var(--esp-text); }

/* boutons d'action des rapports (Imprimer, Excel, Word, PDF) : contour coloré, icône à gauche */
.report-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin: 0 0 1rem; }
.gs-act { display: inline-flex; align-items: center; gap: .5rem; height: 2.6rem; padding: 0 1rem; border: 1px solid currentColor; border-radius: 10px; background: #fff; font-size: .98rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; transition: background .15s; white-space: nowrap; }
.gs-act:hover, .gs-act:focus { text-decoration: none; }
.gs-act .bi { font-size: 1.05rem; }
.gs-act-print { color: #475569; } .gs-act-print:hover { background: #f1f5f9; color: #334155; }
.gs-act-xls { color: #15803d; } .gs-act-xls:hover { background: #e8f6ee; color: #166534; }
.gs-act-doc { color: #2563eb; } .gs-act-doc:hover { background: #e8efff; color: #1d4ed8; }
.gs-act-pdf { color: #dc2626; } .gs-act-pdf:hover { background: #fdecec; color: #b91c1c; }

@media (max-width: 1300px) { .gs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .gs-kpis { grid-template-columns: 1fr; } }
@media print { .gs-kpis, .gs-page-head, .gs-lock { display: none !important; } }

/* ===== Barres de filtres des autres pages (tableaux « étiquettes / listes / boutons » marqués gs-filterbar par page-chrome.js) =====
   Même présentation que celle des rapports : carte, étiquettes grises, listes pleine largeur, boutons d'action ; les lignes de l'ancien tableau
   deviennent des rangées de grille, les colonnes se répartissent automatiquement. Les contrôles restent à leur place dans le tableau d'origine. */
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) {
  display: block; width: 100% !important; height: auto !important; box-sizing: border-box; background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 14px;
  box-shadow: var(--esp-shadow); padding: 1.1rem 1.25rem; margin: 0 0 1rem;
}
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select)::before {
  content: "Sélection"; display: block; margin: -1.1rem -1.25rem 1.15rem; padding: .95rem 1.25rem .95rem 3.2rem; border-bottom: 1px solid var(--esp-border);
  font-size: 1.05rem; font-weight: 700; line-height: 1.2; color: var(--esp-text);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 2.2h12L9.4 7.8v5.4l-2.8 1.3V7.8z' fill='none' stroke='%232563eb' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 1.3rem center / 1.15rem 1.15rem;
}
/* déjà dans une carte (well, panel-body) : pas de seconde carte ni d'en-tête */
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select).gs-in-card { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0 0 .5rem; border-radius: 0; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select).gs-in-card::before { display: none; }

html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody { display: grid; grid-auto-columns: minmax(min-content, 1fr); column-gap: 1.1rem; row-gap: .4rem; align-items: end; width: 100%; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr { display: contents; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { display: block; min-width: 0; width: auto !important; height: auto; padding: 0 !important; font-size: .95rem; font-weight: 500; color: var(--esp-muted); line-height: 1.3; white-space: normal; text-transform: none; letter-spacing: 0; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td.gs-empty { display: none; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(1) > td { grid-row: 1; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(2) > td { grid-row: 2; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(3) > td { grid-row: 3; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(4) > td { grid-row: 4; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(5) > td { grid-row: 5; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr:nth-child(6) > td { grid-row: 6; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(select), html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(a), html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(input), html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(button) { font-weight: 400; color: var(--esp-text); }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(.gs-act) { display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; grid-column: span 2; }
html body.espace #page-content-wrapper .well:has(table.gs-filterbar) { height: auto !important; min-height: 0 !important; }

html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) select {
  width: 100% !important; max-width: none !important; height: 2.75rem !important; padding: 0 .85rem !important; font-size: 1rem !important; color: var(--esp-text);
  background-color: #fff; border: 1px solid #cdd5e6 !important; border-radius: 10px !important; box-shadow: none !important; transition: border-color .15s, box-shadow .15s;
}
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) select:hover { border-color: #9fb0d4 !important; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) select:focus { outline: 0; border-color: var(--esp-accent) !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16) !important; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) input[type="text"], html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) input[type="date"], html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) input[type="number"] { width: 100% !important; height: 2.75rem; padding: 0 .85rem; font-size: 1rem; border: 1px solid #cdd5e6; border-radius: 10px; }

/* liens d'action (Afficher, Actualiser, Archiver…) : boutons discrets ; « Afficher » / « Actualiser » : bouton principal */
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a:not(.btn):not(.gs-act) {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 2.75rem; box-sizing: border-box; padding: 0 1rem; margin: 0;
  font-size: .95rem; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.2; white-space: nowrap;
  color: var(--esp-accent) !important; background: #fff; border: 1px solid #cdd5e6; border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s;
}
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a:not(.btn):not(.gs-act):hover { background: var(--esp-accent-soft); border-color: var(--esp-accent); }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbShow"], html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbActualiser"], html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbRefresh"] { background: var(--esp-accent); color: #fff !important; border-color: var(--esp-accent); font-weight: 700; box-shadow: 0 1px 2px rgba(37, 99, 235, .35); }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbShow"]:hover, html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbActualiser"]:hover, html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a[id$="lkbRefresh"]:hover { background: #1d4ed8; border-color: #1d4ed8; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) input[type="submit"], html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) a.btn:not(.gs-act) { min-height: 2.75rem; border-radius: 10px; font-weight: 600; }
html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) input[type="submit"] { width: 100% !important; white-space: normal; }

/* zones d'impression à hauteur fixe avec défilement forcé dans les deux sens (style en dur dans les pages) : défilement seulement si nécessaire,
   hauteur adaptée au contenu et à la fenêtre */
html body.espace #page-content-wrapper div[id="dvContents"][style*="overflow: scroll"], html body.espace #page-content-wrapper div[id="dvContents"][style*="overflow:scroll"] {
  overflow: auto !important; height: auto !important; max-height: 78vh;
}

/* petit écran : champs empilés, le libellé passe au-dessus de chaque champ (pairLabels dans page-chrome.js) */
@media (max-width: 767px) {
  html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody, html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr { display: block; }
  html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td { display: block; margin: 0 0 .8rem; height: auto !important; grid-row: auto !important; }
  html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td.gs-lab { display: none; }
  html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .25rem; font-size: .85rem; font-weight: 500; color: var(--esp-muted); }
  html body.espace #page-content-wrapper table.gs-filterbar:not([id]):not(.rep-table):has(> tbody > tr > td > select) > tbody > tr > td:has(.gs-act) { flex-wrap: wrap; }
}
/* grille de la conduite : largeur imposée dans la page (900 px) */
@media (max-width: 1199px) { html body.espace #page-content-wrapper.gs-fp-conduite table[id$="gvEvaluation"] { width: 100% !important; } }

/* texte d'invitation « Cliquer sur (Ajouter)… » : police Britannic Bold verte en dur dans les pages -> police et couleurs du site */
html body.espace [style*="Britannic"] { font-family: inherit !important; font-size: 1.1rem !important; font-weight: 600 !important; color: var(--esp-muted) !important; }

/* ===== Pages Absences et retards (Discipline, Réception, Prof) : mise en page adaptative (page-chrome.js pose gs-fp-absence) =====
   Bureau : colonne de filtres + calendrier à gauche, grille à droite. Tablette : une seule colonne, grille avec défilement horizontal.
   Mobile : chaque élève devient une carte (le libellé de la colonne précède chaque valeur). */
html body.espace #page-content-wrapper.gs-fp-absence .row:has(> .col-md-3) { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin: 0; }
html body.espace #page-content-wrapper.gs-fp-absence .row:has(> .col-md-3)::before, html body.espace #page-content-wrapper.gs-fp-absence .row:has(> .col-md-3)::after { display: none; }
html body.espace #page-content-wrapper.gs-fp-absence .row:has(> .col-md-3) > [class*="col-md-"] { float: none; width: auto; max-width: 100%; padding: 0; min-width: 0; }
html body.espace #page-content-wrapper.gs-fp-absence .row:has(> .col-md-3) > .col-md-9 { overflow-x: auto; }

/* colonne des filtres : carte (page Prof : pas de carte d'origine), listes pleine largeur, étiquettes au-dessus des champs */
html body.espace #page-content-wrapper.gs-fp-absence .col-md-3:not(:has(.panel)) { background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 14px; box-shadow: var(--esp-shadow); padding: 1rem 1.25rem; }
html body.espace #page-content-wrapper.gs-fp-absence .col-md-3 span[style*="font-weight:bold"], html body.espace #page-content-wrapper.gs-fp-absence .col-md-3 span[style*="font-weight: bold"] { display: block; margin: .6rem 0 .25rem; font-size: .95rem; font-weight: 500 !important; color: var(--esp-muted); }
html body.espace #page-content-wrapper.gs-fp-absence .col-md-3 select { width: 100% !important; max-width: none !important; height: 2.75rem !important; padding: 0 .85rem !important; font-size: 1rem !important; border: 1px solid #cdd5e6 !important; border-radius: 10px !important; }
html body.espace #page-content-wrapper.gs-fp-absence .col-md-3 a.btn-primary { display: block; width: 100%; margin-top: 1rem; padding: .7rem 1rem; text-align: center; font-weight: 700; border-radius: 10px; }
html body.espace #page-content-wrapper.gs-fp-absence .col-md-3 br { display: none; }
html body.espace #page-content-wrapper.gs-fp-absence table[id$="Calendar1"] { width: 100% !important; max-width: 24rem; margin-top: 1rem; }
/* la page Prof porte déjà son titre dans le contenu : l'en-tête de page suffit */
html body.espace #page-content-wrapper.gs-fp-absence div[id$="UpdatePanel1"] > h3:first-child { display: none; }

/* grille */
html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] { width: 100%; margin-bottom: 1rem; }
html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] th, html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] td { padding: .45rem .5rem !important; font-size: .9rem; }
html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] td:nth-child(3), html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] td:nth-child(4) { min-width: 7rem; }
html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] input[type="checkbox"] { width: 1.15rem; height: 1.15rem; vertical-align: middle; }
html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] td > a[id*="lkb"], html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] td > a[id*="LinkButton"] { margin-left: .25rem; color: var(--esp-muted); font-weight: 400; text-decoration: none; }
html body.espace #page-content-wrapper.gs-fp-absence table[id$="gvEtudiants"] input[type="text"] { width: 100% !important; min-width: 8rem; height: 2.4rem; padding: 0 .6rem; border: 1px solid #cdd5e6; border-radius: 8px; }
html body.espace #page-content-wrapper.gs-fp-absence .col-md-9 a.btn-primary { padding: .6rem 1.2rem; font-weight: 700; border-radius: 10px; }

/* sous 1500 px la colonne de filtres passerait devant 10 colonnes de grille : les filtres passent au-dessus, la grille prend toute la largeur */
@media (max-width: 1499px) {
  html body.espace #page-content-wrapper.gs-fp-absence .row:has(> .col-md-3) { grid-template-columns: minmax(0, 1fr); }
  html body.espace #page-content-wrapper.gs-fp-absence .row:has(> .col-md-3) > .col-md-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); column-gap: 1rem; align-items: start; }
  html body.espace #page-content-wrapper.gs-fp-absence .col-md-3 > *, html body.espace #page-content-wrapper.gs-fp-absence .col-md-3 .panel { min-width: 0; }
  html body.espace #page-content-wrapper.gs-fp-absence table[id$="Calendar1"] { max-width: 22rem; }
}

@media (max-width: 1199px) {
  /* grille : une carte par élève (le libellé de la colonne précède chaque valeur) */
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack, html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack tbody, html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack tr, html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack td { display: block; width: 100% !important; box-sizing: border-box; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack tr:first-child { display: none; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .85rem; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack tbody { display: contents; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack tr { background: var(--esp-surface) !important; border: 1px solid var(--esp-border) !important; border-radius: 12px; padding: .6rem .9rem; margin: 0; box-shadow: var(--esp-shadow); }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack td { display: flex; align-items: center; justify-content: flex-start; gap: .5rem; padding: .45rem 0 !important; border: 0 !important; text-align: right !important; background: transparent !important; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack td::before { content: attr(data-label); flex: 1 1 auto; margin-right: auto; font-size: .85rem; font-weight: 600; color: var(--esp-muted); text-align: left; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack td:not([data-label])::before { display: none; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack td:not([data-label]) { justify-content: flex-start; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack td input[type="text"] { max-width: 60%; }
}

@media (max-width: 767px) {
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-page-head h1 { font-size: 1.5rem; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-page-head p { font-size: .95rem; }
  html body.espace #page-content-wrapper:is(.gs-fp-absence, .gs-fp-conduite) .gs-stack { grid-template-columns: minmax(0, 1fr); }
}

/* fenêtres de dialogue (« Dossier de l'élève », etc.) : centrées à l'écran, horizontalement et verticalement, jamais plus grandes que la fenêtre.
   Le cadre du dossier avait une largeur fixe de 1000 px (zoom 0,7) : il prend maintenant la largeur de la fenêtre et une hauteur adaptée. */
html body.espace .modal.fade[role="dialog"] { text-align: center; padding: 0 !important; overflow-y: auto; }
html body.espace .modal.fade[role="dialog"]::before { content: ""; display: inline-block; height: 100%; vertical-align: middle; }
html body.espace .modal.fade[role="dialog"] .modal-dialog { display: inline-block; vertical-align: middle; text-align: left; width: min(600px, calc(100vw - 2rem)); max-width: none; margin: 1rem auto; left: auto; right: auto; padding-top: 0; padding-bottom: 0; }
html body.espace .modal.fade[role="dialog"] .modal-dialog.modal-lg { width: min(1000px, calc(100vw - 2rem)); }
html body.espace .modal.fade[role="dialog"] .modal-dialog.modal-sm { width: min(320px, calc(100vw - 2rem)); }
html body.espace .modal.fade[role="dialog"] .modal-content { max-height: calc(100vh - 2rem); display: flex; flex-direction: column; border: 0; border-radius: 14px; box-shadow: 0 20px 50px rgba(15, 23, 42, .35); overflow: hidden; }
html body.espace .modal.fade[role="dialog"] .modal-body { overflow: auto; }
html body.espace .modal-body iframe[style*="width: 1000px"], html body.espace .modal-body iframe[style*="width:1000px"] { zoom: 1 !important; width: 100% !important; height: calc(100vh - 14rem) !important; min-height: 18rem; display: block; }

/* Impression : deux bulletins par page A4 */
@media print {
  .rep-sheet.ba-sheet { page-break-after: auto; break-after: auto; page-break-inside: avoid; break-inside: avoid; margin: 0 0 7mm; }
  .rep-sheet.ba-sheet:nth-of-type(2n) { page-break-after: always; break-after: page; margin-bottom: 0; }
  .rep-sheet.ba-sheet:last-of-type { page-break-after: auto; break-after: auto; }
  html body .ba-table { font-size: 1.45cqw; }
}

/* ---------- Page d'accueil (Default.aspx) ---------- */
.home-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  padding: 2.25rem 2.5rem; margin: 0 0 1.75rem; border-radius: 18px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #2f5fe0 0%, rgba(47, 95, 224, 0) 55%), linear-gradient(135deg, #0b1220 0%, #16264a 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}
.home-hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .05); pointer-events: none; }
.home-hero-text { position: relative; z-index: 1; flex: 1 1 320px; }
body.espace .home-hero h1 { margin: 0 0 .35rem; font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.home-hero .lead { margin: 0 0 1.25rem; font-size: 1.2rem; color: #c3cbdb; }
.home-hero .btn-primary { background: #fff; border-color: #fff; color: var(--esp-nav); font-weight: 600; padding: .55rem 1.2rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.home-hero .btn-primary:hover, .home-hero .btn-primary:focus { background: var(--esp-accent-soft); border-color: var(--esp-accent-soft); color: var(--esp-accent); }
.home-hero-img { position: relative; z-index: 1; flex: 0 0 auto; width: 210px; max-width: 100%; height: auto; padding: 8px; background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transform: rotate(2deg); }

.home-section-title { margin: 0 0 .85rem; font-size: .78rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--esp-muted) !important; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.home-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .85rem; padding: 1.15rem 1.15rem 1rem;
  background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 14px; box-shadow: var(--esp-shadow);
  color: var(--esp-text); text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s;
  --tone: var(--esp-accent); --tone-soft: var(--esp-accent-soft);
}
.home-tile.tone-blue   { --tone: #2563eb; --tone-soft: #e8efff; }
.home-tile.tone-green  { --tone: #15803d; --tone-soft: #e3f6ea; }
.home-tile.tone-amber  { --tone: #b45309; --tone-soft: #fdf1dc; }
.home-tile.tone-rose   { --tone: #be185d; --tone-soft: #fde7f1; }
.home-tile.tone-violet { --tone: #6d28d9; --tone-soft: #efe8fd; }
.home-tile > i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--tone-soft); color: var(--tone); font-size: 1.35rem; }
.home-tile > span { font-weight: 600; line-height: 1.3; color: var(--esp-text); }
.home-tile > b { position: absolute; top: 1rem; right: 1rem; font-size: 1rem; font-weight: 400; color: var(--esp-muted); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s, color .15s; }
.home-tile:hover, .home-tile:focus { transform: translateY(-3px); border-color: var(--tone); box-shadow: 0 10px 26px rgba(16, 24, 40, .12); color: var(--esp-text); }
.home-tile:hover > b, .home-tile:focus > b { opacity: 1; transform: none; color: var(--tone); }

.home-card { background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: 14px; box-shadow: var(--esp-shadow); margin-bottom: 1.25rem; overflow: hidden; }
.home-card-head { padding: .95rem 1.25rem; border-bottom: 1px solid var(--esp-border); }
.home-card-head h2 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.05rem; }
.home-card-head h2 > i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--esp-accent-soft); color: var(--esp-accent); font-size: 1rem; }
.home-card-body { padding: 1rem 1.25rem 1.25rem; overflow-x: auto; }
.home-card-foot { padding: .6rem 1.25rem; border-top: 1px solid var(--esp-border); background: #fafbff; color: var(--esp-muted); font-size: .8rem; }
/* Historique de connexion (Administration) : agent utilisateur discret et tronqué */
html body.espace .hist-ua { max-width: 20rem; color: var(--esp-muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Bandeau compact des pages Default de section */
.home-hero.home-hero-sm { padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
body.espace .home-hero-sm h1 { margin: 0; font-size: 1.7rem; }
.home-hero-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.9rem; border: 1px solid rgba(255, 255, 255, .18); }
.home-news { padding-left: 1rem; border-left: 3px solid var(--esp-accent); }
.home-news h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.home-news p { margin: 0; color: var(--esp-muted); }
@media (max-width: 767px) {
  .home-hero { padding: 1.5rem 1.25rem; }
  body.espace .home-hero h1 { font-size: 1.9rem; }
  .home-hero-img { width: 150px; transform: none; }
}

/* ---------- Impression ---------- */
/* ---------- Fenêtres de dialogue autonomes (Prof / Discipline : dlgDossier) ---------- */
body.espace-dlg { margin: 0; padding: 1rem; background: var(--esp-bg); color: var(--esp-text); font: 14.5px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body.espace-dlg form > div:not(.aspNetHidden) { max-width: 600px; margin: 0 auto; background: var(--esp-surface); border: 1px solid var(--esp-border); border-radius: var(--esp-radius); box-shadow: var(--esp-shadow); padding: 1rem 1.25rem; }
body.espace-dlg table { width: 100% !important; border-collapse: collapse; margin: 0 0 .75rem; }
body.espace-dlg td, body.espace-dlg th { padding: .35rem .5rem; vertical-align: top; }
body.espace-dlg table[cellpadding] > tbody > tr > td { background: #f8faff !important; border-radius: 8px; color: var(--esp-text) !important; }
body.espace-dlg table[rules] { border: 1px solid var(--esp-border) !important; border-radius: 8px; overflow: hidden; }
body.espace-dlg table[rules] th { background: #f8faff; color: var(--esp-muted); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: left; border: 0 !important; border-bottom: 1px solid var(--esp-border) !important; }
body.espace-dlg table[rules] td { border: 0 !important; border-bottom: 1px solid var(--esp-border) !important; }
body.espace-dlg input[type="text"], body.espace-dlg textarea { border: 1px solid #d5dbe8; border-radius: 8px; background: #fff; color: var(--esp-text); padding: .4rem .65rem; font: inherit; box-sizing: border-box; max-width: 100%; }
body.espace-dlg textarea { width: 100% !important; margin: .25rem 0 .5rem; }

/* Admin/dlgEtudiant : fiche d'un élève (consultation / modification) */
body.espace-dlg .fe-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin: 0 0 .75rem; }
body.espace-dlg .fe-name { margin: 0; font-size: 1.45rem; font-weight: 800; line-height: 1.2; color: var(--esp-text); }
body.espace-dlg .fe-sub { margin: .2rem 0 0; color: var(--esp-muted); font-size: .95rem; }
body.espace-dlg .fe-title { margin: 1rem 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--esp-muted); }
body.espace-dlg table.fe-table { width: 100% !important; border: 1px solid var(--esp-border); border-radius: 8px; border-collapse: separate; border-spacing: 0; overflow: hidden; margin: 0 0 .5rem; }
body.espace-dlg .fe-table th { width: 22%; background: #f8faff; color: var(--esp-muted); font-size: .85rem; font-weight: 600; text-align: left; border-bottom: 1px solid var(--esp-border); }
body.espace-dlg .fe-table td { border-bottom: 1px solid var(--esp-border); word-break: break-word; }
body.espace-dlg .fe-table th, body.espace-dlg .fe-table td { vertical-align: middle; height: 2.4rem; }
body.espace-dlg .fe-head a.btn, body.espace-dlg .fe-actions a.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.5rem; padding: 0 1.1rem; border: 1px solid #cdd5e6; border-radius: 10px; background: #fff; color: var(--esp-accent); font-weight: 600; text-decoration: none; cursor: pointer; }
body.espace-dlg .fe-head a.btn:hover, body.espace-dlg .fe-actions a.btn:hover { background: var(--esp-accent-soft); border-color: var(--esp-accent); }
body.espace-dlg .fe-actions a.btn-primary { background: var(--esp-accent); border-color: var(--esp-accent); color: #fff; }
body.espace-dlg .fe-actions a.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
body.espace-dlg .fe-table tr:last-child > th, body.espace-dlg .fe-table tr:last-child > td { border-bottom: 0; }
body.espace-dlg .fe-edit input[type="text"] { width: 100%; }
body.espace-dlg .fe-actions { display: flex; gap: .6rem; margin: 1rem 0 0; }
body.espace-dlg .fe-msg { display: block; margin: .75rem 0 0; font-weight: 600; color: var(--esp-muted); }
body.espace-dlg .fe-msg:empty { display: none; }
body.espace-dlg .fe-empty { margin: 0; color: var(--esp-muted); }
body.espace-dlg input:focus, body.espace-dlg textarea:focus { border-color: var(--esp-accent); box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); outline: 0; }
body.espace-dlg a { color: var(--esp-accent); text-decoration: none; }
body.espace-dlg a:hover { text-decoration: underline; }
body.espace-dlg a.btn-primary { display: inline-block; background: var(--esp-accent); color: #fff; border-radius: 8px; padding: .3rem .85rem; font-weight: 600; }
body.espace-dlg a.btn-primary:hover { background: #1d4ed8; text-decoration: none; }

@media print {
  @page { size: A4; margin: 10mm; }
  html body.espace { background: #fff; }
  .navbar, #sidebar-wrapper, .no-print, .hidden-print, .report-toolbar, #menu-toggle { display: none !important; }
  html body.espace .body-content, html body.espace .body-content:has(#wrapper) { padding: 0; }
  html body.espace #wrapper, html body.espace #page-content-wrapper { padding: 0 !important; position: static !important; margin: 0 !important; }
  .rep-sheet { border: 0; box-shadow: none; margin: 0; padding: 0; max-width: none; }
  html body.espace .panel { box-shadow: none; border: 0; }
}
