/* ============================================================
   PACE Platform — Charte Ryze v2
   Fonts: Tenorite (Regular, Bold, Italic, Bold Italic)
   ============================================================ */

@font-face {
  font-family: 'Tenorite';
  src: url('../fonts/tenorite-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Tenorite';
  src: url('../fonts/tenorite-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Tenorite';
  src: url('../fonts/tenorite-italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'Tenorite';
  src: url('../fonts/tenorite-bold-italic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
}

/* ── VARIABLES ── */
:root {
  --primary:       #1B4332;
  --primary-dark:  #0f2b1f;
  --primary-mid:   #2D6A4F;
  --primary-light: #40916C;
  --primary-pale:  #D8F3DC;
  --accent:        #52B788;
  --accent-hover:  #40916C;
  --bg:            #F4F6F3;
  --bg-card:       #ffffff;
  --border:        #e2e8e4;
  --text:          #1a2e22;
  --text-muted:    #6b8070;
  --blue:          #1D4ED8;
  --orange:        #D97706;
  --red:           #DC2626;
  --teal:          #0F766E;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 1px 4px rgba(27,67,50,.07), 0 4px 16px rgba(27,67,50,.05);
  --shadow-md:     0 4px 12px rgba(27,67,50,.12), 0 8px 32px rgba(27,67,50,.08);
  --nav-h:         60px;
  --transition:    .2s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: 'Tenorite', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-pale); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ════════════════════════════════════════
   NAVBAR
════════════════════════════════════════ */
.navbar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--primary);
  color: #fff;
  padding: 0 20px;
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}

/* ── Logo brand block ── */
.nav-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  margin-right: 28px;
  flex-shrink: 0;
  background: rgba(255,255,255,.18);
  padding: 7px 10px;
  border-radius: 10px;
  width: 62px;
  height: 52px;
  transition: background var(--transition);
}
.nav-brand:hover {
  background: rgba(255,255,255,.28);
}
.nav-logo-img {
  height: 34px;
  width: 34px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  transition: transform var(--transition);
}
.nav-brand:hover .nav-logo-img {
  transform: scale(1.08);
}
.nav-brand-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  text-align: center;
  line-height: 1;
  font-family: 'Tenorite', sans-serif;
}

.nav-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.15);
  margin-right: 20px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 2px;
  flex: 1;
  align-items: center;
  height: 100%;
}

.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.68);
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  font-family: 'Tenorite', sans-serif;
  letter-spacing: .01em;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 70%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--transition);
}
.nav-links a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.nav-links a.active {
  background: rgba(255,255,255,.14);
  color: #fff;
  font-weight: 700;
}
.nav-links a.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-links .nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 7px 16px;
  border-radius: 8px;
  font-weight: 700;
  margin-left: 8px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.nav-links .nav-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82,183,136,.35);
}
.nav-links .nav-cta::after { display: none; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  margin-left: auto;
}
.nav-username {
  color: rgba(255,255,255,.85);
  font-weight: 400;
}
.btn-logout {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  transition: all var(--transition);
  background: transparent;
  cursor: pointer;
  font-family: 'Tenorite', sans-serif;
}
.btn-logout:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

