/* INAES - Charte UI partagée v1.1
   Couleurs : Pantone Dark Blue, Pantone 320C, Pantone 241C */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  
  --bleu:             #27348B;   /* Pantone Dark Blue */
  --turquoise:        #009D99;   /* Pantone 320C */
  --violet:           #951B81;   /* Pantone 241C */

  
  --bleu-fonce:       #1d2870;
  --bleu-moyen:       #3d4faa;
  --bleu-clair:       #eceef8;
  --turquoise-fonce:  #007a77;
  --turquoise-clair:  #e0f5f4;
  --violet-fonce:     #6e1460;
  --violet-clair:     #f4e8f1;

  
  --texte:            #1a1e3d;
  --muted:            #6b7299;
  --fond-page:        #f4f5fb;
  --surface:          #ffffff;
  --surface-2:        #f8f9fd;
  --bordure:          #d4d8ee;
  --bordure-lt:       #e8eaf4;

  
  --rouge:            #c0392b;
  --rouge-lt:         #fdecea;
  --jaune:            #9a6b10;
  --jaune-lt:         #fdf8ec;
  --vert:             #1a7a4a;
  --vert-lt:          #e6f4ec;

  
  --radius:           10px;
  --radius-sm:        7px;
  --shadow:           0 1px 3px rgba(39,52,139,.06), 0 4px 14px rgba(39,52,139,.08);
  --shadow-lg:        0 8px 28px rgba(39,52,139,.14);
  --shadow-xl:        0 20px 60px rgba(39,52,139,.20);

  
  --ease-out:         cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out:      cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring:      cubic-bezier(0.34, 1.2, 0.64, 1);
  --ease-drawer:      cubic-bezier(0.32, 0.72, 0, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Greycliff CF', 'DM Sans', sans-serif;
  font-weight: 400;
  background-color: var(--fond-page);
  color: var(--texte);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Themes sombres par page */

/* Fonds sombres dérivés des Pantone INAES */
body.page-dashboard {
  background: linear-gradient(155deg, #162258 0%, #090e28 100%);
  background-attachment: fixed;
  overflow: hidden;
}
/* Login et historique - même bleu nuit que dashboard */
body.page-login,
body.page-historique {
  background: linear-gradient(155deg, #162258 0%, #090e28 100%);
  background-attachment: fixed;
}
body.page-login .site-header,
body.page-historique .site-header {
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid rgba(255,255,255,.16);
}
body.page-login    .site-header::before,
body.page-historique .site-header::before { background: none; }
body.page-login    .site-header::after,
body.page-historique .site-header::after  { background: linear-gradient(90deg, #27348B 0%, rgba(39,52,139,.2) 100%); }


/* Page connexion - fond transparent pour laisser voir les points */
body.page-login .login-page {
  background: transparent;
}
body.page-login .login-page::before,
body.page-login .login-page::after { display: none; }

/* Carte login - glassmorphisme */
body.page-login .login-card {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 48px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}
body.page-login .login-logo-bar {
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
body.page-login .login-eyebrow { color: rgba(255,255,255,0.55); }
body.page-login .login-title   { color: #fff; }
body.page-login .field-label   { color: rgba(255,255,255,0.75); }
body.page-login input[type="password"],
body.page-login input[type="text"],
body.page-login input[type="email"] {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}
body.page-login input[type="password"]::placeholder,
body.page-login input[type="text"]::placeholder,
body.page-login input[type="email"]::placeholder    { color: rgba(255,255,255,0.3); }
body.page-login input[type="password"]:focus,
body.page-login input[type="text"]:focus,
body.page-login input[type="email"]:focus {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

/* Wrapper champ + œil */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  width: 100%;
  padding-right: 44px;
}
.pw-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 150ms;
}
.pw-toggle:hover { color: rgba(255,255,255,0.85); }
/* Mode fond clair (page login light si jamais) */
body:not(.page-login) .pw-toggle { color: var(--muted); }
body:not(.page-login) .pw-toggle:hover { color: var(--bleu); }
body.page-login .login-footer { color: rgba(255,255,255,0.3); }

/* Textes clairs pour historique */
body.page-historique .section-title   { color: #fff; }
body.page-historique .section-eyebrow { opacity: .9; }
body.page-historique .section-subtitle { color: rgba(255,255,255,.6); }
body.page-historique .container,
body.page-historique .container-lg { position: relative; z-index: 1; }

/* Historique - table en glassmorphisme (cohérent DA sombre) */
body.page-historique .history-table-wrap {
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 12px 48px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body.page-historique .history-table {
  background: transparent;
}
body.page-historique .history-table th {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.78);
  border-bottom-color: rgba(255,255,255,.12);
}
body.page-historique .history-table td {
  background: transparent;
  color: rgba(255,255,255,.88);
  border-bottom-color: rgba(255,255,255,.10);
}
body.page-historique .history-table tr:hover td {
  background: rgba(255,255,255,.04);
}
body.page-historique .extrait-cell { color: rgba(255,255,255,.72); }

/* Historique - colonne fichiers : hauteur fixe repli, depliable */
.history-files-td {
  max-width: 220px;
  width: 220px;
  vertical-align: top;
  font-size: .78rem;
  color: rgba(255,255,255,.68);
}
.history-files {
  position: relative;
}
.history-files-inner {
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.history-files--collapse .history-files-inner {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-height: 2.8em;
}
.history-files-cb:checked ~ .history-files-inner {
  -webkit-line-clamp: unset;
  display: block;
  max-height: none;
  overflow: visible;
}
.history-files-cb {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.history-files-toggle {
  display: inline-block;
  margin-top: 5px;
  font-size: .72rem;
  font-weight: 600;
  color: rgba(0, 210, 200, .88);
  cursor: pointer;
  user-select: none;
}
.history-files-toggle:hover {
  color: #9efaf0;
}
.history-files-toggle .hist-collapse {
  display: none;
}
.history-files-cb:checked ~ .history-files-toggle .hist-expand {
  display: none;
}
.history-files-cb:checked ~ .history-files-toggle .hist-collapse {
  display: inline;
}
.history-files-cb:focus-visible ~ .history-files-toggle {
  outline: 2px solid rgba(0, 157, 153, .55);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Historique - filtres en verre */
body.page-historique .filter-btn {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.70);
}
body.page-historique .filter-btn:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.26);
  color: rgba(255,255,255,.90);
}
body.page-historique .filter-btn.active {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.30);
  color: rgba(255,255,255,.92);
}
body.page-historique .filter-btn.teal.active {
  background: rgba(0,157,153,.22);
  border-color: rgba(0,157,153,.45);
  color: #9af3f0;
}
body.page-historique .filter-btn.violet.active {
  background: rgba(149,27,129,.22);
  border-color: rgba(149,27,129,.45);
  color: #f0b0e8;
}

/* Historique - badges outil plus lisibles sur fond sombre */
body.page-historique .outil-badge.grilles      { background: rgba(126,181,255,.18); color: #a8cfff; }
body.page-historique .outil-badge.observations { background: rgba(93,221,217,.18); color: #8ef0ee; }
body.page-historique .outil-badge.ag           { background: rgba(216,127,208,.18); color: #e8a8e0; }

body.page-grilles {
  /* Dérivé Pantone 072C #27348B - version nuit */
  background: linear-gradient(155deg, #162258 0%, #090e28 100%);
  background-attachment: fixed;
}
body.page-observations {
  /* Dérivé Pantone 320C #009D99 - version nuit, hue 178° conservé */
  background: linear-gradient(155deg, #005855 0%, #001f1e 100%);
  background-attachment: fixed;
}
body.page-ag {
  /* Dérivé Pantone 241C #951B81 - version nuit */
  background: linear-gradient(155deg, #3d0f30 0%, #180510 100%);
  background-attachment: fixed;
}

/* Dot grid - blur léger */
#dot-grid-bg canvas,
#page-dot-bg canvas {
  filter: blur(0.8px);
}

/* Dot grid fixe - présent sur toutes les pages */
#page-dot-bg {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Le contenu des outils passe au-dessus du dot grid fixe */
body.page-grilles      .container,
body.page-observations .container,
body.page-ag           .container {
  position: relative;
  z-index: 1;
}

/* Header verre blanc casse sur pages sombres */

body.page-dashboard .site-header,
body.page-grilles   .site-header,
body.page-observations .site-header,
body.page-ag        .site-header {
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 1px 24px rgba(0,0,0,0.18);
}
body.page-dashboard    .site-header::before,
body.page-grilles      .site-header::before,
body.page-observations .site-header::before,
body.page-ag           .site-header::before { background: none; }

/* Ligne accent couleur Pantone par outil */
body.page-dashboard    .site-header::after { background: linear-gradient(90deg, #009D99 0%, rgba(0,157,153,.15) 100%); }
body.page-grilles      .site-header::after { background: linear-gradient(90deg, #27348B 0%, rgba(39,52,139,.2) 100%); }
body.page-observations .site-header::after { background: linear-gradient(90deg, #009D99 0%, rgba(0,157,153,.2) 100%); }
body.page-ag           .site-header::after { background: linear-gradient(90deg, #951B81 0%, rgba(149,27,129,.2) 100%); }

.site-header {
  background: var(--bleu);
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, var(--bleu) 0%, var(--bleu-moyen) 100%);
  pointer-events: none;
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--turquoise), rgba(0,157,153,.4));
}

.header-logo {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: opacity 200ms;
}
.header-logo img,
.header-logo svg { height: 46px; width: auto; }

@media (hover: hover) and (pointer: fine) {
  .header-logo:hover { opacity: .8; }
}

.header-divider {
  width: 1px;
  height: 34px;
  background: rgba(255,255,255,.18);
  margin: 0 24px;
  position: relative;
  flex-shrink: 0;
}

.header-info {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.header-module {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--turquoise);
}
.header-module.violet { color: #c05bb0; }

.header-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,.92);
  letter-spacing: .01em;
}

.header-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.header-nav a {
  font-size: .75rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 5px;
  transition: color 150ms, background 150ms;
  letter-spacing: .02em;
}
@media (hover: hover) and (pointer: fine) {
  .header-nav a:hover {
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.1);
  }
}
.header-nav a.active {
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.1);
}
.header-nav .nav-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.14);
  margin: 0 4px;
}
.header-nav a.nav-has-notif {
  position: relative;
  padding-right: 16px;
}
.header-nav .nav-notif-dot {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e85d4a;
  box-shadow: 0 0 0 2px rgba(18, 26, 72, .95);
  pointer-events: none;
}

.container    { max-width: 980px;  margin: 0 auto; padding: 48px 32px 80px; }
.container-lg { max-width: 1140px; margin: 0 auto; padding: 48px 32px 80px; }

/* Conteneur pleine page dashboard */
.dashboard-fullpage {
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 32px;
  gap: 52px;
  background: linear-gradient(155deg, var(--bleu) 0%, #1d2870 50%, #131d5e 100%);
}

.dashboard-text {
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.dashboard-text .section-eyebrow {
  color: var(--turquoise);
  margin-bottom: 12px;
  font-size: .72rem;
  letter-spacing: .22em;
}

.dashboard-hero-persona-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.dashboard-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
  opacity: 0;
  flex-shrink: 0;
}

.dashboard-hero-persona {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .88);
  margin: 0;
  letter-spacing: .02em;
  opacity: 0;
}

.dashboard-hero-title {
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -.02em;
  line-height: 1.15;
  opacity: 0;
}

.dashboard-hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  max-width: 480px;
  line-height: 1.7;
  opacity: 0;
  margin: 0 auto;
}

/* Glassmorphisme dashboard */

@keyframes blob-morph {
  0%, 100% { border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
  25%       { border-radius: 38% 62% 58% 42% / 48% 62% 38% 52%; }
  50%       { border-radius: 54% 46% 38% 62% / 42% 54% 46% 58%; }
  75%       { border-radius: 46% 54% 64% 36% / 56% 36% 64% 44%; }
}

/* Cartes glassmorphisme sur fond bleu */
.page-dashboard .tool-card {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}

.page-dashboard .tool-card-name {
  color: #fff;
}

.page-dashboard .tool-card-desc {
  color: rgba(255, 255, 255, 0.65);
}

.page-dashboard .tool-card.bleu   .tool-card-accent { color: #7eb5ff; }
.page-dashboard .tool-card.teal   .tool-card-accent { color: #5dddd9; }
.page-dashboard .tool-card.violet .tool-card-accent { color: #d87fd0; }

/* Icônes colorées par thème sur glass cards */
.page-dashboard .tool-card.bleu   .tool-card-icon { color: #7eb5ff; }
.page-dashboard .tool-card.teal   .tool-card-icon { color: #5dddd9; }
.page-dashboard .tool-card.violet .tool-card-icon { color: #c060b8; }

/* Hover : même couleur, pas de dérive */
@media (hover: hover) and (pointer: fine) {
  .page-dashboard .tool-card.bleu:hover   .tool-card-icon { color: #a8cfff; }
  .page-dashboard .tool-card.teal:hover   .tool-card-icon { color: #8ef0ee; }
  .page-dashboard .tool-card.violet:hover .tool-card-icon { color: #d87fd0; }
}

.page-dashboard .tool-card.bleu   .tool-card-cta { background: rgba(126,181,255,0.15); color: #a8cfff; }
.page-dashboard .tool-card.teal   .tool-card-cta { background: rgba(93,221,217,0.15);  color: #8ef0ee; }
.page-dashboard .tool-card.violet .tool-card-cta { background: rgba(216,127,208,0.15); color: #e8a8e0; }

@media (hover: hover) and (pointer: fine) {
  .page-dashboard .tool-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  }
}

.section-eyebrow {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--turquoise);
  margin-bottom: 6px;
}
.section-title {
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--bleu);
  margin-bottom: 24px;
}
.section-subtitle {
  font-size: .88rem;
  color: var(--muted);
  margin-top: -18px;
  margin-bottom: 26px;
  line-height: 1.6;
}
.outil-usage-notice {
  font-size: .82rem;
  line-height: 1.55;
  color: rgba(255,255,255,.68);
  background: rgba(255,211,0,.07);
  border: 1px solid rgba(255,211,0,.2);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin: 1rem 0 1.5rem;
  max-width: 42rem;
}
.outil-usage-notice strong {
  color: rgba(255,235,170,.95);
  font-weight: 600;
}
body.page-grilles .outil-usage-notice,
body.page-observations .outil-usage-notice,
body.page-ag .outil-usage-notice {
  color: rgba(255,255,255,.72);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 150ms, opacity 150ms;
  -webkit-tap-highlight-color: transparent;
}
.back-link::before { content: '←'; }
.back-link:active { opacity: .7; }
@media (hover: hover) and (pointer: fine) {
  .back-link:hover { color: var(--bleu); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--bordure-lt);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 32px;
  margin-bottom: 20px;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--bleu);
  border-radius: var(--radius) 0 0 var(--radius);
}
.card.accent-teal::before   { background: var(--turquoise); }
.card.accent-violet::before { background: var(--violet); }

.card-title {
  font-size: .97rem;
  font-weight: 600;
  color: var(--bleu);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.badge {
  font-size: .59rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 2px 7px;
  margin-left: 5px;
}
.badge-req { background: var(--bleu); color: #fff; }
.badge-rec { background: var(--turquoise-clair); color: var(--turquoise-fonce); border: 1px solid #9dd8d7; }
.badge-opt { background: var(--bordure-lt); color: var(--muted); }

.field-label {
  display: block;
  font-size: .77rem;
  font-weight: 600;
  color: var(--bleu);
  margin-bottom: 7px;
  letter-spacing: .01em;
}
.req { color: var(--rouge); margin-left: 2px; }

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--bordure);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--texte);
  background: var(--surface-2);
  outline: none;
  transition: border-color 180ms, box-shadow 180ms, background 180ms;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--turquoise);
  box-shadow: 0 0 0 3px rgba(0,157,153,.1);
  background: var(--surface);
}
textarea { resize: vertical; min-height: 70px; }

.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 580px) { .upload-grid { grid-template-columns: 1fr; } }

.drop-zone {
  background: var(--surface-2);
  border: 1.5px dashed var(--bordure);
  border-radius: var(--radius-sm);
  padding: 20px 14px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  min-height: 104px;
  transition: border-color 180ms, background 180ms, box-shadow 180ms, transform 150ms;
  color: var(--muted);
  overflow: hidden;
}

/* Overlay "Déposez ici" - visible uniquement en dragover */
.drop-zone::after {
  content: '↓ Déposez ici';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--turquoise);
  background: var(--turquoise-clair);
  color: var(--turquoise-fonce);
  box-shadow: 0 0 0 3px rgba(0,157,153,.15);
}

.drop-zone.dragover {
  border-style: solid;
  border-width: 2px;
  transform: scale(1.012);
  box-shadow: 0 0 0 4px rgba(0,157,153,.22), 0 4px 24px rgba(0,157,153,.15);
}

/* Afficher l'overlay uniquement pendant le drag (pas au hover) */
.drop-zone.dragover::after {
  opacity: 1;
  animation: dz-pulse 900ms ease-in-out infinite alternate;
  background: rgba(220,245,244,.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--turquoise-fonce);
}

@keyframes dz-pulse {
  from { background: rgba(220,245,244,.78); }
  to   { background: rgba(220,245,244,.88); }
}

.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.dz-icon  { font-size: 1.5rem; margin-bottom: 6px; display: block; line-height: 1; }
.dz-label { font-weight: 500; font-size: .8rem; }
.dz-hint  { font-size: .72rem; opacity: .7; margin-top: 2px; }

.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; text-align: left; position: relative; z-index: 2; }
.file-tag {
  background: var(--bleu);
  color: rgba(255,255,255,.92);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.file-tag button {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.38);
  font-size: .85rem; line-height: 1;
  transition: color 120ms;
  padding: 0 2px;
}
.file-tag button:hover { color: #ff8070; }

.file-zone {
  border: 1.5px dashed var(--bordure);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms, background 180ms, transform 150ms, box-shadow 180ms;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.file-zone::after {
  content: '↓ Déposez ici';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
}
.file-zone:hover {
  border-color: var(--turquoise);
  background: var(--turquoise-clair);
}
.file-zone.drag-over {
  border-color: var(--turquoise);
  border-style: solid;
  border-width: 2px;
  background: var(--turquoise-clair);
  transform: scale(1.012);
  box-shadow: 0 0 0 4px rgba(0,157,153,.22), 0 4px 24px rgba(0,157,153,.15);
}
.file-zone.drag-over::after {
  opacity: 1;
  background: rgba(220,245,244,.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--turquoise-fonce);
  animation: dz-pulse 900ms ease-in-out infinite alternate;
}
.file-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-zone-name { margin-top: 10px; font-size: .83rem; color: var(--turquoise-fonce); font-weight: 600; display: none; position: relative; z-index: 2; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .86rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  /* Seulement transform et opacity - GPU compositing */
  transition: transform 160ms var(--ease-out),
              box-shadow 160ms var(--ease-out),
              background-color 150ms,
              opacity .15s;
}
/* scale(0.97) au clic - feedback immédiat */
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .42; cursor: not-allowed; }

.btn-primary {
  background: var(--bleu);
  color: #fff;
  box-shadow: 0 2px 8px rgba(39,52,139,.24);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) {
    background: var(--bleu-fonce);
    box-shadow: 0 4px 16px rgba(39,52,139,.34);
    transform: translateY(-1px);
  }
}

.btn-teal {
  background: var(--turquoise);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,157,153,.24);
}
@media (hover: hover) and (pointer: fine) {
  .btn-teal:hover:not(:disabled) {
    background: var(--turquoise-fonce);
    box-shadow: 0 4px 14px rgba(0,157,153,.34);
    transform: translateY(-1px);
  }
}

.btn-violet {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 2px 8px rgba(149,27,129,.24);
}
@media (hover: hover) and (pointer: fine) {
  .btn-violet:hover:not(:disabled) {
    background: var(--violet-fonce);
    box-shadow: 0 4px 14px rgba(149,27,129,.34);
    transform: translateY(-1px);
  }
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--bordure);
  font-size: .8rem;
  padding: 7px 16px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover:not(:disabled) { background: var(--bordure-lt); color: var(--texte); }
}

.btn-copy {
  background: var(--vert-lt);
  color: var(--vert);
  border: 1px solid #b8e0c8;
  font-size: .8rem;
  padding: 7px 16px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-copy:hover:not(:disabled) { background: #d0edda; }
}

.btn-rewrite {
  background: var(--bleu-clair);
  color: var(--bleu);
  border: 1px solid var(--bordure);
  font-size: .77rem;
  padding: 6px 14px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-rewrite:hover:not(:disabled) { background: var(--bleu); color: #fff; border-color: var(--bleu); }
}

.btn-reformuler {
  background: var(--jaune-lt);
  color: var(--jaune);
  border: 1px solid #e8d48f;
  font-size: .8rem;
  padding: 7px 14px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-reformuler:hover:not(:disabled) { background: #f0e4b0; }
}

.btn-365 {
  background: #0078d4;
  color: #fff;
  font-size: .8rem;
  padding: 7px 16px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-365:hover:not(:disabled) { background: #106ebe; }
}

.generate-row { margin-top: 26px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.loader { display: none; align-items: center; gap: 10px; font-size: .83rem; color: var(--muted); }
.loader.active { display: flex; }

.spinner {
  width: 17px; height: 17px;
  border: 2.5px solid var(--bordure);
  border-top-color: var(--turquoise);
  border-radius: 50%;
  /* Spinner rapide = performance perçue meilleure */
  animation: inaes-spin .55s linear infinite;
  flex-shrink: 0;
}
@keyframes inaes-spin { to { transform: rotate(360deg); } }

.progress-wrap { display: none; margin-top: 18px; }
.progress-bar-bg {
  background: var(--bordure-lt);
  border-radius: 99px;
  height: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--turquoise) 0%, var(--bleu) 50%, var(--turquoise) 100%);
  background-size: 200% 100%;
  width: 0%;
  transition: width .4s var(--ease-out);
  animation: inaes-shimmer 2s linear infinite;
}
@keyframes inaes-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.progress-text { font-size: .75rem; color: var(--muted); margin-top: 7px; text-align: center; }

.error-banner {
  display: none;
  background: var(--rouge-lt);
  color: var(--rouge);
  border: 1px solid #f0c0bb;
  border-left: 3px solid var(--rouge);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: .87rem;
  margin-top: 16px;
}
.error-banner.active { display: block; }

/*
  CSS transitions (pas keyframes) pour interruptibilité.
  Le toast peut être re-triggered rapidement sans glitch.
*/
#inaes-toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--bleu);
  color: rgba(255,255,255,.92);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: .82rem;
  font-weight: 500;
  max-width: 320px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  z-index: 9999;
  border-left: 3px solid var(--turquoise);
  /* Transition CSS - interruptible si re-triggered */
  transition: opacity 220ms var(--ease-out),
              transform 220ms var(--ease-spring);
}
#inaes-toast.show { opacity: 1; transform: translateY(0); }
#inaes-toast.success { border-left-color: var(--vert); }
#inaes-toast.error   { border-left-color: var(--rouge); background: #1e0f14; }

.part-block {
  border: 1px solid var(--bordure-lt);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  margin-bottom: 12px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.part-block.visible { opacity: 1; transform: translateY(0); }
.part-block::after {
  content: attr(data-num);
  position: absolute; top: -10px; right: 10px;
  font-size: 5.5rem; font-weight: 600;
  color: rgba(39,52,139,.03);
  line-height: 1; pointer-events: none; user-select: none;
}

.part-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--turquoise-fonce); margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.part-label::before { content: ''; width: 14px; height: 2px; background: var(--turquoise); flex-shrink: 0; }

.part-text { font-size: .9rem; line-height: 1.78; white-space: pre-wrap; color: var(--texte); }
.part-old {
  font-size: .85rem; line-height: 1.65; color: #b0afc0;
  text-decoration: line-through;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--bordure);
  white-space: pre-wrap;
}
.part-note {
  font-size: .74rem; color: var(--vert); margin-top: 8px;
  font-style: italic; padding: 5px 10px;
  background: var(--vert-lt); border-radius: 4px; display: inline-block;
}
.part-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.rewrite-panel {
  display: none;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.rewrite-panel.open {
  display: block;
  animation: inaes-slide-down 200ms var(--ease-out) both;
}
@keyframes inaes-slide-down {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rewrite-panel > label {
  font-size: .65rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  display: block; margin-bottom: 7px;
}
.rewrite-actions { display: flex; gap: 8px; margin-top: 8px; }

.teams-block { border: 1px solid var(--bordure-lt); border-radius: var(--radius-sm); overflow: hidden; }
.teams-head {
  background: var(--bleu-clair);
  border-bottom: 1px solid var(--bordure-lt);
  padding: 10px 18px;
  display: flex; align-items: center; gap: 8px;
}
.teams-dot { width: 7px; height: 7px; border-radius: 50%; }
.teams-dot:nth-child(1) { background: var(--bleu); opacity: .45; }
.teams-dot:nth-child(2) { background: var(--turquoise); opacity: .65; }
#teams-titre { font-size: .82rem; font-weight: 600; color: var(--bleu); margin-left: 4px; }
.teams-body { background: var(--surface-2); padding: 18px 20px; }
#teams-contenu { font-size: .88rem; line-height: 1.78; white-space: pre-wrap; color: var(--texte); }
.teams-actions { margin-top: 14px; }

.signal-list { display: flex; flex-direction: column; gap: 9px; }
.signal-item {
  border-radius: var(--radius-sm); padding: 10px 16px;
  font-size: .86rem; display: flex; gap: 10px; align-items: flex-start;
  border-left: 3px solid transparent;
}
.signal-item.rouge { background: var(--rouge-lt); color: var(--rouge); border-left-color: var(--rouge); }
.signal-item.jaune { background: var(--jaune-lt); color: var(--jaune); border-left-color: #d4a017; }
.sig-icon { font-size: .95rem; flex-shrink: 0; margin-top: 1px; }
.empty-signals { font-size: .86rem; color: var(--muted); font-style: italic; padding: 6px 2px; }

.result-item {
  background: var(--surface);
  border: 1px solid var(--bordure-lt);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  border-left: 4px solid var(--bleu);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.result-item.visible { opacity: 1; transform: translateY(0); }
.result-item.evolved { border-left-color: var(--vert); }

.result-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.critere-badge {
  background: var(--bleu); color: #fff;
  padding: 3px 12px; border-radius: 20px;
  font-size: .82rem; font-weight: 600;
}
.evolved-badge {
  background: var(--vert-lt); color: var(--vert);
  border: 1px solid #b8e0c8;
  padding: 3px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 600;
}
.traitement-text {
  background: var(--surface-2); border-radius: 6px;
  padding: 14px 16px; font-size: .9rem; line-height: 1.72;
  color: var(--texte); margin-bottom: 12px;
  white-space: pre-wrap; border-left: 2px solid var(--bordure);
}
.note-text { font-size: .77rem; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }

.reformulation-zone {
  display: none; margin-top: 14px;
  background: var(--jaune-lt); border: 1px solid #e8d48f;
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.reformulation-zone label {
  display: block; font-size: .72rem; font-weight: 600;
  color: var(--jaune); letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 8px;
}
.reformulation-actions { display: flex; gap: 8px; margin-top: 8px; }

.historique-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--bordure); }
.historique-label { font-size: .72rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.historique-item {
  background: var(--surface-2); border-radius: 4px;
  padding: 8px 12px; font-size: .8rem; color: var(--muted);
  margin-bottom: 6px; white-space: pre-wrap;
  text-decoration: line-through; opacity: .6;
}

#ag-titre {
  font-size: .93rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: rgba(255,255,255,.92);
  background: linear-gradient(105deg, var(--bleu), var(--violet-fonce));
  padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 16px;
}

/* Dashboard tiles - animation CSS stagger nth-child */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  width: 100%;
  max-width: 980px;
  position: relative;
  z-index: 1;
}
/* Grille adaptée au nombre d'outils visibles selon le rôle */
.dashboard-grid[data-count="2"] {
  grid-template-columns: repeat(2, 1fr);
  max-width: 660px;
}
.dashboard-grid[data-count="1"] {
  grid-template-columns: 1fr;
  max-width: 320px;
}
@media (max-width: 760px) { .dashboard-grid { grid-template-columns: 1fr; } }
@media (min-width: 761px) and (max-width: 1000px) { .dashboard-grid { grid-template-columns: 1fr 1fr; } }

.tool-card {
  background: var(--surface);
  border: 1px solid var(--bordure-lt);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(39,52,139,.10), 0 1px 4px rgba(39,52,139,.06);
  padding: 36px 32px 30px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  /* opacity 0 au départ - anime.js gère l'entrée spring */
  opacity: 0;
  transition: transform 220ms var(--ease-out),
              box-shadow 220ms var(--ease-out);
}

/* Barre de couleur en haut */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 5px;
  border-radius: 14px 14px 0 0;
  transition: height 220ms var(--ease-out);
}
.tool-card.bleu::before   { background: linear-gradient(90deg, #27348B, #3d4fb5); }
.tool-card.teal::before   { background: linear-gradient(90deg, #009D99, #4ac9c6); }
.tool-card.violet::before { background: linear-gradient(90deg, #951B81, #c044a8); }

/* Bulle décorative en coin - couleur exacte Pantone INAES */
.tool-card::after {
  content: '';
  position: absolute;
  bottom: -30px; right: -30px;
  width: 130px; height: 130px;
  border-radius: 50%;
  pointer-events: none;
  transition: transform 300ms var(--ease-out), opacity 300ms;
  opacity: .13;
}
.tool-card.bleu::after   { background: #27348B; }
.tool-card.teal::after   { background: #009D99; }
.tool-card.violet::after { background: #951B81; }

/* Sur fond sombre (glassmorphisme) - bulle plus visible */
.page-dashboard .tool-card::after,
.page-grilles   .tool-card::after,
.page-observations .tool-card::after,
.page-ag        .tool-card::after { opacity: .35; }

@media (hover: hover) and (pointer: fine) {
  .tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(39,52,139,.16), 0 4px 12px rgba(39,52,139,.08);
  }
  .tool-card:hover::before  { height: 6px; }
  .tool-card:hover::after   { opacity: .22; transform: scale(1.3); }
  .page-dashboard .tool-card:hover::after,
  .page-grilles   .tool-card:hover::after,
  .page-observations .tool-card:hover::after,
  .page-ag        .tool-card:hover::after { opacity: .55; }
}
.tool-card:active { transform: scale(.98); }

.tool-card-accent {
  font-size: .65rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; margin-bottom: 16px; margin-top: 10px;
}
.tool-card.bleu   .tool-card-accent { color: var(--bleu); }
.tool-card.teal   .tool-card-accent { color: var(--turquoise-fonce); }
.tool-card.violet .tool-card-accent { color: var(--violet); }

.tool-card-icon { font-size: 2.8rem; margin-bottom: 16px; display: block; line-height: 1; }

.tool-card-name {
  font-size: 1.12rem; font-weight: 700; color: var(--texte); margin-bottom: 10px;
  letter-spacing: -.01em;
}
.tool-card-desc {
  font-size: .88rem; color: var(--muted); line-height: 1.7;
  flex: 1; margin-bottom: 24px;
}
.tool-card-cta {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .83rem; font-weight: 600; padding: 9px 18px;
  border-radius: 8px;
  align-self: flex-start;
  transition: background-color 150ms, filter 150ms, transform 150ms;
}
.tool-card.bleu   .tool-card-cta { background: var(--bleu-clair); color: var(--bleu); }
.tool-card.teal   .tool-card-cta { background: var(--turquoise-clair); color: var(--turquoise-fonce); }
.tool-card.violet .tool-card-cta { background: var(--violet-clair); color: var(--violet); }
@media (hover: hover) and (pointer: fine) {
  .tool-card:hover .tool-card-cta { filter: brightness(.92); }
}

.history-filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn {
  font-size: .77rem; font-weight: 500; padding: 6px 14px;
  border-radius: 20px; border: 1px solid var(--bordure);
  background: var(--surface); color: var(--muted);
  cursor: pointer; text-decoration: none;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}
.filter-btn:hover, .filter-btn.active { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.filter-btn.teal.active  { background: var(--turquoise); border-color: var(--turquoise); }
.filter-btn.violet.active { background: var(--violet); border-color: var(--violet); }

.history-table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--bordure-lt); box-shadow: var(--shadow);
}
.history-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); font-size: .84rem;
}
.history-table th {
  background: var(--bleu-clair); color: var(--bleu);
  font-weight: 600; font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; padding: 11px 16px;
  text-align: left; border-bottom: 1px solid var(--bordure);
  white-space: nowrap;
}
.history-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--bordure-lt);
  color: var(--texte); vertical-align: top;
}
.history-table tr:last-child td { border-bottom: none; }
@media (hover: hover) and (pointer: fine) {
  .history-table tr:hover td { background: var(--fond-page); }
}

.outil-badge {
  display: inline-block; font-size: .67rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  border-radius: 3px; padding: 2px 8px;
}
.outil-badge.grilles      { background: var(--bleu-clair); color: var(--bleu); }
.outil-badge.observations { background: var(--turquoise-clair); color: var(--turquoise-fonce); }
.outil-badge.ag           { background: var(--violet-clair); color: var(--violet); }

.extrait-cell {
  max-width: 300px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: .8rem;
}
.empty-history { text-align: center; padding: 60px 20px; color: var(--muted); font-size: .9rem; }

/* LOGIN PAGE */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--fond-page);
  position: relative;
  overflow: hidden;
}

/* Gradient mesh décoratif - donne de la profondeur sans distraire */
.login-page::before {
  content: '';
  position: absolute;
  top: -30%; left: -20%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse at center,
    rgba(39, 52, 139, .08) 0%,
    transparent 70%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 50%; height: 60%;
  background: radial-gradient(ellipse at center,
    rgba(0, 157, 153, .07) 0%,
    transparent 70%);
  pointer-events: none;
}

/* Filet gradient en haut */
.login-header-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bleu) 0%, var(--turquoise) 50%, var(--violet) 100%);
  z-index: 10;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  /* Entrée fluide - scale depuis 0.97 (pas 0) */
  animation: inaes-card-enter 480ms var(--ease-out) both;
}
@keyframes inaes-card-enter {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo-bar {
  background: linear-gradient(110deg, var(--bleu) 0%, var(--bleu-moyen) 100%);
  padding: 24px 32px 20px;
  position: relative;
  overflow: hidden;
}
/* Filet turquoise */
.login-logo-bar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--turquoise), rgba(0,157,153,.3));
}
/* Cercle décoratif en arrière-plan */
.login-logo-bar::before {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.login-logo-bar img,
.login-logo-bar svg { height: 32px; width: auto; position: relative; }

.login-body { padding: 32px; }

.login-eyebrow {
  font-size: .64rem; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: var(--turquoise); margin-bottom: 4px;
}
.login-title {
  font-size: 1.18rem; font-weight: 600; color: var(--bleu); margin-bottom: 26px;
}
.login-field { margin-bottom: 20px; }

.login-error {
  background: var(--rouge-lt); color: var(--rouge);
  border: 1px solid #f0c0bb; border-left: 3px solid var(--rouge);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: .84rem; margin-bottom: 20px; display: none;
}
.login-error.show { display: block; }
.login-submit { width: 100%; padding: 12px; margin-top: 4px; }
.login-remember {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: .65rem 0 .25rem;
  font-size: .78rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, .62);
  cursor: pointer;
  user-select: none;
}
.login-remember input {
  margin-top: .15rem;
  flex-shrink: 0;
  accent-color: var(--turquoise);
}

.login-footer { text-align: center; font-size: .72rem; color: var(--muted); margin-top: 36px; }

.card.anim { opacity: 0; transform: translateY(12px); }
.card.anim.in {
  transition: opacity 380ms var(--ease-out), transform 380ms var(--ease-out);
  opacity: 1;
  transform: translateY(0);
}

/* Triple rideau de transition couleurs INAES */
#curtain-1,
#curtain-2,
#curtain-3 {
  position: fixed;
  inset: 0;
  pointer-events: none;
  will-change: transform;
  transform: translateY(105%) translateZ(0);
  backface-visibility: hidden;
}
#curtain-1 {
  z-index: 9997;
  clip-path: polygon(0% 0%, 100% 9%, 100% 100%, 0% 100%);
}
#curtain-2 {
  z-index: 9998;
  clip-path: polygon(0% 6%, 100% 0%, 100% 100%, 0% 100%);
}
#curtain-3 {
  z-index: 9999;
  clip-path: polygon(0% 12%, 100% 2%, 100% 100%, 0% 100%);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .spinner { animation: none; border-top-color: var(--turquoise); }
}

/* GLASSMORPHISME PAGES OUTILS - grilles / observations / ag */

/* Textes principaux en blanc */
body.page-grilles .section-title,
body.page-observations .section-title,
body.page-ag .section-title {
  color: #fff;
}
body.page-grilles .section-eyebrow,
body.page-observations .section-eyebrow,
body.page-ag .section-eyebrow {
  opacity: .9;
}
body.page-grilles .section-subtitle,
body.page-observations .section-subtitle,
body.page-ag .section-subtitle {
  color: rgba(255,255,255,.6);
}
body.page-grilles .back-link,
body.page-observations .back-link,
body.page-ag .back-link,
body.page-historique .back-link {
  color: rgba(255,255,255,.5);
}
body.page-grilles .back-link:hover,
body.page-observations .back-link:hover,
body.page-ag .back-link:hover,
body.page-historique .back-link:hover {
  color: rgba(255,255,255,.9);
}
body.page-grilles .back-link:active,
body.page-observations .back-link:active,
body.page-ag .back-link:active,
body.page-historique .back-link:active {
  color: rgba(255,255,255,.5);
  opacity: .7;
}
body.page-grilles .field-label,
body.page-observations .field-label,
body.page-ag .field-label,
body.page-compte .field-label {
  color: rgba(255,255,255,.85);
}

/* Cards glassmorphisme */
body.page-grilles .card,
body.page-observations .card,
body.page-ag .card {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 40px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.12);
}
body.page-grilles .card-title,
body.page-observations .card-title,
body.page-ag .card-title { color: #fff; }

/* Barre latérale des cards */
body.page-grilles      .card::before { background: var(--bleu-moyen); }
body.page-observations .card::before { background: var(--turquoise); }
body.page-ag           .card::before { background: var(--violet); }

body.page-grilles      .card.accent-teal::before   { background: var(--turquoise); }
body.page-grilles      .card.accent-violet::before { background: var(--violet); }
body.page-observations .card.accent-teal::before   { background: var(--turquoise); }
body.page-ag           .card.accent-violet::before { background: var(--violet); }

/* Drop zones glassmorphisme */
body.page-grilles .drop-zone,
body.page-observations .drop-zone,
body.page-ag .drop-zone,
body.page-grilles .file-zone,
body.page-observations .file-zone,
body.page-ag .file-zone {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.7);
}
body.page-grilles .drop-zone:hover,
body.page-observations .drop-zone:hover,
body.page-ag .drop-zone:hover,
body.page-grilles .file-zone:hover,
body.page-observations .file-zone:hover,
body.page-ag .file-zone:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.35);
}
body.page-grilles .drop-zone.dragover,
body.page-observations .drop-zone.dragover,
body.page-ag .drop-zone.dragover,
body.page-grilles .file-zone.drag-over {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.6);
  box-shadow: 0 0 0 4px rgba(255,255,255,.12), 0 4px 24px rgba(255,255,255,.08);
}
body.page-grilles .drop-zone.dragover::after,
body.page-observations .drop-zone.dragover::after,
body.page-ag .drop-zone.dragover::after,
body.page-grilles .file-zone.drag-over::after {
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: dz-pulse-dark 900ms ease-in-out infinite alternate;
}
@keyframes dz-pulse-dark {
  from { background: rgba(0,0,0,.52); }
  to   { background: rgba(0,0,0,.62); }
}
body.page-grilles .dz-label,
body.page-observations .dz-label,
body.page-ag .dz-label { color: rgba(255,255,255,.8); }
body.page-grilles .dz-hint,
body.page-observations .dz-hint,
body.page-ag .dz-hint { color: rgba(255,255,255,.45); }

/* Résultats glassmorphisme */
body.page-grilles .result-item,
body.page-observations .result-item,
body.page-ag .result-item {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.88);
}
body.page-grilles .traitement-text,
body.page-observations .traitement-text,
body.page-ag .traitement-text {
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.06);
  border-left-color: rgba(255,255,255,.18);
}

body.page-grilles .note-text,
body.page-observations .note-text,
body.page-ag .note-text { color: rgba(255,255,255,.55); }

/* Blocs partie AG */
body.page-ag .part-block {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
body.page-ag .part-label { color: rgba(255,255,255,.55); }
body.page-ag .part-text  { color: rgba(255,255,255,.88); }
body.page-ag .part-old   { background: rgba(255,255,255,.05); color: rgba(255,255,255,.5); }

/* Teams block */
body.page-ag .teams-block {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
body.page-ag .teams-head {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.1);
}
body.page-ag #teams-titre { color: rgba(255,255,255,.85); }
body.page-ag .teams-body  { background: rgba(255,255,255,.04); }
body.page-ag #teams-contenu { color: rgba(255,255,255,.82); }

/* Signal items */
body.page-ag .signal-item {
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
}
body.page-ag .signal-item.rouge {
  background: rgba(192,57,43,.22);
  color: #ffaaaa;
  border-left-color: rgba(220,80,70,.7);
}
body.page-ag .signal-item.jaune {
  background: rgba(154,107,16,.22);
  color: #ffd97a;
  border-left-color: rgba(200,150,20,.7);
}
body.page-ag .empty-signals { color: rgba(255,255,255,.45); }

/* Error banner sur fond sombre */
body.page-grilles .error-banner,
body.page-observations .error-banner,
body.page-ag .error-banner {
  background: rgba(220,50,50,.18);
  border-color: rgba(220,50,50,.35);
  color: #ffaaaa;
}

/* Reformulation zone */
body.page-ag .rewrite-panel,
body.page-observations .reformulation-zone {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
}
body.page-ag .rewrite-panel label,
body.page-observations .reformulation-zone label { color: rgba(255,255,255,.7); }
body.page-ag .rewrite-panel textarea,
body.page-observations .reformulation-zone textarea,
body.page-grilles textarea {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}

/* Success card */
body.page-grilles .card.anim {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.18);
}

/* Critere badge */
body.page-observations .critere-badge {
  background: rgba(0,157,153,.25);
  color: #7ff0ed;
}

/* Couleur module header par outil */
body.page-grilles      .header-module { color: #7eb5ff; }
body.page-observations .header-module { color: var(--turquoise); }
body.page-ag           .header-module { color: #d87fd0; }

/* Lien secondaire sous les formulaires login / register */
.login-alt-link {
  margin-top: 1rem;
  text-align: center;
  font-size: .82rem;
}
body.page-login .login-alt-link {
  color: rgba(255,255,255,0.4);
}
body.page-login .login-alt-link a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  transition: color 150ms, border-color 150ms;
}
body.page-login .login-alt-link a:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}

/* Ecran en attente de validation */
.pending-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  text-align: center;
  padding: .5rem 0 .25rem;
}
.pending-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .25rem;
}
.pending-icon svg {
  opacity: .85;
}
.pending-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body.page-login .pending-label {
  color: rgba(255,255,255,0.45);
}
.pending-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}
body.page-login .pending-title {
  color: #fff;
}
.pending-message {
  font-size: .9rem;
  line-height: 1.55;
  max-width: 320px;
}
body.page-login .pending-message {
  color: rgba(255,255,255,0.60);
}
.pending-hint {
  font-size: .78rem;
  margin-top: .15rem;
}
body.page-login .pending-hint {
  color: rgba(255,255,255,0.30);
}

