/* ==============================================
   AXIA MASTER RH — CSS Commun
   Design tokens partages avec dev-ing
   ============================================== */

:root {
  --primary: #1a365d;
  --primary-light: #2b4c7e;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --bg: #edf3f7;
  --card: #ffffff;
  --border: #c8d8e4;
  --text: #2d3748;
  --text-light: #718096;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
}

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, #e8f0f6 0%, #dde8f0 40%, #e2ecf4 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- LOGIN PAGE ---- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--card);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  text-align: center;
}

.login-logo { height: 56px; margin-bottom: 16px; }
.login-card h2 { font-size: 1.4rem; color: var(--primary); margin-bottom: 4px; }
.login-subtitle { color: var(--text-light); font-size: 0.85rem; margin-bottom: 24px; }

.form-field { text-align: left; margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--text-light); margin-bottom: 4px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,126,34,0.1);
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--accent); color: white;
  border: none; border-radius: 8px;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
  margin-top: 8px;
}
.btn-login:hover { background: var(--accent-light); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---- APP HEADER ---- */
.app-header {
  background: #2a6e8f;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%),
    linear-gradient(315deg, rgba(0,210,230,0.2) 0%, transparent 40%),
    linear-gradient(135deg, #1e5a7a 0%, #2a7d9e 30%, #2a6e8f 60%, #1b5575 100%);
  color: white;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.app-header-left { display: flex; align-items: center; gap: 16px; }
.app-logo { height: 44px; filter: brightness(1.1); }
.app-header h1 { font-size: 1.2rem; font-weight: 600; }
.app-header-sub { font-size: 0.78rem; opacity: 0.7; }
.app-header-right { display: flex; align-items: center; gap: 12px; }
.user-badge {
  font-size: 0.82rem;
  padding: 4px 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
}

/* ---- NAV ---- */
.app-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.app-nav a {
  padding: 14px 18px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.app-nav a:hover { color: var(--primary); }
.app-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ---- BUTTONS ---- */
.btn-app {
  padding: 8px 16px;
  border: none; border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem; font-weight: 500;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-outline-dark { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.4); }
.btn-outline-dark:hover { background: rgba(255,255,255,0.1); }
.btn-outline { background: white; color: var(--primary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-small { font-size: 0.78rem; padding: 5px 12px; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.85; }
.btn-success { background: var(--success); color: white; }

/* ---- CONTAINER ---- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 { color: var(--primary); font-size: 1.6rem; }
.page-header .actions { display: flex; gap: 8px; }

/* ---- DASHBOARD STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-left: 4px solid var(--accent);
}
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.info { border-left-color: var(--info); }

.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label {
  font-size: 0.78rem; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.3px;
  margin-top: 4px;
}
.stat-sub { font-size: 0.75rem; color: var(--text-light); margin-top: 8px; }

/* ---- CARD ---- */
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.card h3 { color: var(--primary); margin-bottom: 16px; font-size: 1.1rem; }

/* ---- TABLE ---- */
.table-wrapper {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data-table thead {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
table.data-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
table.data-table tr:hover { background: #fafcfd; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table td a { color: var(--primary); font-weight: 500; text-decoration: none; }
table.data-table td a:hover { color: var(--accent); }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-actif { background: var(--success); }
.badge-conges { background: var(--info); }
.badge-suspendu { background: var(--warning); }
.badge-sorti { background: var(--text-light); }
.badge-apte { background: var(--success); }
.badge-apte_reserves { background: var(--warning); }
.badge-inapte { background: var(--danger); }
.badge-a_faire { background: var(--text-light); }
.badge-en_cours { background: var(--info); }
.badge-fait { background: var(--success); }
.badge-na { background: var(--border); color: var(--text); }

/* ---- PYRAMIDE DES AGES ---- */
.pyramide {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pyr-header {
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  align-items: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.pyr-row {
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  align-items: center;
  gap: 4px;
  height: 28px;
}
.pyr-side {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.pyr-h {
  justify-content: flex-end;
  flex-direction: row;
}
.pyr-f {
  justify-content: flex-start;
}
.pyr-bar {
  height: 20px;
  border-radius: 4px;
  min-width: 0;
  transition: width 0.5s ease;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08);
}
.pyr-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  min-width: 18px;
  text-align: center;
}
.pyr-label {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  background: var(--bg);
  padding: 3px 6px;
  border-radius: 14px;
  white-space: nowrap;
}

/* ---- COMPETENCE PILLS (logiciels + autres) ---- */
.comp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.comp-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px 6px 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.15s;
}
.comp-pill:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.comp-logo, .comp-logo-fallback {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fafcfd;
  border: 1px solid var(--border);
  overflow: hidden;
}
.comp-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.comp-logo-fallback {
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
}
.comp-pill-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.comp-pill-nom {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--primary);
  white-space: nowrap;
}
.comp-pill-editeur {
  font-size: 0.68rem;
  color: var(--text-light);
  white-space: nowrap;
}
.comp-pill-niveau {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: white;
}
.comp-pill-niveau[data-niveau="decouverte"] { background: #95a5a6; }
.comp-pill-niveau[data-niveau="debutant"]   { background: #e67e22; }
.comp-pill-niveau[data-niveau="intermediaire"] { background: #f39c12; }
.comp-pill-niveau[data-niveau="confirme"]   { background: #3498db; }
.comp-pill-niveau[data-niveau="expert"]     { background: #27ae60; }

/* ---- CLES / BADGES CHECKBOX ---- */
.cle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.cle-item:hover { border-color: var(--accent); background: #fff9f0; }
.cle-item input[type=checkbox] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}
.cle-item input[type=checkbox]:checked + span {
  color: var(--primary);
  font-weight: 600;
}
.cle-item input[type=checkbox]:checked {
  transform: scale(1.1);
}
.cle-item:has(input:checked) {
  background: #f0f9f0;
  border-color: var(--success);
}

/* ---- STICKY TABS BAR (fiche employe) ---- */
.sticky-tabs-bar {
  position: sticky;
  top: 76px; /* hauteur de l'app-header */
  background: var(--bg);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 0;
  margin: 0 0 20px;
  box-shadow: 0 6px 10px -8px rgba(0,0,0,0.08);
}
.sticky-tabs-bar .tabs {
  flex: 1;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
}
.sticky-save-btn {
  margin-bottom: 6px;
  flex-shrink: 0;
}

/* ---- FICHE EMPLOYE (tabs) ---- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 18px;
  cursor: pointer;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- GRID FORMULAIRE ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ---- KANBAN ---- */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  overflow-x: auto;
}
.kanban-col {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px;
  min-height: 300px;
}
.kanban-col h4 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  justify-content: space-between;
}
.kanban-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: grab;
  border-left: 3px solid var(--accent);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.kanban-card-meta { font-size: 0.75rem; color: var(--text-light); }

/* ---- ONGLET EN CAS D'URGENCE ---- */
.tab.tab-urgence {
  border-left: 4px solid #e74c3c;
  padding-left: 12px;
}
.tab.tab-urgence.active {
  color: #c0392b;
  border-bottom-color: #e74c3c;
}

.urgence-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #fef2f2, #fff5f5);
  border-left: 6px solid #e74c3c;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(231,76,60,0.15);
}

.urgence-cross {
  width: 72px;
  height: 72px;
  background: #e74c3c;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(231,76,60,0.35);
  flex-shrink: 0;
  position: relative;
}
.urgence-cross::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 2px solid white;
  border-radius: 10px;
}
.urgence-cross span {
  color: white;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  z-index: 1;
}

.urgence-card {
  border-left: 4px solid #e74c3c;
}
.urgence-card h3 {
  color: #c0392b;
}

.contact-urgence-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: white;
  transition: all 0.2s;
  position: relative;
}
.contact-urgence-card.principal {
  border-color: #e74c3c;
  background: #fef2f2;
}
.contact-urgence-card.principal::before {
  content: 'PRINCIPAL';
  position: absolute;
  top: -8px;
  left: 14px;
  background: #e74c3c;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

/* ---- DOC ID CARDS ---- */
.doc-id-card {
  background: white;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  transition: border-color 0.2s;
}
.doc-id-card.uploaded { border-style: solid; border-color: var(--success); }
.doc-id-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.doc-id-state {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
}
.doc-id-state.ok {
  color: var(--text);
  font-weight: 500;
}
.doc-id-state .expired { color: var(--danger); font-weight: 600; }
.doc-id-state .warning { color: var(--warning); font-weight: 600; }
.doc-id-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.doc-faces-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.doc-face {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafcfd;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.15s;
}
.doc-face-empty {
  cursor: pointer;
  border-style: dashed;
  background: white;
  align-items: center;
  justify-content: center;
  padding: 18px 8px;
}
.doc-face-empty:hover {
  border-color: var(--accent);
  background: #fff9f0;
}
.doc-face-plus {
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
}
.doc-face-label {
  font-size: 0.72rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  margin-top: 6px;
}
.doc-face-filled { padding: 0; }
.doc-face-filled .doc-face-label {
  color: var(--primary);
  margin: 0 0 2px 0;
}
.doc-face-preview {
  flex: 1;
  min-height: 80px;
  max-height: 140px;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
}
.doc-face-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.doc-face-icon {
  font-size: 2.2rem;
  color: white;
  text-align: center;
}
.doc-face-meta {
  padding: 6px 8px 4px;
  font-size: 0.72rem;
}
.doc-face-name {
  font-size: 0.72rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-face-size {
  font-size: 0.68rem;
  color: var(--text-light);
}
.doc-face-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
}
.btn-mini {
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}
.btn-mini:hover { background: rgba(0,0,0,0.8); }
.btn-mini-danger { background: var(--danger); }
.btn-mini-danger:hover { background: #c0392b; }

.doc-id-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  padding: 28px;
  max-width: 640px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal h3 { color: var(--primary); margin-bottom: 20px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text); }
.empty-state .btn-app { margin-top: 16px; }

/* ---- NAV MEGA-MENU (MASE) ---- */
.nav-mega-wrapper {
  position: relative;
  display: inline-flex;
}
.nav-mega-trigger {
  padding: 14px 18px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  border-top: none; border-left: none; border-right: none;
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
}
.nav-mega-trigger:hover { color: var(--primary); }
.nav-mega-trigger.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.nav-mega-chevron {
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform 0.15s;
}
.nav-mega-wrapper:hover .nav-mega-chevron,
.nav-mega-wrapper:focus-within .nav-mega-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--espace-color, var(--accent));
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 16px 20px;
  display: none;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 18px;
  z-index: 100;
  min-width: 900px;
}
.nav-mega-wrapper:hover .nav-mega-panel,
.nav-mega-wrapper:focus-within .nav-mega-panel,
.nav-mega-wrapper.open .nav-mega-panel {
  display: grid;
}
.nav-mega-wrapper.open .nav-mega-chevron {
  transform: rotate(180deg);
  opacity: 1;
}
.nav-mega-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-mega-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  padding: 6px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.nav-mega-item {
  padding: 7px 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: all 0.12s;
  border-bottom: none;
  white-space: nowrap;
}
.nav-mega-item:hover {
  background: var(--bg);
  color: var(--accent);
  padding-left: 12px;
}
.nav-mega-item.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(230, 126, 34, 0.08);
}

/* Bonne position a droite si proche du bord */
.nav-mega-wrapper:last-child .nav-mega-panel { left: auto; right: 0; }

/* ---- HUB MASE (page mase.php avec les 5 axes) ---- */
.mase-hub {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.mase-axe {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.mase-axe-bandeau {
  background: var(--axe-color);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.mase-axe-numero {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.95;
  white-space: nowrap;
}
.mase-axe-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex: 1;
}
.mase-axe-body {
  padding: 18px 24px 22px;
}
.mase-axe-objectif {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 4px solid var(--axe-color);
}
.mase-axe-objectif strong {
  color: var(--axe-color);
  font-weight: 700;
}
.mase-sujets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.mase-sujet-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: all 0.15s ease;
  font-size: 0.92rem;
}
.mase-sujet-card:hover {
  background: var(--card);
  border-color: var(--axe-color);
  color: var(--axe-color);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mase-sujet-arrow {
  color: var(--axe-color);
  font-weight: 700;
  transition: transform 0.15s;
}
.mase-sujet-card:hover .mase-sujet-arrow {
  transform: translateX(2px);
}
.mase-sujet-label { flex: 1; }

@media (max-width: 640px) {
  .mase-axe-bandeau { padding: 12px 16px; gap: 10px; }
  .mase-axe-title { font-size: 1rem; }
  .mase-axe-body { padding: 14px 16px 18px; }
  .mase-sujets-grid { grid-template-columns: 1fr; }
}

/* ---- STUB MASE (pages en cours d'implementation) ---- */
.mase-stub-card {
  text-align: center;
  padding: 48px 32px;
  max-width: 640px;
  margin: 32px auto;
}
.mase-stub-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.8;
}
.mase-stub-card h3 {
  font-size: 1.3rem;
  margin: 12px 0 8px;
  color: var(--primary);
}
.mase-stub-card p.muted {
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.mase-stub-features {
  text-align: left;
  background: var(--bg);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0 28px;
  border-left: 3px solid var(--accent);
}
.mase-stub-features-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.mase-stub-features ul {
  margin: 0;
  padding-left: 22px;
  color: var(--text);
}
.mase-stub-features li {
  margin: 6px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.mase-stub-footer {
  margin-top: 16px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .app-header { flex-direction: column; gap: 12px; text-align: center; padding: 12px 16px; }
  .container { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
  .app-nav { flex-wrap: nowrap; overflow-x: auto; }
  .nav-mega-wrapper { position: static; }
  .nav-mega-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 70vh;
    overflow-y: auto;
    display: none !important;
    grid-template-columns: 1fr;
    min-width: 0;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
    border-radius: 12px 12px 0 0;
    border-top: 3px solid var(--espace-color, var(--accent));
    padding: 16px 20px 24px;
    background: var(--card);
    z-index: 200;
  }
  .nav-mega-wrapper.open .nav-mega-panel { display: grid !important; }
  /* Desactiver le hover sur mobile (seul le clic ouvre) */
  .nav-mega-wrapper:hover .nav-mega-panel { display: none !important; }
  .nav-mega-wrapper.open:hover .nav-mega-panel { display: grid !important; }
  .nav-mega-col { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 4px; }
  .nav-mega-col:last-child { border-bottom: none; }
}

/* ============================================================ */
/* MASE — Politique SSE (rendu fidele a la charte PDF AXIA)     */
/* ============================================================ */

.politique-doc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 50px;
  max-width: 900px;
  margin: 0 auto;
  color: #333;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.politique-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 16px;
}
.politique-title {
  font-size: 2rem;
  font-weight: 800;
  color: #2c5ba9;
  letter-spacing: 1px;
  line-height: 1;
}
.politique-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c5ba9;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.politique-annee {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin-top: 6px;
}
.politique-logo {
  max-height: 60px;
  width: auto;
}

.politique-preambule {
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: justify;
  margin-bottom: 16px;
}
.politique-preambule p { margin: 0 0 10px; }

.politique-ambition {
  font-size: 0.95rem;
  text-align: center;
  color: #333;
  margin: 16px 0 20px;
}

/* Les 3 encadres d'engagements */
.politique-block {
  border: 2px solid;
  border-radius: 4px;
  padding: 14px 20px 16px;
  margin-bottom: 18px;
  background: #fff;
}
.politique-block-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.politique-block ul {
  margin: 0;
  padding-left: 22px;
}
.politique-block li {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 6px;
  color: #444;
}
/* Encadre orange "Notre societe" */
.politique-block-societe {
  border-color: #e67e22;
}
.politique-block-societe .politique-block-title {
  color: #e67e22;
}
/* Encadre bleu "Collaborateurs" */
.politique-block-collab {
  border-color: #2c5ba9;
}
.politique-block-collab .politique-block-title {
  color: #2c5ba9;
}
/* Encadre bleu "Partenaires" */
.politique-block-partenaires {
  border-color: #2c5ba9;
}
.politique-block-partenaires .politique-block-title {
  color: #2c5ba9;
}

.politique-slogan {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: #333;
  margin: 22px 0 26px;
  letter-spacing: 0.3px;
}

.politique-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.politique-mase-logo {
  font-weight: 800;
  font-size: 1.6rem;
  color: #4a7c59;
  letter-spacing: 1px;
  line-height: 1;
}
.politique-mase-ref {
  font-size: 0.75rem;
  color: #666;
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.politique-signataires {
  text-align: right;
  font-size: 0.9rem;
}
.politique-signataire {
  margin-bottom: 6px;
}
.politique-signataire-nom {
  font-weight: 600;
  color: #333;
}
.politique-signataire-fonction {
  font-size: 0.82rem;
  color: #666;
}
.politique-date {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #666;
}

/* Formulaire d'edition — repeaters */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.form-grid label { font-size: 0.82rem; color: #555; display: block; margin-bottom: 4px; }
.form-grid input, .form-grid select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.repeater { margin-bottom: 10px; }
.repeater-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.repeater-row input[type="text"] {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.repeater-row-signataire input[type="text"] { flex: 1; }
.repeater-row-signataire input[type="text"]:first-child { flex: 1.2; }

/* Status pill reutilise pour politique (fallback si pas defini ailleurs) */
.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   POLITIQUE SSE — upload PDF signe (drop zone + status)
   ============================================================ */

.pdf-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f7fafc;
}
.pdf-status-ok {
  border-color: #c6f0d4;
  background: #f0faf3;
}
.pdf-status-empty {
  border-color: #fed7aa;
  background: #fff8f0;
}
.pdf-status-icon {
  width: 48px; height: 56px;
  background: #e53e3e;
  color: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.pdf-status-icon-empty {
  background: #cbd5e0;
  color: #718096;
  font-size: 1.4rem;
}
.pdf-status-info {
  flex: 1;
  min-width: 0;
}
.pdf-status-name {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-status-meta {
  font-size: 0.8rem;
  margin-top: 2px;
}
.pdf-status-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Drop zone */
.pdf-dropzone {
  display: block;
  border: 2px dashed #cbd5e0;
  border-radius: 8px;
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  background: #fafbfc;
  transition: all 0.15s;
}
.pdf-dropzone:hover {
  border-color: #1a365d;
  background: #f0f4f8;
}
.pdf-dropzone.dragover {
  border-color: #27ae60;
  background: #f0faf3;
  transform: scale(1.01);
}
.pdf-dropzone.has-file {
  border-color: #27ae60;
  background: #f0faf3;
  border-style: solid;
}
.pdf-dropzone-title {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.95rem;
}
.pdf-dropzone-sub {
  font-size: 0.82rem;
  margin-top: 4px;
}
.pdf-selected {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #27ae60;
  font-weight: 600;
  display: inline-block;
}

@media (max-width: 640px) {
  .pdf-status { flex-direction: column; align-items: flex-start; }
  .pdf-status-actions { width: 100%; }
}

/* ============================================================
   INDICATEURS SSE — jauges KPI, cartes indicateurs
   ============================================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.kpi-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.kpi-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.kpi-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-card-head .axe-badge { flex-shrink: 0; }
.kpi-type-auto {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: #ebf4ff;
  color: #2c5282;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.kpi-type-manuel {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fef3e7;
  color: #9c4221;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.kpi-statut-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.9), 0 0 0 4px rgba(0,0,0,0.08);
}
.kpi-title {
  margin: 0;
  font-size: 0.92rem;
  color: #2d3748;
  line-height: 1.35;
  font-weight: 600;
}
.kpi-jauge {
  text-align: center;
  margin: 4px 0;
}
.kpi-jauge svg { display: block; margin: 0 auto; }
.kpi-seuils {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}
.kpi-seuil {
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.kpi-seuil.vert   { background: #f0faf3; color: #27ae60; }
.kpi-seuil.orange { background: #fff8f0; color: #e67e22; }
.kpi-sens {
  font-size: 0.72rem;
  font-style: italic;
}
.kpi-objectif {
  font-size: 0.8rem;
  padding: 6px 10px;
  background: #f7fafc;
  border-radius: 6px;
  border-left: 3px solid #1a365d;
}
.kpi-meta {
  font-size: 0.72rem;
  font-style: italic;
}
.kpi-card-foot {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
  margin-top: auto;
  border-top: 1px solid #edf2f7;
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   OBJECTIFS SSE — badges axes, progress bars, cards
   ============================================================ */

/* Badges axes MASE (couleurs cohérentes avec hub bandeaux) */
.axe-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
}
.axe-badge.axe-1, .axe-title.axe-1 { border-left-color: #1a365d; }
.axe-badge.axe-1 { background: #1a365d; }
.axe-badge.axe-2 { background: #27ae60; }
.axe-badge.axe-3 { background: #2c5ba9; }
.axe-badge.axe-4 { background: #e67e22; }
.axe-badge.axe-5 { background: #9b59b6; }

/* Filter chips */
.filter-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: #4a5568;
  background: #f0f2f5;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.filter-chip:hover { background: #e2e8f0; }
.filter-chip.active {
  background: #fff;
  border-color: #1a365d;
  color: #1a365d;
}
.filter-chip.axe-1.active { border-color: #1a365d; color: #1a365d; }
.filter-chip.axe-2.active { border-color: #27ae60; color: #27ae60; }
.filter-chip.axe-3.active { border-color: #2c5ba9; color: #2c5ba9; }
.filter-chip.axe-4.active { border-color: #e67e22; color: #e67e22; }
.filter-chip.axe-5.active { border-color: #9b59b6; color: #9b59b6; }

/* Titre de section par axe */
.axe-title {
  padding: 8px 14px;
  border-left: 5px solid #1a365d;
  background: #f7fafc;
  margin: 0 0 12px;
  font-size: 1rem;
  color: #2d3748;
  font-weight: 600;
}
.axe-title.axe-1 { border-left-color: #1a365d; }
.axe-title.axe-2 { border-left-color: #27ae60; }
.axe-title.axe-3 { border-left-color: #2c5ba9; }
.axe-title.axe-4 { border-left-color: #e67e22; }
.axe-title.axe-5 { border-left-color: #9b59b6; }

/* Grille de cartes objectifs */
.objectifs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.objectif-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.15s;
}
.objectif-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.objectif-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.prio-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-left: auto;
}
.objectif-title {
  margin: 0;
  font-size: 0.98rem;
  color: #2d3748;
  line-height: 1.35;
}
.objectif-desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}
.objectif-meta {
  font-size: 0.8rem;
  color: #4a5568;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.objectif-meta strong { color: #2d3748; font-weight: 600; }
.objectif-card-foot {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid #edf2f7;
  margin-top: 4px;
}

/* Progress bar */
.progress-bar {
  position: relative;
  height: 18px;
  background: #edf2f7;
  border-radius: 9px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  transition: width 0.3s;
  border-radius: 9px;
}
.progress-fill.p-green  { background: linear-gradient(90deg, #48bb78, #27ae60); }
.progress-fill.p-orange { background: linear-gradient(90deg, #ed8936, #e67e22); }
.progress-fill.p-red    { background: linear-gradient(90deg, #fc8181, #e53e3e); }
.progress-label {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2d3748;
  text-shadow: 0 0 3px rgba(255,255,255,0.7);
}

/* Modal - variante objectif (position flex quand inline style display:flex) */
#objectif-modal.modal-overlay { align-items: flex-start; padding-top: 40px; }
#objectif-modal .modal { max-width: 780px; padding: 22px 26px; }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.modal-head h3 { margin: 0; color: #1a365d; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #a0aec0;
  padding: 0 4px;
}
.modal-close:hover { color: #2d3748; }

/* Stats row pour page objectifs */
.stat-label { font-size: 0.75rem; color: #718096; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: #2d3748; line-height: 1.1; margin-top: 4px; }

/* Responsive */
@media (max-width: 768px) {
  .politique-doc { padding: 22px 20px; }
  .politique-title { font-size: 1.5rem; }
  .politique-header { flex-direction: column; gap: 12px; }
  .politique-logo { max-height: 48px; }
  .politique-footer { flex-direction: column; align-items: flex-start; }
  .politique-signataires { text-align: left; }
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
  .objectifs-grid { grid-template-columns: 1fr; }
}

/* ============================================================ */
/* MASE - Engagement de la direction                             */
/* ============================================================ */

.engagement-doc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 50px;
  max-width: 900px;
  margin: 0 auto;
  color: #333;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.engagement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 28px;
  border-bottom: 3px solid #1a365d;
  padding-bottom: 16px;
}
.engagement-title-main {
  font-size: 1.9rem;
  font-weight: 800;
  color: #1a365d;
  letter-spacing: 1.5px;
  line-height: 1;
}
.engagement-subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: #4a5568;
  letter-spacing: 0.5px;
  margin-top: 8px;
}
.engagement-logo {
  max-height: 60px;
  width: auto;
  flex-shrink: 0;
}

.engagement-lettre {
  font-size: 0.95rem;
  line-height: 1.7;
  text-align: justify;
  color: #2d3748;
  margin-bottom: 28px;
}
.engagement-lettre p {
  margin: 0 0 14px;
}
.engagement-lettre p:first-child::first-letter {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a365d;
  float: left;
  line-height: 1;
  padding: 4px 8px 0 0;
}

.engagement-moyens {
  margin: 28px 0;
  padding: 20px 22px;
  background: #f7fafc;
  border-left: 4px solid #e67e22;
  border-radius: 4px;
}
.engagement-moyens h3 {
  margin: 0 0 16px;
  color: #1a365d;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}
.engagement-moyens-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
}
.moyen-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
}
.moyen-card.wide {
  grid-column: span 1;
}
.moyen-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #718096;
  font-weight: 600;
  margin-bottom: 6px;
}
.moyen-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e67e22;
  line-height: 1.1;
}
.moyen-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #2d3748;
}

.engagement-plan {
  margin: 28px 0;
}
.engagement-plan h3 {
  margin: 0 0 14px;
  color: #1a365d;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}
.engagement-plan table { margin: 0; }

.engagement-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 2px solid #e5e7eb;
}
.engagement-sign {
  text-align: left;
}
.engagement-sign-nom {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a365d;
}
.engagement-sign-fct {
  font-size: 0.88rem;
  color: #4a5568;
  margin-top: 2px;
}
.engagement-sign-date {
  font-size: 0.82rem;
  color: #718096;
  margin-top: 6px;
}
.engagement-politique-ref {
  font-size: 0.82rem;
  color: #4a5568;
  text-align: right;
  max-width: 280px;
}
.engagement-politique-ref a {
  color: #2c5ba9;
  text-decoration: none;
  font-weight: 600;
}
.engagement-politique-ref a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .engagement-doc { padding: 22px 20px; }
  .engagement-title-main { font-size: 1.4rem; }
  .engagement-header { flex-direction: column; gap: 12px; }
  .engagement-logo { max-height: 48px; }
  .engagement-moyens-grid { grid-template-columns: 1fr; }
  .engagement-footer { flex-direction: column; align-items: flex-start; }
  .engagement-politique-ref { text-align: left; }
  .engagement-lettre p:first-child::first-letter { font-size: 1.8rem; }
}

/* ============================================================ */
/* MASE - Widget etat Axe 1 (dashboard)                          */
/* ============================================================ */

.axe1-widget { margin-bottom: 24px; }
.axe1-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.axe1-widget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.axe1-tile {
  display: block;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  text-decoration: none;
  color: #2d3748;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  border-left-width: 4px;
}
.axe1-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.axe1-tile-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #718096;
  font-weight: 600;
  margin-bottom: 8px;
}
.axe1-tile-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a365d;
  line-height: 1.2;
  word-break: break-word;
}
.axe1-tile-sub {
  font-size: 0.78rem;
  color: #718096;
  margin-top: 6px;
}
.axe1-tile-ok { border-left-color: #27ae60; }
.axe1-tile-ok .axe1-tile-sub { color: #27ae60; font-weight: 600; }
.axe1-tile-partial { border-left-color: #e67e22; }
.axe1-tile-partial .axe1-tile-sub { color: #e67e22; font-weight: 600; }
.axe1-tile-ko { border-left-color: #e53e3e; background: #fff5f5; }
.axe1-tile-ko .axe1-tile-value { color: #e53e3e; }
.axe1-tile-ko .axe1-tile-sub { color: #e53e3e; font-weight: 600; }

@media (max-width: 768px) {
  .axe1-widget-grid { grid-template-columns: repeat(2, 1fr); }
  .axe1-widget-head { flex-direction: column; align-items: flex-start; }
}

/* ============================================================ */
/* MASE - Matrice Causeries (employes x dates)                   */
/* ============================================================ */

.causerie-legende {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.caus-mark {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  margin-left: 6px;
}
.caus-mark.caus-P { background: #27ae60; }
.caus-mark.caus-A { background: #2c5ba9; }
.caus-mark.caus-X { background: #e53e3e; }
.caus-mark.caus-M { background: #f6c244; color: #5a4500; }
.caus-mark.caus-N { background: #cbd5e0; color: #718096; }

.causerie-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}
.causerie-matrix th,
.causerie-matrix td {
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}
.causerie-matrix thead th {
  background: #f7fafc;
  color: #1a365d;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* En-tete causerie : texte vertical propre (writing-mode) */
.causerie-matrix .cm-head {
  height: 180px;
  min-width: 48px;
  max-width: 48px;
  width: 48px;
  padding: 10px 0 8px;
  vertical-align: bottom;
  background: #f7fafc;
  border-bottom: 2px solid #cbd5e0;
}
.cm-head-rot {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #1a365d;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0 auto;
  height: 160px;
}
.cm-head-theme {
  max-height: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm-head-date {
  color: #4a5568;
  font-weight: 500;
  font-size: 0.76rem;
}

/* En-tete "a planifier" (emplacement objectif vide) */
.causerie-matrix .cm-head-empty {
  background: #fafbfc;
  cursor: pointer;
  border-bottom: 2px dashed #cbd5e0;
  transition: background 0.15s;
}
.causerie-matrix .cm-head-empty:hover {
  background: #edf2f7;
}
.cm-head-empty .cm-head-rot {
  color: #a0aec0;
  font-weight: 500;
  font-style: italic;
}
.cm-cell-empty {
  background: repeating-linear-gradient(45deg, #f7fafc, #f7fafc 4px, #edf2f7 4px, #edf2f7 8px);
  color: transparent;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 34px;
}

.causerie-matrix .cm-pct {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 6px 8px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  position: static;
}
.cm-pct-row-label {
  text-align: right !important;
  font-size: 0.78rem;
  font-weight: 600;
  color: #718096;
  background: #fff !important;
  position: sticky;
  left: 0;
  z-index: 1;
}
.cm-total-head {
  background: #f7fafc;
  min-width: 84px;
  padding: 8px 10px;
  vertical-align: bottom;
}
.causerie-matrix .cm-emp-head {
  text-align: left;
  padding-left: 14px;
  min-width: 180px;
  left: 0;
  z-index: 3;
}
.causerie-matrix .cm-emp {
  text-align: left;
  padding-left: 14px;
  font-weight: 600;
  color: #2d3748;
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 2px solid #cbd5e0;
  min-width: 180px;
}
.causerie-matrix .cm-emp-mat {
  font-size: 0.7rem;
  font-weight: 400;
  margin-top: 1px;
}
.causerie-matrix tbody tr:nth-child(even) .cm-emp { background: #f7fafc; }

/* Ligne totaux en pied de matrice */
.causerie-matrix tfoot .cm-footrow td {
  background: #1a365d;
  color: #fff;
  font-weight: 700;
  border-top: 2px solid #0f2542;
  padding: 8px 6px;
  text-align: center;
}
.causerie-matrix tfoot .cm-footrow .cm-emp.cm-footlabel {
  text-align: left;
  padding-left: 14px;
  background: #1a365d;
  color: #fff;
  border-right: 2px solid #0f2542;
  position: sticky;
  left: 0;
  z-index: 1;
}
.causerie-matrix tfoot .cm-footrow-sub td {
  background: #2c5282;
  font-weight: 500;
  font-size: 0.78rem;
  padding: 6px 4px;
  border-top: 1px solid #1a365d;
}
.causerie-matrix tfoot .cm-footrow-sub .cm-emp.cm-footlabel {
  background: #2c5282;
  font-style: italic;
}
.cm-foot-cell .muted { color: #cbd5e0; font-weight: 400; font-size: 0.78rem; margin-left: 2px; }
.cm-foot-empty { background: rgba(255,255,255,0.08) !important; color: #718096 !important; }
.cm-foot-detail .cm-foot-p { color: #9ae6b4; font-weight: 700; }
.cm-foot-detail .cm-foot-a { color: #90cdf4; font-weight: 700; }
.cm-foot-detail .cm-foot-x { color: #feb2b2; font-weight: 700; }
.cm-foot-detail .cm-foot-m { color: #fbd38d; font-weight: 700; }

/* Bandeau statistiques globales au-dessus de la matrice */
.matrix-info {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  color: #fff;
  border-bottom: 3px solid #e67e22;
}
.matrix-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 24px;
  align-items: center;
}
.matrix-info .mi-block { padding: 4px 0; }
.matrix-info .mi-block-global {
  padding-left: 20px;
  border-left: 2px solid rgba(255,255,255,0.25);
}
.matrix-info .mi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}
.matrix-info .mi-value {
  font-size: 1rem;
  color: #fff;
  font-weight: 600;
}
.matrix-info .mi-value strong { color: #fff; }
.matrix-info .muted { color: rgba(255,255,255,0.6); }
@media (max-width: 768px) {
  .matrix-info-row { grid-template-columns: 1fr; gap: 12px; }
  .matrix-info .mi-block-global { padding-left: 0; border-left: none; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 12px; }
}

/* ==================================================
   Blocs detail par causerie (sous la matrice)
   ================================================== */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a365d;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e67e22;
}
.caus-block {
  padding: 0;
  margin-bottom: 18px;
  overflow: hidden;
}
.caus-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  color: #fff;
  gap: 20px;
}
.caus-block-date {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.caus-block .caus-block-title,
h3.caus-block-title {
  margin: 2px 0 6px !important;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff !important;
}
.caus-block-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  flex-wrap: wrap;
}
.caus-block-meta strong { color: #fff; }
.caus-block-stats { text-align: right; min-width: 140px; }
.caus-mini-pct { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.caus-mini-detail { font-size: 0.75rem; color: rgba(255,255,255,0.7); margin-top: 2px; }
.caus-badge-future {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.caus-block-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 20px;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}
.caus-block-section {
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.caus-block-section:last-child { border-bottom: none; }
.caus-subheader {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4a5568;
  font-weight: 700;
  margin-bottom: 8px;
}
.caus-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  resize: vertical;
  background: #fff;
  transition: border-color 0.15s;
}
.caus-field:focus {
  outline: none;
  border-color: #1a365d;
  box-shadow: 0 0 0 2px rgba(26,54,93,0.12);
}
.caus-bullets {
  line-height: 1.55;
  font-size: 0.92rem;
  padding-left: 12px;
  background: #fff;
}
.caus-bullets::placeholder { color: #a0aec0; font-style: italic; }

/* Upload slots */
.caus-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  border: 1px dashed #cbd5e0;
  background: #fff;
  transition: all 0.15s;
}
.caus-upload-ok {
  border: 1px solid #27ae60;
  background: #f0fdf4;
}
.caus-upload-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1a365d;
  text-decoration: none;
  font-weight: 600;
  min-width: 0;
}
.caus-upload-link:hover { color: #e67e22; }
.caus-upload-icon { font-size: 1.2rem; }
.caus-upload-name { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.caus-upload-del {
  background: transparent;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
}
.caus-upload-del:hover { background: #fef2f2; }
.caus-upload-empty {
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 4px;
}
.caus-upload-drop { cursor: pointer; }
.caus-upload-drop:hover {
  border-color: #e67e22;
  background: #fffaf5;
}
.caus-upload-plus {
  font-weight: 700;
  color: #1a365d;
}
.caus-upload-hint { font-size: 0.75rem; }

/* Actions issues de la causerie */
.caus-actions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}
.caus-empty {
  padding: 14px;
  text-align: center;
  background: #f7fafc;
  border-radius: 6px;
  font-style: italic;
  font-size: 0.88rem;
}
.caus-action {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.caus-action:last-child { margin-bottom: 0; }
.caus-action-line1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.caus-action-prio {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.prio-low { background: #e2e8f0; color: #4a5568; }
.prio-med { background: #fef3c7; color: #7c5800; }
.prio-high { background: #fed7aa; color: #7c2d12; }
.prio-crit { background: #fecaca; color: #7f1d1d; }
.caus-action-title {
  flex: 1;
  font-weight: 600;
  color: #2d3748;
  min-width: 150px;
}
.caus-action-statut {
  padding: 4px 8px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.82rem;
  background: #fff;
  cursor: pointer;
}
.caus-action-statut.stat-fait,
.caus-action-statut.stat-realisee,
.caus-action-statut.stat-verifiee,
.caus-action-statut.stat-soldee { background: #d1fae5; color: #065f46; border-color: #27ae60; }
.caus-action-statut.stat-en_cours { background: #fef3c7; color: #78350f; border-color: #f6c244; }
.caus-action-statut.stat-annulee,
.caus-action-statut.stat-supprimee { background: #e2e8f0; color: #718096; }
.caus-action-del {
  background: transparent;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.caus-action-del:hover { background: #fef2f2; }
.caus-action-line2 {
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  color: #718096;
  margin-top: 4px;
  flex-wrap: wrap;
}
.caus-action-desc {
  font-size: 0.85rem;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

/* Num / categorie badges sur action */
.caus-action-num {
  background: #1a365d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  font-family: ui-monospace, Menlo, monospace;
}
.caus-action-cat {
  background: #edf2f7;
  color: #2d3748;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e0;
}
.caus-action-title[data-action-edit]:hover {
  text-decoration: underline;
  color: #1a365d;
}

/* Barre de progression % realisation */
.caus-action-progress {
  position: relative;
  height: 6px;
  background: #edf2f7;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.caus-action-progress-bar {
  height: 100%;
  transition: width 0.25s ease;
  border-radius: 3px;
}
.caus-action-progress-label {
  position: absolute;
  top: -18px;
  right: 0;
  font-size: 0.72rem;
  color: #718096;
  font-weight: 600;
}

/* Modal large pour formulaires riches */
.modal-wide {
  max-width: 860px !important;
  width: 92vw;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.form-grid-3 > div > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 4px;
}
.form-grid-3 input,
.form-grid-3 select,
#action-form textarea,
#action-form > div > label + input,
#action-form > div > label + select,
#action-form > div > label + textarea {
  width: 100%;
}
#action-form textarea {
  resize: vertical;
  min-height: 48px;
}
#action-form input[readonly] {
  background: #f7fafc;
  color: #718096;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .caus-block-head { flex-direction: column; }
  .caus-block-stats { text-align: left; }
  .caus-block-body { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .modal-wide { width: 96vw; }
}
.causerie-matrix tbody tr:hover td { background: #edf2f7; }
.causerie-matrix tbody tr:hover .cm-emp { background: #edf2f7; }

/* ============================================================
   PLAN D'ACTIONS — Aligne sur l'app MASE
   ============================================================ */

/* KPIs en haut */
.pa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.pa-kpi {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  border-left: 4px solid #a0aec0;
}
.pa-kpi-label {
  font-size: 0.78rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.pa-kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a365d;
  margin-top: 4px;
  line-height: 1;
}
.pa-kpi-pct {
  font-size: 0.9rem;
  color: #27ae60;
  font-weight: 600;
  margin-left: 6px;
}
.pa-kpi-open    { border-left-color: #3498db; }
.pa-kpi-done    { border-left-color: #27ae60; }
.pa-kpi-overdue { border-left-color: #e53e3e; }
.pa-kpi-urgent  { border-left-color: #f6c244; }

/* Filtres */
.pa-filters {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.pa-filter-grp label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pa-filter-grp select,
.pa-filter-grp input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 0.88rem;
}
.pa-filter-search { grid-column: span 2; }

/* Table */
.pa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.pa-table thead th {
  background: #1a365d;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: sticky;
  top: 0;
}
.pa-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
}
.pa-table tbody tr:hover td { background: #f7fafc; }
.pa-table tbody tr.row-done td { background: #f0fdf4; color: #065f46; }
.pa-table tbody tr.row-done:hover td { background: #dcfce7; }
.pa-table tbody tr.row-progress td { background: #fffbeb; }
.pa-table tbody tr.row-progress:hover td { background: #fef3c7; }
.pa-table tbody tr.row-overdue td { background: #fef2f2; }
.pa-table tbody tr.row-overdue:hover td { background: #fee2e2; }

.pa-num {
  font-family: ui-monospace, Menlo, monospace;
  font-weight: 600;
  color: #1a365d;
  white-space: nowrap;
}
.pa-title { font-weight: 500; max-width: 240px; }
.pa-faits { color: #4a5568; font-size: 0.82rem; max-width: 260px; }

.pa-cat-badge, .pa-orig-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.pa-cat-badge  { background: #edf2f7; color: #2d3748; border: 1px solid #cbd5e0; }
.pa-orig-badge { background: #e6f4ff; color: #1a365d; border: 1px solid #90cdf4; }

/* Tags statut / priorite (MASE style) */
.pa-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.pa-tag-green  { background: #d1fae5; color: #065f46; border: 1px solid #27ae60; }
.pa-tag-orange { background: #fef3c7; color: #78350f; border: 1px solid #f6c244; }
.pa-tag-blue   { background: #dbeafe; color: #1e3a8a; border: 1px solid #3498db; }
.pa-tag-red    { background: #fee2e2; color: #7f1d1d; border: 1px solid #e53e3e; }
.pa-tag-purple { background: #ede9fe; color: #5b21b6; border: 1px solid #8b5cf6; }
.pa-tag-xs { font-size: 0.66rem; padding: 1px 5px; margin-left: 4px; }

/* Barre % realisation */
.pa-pctbar {
  position: relative;
  height: 18px;
  background: #edf2f7;
  border-radius: 3px;
  min-width: 70px;
  overflow: hidden;
}
.pa-pctbar-fill {
  height: 100%;
  transition: width 0.25s ease;
}
.pa-pctbar span {
  position: absolute;
  top: 1px; left: 0; right: 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2d3748;
}

.pa-row-actions { text-align: center; }
.pa-btn-del {
  background: transparent;
  border: 1px solid transparent;
  color: #e53e3e;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
}
.pa-btn-del:hover { background: #fef2f2; border-color: #fca5a5; }

.pa-empty {
  padding: 48px 24px;
  text-align: center;
  color: #718096;
}
.pa-empty p { margin-bottom: 14px; }

@media (max-width: 1100px) {
  .pa-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pa-filters { grid-template-columns: repeat(2, 1fr); }
  .pa-filter-search { grid-column: span 2; }
}

.causerie-matrix .cm-cell {
  font-weight: 700;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 34px;
  color: #fff;
  user-select: none;
  font-size: 0.95rem;
}
.cm-cell-P { background: #27ae60; }
.cm-cell-A { background: #2c5ba9; }
.cm-cell-X { background: #e53e3e; }
.cm-cell-M { background: #f6c244; color: #5a4500; }
.cm-cell-N { background: #e2e8f0; color: #a0aec0; }
/* Causerie a venir : cellule neutre avec "?" */
.cm-cell-F {
  background: repeating-linear-gradient(45deg, #edf2f7, #edf2f7 4px, #e2e8f0 4px, #e2e8f0 8px);
  color: #718096;
  font-weight: 400;
}
.cm-cell-future { opacity: 0.92; }
.cm-head-future { background: #edf2f7 !important; }
.cm-head-future .cm-head-date { color: #718096 !important; font-style: italic; }
.cm-pct-future { font-style: italic; }
.cm-clickable { cursor: pointer; }
.cm-clickable:hover { outline: 2px solid #1a365d; outline-offset: -2px; filter: brightness(1.08); }

.causerie-matrix .cm-total {
  font-weight: 700;
  min-width: 84px;
  padding: 6px 10px;
  border-left: 2px solid #cbd5e0;
  background: #fff;
}

/* Modal cell */
.cell-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cell-choice-M {
  grid-column: span 2; /* la ligne maladie prend toute la largeur */
}
.cell-choice {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.cell-choice:hover {
  border-color: #1a365d;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.cell-choice-P:hover { background: #f0fdf4; }
.cell-choice-A:hover { background: #eff6ff; }
.cell-choice-X:hover { background: #fef2f2; }
.cell-choice-M:hover { background: #fffbeb; }
.cell-choice-N:hover { background: #f7fafc; }

@media (max-width: 768px) {
  .causerie-matrix { font-size: 0.78rem; }
  .causerie-matrix .cm-emp,
  .causerie-matrix .cm-emp-head { min-width: 140px; }
  .cell-choices { grid-template-columns: 1fr; }
}

/* ============================================================
   EPI — Axe 3 : catalogue + dotations
   ============================================================ */
.epi-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.epi-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.epi-tab:hover { color: #1a365d; background: #fff; }
.epi-tab.active {
  color: #1a365d;
  border-bottom-color: #e67e22;
  background: #fff;
}
.epi-zone {
  margin-bottom: 26px;
}
.epi-zone-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}
.epi-zone-head h4 {
  margin: 0;
  color: #1a365d;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.epi-zone-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.epi-zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.epi-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #e67e22;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.epi-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.epi-card-off {
  opacity: 0.5;
  border-left-color: #cbd5e0;
}
.epi-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.epi-card-head strong {
  color: #1a365d;
  font-size: 0.95rem;
  line-height: 1.3;
}
.epi-card-desc {
  font-size: 0.83rem;
  color: #475569;
  line-height: 1.4;
}
.epi-card-refs {
  font-size: 0.78rem;
  color: #2d3748;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.4;
}
.inrs-label {
  display: inline-block;
  background: #1a365d;
  color: #fff;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 4px;
  letter-spacing: 0.5px;
}
.epi-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}
.btn-xs {
  padding: 3px 10px !important;
  font-size: 0.75rem !important;
}

/* EPI — Brochures uploadees par categorie */
.epi-brochures {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.epi-broc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #fef3e8;
  border-left: 3px solid #e67e22;
  border-radius: 4px;
  font-size: 0.78rem;
}
.epi-broc-link {
  color: #1a365d;
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epi-broc-link:hover {
  color: #e67e22;
  text-decoration: underline;
}
.epi-broc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.epi-broc-btn {
  background: transparent;
  border: 1px solid #cbd5e0;
  border-radius: 3px;
  padding: 1px 6px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #4a5568;
  text-decoration: none;
  line-height: 1.2;
}
.epi-broc-btn:hover {
  background: #e67e22;
  color: #fff;
  border-color: #e67e22;
}
.epi-broc-del:hover {
  background: #e53e3e;
  border-color: #e53e3e;
}

/* ============================================================
   ORGANIGRAMME AXIA — vue hierarchique + transversale
   ============================================================ */
.org-tree {
  padding: 20px 10px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-level {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.org-level-gerants { margin-top: 10px; }
.org-trunk {
  width: 3px;
  height: 36px;
  background: linear-gradient(to bottom, #1a365d, #e67e22);
  margin: 6px 0;
  border-radius: 2px;
}
.org-poles-label {
  width: 100%;
  text-align: center;
  margin: 30px 0 16px;
  position: relative;
}
.org-poles-label::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: #cbd5e0;
  z-index: 0;
}
.org-poles-label span {
  position: relative;
  z-index: 1;
  background: #f7fafc;
  padding: 0 20px;
  color: #1a365d;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.org-poles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  width: 100%;
}

/* ---- Carte personne ---- */
.org-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  min-width: 160px;
  max-width: 200px;
  text-align: center;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.org-card:hover {
  border-color: #e67e22;
  box-shadow: 0 6px 18px rgba(230,126,34,0.18);
  transform: translateY(-2px);
}
.org-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #edf2f7;
  border: 2px solid #cbd5e0;
}
.org-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a365d;
  letter-spacing: 1px;
}
.org-name {
  font-weight: 700;
  color: #1a365d;
  font-size: 0.92rem;
  line-height: 1.2;
}
.org-fn {
  font-size: 0.76rem;
  color: #4a5568;
  line-height: 1.25;
  min-height: 1em;
}
.org-mat {
  font-size: 0.68rem;
  color: #718096;
  font-family: 'SF Mono', Consolas, monospace;
  letter-spacing: 0.5px;
}
.org-role {
  margin-top: 4px;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #1a365d;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Hierarchie : variations ---- */
.org-card-top {
  border-top: 5px solid #1a365d;
  min-width: 190px;
}
.org-card-top .org-avatar { width: 72px; height: 72px; }
.org-card-top .org-name { font-size: 1rem; }
.org-card-top .org-role { background: #1a365d; }

.org-card-l2 {
  border-top: 4px solid #9b59b6;
  min-width: 180px;
}
.org-card-l2 .org-avatar { width: 64px; height: 64px; }
.org-card-l2 .org-role { background: #9b59b6; }

.org-card-assistant { border-top-color: #e67e22; }
.org-card-assistant .org-role { background: #e67e22; }

.org-card-sse { border-top-color: #27ae60; }
.org-card-sse .org-role { background: #27ae60; }

.org-level-transverse { margin-top: 4px; }

/* ---- Mode compact (sans photo, sans matricule) ---- */
.org-card-compact {
  padding: 10px 14px;
  min-width: 150px;
  max-width: 220px;
  gap: 3px;
}
.org-card-compact .org-name {
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.org-card-compact .org-fn {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}
.org-card-compact .org-role {
  margin-top: 6px;
}

/* En haut de hierarchie : cartes un peu plus grandes */
.org-card-top.org-card-compact { padding: 14px 18px; min-width: 180px; }
.org-card-top.org-card-compact .org-name { font-size: 1.05rem; }

.org-card-l2.org-card-compact { padding: 12px 16px; min-width: 170px; }
.org-card-l2.org-card-compact .org-name { font-size: 1rem; }

/* Cartes dans les pole-members : encore plus compactes */
.org-pole-members .org-card-compact {
  padding: 7px 10px;
  min-width: 0;
  max-width: none;
}
.org-pole-members .org-card-compact .org-name {
  font-size: 0.85rem;
}
.org-pole-members .org-card-compact .org-fn {
  font-size: 0.68rem;
}

.org-card-resp {
  border: 2px solid #e67e22;
  background: linear-gradient(180deg, #fef3e8 0%, #fff 60%);
  min-width: 170px;
}
.org-card-resp .org-role { background: #e67e22; }

/* ---- Box Pole ---- */
.org-pole {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s;
}
.org-pole:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.org-pole-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 2px solid #e67e22;
}
.org-pole-head h4 {
  margin: 0;
  color: #1a365d;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.org-pole-count {
  background: #1a365d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}
.org-pole-desc {
  font-size: 0.78rem;
  color: #64748b;
  font-style: italic;
  line-height: 1.3;
}
.org-pole-resp {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.org-pole-noresp {
  text-align: center;
  color: #a0aec0;
  font-size: 0.8rem;
  padding: 14px;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e0;
}
.org-pole-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}
.org-pole-members .org-card {
  min-width: 0;
  max-width: none;
  padding: 8px;
  border-radius: 8px;
}
.org-pole-members .org-avatar {
  width: 44px;
  height: 44px;
}
.org-pole-members .org-avatar-initials { font-size: 0.88rem; }
.org-pole-members .org-name { font-size: 0.82rem; }
.org-pole-members .org-fn { font-size: 0.7rem; }
.org-pole-members .org-mat { font-size: 0.62rem; }

@media print {
  .app-header, .app-nav, .page-header > div:last-child { display: none !important; }
  .org-tree { padding: 0; }
  .org-card, .org-pole { break-inside: avoid; }
}
@media (max-width: 768px) {
  .org-poles-grid { grid-template-columns: 1fr; }
  .org-level-gerants { gap: 12px; }
  .org-card { min-width: 140px; }
}

/* ============================================================
   DUER — Document Unique d'Evaluation des Risques
============================================================ */

/* Evaluations list */
.duer-eval-list { display: flex; flex-direction: column; gap: 12px; }
.duer-eval-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
  transition: box-shadow .15s;
}
.duer-eval-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.duer-eval-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.duer-eval-head h4 { margin: 0 0 4px 0; font-size: 1rem; color: #1a365d; }
.duer-eval-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.duer-eval-actions { display: flex; gap: 6px; flex-shrink: 0; }
.duer-progress {
  height: 6px;
  background: #f0f2f5;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.duer-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1a365d, #2d5a90);
  transition: width .3s;
}
.duer-eval-stats {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: #64748b;
}
.duer-risk { color: #e67e22; font-weight: 500; }

/* Statut chips */
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .72rem; background: #f0f2f5; color: #475569; }
.chip-primary { background: #1a365d; color: #fff; }
.chip-client { background: #fef3c7; color: #92400e; }
.chip-inactif { background: #e2e8f0; color: #64748b; }
.duer-st-brouillon { background: #e2e8f0; color: #475569; }
.duer-st-en_cours { background: #dbeafe; color: #1e40af; }
.duer-st-valide { background: #d1fae5; color: #065f46; }
.duer-st-archive { background: #f3f4f6; color: #6b7280; }
.chip-en_place { background: #d1fae5; color: #065f46; }
.chip-a_faire { background: #fef3c7; color: #92400e; }
.chip-en_cours { background: #dbeafe; color: #1e40af; }
.chip-reporte { background: #fecaca; color: #991b1b; }

/* Catalogue */
.duer-catalogue { }
.duer-theme {
  margin-bottom: 22px;
  border-left: 3px solid #1a365d;
  padding-left: 14px;
}
.duer-theme-head {
  margin: 0 0 10px 0;
  color: #1a365d;
  font-size: 1.02rem;
}
.duer-cat-q {
  list-style: decimal;
  padding-left: 22px;
  margin: 0;
}
.duer-cat-q li { margin-bottom: 14px; }
.duer-cat-q-title {
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.4;
}
.duer-cat-q-desc {
  font-size: .83rem;
  color: #64748b;
  margin-bottom: 6px;
  line-height: 1.5;
}
.duer-cat-mesures {
  font-size: .83rem;
  margin-top: 4px;
}
.duer-cat-mesures summary {
  cursor: pointer;
  color: #e67e22;
  font-weight: 500;
  padding: 4px 0;
}
.duer-cat-mesures ul {
  padding-left: 18px;
  margin: 6px 0 0 0;
}
.duer-cat-mesures li {
  margin-bottom: 4px;
  color: #475569;
  list-style: '✓ ';
}

/* Unites travail */
.duer-site-group { margin-bottom: 24px; }
.duer-site-group h4 {
  margin: 0 0 10px 0;
  color: #1a365d;
  font-size: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}
.duer-ut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.duer-ut-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  position: relative;
}
.duer-ut-name { font-weight: 600; color: #0f172a; margin-bottom: 4px; }
.duer-ut-desc { font-size: .78rem; color: #64748b; margin-bottom: 6px; }
.duer-ut-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.duer-ut-actions { display: flex; gap: 4px; }

/* Questions (eval ouverte) */
.duer-q-list { display: flex; flex-direction: column; gap: 10px; }
.duer-q {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.duer-q-risk {
  border-color: #e67e22;
  background: #fffbf5;
}
.duer-q-head {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.duer-q-text { flex: 1; }
.duer-q-title { font-weight: 500; color: #0f172a; line-height: 1.4; margin-bottom: 4px; }
.duer-q-desc { font-size: .8rem; color: #64748b; line-height: 1.5; }
.duer-q-reponses {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.duer-q-reponses label {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: all .15s;
}
.duer-q-reponses label input { display: none; }
.duer-q-reponses label:hover { background: #f8fafc; }
.duer-rep-oui.active { background: #d1fae5; border-color: #10b981; color: #065f46; }
.duer-rep-non.active { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.duer-rep-na.active { background: #e2e8f0; border-color: #64748b; color: #334155; }

.duer-q-cotation { padding-top: 8px; border-top: 1px dashed #e2e8f0; }
.duer-risk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: .85rem;
  color: #e67e22;
  font-weight: 500;
  margin-bottom: 8px;
}
.duer-cotes {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.duer-cote { display: flex; flex-direction: column; gap: 2px; }
.duer-cote label { font-size: .72rem; color: #64748b; }
.duer-cote select {
  padding: 4px 6px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: .8rem;
}
.duer-criticite {
  padding: 6px 10px;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: .85rem;
  align-self: center;
}
.duer-criticite b { color: #e67e22; font-size: 1rem; }

.duer-constat { margin-bottom: 10px; }
.duer-constat label { font-size: .75rem; color: #64748b; display: block; margin-bottom: 2px; }
.duer-constat textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: .85rem;
  font-family: inherit;
  resize: vertical;
}

.duer-mesures { }
.duer-mesures-head {
  font-size: .85rem;
  font-weight: 500;
  color: #1a365d;
  margin-bottom: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.duer-mesures-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.duer-mesure-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 4px;
  font-size: .83rem;
}
.duer-mesure-text { flex: 1; }
.duer-mesure-del {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
}
.duer-mesures-templates {
  padding: 8px 10px;
  background: #f1f5f9;
  border-radius: 6px;
  margin-top: 6px;
}
.duer-tpl-head { font-size: .78rem; margin-bottom: 6px; }
.duer-tpl-list { list-style: none; padding: 0; margin: 0; }
.duer-tpl-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0;
  font-size: .83rem;
  border-bottom: 1px solid #e2e8f0;
}
.duer-tpl-list li:last-child { border-bottom: 0; }
.duer-tpl-list li span { flex: 1; color: #475569; }

@media (max-width: 768px) {
  .duer-q-head { flex-direction: column; }
  .duer-q-reponses { width: 100%; }
  .duer-eval-head { flex-direction: column; }
}

/* ===== EPI : Catalogue de references ===== */
.epi-refs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 4px;
}
.epi-ref-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.epi-ref-card:hover {
  border-color: #1a365d;
  box-shadow: 0 4px 14px rgba(26,54,93,.12);
  transform: translateY(-2px);
}
.epi-ref-img {
  height: 140px;
  background: #f7fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}
.epi-ref-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.epi-ref-noimg {
  font-size: 2.4rem;
  color: #cbd5e0;
}
.epi-ref-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.epi-ref-nom {
  font-weight: 600;
  color: #1a365d;
  font-size: .92rem;
  line-height: 1.25;
}
.epi-ref-normes { font-size: .72rem; color: #4a5568; }
.epi-ref-normes .inrs-label {
  display: inline-block;
  background: #1a365d;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: .65rem;
  margin-right: 4px;
  font-weight: 600;
}
.epi-ref-desc { font-size: .78rem; color: #4a5568; line-height: 1.4; }
.epi-ref-foot {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.epi-ref-prix {
  font-weight: 700;
  color: #e67e22;
  font-size: .95rem;
}

/* Detail d'une reference */
.epi-rd-head {
  display: flex;
  gap: 16px;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 14px;
  align-items: flex-start;
}
.epi-rd-img {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.epi-rd-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.epi-rd-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.epi-rd-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
}
.epi-rd-row:nth-child(even) { background: #fafbfc; }
.epi-rd-lbl {
  font-weight: 600;
  color: #4a5568;
  font-size: .82rem;
}
.epi-rd-val {
  font-size: .87rem;
  color: #2d3748;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .epi-rd-head { flex-direction: column; align-items: center; }
  .epi-rd-row { grid-template-columns: 1fr; }
  .epi-rd-lbl { color: #1a365d; }
}
