/* ==========================================================================
   PromptForge — Design System
   ========================================================================== */

:root {
  /* Couleurs primaires */
  --primary: #6366f1;       /* Indigo 500 — couleur de marque */
  --primary-hover: #4f46e5; /* Indigo 600 */
  --primary-light: #eef2ff; /* Indigo 50 */
  --primary-dark: #312e81;  /* Indigo 900 */

  --accent: #10b981;        /* Émeraude — succès */
  --accent-hover: #059669;
  --accent-light: #d1fae5;

  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --info-light: #cffafe;

  /* Neutres */
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #94a3b8;

  /* Espacement & Radius */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow: 0 4px 6px -1px rgba(15,23,42,0.06), 0 2px 4px -2px rgba(15,23,42,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -4px rgba(15,23,42,0.06);
  --shadow-xl: 0 25px 50px -12px rgba(15,23,42,0.12);

  /* Layout */
  --sidebar-w: 260px;
  --header-h: 64px;
  --content-max: 1280px;
}

/* Dark mode (préparé) */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f172a;
    --bg-soft: #1e293b;
    --surface: #1e293b;
    --surface-soft: #334155;
    --border: #334155;
    --text: #f1f5f9;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;
  }
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4, h5, h6 { margin: 0 0 12px; font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 12px; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
code, pre { font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, monospace; font-size: 0.9em; }
code { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; color: var(--primary-dark); }
pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
}
pre code { background: transparent; color: inherit; padding: 0; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); }
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: white; }
.btn-success { background: var(--accent); color: white; border-color: var(--accent); }
.btn-success:hover { background: var(--accent-hover); color: white; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 768px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}
.form-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s ease;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--danger);
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }

input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin-right: 6px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title {
  margin: 0;
  font-size: 1.05rem;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}
.card-stat {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.card-stat .value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
  line-height: 1;
}
.card-stat .delta {
  font-size: 12px;
  margin-top: 6px;
  color: var(--text-muted);
}

/* ==========================================================================
   Layout Public
   ========================================================================== */
.public-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.92);
}
.public-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.brand .logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.public-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.public-nav a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 14px;
}
.public-nav a:hover { color: var(--primary); }
.public-nav .btn { padding: 8px 16px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 18px;
}

@media (max-width: 768px) {
  .public-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 99;
  }
  .public-nav.open {
    transform: translateY(0);
  }
  .public-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }
  .public-nav a:last-child {
    border-bottom: none;
    margin-top: 8px;
  }
  .nav-toggle { display: inline-flex; align-items: center; }
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

.public-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 60px 0 30px;
  margin-top: 80px;
}
.public-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 768px) {
  .public-footer .footer-grid { grid-template-columns: 1fr 1fr; }
}
.public-footer h4 { color: white; margin-bottom: 14px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; }
.public-footer ul { list-style: none; padding: 0; margin: 0; }
.public-footer li { margin-bottom: 8px; }
.public-footer a { color: #94a3b8; font-size: 14px; }
.public-footer a:hover { color: white; }
.public-footer .copy {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  color: #64748b;
  font-size: 13px;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary-light) 0%, transparent 100%);
}
.hero h1 {
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}
@media (max-width: 768px) { .hero h1 { font-size: 2rem; } }
.hero .lead {
  font-size: 1.2rem;
  color: var(--text-soft);
  max-width: 700px;
  margin: 0 auto 28px;
}
.hero .cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sections public */
.section { padding: 60px 0; }
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.section-title h2 {
  font-size: 2.25rem;
  margin: 0 auto;
  max-width: 700px;
  line-height: 1.2;
}

/* Grid features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}
.feature:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.feature .icon {
  width: 48px; height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
  color: var(--primary);
}
.feature h3 { margin-bottom: 8px; font-size: 1.15rem; }
.feature p { color: var(--text-soft); font-size: 14px; margin: 0; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.pricing-card {
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}
.pricing-card.featured {
  border-color: var(--primary);
  border-width: 2px;
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.pricing-card.featured::before {
  content: 'POPULAIRE';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.pricing-card .name { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.pricing-card .desc { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.pricing-card .price {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text);
}
.pricing-card .price small { font-size: 1rem; color: var(--text-muted); font-weight: 500; }
.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}
.pricing-card li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.pricing-card li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   App Layout (Dashboard)
   ========================================================================== */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}
.sidebar-section {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s;
}
.sidebar-link:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.user-card .info { flex: 1; min-width: 0; }
.user-card .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .role { font-size: 11px; color: var(--text-muted); }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-header h1 {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
}
.app-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.app-content {
  padding: 28px;
  flex: 1;
  background: var(--bg);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}
@media (max-width: 1024px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -100%;
    width: 280px;
    z-index: 200;
    transition: left 0.3s;
  }
  .sidebar.open { left: 0; box-shadow: var(--shadow-xl); }
  .sidebar-overlay.show { display: block; }
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
}
@media (max-width: 1024px) {
  .menu-toggle { display: inline-flex; }
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-soft); }

/* ==========================================================================
   Badges & Tags
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--bg-soft);
  color: var(--text-soft);
  text-transform: uppercase;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--accent-light); color: var(--accent-hover); }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #155e75; }

/* Statut prompt */
.statut-SUCCES { background: var(--accent-light); color: var(--accent-hover); }
.statut-ECHEC_PARTIEL { background: var(--warning-light); color: #92400e; }
.statut-ECHEC { background: var(--danger-light); color: #991b1b; }
.statut-EN_COURS { background: var(--info-light); color: #155e75; }
.statut-BROUILLON { background: var(--bg-soft); color: var(--text-muted); }

/* Mode critère */
.mode-PASS_FAIL { background: var(--info-light); color: #155e75; }
.mode-GRADUE { background: #fce7f3; color: #831843; }

/* Type critère */
.type-BLOQUANT { background: var(--danger-light); color: #991b1b; }
.type-SOUHAITABLE { background: var(--bg-soft); color: var(--text-soft); }

/* Statut éval */
.eval-VALIDE { color: var(--accent-hover); }
.eval-ECHOUE { color: var(--danger); }
.eval-DEGRADE { color: var(--warning); }

/* ==========================================================================
   Alerts / Flash
   ========================================================================== */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert .icon { flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--accent-light); border-color: #6ee7b7; color: var(--accent-hover); }
.alert-error { background: var(--danger-light); border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: var(--warning-light); border-color: #fcd34d; color: #92400e; }
.alert-info { background: var(--info-light); border-color: #67e8f9; color: #155e75; }

/* ==========================================================================
   Utilities
   ========================================================================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-primary { color: var(--primary); }
.text-success { color: var(--accent); }
.text-danger { color: var(--danger); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
}
.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-soft);
}
.pagination a:hover { background: var(--bg-soft); }
.pagination .active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.pagination .disabled { opacity: 0.5; cursor: not-allowed; }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar select, .filter-bar input {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

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

/* Cercles 5 — Pipeline */
.pipeline-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  position: relative;
}
.pipeline-step .step-num {
  position: absolute;
  top: -12px;
  left: 18px;
  width: 28px; height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.pipeline-step h4 { margin-top: 4px; }
.pipeline-step.done {
  background: linear-gradient(180deg, var(--accent-light) 0%, var(--surface) 100%);
  border-color: var(--accent);
}
.pipeline-step.done .step-num { background: var(--accent); }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Empty state */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 { color: var(--text-soft); margin-bottom: 8px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Tooltip */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--text);
  color: white;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* Print */
@media print {
  .sidebar, .app-header, .public-header, .public-footer { display: none; }
  .app-content { padding: 0; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Loading state */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--border) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