@keyframes pending-pulse {
  0%, 100% { opacity: .5; transform: scale(1); }
  50%       { opacity: 1;  transform: scale(1.08); }
}
.pending-icon {
  animation: pending-pulse 2.4s ease-in-out infinite;
}
.pending-icon--success {
  background: rgba(122, 234, 170, .15);
  border-color: rgba(122, 234, 170, .35);
  animation: none;
}
.access-revoked-icon {
  background: rgba(255, 140, 40, .12);
  border-color: rgba(255, 140, 40, .32);
  animation: none;
}
.admin-profile-access-panel {
  margin: 1.25rem 0 1.75rem;
  padding: 1.1rem 1.25rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
}
.admin-profile-access-panel .section-eyebrow {
  margin-bottom: .5rem;
}
.admin-profile-access-panel form {
  margin-top: .85rem;
}
body.page-login .login-error#registerClientError:not(.show) {
  display: none;
}
body.page-login .login-access-intro {
  font-size: .8rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, .55);
  margin: 0 0 .85rem;
}

/* Espace administration */
body.page-admin .header-module { color: #ffd97a; }

.admin-page-top {
  margin-bottom: 1.35rem;
}
.admin-back-dashboard {
  display: inline-block;
  margin-bottom: 0.85rem;
}

/* Onglets secondaires (accès / évaluateurs) */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.42);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.admin-tab:hover {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
}
.admin-tab.is-active {
  color: #fff;
  background: rgba(39, 52, 139, 0.65);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}
