@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* ===================================================
   * LIGHT THEME — Propre, Aéré, Professionnel
   * Sidebar blanche, fond gris très clair, accents bleu
   * =================================================== */
  --primary: #1E40AF;
  --primary-rgb: 30, 64, 175;
  /* Bleu accent principal */
  --primary-light: #3B82F6;
  --accent: #2563EB;
  --accent-rgb: 37, 99, 235;
  --accent-hover: #1D4ED8;
  --accent-gradient: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  --accent-light: rgba(37, 99, 235, 0.12);

  /* Backgrounds */
  --bg: #dbeafe;
  /* Fond bleu clair au lieu du gris/blanc */
  --surface: #FFFFFF;
  /* Cartes : blanc pur */
  --surface-solid: #FFFFFF;
  --surface-hover: #F8FAFC;
  --sidebar-bg: #FFFFFF;
  /* Sidebar blanche */
  --topbar-bg: rgba(255, 255, 255, 0.85);

  /* Textes */
  --text-main: #0F172A;
  /* Quasi-noir */
  --text-muted: #64748B;
  /* Gris ardoise */
  --text-sidebar: #334155;
  /* Liens sidebar */
  --text-sidebar-muted: #94A3B8;

  /* Bordures */
  --border: #E2E8F0;
  --border-sidebar: #E2E8F0;
  --sidebar-active-bg: #EFF6FF;
  /* Bleu très pâle pour item actif */

  /* Sémantique */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --danger: #EF4444;
  --info: #3B82F6;

  /* KPI */
  --kpi-primary-bg: rgba(37, 99, 235, 0.08);
  --kpi-success-bg: rgba(16, 185, 129, 0.08);
  --kpi-warning-bg: rgba(245, 158, 11, 0.08);
  --kpi-error-bg: rgba(239, 68, 68, 0.08);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.25);
  --shadow-sidebar: 2px 0 12px rgba(15, 23, 42, 0.06);

  /* Misc */
  --radius: 12px;
  --radius-lg: 18px;
  --blur: blur(16px);
  --transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Glows (light = transparent) */
  --glow-primary: none;
  --glow-success: none;
  --glow-warning: none;
  --glow-error: none;
}

[data-theme='dark'] {
  /* ===================================================
   * DARK THEME — Premium SaaS (Inspiré Google / Modern Dashboards)
   * Palette : Slate profond (Gris-Bleu) | Accents : Bleu lumineux
   * =================================================== */
  --primary: #3B82F6;
  --primary-rgb: 59, 130, 246;
  /* Bleu Google éclatant */
  --primary-light: #60A5FA;
  --accent: #60A5FA;
  --accent-rgb: 96, 165, 250;
  /* Accents clairs pour la lisibilité (WCAG) */
  --accent-hover: #93C5FD;
  --accent-gradient: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);

  /* Backgrounds (Teintes Slate ultra-reposantes) */
  --bg: #0B1120;
  /* Fond Global ultra-sombre (Gris-Bleu abysse) */
  --surface: #131231;
  /* Panneaux Slate-800 avec Glassmorphism */
  --surface-solid: #131231;
  /* Panneaux opaques */
  --surface-hover: #334155;
  /* Survol Slate-700 */
  --sidebar-bg: #0F172A;
  /* Menu Slate-900 */
  --topbar-bg: #131231;

  /* Textes (Contraste exceptionnel) */
  --text-main: #F8FAFC;
  /* Blanc Slate-50 éclatant */
  --text-muted: #94A3B8;
  /* Gris Slate-400 sophistiqué */
  --text-sidebar: #E2E8F0;
  /* Menu clair */
  --text-sidebar-muted: #64748B;

  /* Bordures subtiles */
  --border: rgba(148, 163, 184, 0.15);
  --border-sidebar: rgba(148, 163, 184, 0.10);
  --sidebar-active-bg: rgba(59, 130, 246, 0.15);
  /* Légère lueur bleue */

  /* Sémantique */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  /* KPI */
  --kpi-primary-bg: rgba(59, 130, 246, 0.12);
  --kpi-success-bg: rgba(16, 185, 129, 0.12);
  --kpi-warning-bg: rgba(245, 158, 11, 0.12);
  --kpi-error-bg: rgba(239, 68, 68, 0.12);

  /* Shadows professionnelles */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-sidebar: 2px 0 10px rgba(0, 0, 0, 0.4);

  /* Glows */
  --glow-primary: 0 0 15px rgba(59, 130, 246, 0.20);
  --glow-success: none;
  --glow-warning: none;
  --glow-error: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Outfit', sans-serif;
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: clip;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme='dark'] body {
  background-image:
    radial-gradient(ellipse at top left, rgba(93, 235, 37, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(96, 165, 250, 0.05) 0%, transparent 50%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Open Sauce', 'Open Sauce Sans', 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* --- Auth Views (Login & Reset) --- */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #050b18, #020617);
  overflow: hidden;
  position: relative;
}

.auth-view::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: var(--accent);
  filter: blur(150px);
  opacity: 0.1;
  top: -100px;
  right: -100px;
}

.login-card,
.glass-card-reset {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 48px;
  border-radius: 28px;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 440px;
  text-align: center;
  z-index: 5;
  transition: var(--transition);
}

.login-card h2,
.glass-card-reset h2 {
  color: var(--text-main);
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 155, 213, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
  padding: 12px;
}

/* --- Input with Icons --- */
.input-with-icon {
  position: relative;
  display: flex !important;
  align-items: center !important;
  width: 100%;
}

.input-with-icon i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  z-index: 10;
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 48px !important;
  height: 50px !important;
}

