/* ═══════════════════════════════════════════════════════════════
   PRÉPAVANCE — DESIGN SYSTEM V2
   Light · Clean · Premium
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600&family=Inter:wght@400;500;600&display=swap');
@import url('/public/fonts/tabler/tabler-icons.min.css');

/* ───────────────────────────────
   TOKENS — SOURCE DE VÉRITÉ
─────────────────────────────── */
:root {
  /* Fond & surfaces */
  --bg            : #16161F;
  --surface       : rgba(255,255,255,.022);
  --surface-2     : rgba(255,255,255,.05);
  --surface-3     : rgba(255,255,255,.07);
  --line          : rgba(255,255,255,.055);
  --line-2        : rgba(255,255,255,.1);

  /* Texte */
  --text          : #ECECF1;
  --mut           : #9696AE;
  --dim           : #5E5E78;

  /* Marque */
  --brand         : #D1265B;
  --brand-soft    : rgba(209,38,91,.1);

  /* Sémantique de performance */
  --low           : #E07F66;
  --mid           : #D9B25C;
  --good          : #5FC9A6;

  /* Identité sous-tests (icônes + graphiques uniquement) */
  --c-log         : #5FC9A6;
  --c-cal         : #D9B25C;
  --c-rai         : #E07F66;
  --c-com         : #8B94E0;
  --c-exp         : #D77AAB;
  --c-con         : #A294D4;

  /* Forme & mouvement */
  --r             : 18px;
  --r-sm          : 11px;
  --ease          : cubic-bezier(.22,.61,.36,1);

  /* Aliases pa- (compatibilité pages existantes) */
  --pa-bg         : var(--bg);
  --pa-surface-1  : var(--surface);
  --pa-surface-2  : var(--surface-2);
  --pa-surface-3  : var(--surface-3);
  --pa-acc        : var(--brand);
  --pa-acc-dim    : var(--brand-soft);
  --pa-text       : var(--text);
  --pa-text-2     : var(--mut);
  --pa-text-3     : var(--dim);
  --pa-border     : var(--line);
  --pa-border-h   : var(--line-2);
  --pa-ok         : var(--good);
  --pa-warn       : var(--mid);
  --pa-danger     : var(--low);
  --pa-hover      : rgba(255,255,255,.04);
  --pa-topbar-bg  : rgba(22,22,31,.92);
  --pa-nav-active-bg   : var(--brand-soft);
  --pa-nav-active-color: var(--brand);
  --pa-ring-track : rgba(255,255,255,.08);

  /* Typographie */
  --pa-display    : 'Bricolage Grotesque', 'Inter', -apple-system, sans-serif;
  --pa-font       : 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Rayons */
  --pa-r-sm       : var(--r-sm);
  --pa-r          : var(--r-sm);
  --pa-r-lg       : var(--r);

  /* Transitions */
  --pa-t          : 200ms var(--ease);
}