.admin-tab.is-active:hover {
  color: #fff;
}

/* Bouton profil évaluateur (liste + tableau comptes) */
.btn-admin-eval-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid rgba(0, 157, 153, 0.5);
  background: rgba(0, 157, 153, 0.22);
  color: #9efaf0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.btn-admin-eval-profile:hover {
  background: rgba(0, 157, 153, 0.38);
  border-color: rgba(0, 210, 200, 0.55);
  color: #e4fffc;
}
.btn-admin-eval-profile:active {
  transform: scale(0.98);
}

.admin-actions-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Boutons d'action du tableau comptes : même gabarit (profil + réinit. mdp) */
.admin-actions-cell .btn-admin-eval-profile,
.admin-actions-cell .btn-admin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 34px;
  min-width: 11.5rem;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}
.admin-actions-empty {
  opacity: 0.28;
  font-size: 0.78rem;
}

.admin-eval-profile-back {
  margin: 0 0 1.1rem;
}
.admin-eval-back-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(0, 210, 200, 0.85);
  text-decoration: none;
}
.admin-eval-back-link:hover {
  text-decoration: underline;
  color: #b8fff8;
}

/* Stats bar */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}
@media (max-width: 640px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.stat-label {
  font-size: .72rem;
  color: rgba(255,255,255,.38);
  margin-top: .35rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat-card.pending .stat-value { color: #ffd97a; }
.stat-card.active  .stat-value { color: #7aeaaa; }
.stat-card.rejected .stat-value { color: #ff9999; }
.stat-card.blocked .stat-value { color: #ffb366; }

/* Compteur inline dans le titre */
.admin-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(255,211,0,.2);
  border: 1px solid rgba(255,211,0,.35);
  color: #ffd97a;
  font-size: .72rem;
  font-weight: 700;
}

/* Formulaire inline approuver */
.inline-action-form {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Select rôle */
.role-select {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: .8rem;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms;
}
.role-select:focus { border-color: rgba(255,255,255,.38); }
.role-select option { background: #1d2870; color: #fff; }

/* Boutons d'action admin */
.btn-admin-action {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
  background: none;
  white-space: nowrap;
}
.btn-admin-action.approve {
  background: rgba(0,157,153,.18);
  border-color: rgba(0,157,153,.38);
  color: #6beeeb;
}
.btn-admin-action.approve:hover {
  background: rgba(0,157,153,.3);
  border-color: rgba(0,157,153,.6);
}
.btn-admin-action.reject {
  background: rgba(192,57,43,.15);
  border-color: rgba(192,57,43,.32);
  color: #ff9999;
}
.btn-admin-action.reject:hover {
  background: rgba(192,57,43,.28);
  border-color: rgba(192,57,43,.55);
}
.btn-admin-action.block {
  background: rgba(255, 140, 40, .14);
  border-color: rgba(255, 140, 40, .35);
  color: #ffb366;
}
.btn-admin-action.block:hover {
  background: rgba(255, 140, 40, .26);
  border-color: rgba(255, 140, 40, .55);
}
.btn-admin-action.reset {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.55);
  font-size: .76rem;
}
.btn-admin-action.reset:hover {
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.9);
}
.btn-admin-action.copy {
  background: rgba(39,52,139,.28);
  border-color: rgba(39,52,139,.45);
  color: #aab8ff;
}
.btn-admin-action.copy:hover { background: rgba(39,52,139,.42); }
.btn-admin-action.close {
  background: transparent;
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.45);
}
.btn-admin-action.close:hover { color: rgba(255,255,255,.75); }
.btn-admin-action:disabled { opacity: .45; cursor: not-allowed; }

/* Badges statut */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .03em;
  border: 1px solid transparent;
}
.status-badge.active {
  background: rgba(26,122,74,.2);
  border-color: rgba(26,122,74,.38);
  color: #7aeaaa;
}
.status-badge.rejected {
  background: rgba(192,57,43,.18);
  border-color: rgba(192,57,43,.35);
  color: #ff9999;
}
.status-badge.blocked {
  background: rgba(255, 140, 40, .16);
  border-color: rgba(255, 140, 40, .38);
  color: #ffb366;
}

/* Badges rôle */
.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.role-badge.admin {
  background: rgba(149,27,129,.22);
  border-color: rgba(149,27,129,.4);
  color: #f0b0e8;
}
.role-badge.rsms {
  background: rgba(39,52,139,.25);
  border-color: rgba(39,52,139,.45);
  color: #aab8ff;
}
.role-badge.evaluateur {
  background: rgba(0,157,153,.18);
  border-color: rgba(0,157,153,.35);
  color: #7ff0ed;
}

/* Etat vide admin */
.admin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: rgba(255,255,255,.28);
  font-size: .88rem;
  text-align: center;
  gap: .4rem;
}

/* Modal lien reset */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-modal-card {
  background: rgba(22,34,88,.92);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.admin-modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: .35rem;
}
.admin-modal-sub {
  font-size: .82rem;
  color: rgba(255,255,255,.4);
  margin-bottom: 1.25rem;
}
.admin-modal-link-wrap {
  display: flex;
  gap: .5rem;
  margin-bottom: .7rem;
}
.admin-modal-input {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px;
  padding: 7px 10px;
  color: rgba(255,255,255,.82);
  font-size: .78rem;
  font-family: ui-monospace, monospace;
  outline: none;
  min-width: 0;
}
.admin-modal-hint {
  font-size: .74rem;
  color: rgba(255,255,255,.28);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Profils évaluateurs (liste + fiche) */
.admin-eval-intro {
  font-size: .86rem;
  color: rgba(255,255,255,.42);
  line-height: 1.55;
  max-width: 52rem;
  margin: 0 0 1.5rem;
}
.admin-eval-table tbody tr.admin-eval-row-click {
  cursor: pointer;
  transition: background .12s ease;
}
.admin-eval-table tbody tr.admin-eval-row-click:hover td {
  background: rgba(255,255,255,.04);
}
.admin-eval-table tbody tr.admin-eval-row-click:focus-visible {
  outline: 2px solid rgba(0,157,153,.65);
  outline-offset: -2px;
}
.admin-eval-row-action-cell {
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}
.admin-eval-row-hint {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.28);
  margin-bottom: 4px;
}
.admin-eval-table th,
.admin-eval-table td {
  vertical-align: middle;
}
.admin-eval-table th.admin-eval-col-stat,
.admin-eval-table td.admin-eval-col-stat {
  text-align: center;
  width: 5rem;
  font-variant-numeric: tabular-nums;
}
.admin-eval-table .admin-eval-avatar-cell {
  width: 52px;
  vertical-align: middle;
}
.admin-eval-thumb {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.14);
}
.admin-eval-thumb-placeholder {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255,255,255,.12);
}
.admin-eval-profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.admin-eval-profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.16);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.admin-eval-profile-photo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 2px dashed rgba(255,255,255,.14);
}
.admin-eval-profile-name {
  margin: 0 0 .25rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}