/* --- Premium Reset Card --- */
/* Helper classes for Reset View */
.reset-email-info {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  display: inline-block;
}

.text-accent {
  color: var(--accent) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- App Layout --- */
#app-view {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s ease, background-color 0.3s ease;
  overflow-y: auto;
  border-right: 1px solid var(--border-sidebar);
  box-shadow: var(--shadow-sidebar);
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  transform: translateX(-280px);
}

.sidebar-header {
  padding: 28px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-sidebar);
  margin-bottom: 8px;
}

.sidebar-header span {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-logo {
  height: 30px;
  width: auto;
  transition: var(--transition);
}

.dark-logo {
  display: none;
}

.light-logo {
  display: block;
}

[data-theme='dark'] .light-logo {
  display: none;
}

[data-theme='dark'] .dark-logo {
  display: block;
}

.sidebar-header i {
  color: var(--accent);
}

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
  flex-grow: 1;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  margin: 2px 12px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.sidebar-menu li a i {
  width: 20px;
  text-align: center;
  color: var(--text-sidebar-muted);
  transition: var(--transition);
  font-size: 15px;
}

.sidebar-menu li a:hover {
  background-color: var(--sidebar-active-bg);
  color: var(--accent);
}

.sidebar-menu li a:hover i {
  color: var(--accent);
}

.sidebar-menu li a.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
  font-weight: 600;
}

.sidebar-menu li a.active i {
  color: #ffffff;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-sidebar);
}

/* Label de section dans le menu sidebar */
.sidebar-section-label {
  margin-top: 20px;
  padding: 6px 12px 4px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-sidebar-muted);
  pointer-events: none;
  user-select: none;
}

.user-info {
  margin-bottom: 12px;
}

.user-name {
  font-weight: 600;
}

.user-role {
  font-size: 13px;
  color: var(--accent);
}

.content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-left: 280px;
  transition: margin-left 0.3s ease;
  min-height: 100vh;
  position: relative;
  padding-top: 68px;
}

.content-wrapper.sidebar-collapsed {
  margin-left: 0;
}

.topbar {
  height: 68px;
  background: var(--topbar-bg, var(--surface));
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  position: fixed;
  left: 280px;
  right: 0;
  top: 0;
  z-index: 1300;
  transition: background 0.3s ease;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  flex-shrink: 0;
}

.content-wrapper.sidebar-collapsed .topbar {
  left: 0;
}

/* USER PROFILE MENU */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
}

.user-profile-menu:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.country-flag-container {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
}

.user-avatar-container {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--border);
}

.user-avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta-header {
  display: flex;
  flex-direction: column;
  max-width: 120px;
}

#user-header-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#user-header-position {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* DROP DOWN */
/* EXPORT DROPDOWN */
.glass-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 8px 0;
  display: none;
  animation: slideDown 0.3s ease;
}

.glass-dropdown.active {
  display: block;
}

.glass-dropdown a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.glass-dropdown a:hover {
  background: var(--surface-hover);
  color: var(--accent);
  padding-left: 24px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  z-index: 1000;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 16px 0;
  display: none;
  flex-direction: column;
  animation: slideDown 0.3s ease forwards;
  backdrop-filter: blur(10px);
}