/* ───────────────────────────────
   html.light — override pages avec variables hardcodées dark
   Spécificité (0,1,1) > :root (0,1,0) — gagne même sur les inline <style>
─────────────────────────────── */
html.light {
  /* Variante claire — même identité, surfaces plus lumineuses */
  --bg            : #F2F2F5;
  --surface       : rgba(0,0,0,.03);
  --surface-2     : rgba(0,0,0,.055);
  --surface-3     : rgba(0,0,0,.08);
  --line          : rgba(0,0,0,.08);
  --line-2        : rgba(0,0,0,.14);
  --text          : #1A1A28;
  --mut           : #5A5A72;
  --dim           : #9898B0;
  --pa-bg         : var(--bg);
  --pa-surface-1  : var(--surface);
  --pa-surface-2  : var(--surface-2);
  --pa-surface-3  : var(--surface-3);
  --pa-text       : var(--text);
  --pa-text-2     : var(--mut);
  --pa-text-3     : var(--dim);
  --pa-border     : var(--line);
  --pa-border-h   : var(--line-2);
  --pa-hover      : rgba(0,0,0,.04);
  --pa-topbar-bg  : rgba(242,242,245,.94);
  --pa-nav-active-bg   : var(--brand-soft);
  --pa-nav-active-color: var(--brand);
  --pa-ring-track : rgba(0,0,0,.10);

  /* Alias courts */
  --s1            : rgba(0,0,0,.03);
  --s2            : rgba(0,0,0,.055);
  --s3            : rgba(0,0,0,.08);
  --s4            : #E0DFDD;
  --b1            : rgba(0,0,0,.08);
  --b2            : rgba(0,0,0,.14);
  --b3            : rgba(0,0,0,.06);
  --txt           : var(--text);
  --txt2          : var(--mut);
  --txt3          : var(--dim);
  --acc           : var(--brand);
  --acc2          : var(--brand);
  --ok            : var(--good);
  --warn          : var(--mid);
  --danger        : var(--low);
}
html.light body { color-scheme: light; }
html.light ::-webkit-scrollbar-thumb { background: #d4d3d1; }

/* ───────────────────────────────
   html.dark — thème sombre (optionnel via toggle)
─────────────────────────────── */
html.dark {
  /* Identique à :root — le thème par défaut est déjà sombre */
  --bg            : #16161F;
  --surface       : rgba(255,255,255,.022);
  --surface-2     : rgba(255,255,255,.05);
  --surface-3     : rgba(255,255,255,.07);
  --line          : rgba(255,255,255,.055);
  --line-2        : rgba(255,255,255,.1);
  --text          : #ECECF1;
  --mut           : #9696AE;
  --dim           : #5E5E78;
  --s1: var(--surface); --s2: var(--surface-2); --s3: var(--surface-3);
  --b1: var(--line); --b2: var(--line-2); --b3: rgba(255,255,255,.04);
  --txt: var(--text); --txt2: var(--mut); --txt3: var(--dim);
  --acc: var(--brand); --acc2: var(--brand);
  --ok: var(--good); --warn: var(--mid); --danger: var(--low);
}
html.dark body { color-scheme: dark; }
html.dark ::-webkit-scrollbar-thumb { background: #2a2c40; }

/* Transition douce lors du changement de thème */
*, *::before, *::after {
  transition: background-color 180ms cubic-bezier(0.4,0,0.2,1),
              border-color 180ms cubic-bezier(0.4,0,0.2,1),
              color 60ms cubic-bezier(0.4,0,0.2,1);
}

/* Éléments exclus des transitions de thème */
svg *, canvas, video, img,
.ls-fill, .fc-prog-fill, .xp-bar-fill, .rsc-bar-fill, .pos-bar-fill,
.mod-bar-fill, .pa-progress-fill, .wk-bar-inner {
  transition: none !important;
}
/* Exception : le ring anime stroke-dashoffset */
.pa-score-ring-fill {
  transition: stroke-dashoffset 1s ease-out !important;
}

/* ───────────────────────────────
   RESET & BASE
─────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  background: var(--pa-bg);
  color: var(--pa-text);
  font-family: var(--pa-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
  overflow-x: hidden;
}

/* Titres display — Bricolage Grotesque */
h1, h2, h3, .pa-page-title, .pa-h1, .pa-h2 {
  font-family: var(--pa-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Chiffres alignés */
.pa-num, .pa-stat-value, .pa-timer, .pa-score-ring-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--pa-surface-2); border-radius: 4px; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ───────────────────────────────
   TYPOGRAPHIE
─────────────────────────────── */
.pa-h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pa-text);
  line-height: 1.2;
}
.pa-h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--pa-text);
  line-height: 1.3;
}
.pa-h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--pa-text);
}
.pa-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--pa-text-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pa-caption {
  font-size: 12px;
  color: var(--pa-text-3);
}
.pa-num {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.02em;
  color: var(--pa-text);
}
.pa-num-sm {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  color: var(--pa-text);
}
.pa-muted { color: var(--pa-text-3); }
.pa-secondary { color: var(--pa-text-2); }

/* ───────────────────────────────
   LAYOUT SHELL
─────────────────────────────── */
.pa-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.pa-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--pa-bg);
  border-right: 0.5px solid var(--pa-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width var(--pa-t);
}
.pa-sidebar.collapsed { width: 52px; }