.admin-eval-profile-email {
  margin: 0 0 .5rem;
  font-size: .84rem;
  color: rgba(255,255,255,.42);
  word-break: break-all;
}
.admin-eval-profile-role {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.admin-eval-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 28rem;
}
.admin-eval-stats.admin-eval-stats--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 42rem;
}
.stat-card.observations .stat-value { color: #8ef0ee; }
@media (max-width: 720px) {
  .admin-eval-stats.admin-eval-stats--3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .admin-eval-stats { grid-template-columns: 1fr; }
}
.admin-eval-history-eyebrow {
  margin-top: 2.5rem;
}
.admin-eval-history-filters {
  margin-bottom: 1.25rem;
}
.admin-eval-history-global-link {
  color: rgba(126, 220, 215, .85);
  text-decoration: none;
  border-bottom: 1px solid rgba(126, 220, 215, .35);
  margin-left: .35rem;
}
@media (hover: hover) and (pointer: fine) {
  .admin-eval-history-global-link:hover {
    color: #b8fff8;
    border-bottom-color: rgba(184, 255, 248, .6);
  }
}
.admin-eval-hint {
  font-size: .8rem;
  color: rgba(255,255,255,.38);
  line-height: 1.55;
  max-width: 40rem;
  margin: 0 0 1rem;
}
.admin-eval-upload-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
  margin-bottom: 1rem;
  max-width: 32rem;
}
.admin-eval-file-input {
  font-size: .8rem;
  color: rgba(255,255,255,.55);
  max-width: 100%;
}
.admin-eval-remove-form {
  margin-top: .25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-eval-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 140px;
  padding: 1.25rem 1rem;
  text-align: center;
  border: 2px dashed rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.admin-eval-dropzone:hover {
  border-color: rgba(0,157,153,.45);
  background: rgba(0,157,153,.08);
}
.admin-eval-dropzone.is-dragover {
  border-color: rgba(0,210,200,.75);
  background: rgba(0,157,153,.14);
  box-shadow: 0 0 0 3px rgba(0,157,153,.2);
}
.admin-eval-dropzone:focus-visible {
  outline: 2px solid rgba(0,157,153,.7);
  outline-offset: 2px;
}
.admin-eval-dropzone-title {
  font-size: .95rem;
  font-weight: 600;
  color: rgba(255,255,255,.88);
}
.admin-eval-dropzone-sub {
  font-size: .8rem;
  color: rgba(255,255,255,.42);
  max-width: 22rem;
  line-height: 1.45;
}
.admin-eval-upload-status {
  font-size: .82rem;
  color: rgba(0,210,200,.85);
  margin: .35rem 0 0;
}

/* === VALIDATION HUMAINE IA === */

.validation-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,193,7,.09);
  border: 1px solid rgba(255,193,7,.28);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: .81rem;
  color: rgba(255,215,100,.88);
  margin-bottom: 16px;
}
.val-notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.validation-approval-wrap {
  margin-top: 20px;
  padding: 18px 20px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
}