#user-dropdown.active {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-user-info {
  padding: 0 20px 12px 20px;
}

.dropdown-user-info h4 {
  margin: 0;
  font-size: 16px;
}

.dropdown-user-info p {
  margin: 4px 0 8px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.user-dropdown a {
  padding: 10px 20px;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  transition: background 0.2s;
}

.user-dropdown a:hover {
  background: var(--bg);
  color: var(--accent);
}

.logout-link:hover {
  color: var(--danger) !important;
}

/* Badge role */
.user-dropdown .badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
}

/* --- Utilities --- */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
}

/* Cards & Tables */
.card {
  background-color: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.25);
}

[data-theme='dark'] .card:hover {
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(96, 165, 250, 0.1);
}

.table-responsive {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  background: transparent;
  border-bottom: 2px solid var(--border);
}

tr {
  transition: var(--transition);
}

tr:hover td {
  background-color: var(--sidebar-active-bg, var(--surface-hover));
}

[data-theme='dark'] tr:hover td {
  background-color: rgba(59, 130, 246, 0.06);
}

.call-signals-table {
  table-layout: fixed;
}

.call-signals-table th:nth-child(1),
.call-signals-table td:nth-child(1) { width: 20%; }
.call-signals-table th:nth-child(2),
.call-signals-table td:nth-child(2) { width: 18%; }
.call-signals-table th:nth-child(3),
.call-signals-table td:nth-child(3) { width: 24%; }
.call-signals-table th:nth-child(4),
.call-signals-table td:nth-child(4) { width: 16%; }
.call-signals-table th:nth-child(5),
.call-signals-table td:nth-child(5) { width: 12%; }
.call-signals-table th:nth-child(6),
.call-signals-table td:nth-child(6) { width: 10%; }

.call-signals-table td {
  vertical-align: middle;
  word-break: break-word;
}

.callback-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  line-height: 1.2;
}