.pa-sidebar-logo {
  padding: 20px 16px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pa-text);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 0.5px solid var(--pa-border);
  white-space: nowrap;
  overflow: hidden;
}
.pa-sidebar-logo .logo-dot {
  width: 22px;
  height: 22px;
  background: var(--pa-acc);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.pa-sidebar-section {
  display: none; /* Brief §4 — suppression eyebrow labels */
}
.pa-sidebar.collapsed .pa-sidebar-section { opacity: 0; }

.pa-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  margin: 1px 6px;
  border-radius: var(--pa-r-sm);
  font-size: 13px;
  color: var(--pa-text-2);
  transition: color var(--pa-t), background var(--pa-t);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  border: none;
  background: none;
  width: calc(100% - 12px);
  text-align: left;
}
.pa-nav-item i { font-size: 16px; flex-shrink: 0; }
.pa-nav-item:hover { color: var(--pa-text); background: var(--pa-hover); }
.pa-nav-item.active {
  color: var(--pa-nav-active-color);
  background: var(--pa-nav-active-bg);
  border-radius: 8px;
}
.pa-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 2px;
  background: var(--pa-acc);
  border-radius: 0 2px 2px 0;
}
.pa-nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 100px;
  background: rgba(0,0,0,.05);
  color: var(--pa-text-3);
  flex-shrink: 0;
}
.pa-nav-badge.ok  { color: var(--pa-ok); }
.pa-nav-badge.warn { color: var(--pa-warn); }

.pa-sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 0.5px solid var(--pa-border);
}
.pa-user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: var(--pa-r-sm);
  transition: background var(--pa-t);
  cursor: pointer;
}
.pa-user-row:hover { background: var(--pa-hover); }
.pa-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--pa-acc-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--pa-acc);
  flex-shrink: 0;
}
.pa-user-info { overflow: hidden; }
.pa-user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--pa-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pa-user-plan {
  font-size: 10px;
  color: var(--pa-text-3);
}

/* Main content */
.pa-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.pa-topbar {
  height: 52px;
  border-bottom: 0.5px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  flex-shrink: 0;
  background: var(--pa-topbar-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.pa-topbar-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--pa-text);
}
.pa-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pa-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--pa-text-3);
}
.pa-breadcrumb-sep { color: var(--pa-text-3); }
.pa-breadcrumb-current { color: var(--pa-text-2); }

/* Content area */
.pa-content {
  padding: 28px 24px;
  flex: 1;
  max-width: 1100px;
  width: 100%;
}
.pa-content-full { max-width: 100%; }

/* ───────────────────────────────
   CARTES
─────────────────────────────── */
.pa-card {
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: var(--r);
  padding: 26px 28px;
  transition: border-color 200ms var(--ease);
}
.pa-card:hover { border-color: var(--line-2); }

.pa-card-sm { padding: 12px 16px; border-radius: var(--pa-r); }
.pa-card-lg { padding: 20px 24px; border-radius: var(--pa-r-lg); }

/* Carte stat */
.pa-stat-card {
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: var(--r);
  padding: 26px 28px;
  transition: border-color 200ms var(--ease);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pa-stat-card:hover { border-color: var(--line-2); }
.pa-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--pa-text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pa-stat-label i { font-size: 14px; }
.pa-stat-value {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.02em;
  color: var(--pa-text);
  line-height: 1;
}
.pa-stat-sub {
  font-size: 13px;
  color: var(--pa-text-3);
}
.pa-stat-suffix {
  font-size: 14px;
  font-weight: 400;
  color: var(--pa-text-3);
  margin-left: 2px;
}

/* Grille de stats */
.pa-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

/* ───────────────────────────────
   BARRES DE PROGRESSION
─────────────────────────────── */
.pa-progress {
  height: 4px;
  background: var(--pa-ring-track);
  border-radius: 2px;
  overflow: hidden;
}
.pa-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--pa-acc);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.pa-progress-fill.ok   { background: var(--pa-ok); }
.pa-progress-fill.warn { background: var(--pa-warn); }
.pa-progress-fill.danger { background: var(--pa-danger); }

/* Barre avec label */
.pa-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pa-progress-row .pa-progress { flex: 1; }
.pa-progress-val {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--pa-text-2);
  min-width: 32px;
  text-align: right;
}

/* ───────────────────────────────
   BOUTONS
─────────────────────────────── */
.pa-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--pa-r);
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  cursor: pointer;
}
.pa-btn i { font-size: 15px; }
.pa-btn:active:not(:disabled) { transform: scale(0.97); }

.pa-btn-primary {
  background: var(--brand);
  color: #fff;
}
.pa-btn-primary:hover:not(:disabled) { opacity: .88; }