.validation-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.validation-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}
.validation-progress-fill {
  height: 100%;
  background: #009D99;
  border-radius: 2px;
  transition: width 300ms ease;
}
.validation-progress-text {
  font-size: .78rem;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  min-width: 54px;
  text-align: right;
}

/* Items de validation */
.validation-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.validation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  transition: border-color 150ms, background 150ms;
}
.validation-item.status-validated {
  border-color: rgba(0,157,153,.4);
  background: rgba(0,157,153,.07);
}
.validation-item.status-to_correct {
  border-color: rgba(255,193,7,.3);
  background: rgba(255,193,7,.05);
}
.validation-item-label {
  flex: 1;
  font-size: .84rem;
  color: rgba(255,255,255,.72);
}
.validation-item-btns {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* Boutons de statut (AG, blocs dynamiques via validation.js) */
.btn-val {
  font-size: .7rem;
  font-weight: 600;
  padding: 4px 9px;
  min-height: 30px;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  font-family: inherit;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  white-space: nowrap;
}
.btn-val .val-mini-glyph {
  font-size: .92rem;
  font-weight: 800;
  line-height: 1;
}
.btn-val .val-mini-glyph-corr {
  font-size: .98rem;
  transform: translateY(0);
}
.btn-val:disabled { opacity: .35; cursor: not-allowed; }
.btn-val-ok {
  background: rgba(0,157,153,.1);
  border-color: rgba(0,157,153,.3);
  color: rgba(0,200,195,.75);
}
.btn-val-ok:hover:not(:disabled), .btn-val-ok.active {
  background: rgba(0,157,153,.28);
  border-color: rgba(0,157,153,.65);
  color: #00d2c8;
}
.btn-val-corr {
  background: rgba(255,193,7,.07);
  border-color: rgba(255,193,7,.25);
  color: rgba(255,200,80,.7);
}
.btn-val-corr:hover:not(:disabled), .btn-val-corr.active {
  background: rgba(255,193,7,.2);
  border-color: rgba(255,193,7,.55);
  color: #ffc107;
}

/* Boutons mini (en-têtes cartes grilles ; observations avec libellé) */
.btn-val-mini {
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 6px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  line-height: 1.1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  white-space: nowrap;
}
.btn-val-mini .val-mini-glyph {
  font-size: .95rem;
  line-height: 1;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-val-mini .val-mini-glyph-corr {
  font-size: 1rem;
  transform: translateY(0);
}
.btn-val-mini:disabled { opacity: .3; cursor: not-allowed; }
.btn-val-mini-ok {
  background: rgba(0,157,153,.12);
  border-color: rgba(0,157,153,.38);
  color: rgba(0,220,210,.88);
}
.btn-val-mini-ok:hover:not(:disabled), .btn-val-mini-ok.active {
  background: rgba(0,157,153,.28);
  border-color: rgba(0,157,153,.65);
  color: #e8fffc;
}
.btn-val-mini-corr {
  background: rgba(255,193,7,.1);
  border-color: rgba(255,193,7,.35);
  color: rgba(255,210,100,.92);
}
.btn-val-mini-corr:hover:not(:disabled), .btn-val-mini-corr.active {
  background: rgba(255,193,7,.22);
  border-color: rgba(255,193,7,.55);
  color: #ffe082;
}
.val-mini-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  align-items: center;
}

/* Commentaire + bouton approbation */
.validation-comment {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: .81rem;
  color: rgba(255,255,255,.82) !important;
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
  outline: none;
  transition: border-color 150ms;
}
.validation-comment:focus {
  border-color: rgba(0,157,153,.45) !important;
}
.validation-comment:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  background: rgba(0,157,153,.15);
  border: 1.5px solid rgba(0,157,153,.4);
  border-radius: 8px;
  color: rgba(0,210,200,.88);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms;
}
.btn-approve:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.btn-approve:not(:disabled):hover {
  background: rgba(0,157,153,.3);
  border-color: rgba(0,157,153,.7);
  color: #00d2c8;
}