.callback-badge.cb-ok {
  color: #065f46;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.callback-badge.cb-processing {
  color: #92400e;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.callback-badge.cb-failed {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-soumis {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}

.badge-eval {
  background-color: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

.badge-evalue {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10B981;
}

.badge-signale {
  background-color: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

/* Grid Dashboard */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: var(--transition);
  flex-shrink: 0;
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

/* KPI Helper Classes with Glow */
.kpi-success {
  box-shadow: var(--glow-success);
  border-color: rgba(16, 185, 129, 0.1);
}

.kpi-success .kpi-icon {
  color: var(--success);
  background: var(--kpi-success-bg);
}

.kpi-success .kpi-value {
  color: var(--success);
}

.kpi-error {
  box-shadow: var(--glow-error);
  border-color: rgba(239, 68, 68, 0.1);
}

.kpi-error .kpi-icon {
  color: var(--error);
  background: var(--kpi-error-bg);
}

.kpi-error .kpi-value {
  color: var(--error);
}

.kpi-warning {
  box-shadow: var(--glow-warning);
  border-color: rgba(245, 158, 11, 0.1);
}

.kpi-warning .kpi-icon {
  color: var(--warning);
  background: var(--kpi-warning-bg);
}

.kpi-warning .kpi-value {
  color: var(--warning);
}

.kpi-primary {
  box-shadow: var(--glow-primary);
  border-color: rgba(59, 130, 246, 0.1);
}

.kpi-primary .kpi-icon {
  color: var(--accent);
  background: var(--kpi-primary-bg);
}

/* Evaluation Sliders */
.eval-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.eval-desc {
  flex: 1;
}

.eval-slider-container {
  width: 200px;
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.eval-val {
  width: 40px;
  text-align: center;
  font-weight: 600;
}

/* --- Project Evolution Gauge --- */
.project-evolution-container {
  margin-top: 10px;
  position: relative;
}

.evolution-track {
  height: 12px;
  background: var(--bg);
  border-radius: 10px;
  position: relative;
  overflow: visible;
  border: 1px solid var(--border);
}

.evolution-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 10px;
  width: 0%;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.evolution-marker {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  background: var(--surface-solid);
  border: 3px solid var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: var(--shadow-sm);
  transition: left 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.marker-label {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.evolution-dates {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

.date-point {
  display: flex;
  flex-direction: column;
}

.date-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.date-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface-solid);
  padding: 16px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 12px;
  align-items: center;
  transform: translateY(150%);
  transition: transform 0.3s;
  z-index: 1000;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.toast.show {
  transform: translateY(0);
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--error);
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(6, 13, 31, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--surface-solid);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  border: 1px solid var(--border);
}

.modal-container.large {
  max-width: 800px;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 17px;
  margin: 0;
  color: var(--text-main);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--error);
}

.main-content {
  flex-grow: 1;
  padding: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: var(--surface-solid);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 12px;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  transform: rotate(15deg);
}

.theme-toggle .fa-sun {
  display: none;
}

.theme-toggle .fa-moon {
  display: block;
}

[data-theme='dark'] .theme-toggle .fa-sun {
  display: block;
}

[data-theme='dark'] .theme-toggle .fa-moon {
  display: none;
}

/* --- Choices.js Styling --- */
.choices {
  margin-bottom: 0;
}

.choices__inner {
  background-color: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 6px 10px !important;
  min-height: 42px !important;
  color: var(--text-main) !important;
}

.choices__list--dropdown {
  background-color: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  z-index: 1001 !important;
}

.choices__item {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.choices__item--selectable.is-highlighted {
  background-color: var(--accent) !important;
  color: white !important;
}

.choices__placeholder {
  opacity: 0.7 !important;
}

.flag-icon {
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .choices__inner,
[data-theme='dark'] .choices__list--dropdown {
  background-color: var(--surface-solid) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}

[data-theme='dark'] .choices__item--selectable.is-highlighted {
  background-color: var(--accent) !important;
}

/* --- Modern Profile View --- */
.profile-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  padding: 24px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.profile-card {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: fit-content;
}

.avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 24px;
}

.avatar-circular {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface-solid);
  box-shadow: var(--shadow-md);
  background: var(--bg);
}

.btn-edit-avatar {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  border: 3px solid var(--surface-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-edit-avatar:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.profile-sidebar h2 {
  font-size: 24px;
  margin-bottom: 4px;
  color: var(--text-main);
}

.profile-job {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.profile-details-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-card h3 {
  font-size: 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.info-item label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.info-item p {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
}

/* Glass effect for details */
.profile-card.glass {
  background: rgba(255, 255, 255, 0.4);
}

[data-theme='dark'] .profile-card.glass {
  background: rgba(30, 41, 59, 0.3);
}

/* Modal Sizes */
.modal-container.medium {
  max-width: 600px;
}

.modal-container.small {
  max-width: 400px;
}

/* Responsive Profile */
@media (max-width: 992px) {
  .profile-container {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    flex-direction: row;
    text-align: left;
    gap: 24px;
    padding: 24px;
  }

  .avatar-wrapper {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
  }

  .profile-actions {
    margin-top: 0 !important;
    margin-left: auto;
    width: auto !important;
  }
}

@media (max-width: 600px) {
  .profile-sidebar {
    flex-direction: column;
    text-align: center;
  }

  .profile-actions {}
}

/* Radio Cards for Submission Type */
.radio-card {
  flex: 1;
  cursor: pointer;
  position: relative;
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  text-align: center;
}

.radio-card-content i {
  font-size: 24px;
  color: var(--text-muted);
}

.radio-card-content span {
  font-size: 14px;
  font-weight: 500;
}

.radio-card input:checked+.radio-card-content {
  border-color: var(--accent);
  background: rgba(30, 113, 184, 0.05);
  box-shadow: 0 4px 12px rgba(30, 113, 184, 0.1);
}

.radio-card input:checked+.radio-card-content i {
  color: var(--accent);
}

.radio-card:hover .radio-card-content {
  border-color: var(--accent);
  transform: translateY(-2px);
}

#episode-status-alert {
  transition: all 0.3s ease;
}

/* --- Professional wizard styles --- */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin: 30px auto 50px;
  max-width: 800px;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  background: var(--bg);
  padding: 0 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-item.active .step-circle {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px rgba(30, 113, 184, 0.3);
  transform: scale(1.1);
}

.step-item.completed .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.step-item.active .step-label {
  color: var(--text-main);
  font-weight: 600;
}

.wizard-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 500px;
}

.wizard-content {
  padding: 40px;
}

.wizard-step {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.wizard-step.active {
  display: block;
}

.wizard-footer {
  padding: 24px 40px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-wizard {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-prev {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-next {
  background: var(--accent-gradient);
  border: none;
  color: white;
}

.btn-prev:hover {
  background: var(--border);
}

.btn-next:hover {
  box-shadow: var(--shadow-glow);
  transform: translateX(4px);
}

/* Selection Cards Step 1 */
.selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.selection-card {
  cursor: pointer;
  position: relative;
}

.selection-card input {
  position: absolute;
  opacity: 0;
}

.selection-inner {
  height: 100%;
  padding: 40px;
  border: 2px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.selection-card:hover .selection-inner {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.selection-card input:checked+.selection-inner {
  border-color: var(--accent);
  background: rgba(30, 113, 184, 0.05);
  box-shadow: 0 0 0 2px var(--accent);
}

.selection-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-muted);
  transition: all 0.3s;
}

.selection-card input:checked+.selection-inner .selection-icon {
  background: var(--accent);
  color: white;
}

.selection-text h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.selection-text p {
  font-size: 14px;
  color: var(--text-muted);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .selection-grid {
    grid-template-columns: 1fr;
  }

  .wizard-progress {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 10px;
  }

  .step-label {
    display: none;
  }
}

/* SweetAlert Theme Support */
.swal2-popup {
  background: var(--surface-solid) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}

.swal2-title,
.swal2-html-container {
  color: var(--text-main) !important;
}

[data-theme='dark'] .swal2-popup {
  background: var(--surface-solid) !important;
  border-color: var(--border) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15), var(--shadow-lg) !important;
}

.swal2-toast {
  background: var(--surface-solid) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
}

/* ── Scrollbar personnalisée ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

[data-theme='dark'] ::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
}

[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.6);
}

/* ── Transitions globales thème ── */
.sidebar,
.topbar,
.card,
.modal-container,
.kpi-card,
table,
.badge,
.btn,
.form-control,
.modal-overlay,
#app-view,
.content-wrapper {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease, box-shadow 0.3s ease;
}

/* ── Responsivité mobile ── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-280px);
    z-index: 1100;
  }

  .sidebar:not(.collapsed) {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
  }

  .content-wrapper {
    margin-left: 0 !important;
  }

  .topbar {
    left: 0;
    right: 0;
  }
}

/* ─── TIROIR LATÉRAL (SIDE PANEL) ─── */
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 800px;
  height: 100vh;
  background: var(--surface);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
  z-index: 1400;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.side-panel.open {
  transform: translateX(0);
}

.side-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(var(--primary-rgb), 0.05);
}

.side-panel-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-main);
}

.btn-close-panel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-close-panel:hover {
  color: #ef4444;
}

.side-panel-content {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.sp-section {
  margin-bottom: 24px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sp-section h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-section p {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.sp-section p strong {
  color: var(--text-main);
  display: inline-block;
  width: 120px;
}

@media (max-width: 500px) {
  .side-panel {
    width: 100%;
    right: -100%;
  }
}

/* --- Project Dashboard (M&E) Styles --- */
/*Moved to full page analysis*/
#project-map {
  border: 1px solid var(--border);
  overflow: hidden;
}

.project-dashboard-view {
  padding: 20px;
  width: 100%;
  min-width: 0;
}

.project-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.project-dashboard-header-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.02));
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.project-back-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.16), rgba(var(--primary-rgb), 0.04));
}

.project-back-btn i {
  color: var(--primary);
}

.topbar-projects-shortcut {
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.16), rgba(var(--primary-rgb), 0.08));
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  color: var(--text-main);
  font-weight: 700;
  padding: 8px 12px;
}

.topbar-projects-shortcut:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.project-dashboard-kpis {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.project-dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  width: 100%;
  min-width: 0;
}

.project-dashboard-charts .card {
  min-width: 0;
}

.project-chart-box {
  height: clamp(220px, 30vh, 320px);
}

.project-map-box {
  height: clamp(320px, 52vh, 620px);
}

.radio-point-label {
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .radio-point-label {
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.35);
}

@media (max-width: 1200px) {
  .project-dashboard-kpis {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .project-dashboard-view {
    padding: 12px;
  }

  .project-dashboard-header {
    align-items: stretch;
  }

  .project-dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .project-dashboard-charts {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-chart-box {
    height: 240px;
  }

  .project-map-box {
    height: 360px;
  }

  .project-back-btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- SERIE PROFILE PANEL STYLES --- */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1399;
  backdrop-filter: blur(2px);
}

.panel-overlay.active {
  display: block;
}

.srp-info-card {
  background: rgba(var(--primary-rgb), 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: background 0.2s;
}

.srp-info-card:hover {
  background: rgba(var(--primary-rgb), 0.1);
}

.srp-info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.srp-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srp-theme-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.episode-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.episode-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.1);
}

.episode-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.episode-info {
  flex: 1;
  min-width: 0;
}

.episode-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.episode-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- STYLES PREMIUM TIROIR STATION & EPISODE --- */
.sp-info-item {
  background: rgba(var(--primary-rgb), 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: background 0.2s;
}

.sp-info-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
}

.sp-info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.sp-info-label i {
  color: var(--primary);
  font-size: 10px;
}

/* --- INTERACTION RESULTS PREMIUM UI --- */
.interaction-results-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 26px;
  width: 100%;
  min-width: 0;
}

.interaction-results-view {
  padding: 34px 24px 24px;
  width: 100%;
  min-width: 0;
  margin-top: 20px;
  scroll-margin-top: 92px;
}

.interaction-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  min-height: 48px;
}