.pa-btn-secondary {
  background: transparent;
  color: var(--pa-text);
  border: 0.5px solid var(--line-2);
}
.pa-btn-secondary:hover:not(:disabled) { background: var(--pa-hover); border-color: var(--line-2); }

.pa-btn-ghost {
  background: transparent;
  color: var(--pa-text-2);
  border: none;
  padding: 8px 12px;
}
.pa-btn-ghost:hover:not(:disabled) { background: var(--pa-hover); color: var(--pa-text); }

.pa-btn-sm { padding: 6px 12px; font-size: 12px; }
.pa-btn-sm i { font-size: 13px; }

.pa-btn-danger {
  background: rgba(224,127,102,.1);
  color: var(--low);
  border: 0.5px solid rgba(224,127,102,.2);
}
.pa-btn-danger:hover:not(:disabled) { background: rgba(224,127,102,.18); }

.pa-btn-full { width: 100%; justify-content: center; }
.pa-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ───────────────────────────────
   INPUTS
─────────────────────────────── */
.pa-input {
  width: 100%;
  background: var(--pa-surface-2);
  border: 0.5px solid var(--pa-border);
  border-radius: var(--pa-r);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--pa-text);
  outline: none;
  transition: border-color var(--pa-t);
}
.pa-input::placeholder { color: var(--pa-text-3); }
.pa-input:focus { border-color: var(--brand); }
.pa-input:focus-visible { outline: none; }

.pa-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5080' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.pa-field { display: flex; flex-direction: column; gap: 6px; }
.pa-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--pa-text-2);
}

/* ───────────────────────────────
   TAGS / BADGES
─────────────────────────────── */
.pa-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255,255,255,.06);
  color: var(--pa-text-2);
  border: 0.5px solid var(--pa-border);
}
.pa-tag.accent {
  background: var(--pa-acc-dim);
  color: var(--pa-nav-active-color);
  border-color: rgba(127,119,221,.2);
}
.pa-tag.ok    { background: rgba(16,217,160,.08); color: var(--pa-ok); border-color: rgba(16,217,160,.2); }
.pa-tag.warn  { background: rgba(240,180,41,.08); color: var(--pa-warn); border-color: rgba(240,180,41,.2); }
.pa-tag.danger{ background: rgba(240,120,80,.08); color: var(--pa-danger); border-color: rgba(240,120,80,.2); }

/* ───────────────────────────────
   TABLES
─────────────────────────────── */
.pa-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pa-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--pa-text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 0.5px solid var(--pa-border);
}
.pa-table td {
  padding: 11px 14px;
  border-bottom: 0.5px solid var(--pa-border);
  color: var(--pa-text-2);
}
.pa-table tr:last-child td { border-bottom: none; }
.pa-table tr:hover td { background: var(--pa-hover); }

/* ───────────────────────────────
   DIVIDER
─────────────────────────────── */
.pa-divider {
  height: 0.5px;
  background: var(--pa-border);
  margin: 20px 0;
}

/* ───────────────────────────────
   SECTIONS / PAGE HEADER
─────────────────────────────── */
.pa-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.pa-page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.pa-page-sub   { font-size: 13px; color: var(--pa-text-2); margin-top: 3px; }

.pa-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--pa-text-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ───────────────────────────────
   GRILLES
─────────────────────────────── */
.pa-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pa-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.pa-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

@media (max-width: 900px) {
  .pa-grid-3, .pa-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .pa-grid-2, .pa-grid-3, .pa-grid-4 { grid-template-columns: 1fr; }
  .pa-sidebar { display: none; }
  .pa-content { padding: 16px; }
}

/* ───────────────────────────────
   UTILITAIRES
─────────────────────────────── */
.pa-flex     { display: flex; }
.pa-flex-col { display: flex; flex-direction: column; }
.pa-items-center { align-items: center; }
.pa-justify-between { justify-content: space-between; }
.pa-gap-4  { gap: 4px; }
.pa-gap-8  { gap: 8px; }
.pa-gap-12 { gap: 12px; }
.pa-gap-16 { gap: 16px; }
.pa-gap-24 { gap: 24px; }
.pa-mt-8   { margin-top: 8px; }
.pa-mt-12  { margin-top: 12px; }
.pa-mt-16  { margin-top: 16px; }
.pa-mt-24  { margin-top: 24px; }
.pa-mt-32  { margin-top: 32px; }
.pa-mb-16  { margin-bottom: 16px; }
.pa-mb-24  { margin-bottom: 24px; }
.pa-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-text-right { text-align: right; }