.validation-approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,157,153,.14);
  border: 1px solid rgba(0,157,153,.38);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .78rem;
  color: rgba(0,210,200,.9);
  font-weight: 600;
}

.grilles-approved-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0.35rem 0 0.15rem;
}

.val-err-msg {
  font-size: .77rem;
  color: rgba(255,160,160,.9);
}

/* Progress chip dans topbar */
.val-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  font-size: .76rem;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
}
.val-chip-bar {
  width: 40px;
  height: 3px;
  background: rgba(255,255,255,.12);
  border-radius: 2px;
  overflow: hidden;
}
.val-chip-fill {
  height: 100%;
  background: #009D99;
  border-radius: 2px;
  transition: width 250ms ease;
}
.val-chip.complete {
  border-color: rgba(0,157,153,.38);
  color: rgba(0,210,200,.8);
}

/* Colonne validation dans l'historique */
.val-badge {
  display: inline-block;
  font-size: .71rem;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid;
  white-space: nowrap;
}
.val-badge-pending  {
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.32);
}
.val-badge-validated {
  border-color: rgba(0,157,153,.38);
  color: rgba(0,200,195,.82);
  background: rgba(0,157,153,.08);
}
.val-badge-partial {
  border-color: rgba(255,193,7,.3);
  color: rgba(255,200,80,.8);
  background: rgba(255,193,7,.06);
}