.inter-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.inter-breadcrumb-sep {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

.inter-breadcrumb-item {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.inter-subtitle {
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.interaction-back-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.interaction-back-btn:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
  background: var(--surface-hover);
}

.interaction-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.interaction-kpi-grid {
  padding: 20px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.inter-kpi-card {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 14px;
  text-align: center;
}

.inter-kpi-primary {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: rgba(var(--primary-rgb), 0.2);
}

.inter-kpi-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

.inter-kpi-info {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.25);
}

.inter-kpi-accent {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

.inter-kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.inter-kpi-label {
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: var(--text-muted);
}

.interaction-context-card,
.interaction-survey-card {
  padding: 20px;
}

.interaction-context-card h4 {
  margin-top: 0;
  font-size: 14px;
  color: var(--primary);
}

.interaction-meta-list {
  font-size: 13px;
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.interaction-feed-card {
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.interaction-feed-header {
  border-bottom: 1px solid var(--border);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.interaction-feed-header h3 {
  margin: 0;
  font-size: 16px;
}

.interaction-feed-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.interaction-feed-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.interaction-feed-actions .form-control {
  min-width: 220px;
}

.interaction-grouped-results {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 12px;
  background: rgba(var(--primary-rgb), 0.02);
}

.iq-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.iq-title {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 700;
}

.iq-sub {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.iq-row {
  display: grid;
  grid-template-columns: 170px 1fr 48px;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}

.iq-label {
  font-size: 12px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iq-bar-wrap {
  height: 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.24);
  overflow: hidden;
}

.iq-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
}

.iq-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

.interaction-feed-body {
  padding: 20px;
  max-height: 720px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.02);
}

.interaction-item {
  background: rgba(var(--primary-rgb), 0.03);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.interaction-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.interaction-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  gap: 12px;
}

.interaction-item-phone {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.interaction-item-date {
  font-size: 11px;
  color: var(--text-muted);
}

.interaction-item-content {
  margin: 0;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

.interaction-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 3px 10px;
  margin-top: 8px;
}

.interaction-tag.dtmf {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
}

.interaction-tag.open {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

@media (max-width: 1200px) {
  .interaction-results-view {
    padding: 28px 14px 14px;
    margin-top: 14px;
  }

  .interaction-results-layout {
    grid-template-columns: 1fr;
  }

  .interaction-results-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .interaction-feed-header {
    flex-direction: column;
    align-items: stretch;
  }

  .interaction-feed-actions {
    flex-wrap: wrap;
  }

  .interaction-feed-actions .form-control {
    min-width: 0;
    flex: 1;
  }

  .iq-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .iq-count {
    text-align: left;
  }
}

.sp-info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

/* Grille de notation par critere */
.ep-note-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.ep-note-row:hover {
  border-color: var(--primary);
}

.ep-note-critere {
  flex: 1;
  min-width: 0;
}

.ep-note-critere-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-note-critere-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.ep-note-stars {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.ep-note-star {
  font-size: 13px;
  color: #d1d5db;
  transition: color 0.1s;
}

.ep-note-star.filled {
  color: #f59e0b;
}

.ep-note-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* Episode item clickable */
.episode-item {
  cursor: pointer;
}

.episode-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.15);
  background: rgba(var(--primary-rgb), 0.03);
}

/* --- SIDE PANEL FOOTER --- */
.side-panel-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--surface);
  flex-shrink: 0;
}