/* ───────────────────────────────
   ÉTAT VIDE
─────────────────────────────── */
.pa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--pa-text-3);
  gap: 10px;
  text-align: center;
}
.pa-empty i { font-size: 32px; opacity: .4; }
.pa-empty-title { font-size: 14px; font-weight: 500; color: var(--pa-text-2); }
.pa-empty-sub   { font-size: 13px; }

/* ───────────────────────────────
   LOADING / SKELETON
─────────────────────────────── */
@keyframes pa-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.pa-skeleton {
  background: linear-gradient(90deg, var(--pa-surface-2) 25%, var(--pa-surface-1) 50%, var(--pa-surface-2) 75%);
  background-size: 800px 100%;
  animation: pa-shimmer 1.4s infinite;
  border-radius: var(--pa-r-sm);
}

/* ───────────────────────────────
   TOASTS / ALERTS
─────────────────────────────── */
.pa-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--pa-r);
  font-size: 13px;
  border: 0.5px solid var(--pa-border);
  background: var(--pa-surface-1);
}
.pa-alert.ok     { background: rgba(16,217,160,.06); border-color: rgba(16,217,160,.2); color: var(--pa-ok); }
.pa-alert.warn   { background: rgba(240,180,41,.06); border-color: rgba(240,180,41,.2); color: var(--pa-warn); }
.pa-alert.danger { background: rgba(240,120,80,.06); border-color: rgba(240,120,80,.2); color: var(--pa-danger); }

/* ───────────────────────────────
   TABS
─────────────────────────────── */
.pa-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 0.5px solid var(--pa-border);
  margin-bottom: 20px;
}
.pa-tab {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--pa-text-3);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: color var(--pa-t), border-color var(--pa-t);
  font-family: inherit;
}
.pa-tab:hover { color: var(--pa-text-2); }
.pa-tab.active { color: var(--pa-text); border-bottom-color: var(--pa-acc); }

/* ───────────────────────────────
   QUESTION CARD (oral/exos)
─────────────────────────────── */
.pa-question-card {
  background: var(--pa-surface-2);
  border: 0.5px solid var(--pa-border);
  border-radius: var(--pa-r-lg);
  padding: 20px 24px;
}
.pa-question-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--pa-text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.pa-question-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--pa-text);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ───────────────────────────────
   MIC / RECORDING (oral)
─────────────────────────────── */
.pa-mic-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pa-surface-2);
  border: 0.5px solid var(--pa-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--pa-t);
  color: var(--pa-text-2);
}
.pa-mic-btn i { font-size: 22px; }
.pa-mic-btn:hover { border-color: var(--pa-border-h); color: var(--pa-text); }
.pa-mic-btn.recording {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
@keyframes pa-pulse-ring {
  0%   { outline: 0px solid rgba(209,38,91,.3); }
  70%  { outline: 8px solid rgba(209,38,91,0); }
  100% { outline: 0px solid rgba(209,38,91,0); }
}
.pa-mic-btn.recording { animation: pa-pulse-ring 1.5s infinite; }

/* ───────────────────────────────
   SCORE RING (résultats)
─────────────────────────────── */
.pa-score-ring {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.pa-score-ring svg { transform: rotate(-90deg); }
.pa-score-ring-bg   { fill: none; stroke: var(--pa-ring-track); stroke-width: 4; }
.pa-score-ring-fill { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.pa-score-ring-fill.ok     { stroke: var(--pa-ok); }
.pa-score-ring-fill.warn   { stroke: var(--pa-warn); }
.pa-score-ring-fill.danger { stroke: var(--pa-danger); }
.pa-score-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ───────────────────────────────
   TIMER
─────────────────────────────── */
.pa-timer {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--pa-text-2);
  font-family: var(--pa-mono);
}
.pa-timer.warn  { color: var(--pa-warn); }
.pa-timer.danger{ color: var(--pa-danger); }

/* ───────────────────────────────
   TRANSCRIPT
─────────────────────────────── */
.pa-transcript {
  font-size: 14px;
  line-height: 1.7;
  color: var(--pa-text-2);
  min-height: 80px;
  padding: 14px;
  background: var(--pa-surface-2);
  border: 0.5px solid var(--pa-border);
  border-radius: var(--pa-r);
}
.pa-transcript.live { border-color: var(--pa-acc); }
.pa-transcript .interim { color: var(--pa-text-3); font-style: italic; }

/* ───────────────────────────────
   FEEDBACK ITEM
─────────────────────────────── */
.pa-feedback-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--pa-surface-2);
  border: 0.5px solid var(--pa-border);
  border-radius: var(--pa-r);
  font-size: 13px;
  line-height: 1.6;
  color: var(--pa-text-2);
}
.pa-feedback-item i { font-size: 15px; flex-shrink: 0; margin-top: 1px; color: var(--pa-text-3); }
.pa-feedback-item.positive i { color: var(--pa-ok); }
.pa-feedback-item.negative i { color: var(--pa-warn); }