/* Filtres historique : utilisateur + recherche nom */
.history-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 28px;
  margin-bottom: 18px;
}
.history-user-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.history-user-filter label {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}
.history-user-select {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  color: rgba(255,255,255,.88);
  font-family: inherit;
  font-size: .81rem;
  padding: 6px 28px 6px 10px;
  outline: none;
  cursor: pointer;
  min-width: 14rem;
  max-width: 100%;
  /* Liste native lisible (sinon texte clair sur fond blanc Windows) */
  color-scheme: dark;
  appearance: auto;
  -webkit-appearance: menulist;
}
.history-user-select option {
  background-color: #1e2440;
  color: #f0f4ff;
}
.history-user-select:focus {
  border-color: rgba(0,157,153,.4);
}

.history-name-search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.history-name-search-form label {
  font-size: .8rem;
  color: rgba(255,255,255,.45);
}
.history-name-search-input {
  min-width: 10rem;
  max-width: 20rem;
  width: 14rem;
  box-sizing: border-box;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  color: rgba(255,255,255,.88);
  font-family: inherit;
  font-size: .81rem;
  padding: 6px 10px;
  outline: none;
}
.history-name-search-input:focus {
  border-color: rgba(0,157,153,.4);
}
.history-name-search-btn {
  font-size: .78rem !important;
  padding: 6px 14px !important;
}
.history-filter-reset {
  font-size: .78rem;
  color: rgba(0,210,200,.88);
  text-decoration: none;
  white-space: nowrap;
}
.history-filter-reset:hover {
  text-decoration: underline;
  color: #9efaf0;
}