/* ── ROLE BADGES ── */
.role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.role-senior  { background: #dbeafe; color: #1e40af; }
.role-manager { background: #d1fae5; color: #065f46; }
.role-sll     { background: #ede9fe; color: #5b21b6; }
.role-qrm     { background: #fef3c7; color: #92400e; }
.role-md      { background: #fee2e2; color: #991b1b; }
.role-admin   { background: #f3f4f6; color: #374151; }

/* ════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════ */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px;
  animation: fadeInUp .35s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   FLASH MESSAGES
════════════════════════════════════════ */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 400;
  border-left: 4px solid;
  animation: slideDown .25s ease both;
  transition: opacity .4s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.flash-success { background: #ecfdf5; color: #065f46; border-color: #10b981; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #ef4444; }
.flash-info    { background: #eff6ff; color: #1e40af; border-color: #3b82f6; }
.flash-warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }

/* ════════════════════════════════════════
   PAGE HEADER
════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.01em;
}
.page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ════════════════════════════════════════
   STATS CARDS
════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary-light);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: currentColor;
  opacity: .04;
  transform: translate(20px, -20px);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-val {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -.02em;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.stat-blue   { border-top-color: var(--blue); }
.stat-blue   .stat-val { color: var(--blue); }
.stat-green  { border-top-color: var(--primary-light); }
.stat-green  .stat-val { color: var(--primary-light); }
.stat-orange { border-top-color: var(--orange); }
.stat-orange .stat-val { color: var(--orange); }
.stat-teal   { border-top-color: var(--teal); }
.stat-teal   .stat-val { color: var(--teal); }
.stat-red    { border-top-color: var(--red); }
.stat-red    .stat-val { color: var(--red); }

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(27,67,50,.02) 0%, transparent 100%);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.005em;
}
.card-body { padding: 22px; }

/* ════════════════════════════════════════
   TABLE
════════════════════════════════════════ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  background: var(--primary);
  color: rgba(255,255,255,.9);
  padding: 11px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover td { background: rgba(27,67,50,.03); }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Tenorite', sans-serif;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(27,67,50,.2);
}
.btn-primary:hover {
  background: var(--primary-mid);
  box-shadow: 0 4px 16px rgba(27,67,50,.3);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,.2);
}
.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 16px rgba(220,38,38,.3);
  transform: translateY(-1px);
}
.btn-success {
  background: var(--primary-light);
  color: #fff;
  box-shadow: 0 2px 8px rgba(64,145,108,.2);
}
.btn-success:hover {
  background: var(--primary-mid);
  box-shadow: 0 4px 16px rgba(64,145,108,.3);
  transform: translateY(-1px);
}
.btn-sm   { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-full { width: 100%; justify-content: center; }

/* ════════════════════════════════════════
   BADGES
════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-approved  { background: #d1fae5; color: #065f46; }
.badge-rejected  { background: #fee2e2; color: #991b1b; }
.badge-draft     { background: #f3f4f6; color: #6b7280; }
.badge-type      { background: #ede9fe; color: #5b21b6; }
.badge-validated { background: #d1fae5; color: #065f46; }
.badge-flagged   { background: #fee2e2; color: #991b1b; }

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.form-group label .required { color: var(--red); margin-left: 3px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: 'Tenorite', sans-serif;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(64,145,108,.15);
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ════════════════════════════════════════
   STEPPER
════════════════════════════════════════ */
.stepper {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  margin-bottom: 32px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.step {
  display: flex; align-items: center;
  flex: 0 0 auto;    /* taille fixe au contenu : ne s'étire plus, ne se compresse plus */
  white-space: nowrap;
}
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  background: var(--border); color: var(--text-muted);
  transition: all var(--transition);
}
.step.done   .step-num { background: var(--primary-light); color: #fff; }
.step.active .step-num {
  background: var(--primary); color: #fff;
  box-shadow: 0 0 0 4px rgba(27,67,50,.15);
}
.step-label {
  margin-left: 10px;
  font-size: 12px; font-weight: 400; color: var(--text-muted);
  transition: color var(--transition);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;   /* le libellé ne passe plus jamais à la ligne */
}
.step.active .step-label { color: var(--primary); font-weight: 700; }
.step.done   .step-label { color: var(--primary-light); }
.step-line {
  width: 28px; flex: 0 0 28px;   /* largeur fixe au lieu de flex:1 (qui étirait toute la barre) */
  height: 2px; background: var(--border);
  margin: 0 10px; border-radius: 2px;
  transition: background var(--transition);
}

/* ════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-mid) 100%);
  position: relative;
  overflow: hidden;
}
.login-body::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -200px; right: -100px;
  pointer-events: none;
}
.login-body::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  bottom: -100px; left: -100px;
  pointer-events: none;
}
.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  position: relative;
  z-index: 1;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 64px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.1);
  animation: fadeInUp .4s ease both;
}
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-img {
  height: 110px;
  width: auto;
  margin-bottom: 10px;
  object-fit: contain;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.login-brand h1 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 4px;
  font-family: 'Tenorite', sans-serif;
}
.login-brand p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.login-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.login-hint code {
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12px;
  border: 1px solid var(--border);
}

/* ════════════════════════════════════════
   INFO BOX
════════════════════════════════════════ */
.info-box {
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.info-box.info    { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.info-box.success { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.info-box.warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.info-box.danger  { background: #fef2f2; border-color: #ef4444; color: #991b1b; }

/* ════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state p { font-size: 14px; margin-top: 8px; }

/* ════════════════════════════════════════
   UTILITIES
════════════════════════════════════════ */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--red); }
.text-success { color: var(--teal); }
.text-primary { color: var(--primary); }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.mt-6  { margin-top: 24px; }
.mb-6  { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.fw-bold { font-weight: 700; }
.fs-sm  { font-size: 12px; }

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* ── Badges CC statuts manquants ── */
.badge-pending-l1  { background:#fef9c3; color:#854d0e; }
.badge-escalated   { background:#ffedd5; color:#9a3412; }
.badge-warning     { background:#fef3c7; color:#92400e; }
.badge-flagged     { background:#fee2e2; color:#991b1b; }

/* ── Autocomplete dropdown ── */
.ac-dropdown {
  position: absolute;
  z-index: 9999;
  background: #fff;
  border: 1.5px solid var(--primary-light);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 32px rgba(27,67,50,.15);
  max-height: 280px;
  overflow-y: auto;
  width: 100%;
  left: 0;
  top: 100%;
}




.notif-bell {
  position: relative;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .18s;
  margin-right: 6px;
}
.notif-bell:hover { background: rgba(255,255,255,.15); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}