/* ───────────────────────────────
   SCHOOL SELECTOR
─────────────────────────────── */
.pa-school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.pa-school-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  background: var(--pa-surface-2);
  border: 0.5px solid var(--pa-border);
  border-radius: var(--pa-r-lg);
  cursor: pointer;
  transition: all var(--pa-t);
  font-size: 12px;
  font-weight: 500;
  color: var(--pa-text-2);
}
.pa-school-btn:hover { border-color: var(--pa-border-h); color: var(--pa-text); }
.pa-school-btn.selected {
  border-color: var(--pa-acc);
  background: var(--pa-acc-dim);
  color: var(--pa-text);
}
.pa-school-abbr {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--pa-text);
}

/* ───────────────────────────────
   ANIMATIONS
─────────────────────────────── */
@keyframes pa-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pa-anim { animation: pa-fade-up .25s ease both; }

/* ───────────────────────────────
   NOUVEAUX UTILITAIRES — REDESIGN
─────────────────────────────── */

/* Label de section (pour grouper les modules par catégorie) */
.pa-section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--pa-text-2);
  margin-bottom: 8px;
  margin-top: 4px;
}

/* Pill d'alerte discrète (remplace les bandeaux criards) */
.pa-alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(240,120,80,.1);
  color: var(--pa-danger);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  line-height: 1.4;
}

/* Pill de statut générique */
.pa-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  line-height: 1.4;
}
.pa-pill.ok      { background: rgba(99,153,34,.12); color: var(--pa-ok); }
.pa-pill.warn    { background: rgba(186,117,23,.12); color: var(--pa-warn); }
.pa-pill.danger  { background: rgba(240,120,80,.12); color: var(--pa-danger); }
.pa-pill.acc     { background: var(--pa-acc-dim); color: var(--pa-nav-active-color); }
.pa-pill.muted   { background: var(--pa-hover); color: var(--pa-text-2); }

@keyframes pa-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.pa-cursor { animation: pa-blink .8s infinite; }

/* ─────────────────────────────── RESPONSIVE — MOBILE ─────────────────────────────── */

.pa-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--pa-text-2);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--pa-r-sm);
  transition: background var(--pa-t);
  flex-shrink: 0;
  padding: 0;
}
.pa-hamburger:hover { background: var(--pa-hover); }

.pa-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.pa-sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
  .pa-hamburger { display: flex; }

  .pa-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: left 0.25s ease;
  }
  .pa-sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 32px rgba(0,0,0,.5);
  }

  .pa-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .pa-topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .pa-topbar-title { font-size: 13px; }

  .pa-content {
    padding: 16px;
    padding-bottom: 32px;
  }

  /* Grids → single column */
  .pa-grid-2,
  .pa-grid-3,
  .pa-grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Module/card grids inside pages */
  [class*="modules-grid"],
  [class*="cards-grid"],
  [class*="stat-grid"],
  [class*="dash-grid"],
  [class*="prog-grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Tables → scrollable */
  .pa-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modals → full width */
  .pa-modal { width: calc(100vw - 32px); max-width: 100%; margin: 16px; }

  /* Buttons in rows → stack */
  .pa-btn-row { flex-direction: column; }
  .pa-btn-row .pa-btn { width: 100%; justify-content: center; }

  /* Topbar search → hidden on small screens */
  .pa-topbar-search { display: none; }
}