/* Mon compte */
body.page-compte .account-form-block {
  max-width: 520px;
}
body.page-compte .account-field {
  margin-bottom: 1rem;
}
body.page-compte .admin-eval-hint {
  color: rgba(255,255,255,.55);
}
body.page-compte .password-wrap input {
  width: 100%;
  padding-right: 44px;
}
body.page-compte .pw-toggle {
  color: rgba(9, 14, 40, .4);
}
body.page-compte .pw-toggle:hover,
body.page-compte .pw-toggle:focus-visible {
  color: var(--bleu);
  outline: none;
}
body.page-compte .account-field input.is-invalid {
  border-color: rgba(255, 120, 110, .85);
  box-shadow: 0 0 0 2px rgba(255, 120, 110, .2);
}
.pw-field-hint {
  margin: .4rem 0 0;
  font-size: .76rem;
  color: rgba(255, 255, 255, .45);
}
body.page-compte .pw-field-hint.is-ok {
  color: #7aeaaa;
}
.pw-match-msg {
  margin: .4rem 0 0;
  font-size: .78rem;
  font-weight: 500;
}
.pw-match-msg.is-ok {
  color: #7aeaaa;
}
.pw-match-msg.is-err {
  color: #ff9999;
}
#compte-pw-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Infobulle formation évaluateurs (cotation) */
.inaes-info-tip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: .25rem;
}
.inaes-info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 157, 153, .45);
  background: rgba(0, 157, 153, .12);
  color: #9af3f0;
  font-size: .7rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
  cursor: help;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.inaes-info-tip-btn:hover,
.inaes-info-tip-btn:focus-visible {
  background: rgba(0, 157, 153, .28);
  border-color: rgba(0, 157, 153, .65);
  color: #fff;
  outline: none;
}
.inaes-info-tip-panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 40;
  width: max(16rem, 220px);
  max-width: min(280px, 90vw);
  padding: .65rem .75rem;
  border-radius: var(--radius);
  background: rgba(12, 18, 48, .97);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  font-size: .78rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  color: rgba(255, 255, 255, .88);
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms, visibility 150ms;
}
.inaes-info-tip-panel::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(12, 18, 48, .97);
}
.inaes-info-tip:hover .inaes-info-tip-panel,
.inaes-info-tip:focus-within .inaes-info-tip-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.inaes-info-tip-panel a {
  display: block;
  margin-top: .4rem;
  color: #9af3f0;
  font-weight: 600;
  text-decoration: none;
}
.inaes-info-tip-panel a:hover {
  color: #fff;
  text-decoration: underline;
}
.revue-topbar-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .15rem;
}
.compte-formation-block {
  max-width: 36rem;
  margin: 1.25rem 0 0;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
}
.compte-formation-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--turquoise);
  margin-bottom: .35rem;
}
.compte-formation-text {
  margin: 0;
  font-size: .84rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .65);
}
.compte-formation-link {
  color: #9af3f0;
  font-weight: 600;
  text-decoration: none;
}
.compte-formation-link:hover {
  color: #fff;
  text-decoration: underline;
}

