/* ============================================================
   NexusERP — Feuille de style principale
   Design system : Dark #0a0a0f · Or #d4a550 · DM Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=DM+Mono:wght@400;500&display=swap');

/* ---- VARIABLES ---- */
:root {
  --bg-base:     #0a0a0f;
  --bg-card:     #0e0e18;
  --bg-elevated: #111118;
  --bg-input:    #141420;
  --border:      #1a1a28;
  --border-soft: #141420;
  --border-strong:#222232;

  --text-primary:   #f0ede6;
  --text-secondary: #c0c0cc;
  --text-muted:     #6a6a78;
  --text-faint:     #3a3a48;

  --gold:        #d4a550;
  --gold-light:  #e8c47a;
  --gold-dark:   #a07030;
  --gold-bg:     #1a1400;

  --green:       #3a8c60;
  --green-bg:    #0f2018;
  --green-border:#1a3028;

  --red:         #8c3a3a;
  --red-bg:      #1f0f0f;
  --red-border:  #3a1a1a;

  --blue:        #3a6a9a;
  --blue-bg:     #0f1520;
  --blue-border: #1a2a3a;

  --amber:       #c09040;
  --amber-bg:    #1a1800;

  --sidebar-w:   60px;
  --topbar-h:    54px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   10px;
  --radius-xl:   14px;

  --font-sans:   'DM Sans', sans-serif;
  --font-serif:  'DM Serif Display', serif;
  --font-mono:   'DM Mono', monospace;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.5);

  --transition:  0.15s ease;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-secondary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { opacity: 0.8; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---- LAYOUT PRINCIPAL ---- */
.erp-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: #080810;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 4px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-logo svg { width: 18px; height: 18px; }

.sb-item {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
  color: var(--text-faint);
  text-decoration: none;
  flex-shrink: 0;
}
.sb-item:hover { background: var(--bg-elevated); color: var(--text-muted); }
.sb-item.active { background: #1c1c2c; color: var(--gold); }
.sb-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.sb-item .badge {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  position: absolute; top: 6px; right: 6px;
}

.sb-sep { width: 28px; height: 1px; background: var(--border-soft); margin: 6px 0; flex-shrink: 0; }
.sb-spacer { flex: 1; }

.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--bg-base);
  cursor: pointer; flex-shrink: 0;
}

/* Tooltip sidebar */
.sb-item[data-title]::after {
  content: attr(data-title);
  position: absolute;
  left: 50px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 200;
}
.sb-item:hover[data-title]::after { opacity: 1; }

/* ---- CONTENU PRINCIPAL ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  background: var(--bg-base);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-breadcrumb { font-size: 12px; color: var(--text-faint); }
.topbar-breadcrumb strong { color: var(--text-muted); font-weight: 500; }
.topbar-breadcrumb a { color: var(--text-faint); }
.topbar-breadcrumb a:hover { color: var(--text-muted); }
.topbar-breadcrumb .sep { margin: 0 5px; color: var(--border); }

.topbar-spacer { flex: 1; }

.topbar-search {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-muted);
  outline: none;
  width: 220px;
  transition: border-color var(--transition);
}
.topbar-search::placeholder { color: var(--text-faint); }
.topbar-search:focus { border-color: var(--gold); }

.notif-btn {
  position: relative;
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
}
.notif-btn:hover { background: var(--bg-elevated); }
.notif-btn .count {
  position: absolute; top: 4px; right: 4px;
  background: var(--red);
  color: #ffd0d0;
  font-size: 8px; font-weight: 700;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.topbar-date { font-size: 11px; color: var(--text-faint); }

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.topbar-user .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--bg-base);
}
.topbar-user .name { font-size: 12px; color: var(--text-muted); }

/* Sélecteur de société */
.company-selector {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  font-size: 11px;
  color: var(--text-muted);
  outline: none;
  cursor: pointer;
}
.company-selector:focus { border-color: var(--gold); }

/* ---- PAGE ---- */
.page-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--text-primary);
  line-height: 1.1;
}
.page-title em { font-style: italic; color: var(--gold); }
.page-subtitle { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* ---- BOUTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: opacity var(--transition), background var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn-gold  { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--bg-base); }
.btn-ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-elevated); }
.btn-green { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green); }
.btn-red   { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red); }
.btn-blue  { background: var(--blue-bg); border: 1px solid var(--blue-border); color: var(--blue); }
.btn-sm    { padding: 5px 12px; font-size: 11px; }
.btn-lg    { padding: 12px 24px; font-size: 14px; }
.btn-icon  { padding: 7px; width: 34px; height: 34px; justify-content: center; }

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.card-body  { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-soft); }

/* Accent couleur haut carte */
.card-accent-gold::before { content: ''; display: block; height: 2px; background: linear-gradient(90deg, var(--gold), transparent); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-accent-green::before { content: ''; display: block; height: 2px; background: linear-gradient(90deg, var(--green), transparent); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-accent-red::before   { content: ''; display: block; height: 2px; background: linear-gradient(90deg, var(--red), transparent); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-accent-blue::before  { content: ''; display: block; height: 2px; background: linear-gradient(90deg, var(--blue), transparent); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* ---- KPI CARDS ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.kpi-label  { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; }
.kpi-value  { font-size: 24px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; margin-bottom: 4px; }
.kpi-value span { font-size: 13px; font-weight: 400; color: var(--text-faint); }
.kpi-delta  { font-size: 11px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.dn { color: var(--red); }
.kpi-sparkline { margin-top: 12px; opacity: 0.6; width: 100%; }

/* ---- TABLES ---- */
.erp-table {
  width: 100%;
  border-collapse: collapse;
}
.erp-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  font-weight: 500;
  padding: 9px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.erp-table td {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.erp-table tr:last-child td { border-bottom: none; }
.erp-table tr:hover td { background: rgba(255,255,255,0.02); cursor: pointer; }
.erp-table tr.selected td { background: rgba(212,165,80,0.05); }
.erp-table td.strong { color: var(--text-secondary); font-weight: 500; }
.erp-table td.mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.erp-table td.amount { text-align: right; font-weight: 500; color: var(--text-secondary); }
.erp-table td.amount.red { color: var(--red); }
.erp-table td.amount.green { color: var(--green); }

/* ---- STATUT PILLS ---- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.pill-brouillon   { background: #111118; color: #5a5a68; border: 1px solid #1a1a28; }
.pill-envoye      { background: #0f1520; color: #4a8aca; border: 1px solid #1a2a3a; }
.pill-valide      { background: #0f2018; color: #3a8c60; border: 1px solid #1a3028; }
.pill-en_attente  { background: #1a1800; color: #c09040; border: 1px solid #2a2800; }
.pill-paye        { background: #0f2018; color: #3a8c60; border: 1px solid #1a3028; }
.pill-partiellement_payee { background: #1a1200; color: #c08030; border: 1px solid #2a2000; }
.pill-en_retard   { background: #1f0f0f; color: #8c3a3a; border: 1px solid #3a1a1a; }
.pill-annule      { background: #1a0f1a; color: #7a4a7a; border: 1px solid #2a1a2a; }
.pill-surestarie  { background: #1f0f0f; color: #8c3a3a; border: 1px solid #3a1a1a; }
.pill-en_franchise{ background: #0f2018; color: #3a8c60; border: 1px solid #1a3028; }
.pill-cdi         { background: #0f2018; color: #3a8c60; border: 1px solid #1a3028; }
.pill-cdd         { background: #1a1800; color: #c09040; border: 1px solid #2a2800; }
.pill-stage       { background: #0f1520; color: #4a8aca; border: 1px solid #1a2a3a; }
.pill-urgent      { background: #1f0f0f; color: #8c3a3a; border: 1px solid #3a1a1a; }

/* ---- FORMULAIRES ---- */
.form-group { margin-bottom: 16px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

label.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
label.form-label .required { color: var(--red); margin-left: 2px; }

.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus { border-color: var(--gold); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }
.form-control.error { border-color: var(--red); }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-error { font-size: 11px; color: var(--red); margin-top: 5px; }
.form-hint  { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

/* ---- PROGRESS BARS ---- */
.progress { height: 5px; background: var(--border-soft); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; }
.progress-bar.gold  { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.progress-bar.green { background: linear-gradient(90deg, var(--green), #5aac80); }
.progress-bar.red   { background: linear-gradient(90deg, var(--red), #ac5a5a); }
.progress-bar.blue  { background: linear-gradient(90deg, var(--blue), #5a8aba); }

/* ---- ALERTES / FLASH MESSAGES ---- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green); }
.alert-error   { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red); }
.alert-warning { background: var(--amber-bg); border: 1px solid #2a2800; color: var(--amber); }
.alert-info    { background: var(--blue-bg); border: 1px solid var(--blue-border); color: var(--blue); }

/* ---- PAGINATION ---- */
.pagination {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
}
.pagination .info { font-size: 11px; color: var(--text-faint); flex: 1; }
.page-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { background: var(--bg-elevated); }
.page-btn.active { background: var(--gold-bg); border-color: var(--gold); color: var(--gold); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---- MODALS ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-serif); font-size: 20px; color: var(--text-primary); }
.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-soft); display: flex; gap: 8px; justify-content: flex-end; }

/* ---- TABS ---- */
.tabs-nav {
  display: flex;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  width: fit-content;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-faint);
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--text-muted); background: rgba(255,255,255,0.03); }
.tab-btn.active { background: #1c1c2c; color: var(--gold); }

/* ---- STAT CARDS (small) ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.stat-lbl { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-val { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.stat-delta { font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.val-gold  { color: var(--gold); }
.val-green { color: var(--green); }
.val-red   { color: var(--red); }
.val-blue  { color: var(--blue); }
.val-white { color: var(--text-primary); }

/* ---- UTILITAIRES ---- */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm    { font-size: 11px; }
.text-xs    { font-size: 10px; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-gold  { color: var(--gold); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.font-serif { font-family: var(--font-serif); }
.font-mono  { font-family: var(--font-mono); }
.italic     { font-style: italic; }
.bold       { font-weight: 600; }
.hidden     { display: none; }
.sr-only    { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.separator  { height: 1px; background: var(--border-soft); margin: 16px 0; }
.w-full     { width: 100%; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border-soft) 50%, var(--bg-elevated) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ---- RESPONSIF ---- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 50px; }
  .main-content { margin-left: 50px; }
  .topbar-search { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; }
}
@media print {
  .sidebar, .topbar { display: none; }
  .main-content { margin-left: 0; }
  .page-body { padding: 0; }
  .btn { display: none; }
}

/* ============================================================
   NEXUSERP — 60 THÈMES COMPLETS
   Chaque thème redéfinit TOUTES les variables CSS
   ============================================================ */

/* ===== TRANSITION GLOBALE ===== */
*, *::before, *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease;
}

/* ================================================================
   CATÉGORIE 1 : DARK CLASSICS (fond sombre, accent coloré)
================================================================ */

/* Or Impérial — thème par défaut, déjà dans :root */

/* Azure Nuit */
.theme-azure {
  --bg-base:#060e1e; --bg-card:#0a1528; --bg-elevated:#0e1c34; --bg-input:#12233f;
  --border:#1c3050; --border-soft:#121e38; --border-strong:#243860;
  --text-primary:#e8f2ff; --text-secondary:#9ab4d8; --text-muted:#4a6888; --text-faint:#1e3050;
  --gold:#4f8ef7; --gold-light:#7aaeff; --gold-dark:#2f6ed7; --gold-bg:#0a1c3a;
  --green:#22d06a; --green-bg:#041a10; --green-border:#083020;
  --red:#ff6b7a; --red-bg:#1e0810; --red-border:#380f1e;
  --blue:#4f8ef7; --blue-bg:#0a1528; --blue-border:#1c3050;
  --amber:#ffcc44; --amber-bg:#1a1400;
  --sidebar-bg:#040a18;
}

/* Émeraude */
.theme-emerald {
  --bg-base:#030f09; --bg-card:#051510; --bg-elevated:#081c15; --bg-input:#0c241c;
  --border:#10321e; --border-soft:#0c241c; --border-strong:#184028;
  --text-primary:#e0fff0; --text-secondary:#80c8a0; --text-muted:#2e6844; --text-faint:#103020;
  --gold:#14d470; --gold-light:#40f090; --gold-dark:#0aaa54; --gold-bg:#041e0e;
  --green:#14d470; --green-bg:#042010; --green-border:#083018;
  --red:#ff6b6b; --red-bg:#1e0808; --red-border:#381010;
  --blue:#40d0f0; --blue-bg:#041520; --blue-border:#0f2838;
  --amber:#ffd04a; --amber-bg:#1a1200;
  --sidebar-bg:#020a06;
}

/* Lavande */
.theme-lavender {
  --bg-base:#0c0a1c; --bg-card:#120f26; --bg-elevated:#181430; --bg-input:#1e183c;
  --border:#2c2050; --border-soft:#1e183c; --border-strong:#342860;
  --text-primary:#f0eaff; --text-secondary:#b8a8e8; --text-muted:#584878; --text-faint:#281840;
  --gold:#9b6dff; --gold-light:#ba90ff; --gold-dark:#7a4de0; --gold-bg:#180e38;
  --green:#50e896; --green-bg:#041a0e; --green-border:#0a2e18;
  --red:#ff7090; --red-bg:#200810; --red-border:#3a1020;
  --blue:#80a0ff; --blue-bg:#0e1030; --blue-border:#1a1848;
  --amber:#ffd04a; --amber-bg:#1a1500;
  --sidebar-bg:#080618;
}

/* Carbone */
.theme-carbon {
  --bg-base:#020508; --bg-card:#050a12; --bg-elevated:#090f1a; --bg-input:#0e1520;
  --border:#1a2030; --border-soft:#0e1520; --border-strong:#202840;
  --text-primary:#e8edf5; --text-secondary:#8a9ab0; --text-muted:#3a4a60; --text-faint:#182030;
  --gold:#8090b0; --gold-light:#a0b0d0; --gold-dark:#6070a0; --gold-bg:#0e1828;
  --green:#30d888; --green-bg:#041810; --green-border:#082818;
  --red:#ff6060; --red-bg:#1e0808; --red-border:#380f0f;
  --blue:#60a0f8; --blue-bg:#080f20; --blue-border:#101838;
  --amber:#ffba44; --amber-bg:#181000;
  --sidebar-bg:#020408;
}

/* Ambre Solaire */
.theme-amber {
  --bg-base:#100a00; --bg-card:#1a1000; --bg-elevated:#221600; --bg-input:#2c1c00;
  --border:#3e2800; --border-soft:#2c1c00; --border-strong:#503400;
  --text-primary:#fff8e8; --text-secondary:#d4a060; --text-muted:#7a5820; --text-faint:#3a2800;
  --gold:#f5a520; --gold-light:#ffc040; --gold-dark:#d08000; --gold-bg:#1e1200;
  --green:#40d488; --green-bg:#051a08; --green-border:#0a2e10;
  --red:#ff6060; --red-bg:#200808; --red-border:#381010;
  --blue:#60c0f8; --blue-bg:#051018; --blue-border:#0f2030;
  --amber:#f5a520; --amber-bg:#1a0e00;
  --sidebar-bg:#0a0600;
}

/* Crimson */
.theme-crimson {
  --bg-base:#0e0404; --bg-card:#160608; --bg-elevated:#1e0a0c; --bg-input:#280e10;
  --border:#401418; --border-soft:#280e10; --border-strong:#501c20;
  --text-primary:#fff0f0; --text-secondary:#d89090; --text-muted:#784040; --text-faint:#381818;
  --gold:#f04040; --gold-light:#ff6060; --gold-dark:#c02020; --gold-bg:#1e0808;
  --green:#40d880; --green-bg:#051808; --green-border:#0a2c10;
  --red:#ff8080; --red-bg:#280808; --red-border:#401010;
  --blue:#70c0f8; --blue-bg:#041018; --blue-border:#0f2030;
  --amber:#ffc040; --amber-bg:#1a1000;
  --sidebar-bg:#080202;
}

/* Océan Profond */
.theme-ocean {
  --bg-base:#020d18; --bg-card:#041320; --bg-elevated:#071a2a; --bg-input:#0a2034;
  --border:#0e3048; --border-soft:#0a2034; --border-strong:#143858;
  --text-primary:#e0f8ff; --text-secondary:#70c8e8; --text-muted:#285870; --text-faint:#0a2838;
  --gold:#00c8f0; --gold-light:#30e0ff; --gold-dark:#00a0c8; --gold-bg:#041828;
  --green:#30e890; --green-bg:#041a10; --green-border:#083018;
  --red:#ff7080; --red-bg:#1e0810; --red-border:#381018;
  --blue:#00c8f0; --blue-bg:#041828; --blue-border:#0c3040;
  --amber:#ffd060; --amber-bg:#181200;
  --sidebar-bg:#010810;
}

/* Menthe */
.theme-mint {
  --bg-base:#021614; --bg-card:#041e1c; --bg-elevated:#072622; --bg-input:#0a2e2a;
  --border:#103e38; --border-soft:#0a2e2a; --border-strong:#184e46;
  --text-primary:#e0fff8; --text-secondary:#70e0c8; --text-muted:#20685a; --text-faint:#0a3430;
  --gold:#00d8c0; --gold-light:#30f0d8; --gold-dark:#00b0a0; --gold-bg:#041e1c;
  --green:#00d8c0; --green-bg:#052018; --green-border:#0a3028;
  --red:#ff7080; --red-bg:#1e0808; --red-border:#381010;
  --blue:#40d0f8; --blue-bg:#041520; --blue-border:#0f2838;
  --amber:#ffd060; --amber-bg:#181200;
  --sidebar-bg:#010c0a;
}

/* Crépuscule */
.theme-twilight {
  --bg-base:#0e0218; --bg-card:#160428; --bg-elevated:#1e0838; --bg-input:#260c46;
  --border:#3c1060; --border-soft:#260c46; --border-strong:#4c1878;
  --text-primary:#f8eaff; --text-secondary:#d890f8; --text-muted:#8840a8; --text-faint:#401860;
  --gold:#e040f8; --gold-light:#f060ff; --gold-dark:#c020d8; --gold-bg:#1c0830;
  --green:#40f090; --green-bg:#051a10; --green-border:#0a3018;
  --red:#ff6080; --red-bg:#1e0810; --red-border:#381018;
  --blue:#a060f8; --blue-bg:#0e0e28; --blue-border:#181840;
  --amber:#ffd060; --amber-bg:#181200;
  --sidebar-bg:#09010f;
}

/* ================================================================
   CATÉGORIE 2 : DARK PREMIUM (atmosphères profondes)
================================================================ */

/* Obsidienne */
.theme-obsidian {
  --bg-base:#080808; --bg-card:#101010; --bg-elevated:#181818; --bg-input:#202020;
  --border:#303030; --border-soft:#202020; --border-strong:#404040;
  --text-primary:#f8f8f8; --text-secondary:#a0a0a0; --text-muted:#505050; --text-faint:#252525;
  --gold:#e0e0e0; --gold-light:#ffffff; --gold-dark:#c0c0c0; --gold-bg:#181818;
  --green:#50d888; --green-bg:#051808; --green-border:#0a2c10;
  --red:#f86060; --red-bg:#1e0808; --red-border:#381010;
  --blue:#60a8f8; --blue-bg:#080f20; --blue-border:#101838;
  --amber:#f8c040; --amber-bg:#181000;
  --sidebar-bg:#050505;
}

/* Minuit Indigo */
.theme-midnight {
  --bg-base:#02001e; --bg-card:#060030; --bg-elevated:#0c0040; --bg-input:#120050;
  --border:#1c0070; --border-soft:#120050; --border-strong:#240090;
  --text-primary:#e8e0ff; --text-secondary:#9080d0; --text-muted:#3c2878; --text-faint:#180e40;
  --gold:#7060f8; --gold-light:#9080ff; --gold-dark:#5040e0; --gold-bg:#0c0038;
  --green:#40d888; --green-bg:#041810; --green-border:#082818;
  --red:#f86080; --red-bg:#1e0810; --red-border:#381018;
  --blue:#7060f8; --blue-bg:#0a0e28; --blue-border:#141840;
  --amber:#ffc040; --amber-bg:#181200;
  --sidebar-bg:#010018;
}

/* Noir Parisien */
.theme-noir {
  --bg-base:#0a0a08; --bg-card:#121210; --bg-elevated:#1a1a18; --bg-input:#222220;
  --border:#303028; --border-soft:#222220; --border-strong:#3a3a30;
  --text-primary:#f8f4e8; --text-secondary:#c8b880; --text-muted:#685830; --text-faint:#302818;
  --gold:#d0a040; --gold-light:#f0c060; --gold-dark:#a07820; --gold-bg:#181000;
  --green:#50d880; --green-bg:#051808; --green-border:#0a2c10;
  --red:#f86060; --red-bg:#1e0808; --red-border:#381010;
  --blue:#60a0f8; --blue-bg:#08101e; --blue-border:#101838;
  --amber:#d0a040; --amber-bg:#181000;
  --sidebar-bg:#060604;
}

/* Slate Arctique */
.theme-slate {
  --bg-base:#080c12; --bg-card:#0e1420; --bg-elevated:#141c28; --bg-input:#1a2432;
  --border:#243040; --border-soft:#1a2432; --border-strong:#2c3a50;
  --text-primary:#e8edf8; --text-secondary:#7888a8; --text-muted:#384858; --text-faint:#1a2232;
  --gold:#6888b8; --gold-light:#88a8d8; --gold-dark:#4868a0; --gold-bg:#101828;
  --green:#40d878; --green-bg:#051808; --green-border:#082e10;
  --red:#f87070; --red-bg:#1e0808; --red-border:#381010;
  --blue:#60a8f8; --blue-bg:#081020; --blue-border:#101838;
  --amber:#f8c040; --amber-bg:#181000;
  --sidebar-bg:#05080e;
}

/* Void Cosmos */
.theme-void {
  --bg-base:#04001a; --bg-card:#08002a; --bg-elevated:#0e003c; --bg-input:#14004e;
  --border:#200070; --border-soft:#14004e; --border-strong:#280088;
  --text-primary:#eae0ff; --text-secondary:#9078d8; --text-muted:#402878; --text-faint:#1a0848;
  --gold:#a050ff; --gold-light:#c070ff; --gold-dark:#8030e8; --gold-bg:#140038;
  --green:#40e880; --green-bg:#041810; --green-border:#082c18;
  --red:#ff6080; --red-bg:#1e0810; --red-border:#381018;
  --blue:#8060f8; --blue-bg:#0c0e28; --blue-border:#161840;
  --amber:#ffd060; --amber-bg:#181200;
  --sidebar-bg:#030012;
}

/* Graphite Pro */
.theme-graphite {
  --bg-base:#0c0c0e; --bg-card:#141416; --bg-elevated:#1c1c1e; --bg-input:#242428;
  --border:#343438; --border-soft:#242428; --border-strong:#404044;
  --text-primary:#f0f0f8; --text-secondary:#a0a0b8; --text-muted:#505060; --text-faint:#242430;
  --gold:#b870f8; --gold-light:#d090ff; --gold-dark:#9850e8; --gold-bg:#1a0828;
  --green:#40e880; --green-bg:#051808; --green-border:#0a2c10;
  --red:#f86060; --red-bg:#1e0808; --red-border:#381010;
  --blue:#60a0f8; --blue-bg:#080f20; --blue-border:#101838;
  --amber:#f8c040; --amber-bg:#181000;
  --sidebar-bg:#080808;
}

/* Nébuleuse Cosmique */
.theme-nebula {
  --bg-base:#060812; --bg-card:#0c0e1e; --bg-elevated:#121428; --bg-input:#181a32;
  --border:#202448; --border-soft:#181a32; --border-strong:#282c58;
  --text-primary:#eaeaff; --text-secondary:#9898d8; --text-muted:#404880; --text-faint:#181c3c;
  --gold:#f0a0ff; --gold-light:#ffb8ff; --gold-dark:#d070e8; --gold-bg:#1a0828;
  --green:#40f880; --green-bg:#041a10; --green-border:#082e18;
  --red:#ff7090; --red-bg:#1e0810; --red-border:#381020;
  --blue:#8090f8; --blue-bg:#0e1028; --blue-border:#181840;
  --amber:#ffd860; --amber-bg:#181200;
  --sidebar-bg:#04060e;
}

/* Aurora Boréale */
.theme-aurora {
  --bg-base:#020e10; --bg-card:#041618; --bg-elevated:#081e22; --bg-input:#0c282c;
  --border:#143840; --border-soft:#0c282c; --border-strong:#1c4850;
  --text-primary:#e8fffe; --text-secondary:#70e0d8; --text-muted:#205858; --text-faint:#0a2e30;
  --gold:#00e8d8; --gold-light:#30ffee; --gold-dark:#00c0b0; --gold-bg:#041c20;
  --green:#40f890; --green-bg:#052010; --green-border:#0a3018;
  --red:#ff7080; --red-bg:#1e0808; --red-border:#381010;
  --blue:#40d0f8; --blue-bg:#061420; --blue-border:#0f2438;
  --amber:#ffd860; --amber-bg:#181400;
  --sidebar-bg:#010a0c;
}

/* Matrix Code */
.theme-matrix {
  --bg-base:#000800; --bg-card:#001000; --bg-elevated:#001a00; --bg-input:#002200;
  --border:#003a00; --border-soft:#002200; --border-strong:#005000;
  --text-primary:#c0ffc0; --text-secondary:#30c030; --text-muted:#106010; --text-faint:#003000;
  --gold:#00ff60; --gold-light:#80ff80; --gold-dark:#00d040; --gold-bg:#001800;
  --green:#00ff60; --green-bg:#002a00; --green-border:#004000;
  --red:#ff4040; --red-bg:#1e0000; --red-border:#380000;
  --blue:#40e0ff; --blue-bg:#001828; --blue-border:#003040;
  --amber:#ffdd00; --amber-bg:#1a1400;
  --sidebar-bg:#000400;
}

/* Neon Cyberpunk */
.theme-neon {
  --bg-base:#04020e; --bg-card:#080416; --bg-elevated:#0c081e; --bg-input:#100c26;
  --border:#1c1040; --border-soft:#100c26; --border-strong:#241450;
  --text-primary:#f0e8ff; --text-secondary:#b090e0; --text-muted:#504880; --text-faint:#1c1440;
  --gold:#ff1880; --gold-light:#ff50a0; --gold-dark:#d80060; --gold-bg:#1e0418;
  --green:#08ff80; --green-bg:#001a0c; --green-border:#003018;
  --red:#ff4040; --red-bg:#200408; --red-border:#380810;
  --blue:#00d8ff; --blue-bg:#001828; --blue-border:#003040;
  --amber:#ffee00; --amber-bg:#1a1800;
  --sidebar-bg:#020108;
}

/* Galactique Violet */
.theme-galactic {
  --bg-base:#060018; --bg-card:#0c0028; --bg-elevated:#12003c; --bg-input:#18004e;
  --border:#260070; --border-soft:#18004e; --border-strong:#300088;
  --text-primary:#eee8ff; --text-secondary:#b098e8; --text-muted:#584898; --text-faint:#281848;
  --gold:#c060f8; --gold-light:#e080ff; --gold-dark:#a040e0; --gold-bg:#180038;
  --green:#40f880; --green-bg:#041a10; --green-border:#082c18;
  --red:#ff6080; --red-bg:#1e0808; --red-border:#381010;
  --blue:#8080ff; --blue-bg:#0c0e30; --blue-border:#161848;
  --amber:#ffd060; --amber-bg:#181200;
  --sidebar-bg:#040010;
}

/* Tokyo Night */
.theme-tokyonight {
  --bg-base:#1a1b2e; --bg-card:#1f2335; --bg-elevated:#24283b; --bg-input:#292e42;
  --border:#3b4261; --border-soft:#292e42; --border-strong:#414868;
  --text-primary:#c0caf5; --text-secondary:#9aa5ce; --text-muted:#565f89; --text-faint:#292e42;
  --gold:#7aa2f7; --gold-light:#89b4fa; --gold-dark:#5282d4; --gold-bg:#1a2040;
  --green:#9ece6a; --green-bg:#0f1f0a; --green-border:#1a3010;
  --red:#f7768e; --red-bg:#1f0a0e; --red-border:#38101a;
  --blue:#7dcfff; --blue-bg:#0a1828; --blue-border:#102438;
  --amber:#e0af68; --amber-bg:#1a1408;
  --sidebar-bg:#16161e;
}

/* Dracula */
.theme-dracula {
  --bg-base:#1e2029; --bg-card:#282a36; --bg-elevated:#343746; --bg-input:#3c3f50;
  --border:#44475a; --border-soft:#3c3f50; --border-strong:#6272a4;
  --text-primary:#f8f8f2; --text-secondary:#d0d0e8; --text-muted:#6272a4; --text-faint:#44475a;
  --gold:#bd93f9; --gold-light:#d0aaff; --gold-dark:#9d73f7; --gold-bg:#1e1a38;
  --green:#50fa7b; --green-bg:#1a2510; --green-border:#2a3818;
  --red:#ff5555; --red-bg:#200a0a; --red-border:#381010;
  --blue:#8be9fd; --blue-bg:#0a1e25; --blue-border:#103038;
  --amber:#f1fa8c; --amber-bg:#1e1e08;
  --sidebar-bg:#191a22;
}

/* Nord */
.theme-nord {
  --bg-base:#272d3a; --bg-card:#2e3440; --bg-elevated:#3b4252; --bg-input:#434c5e;
  --border:#4c566a; --border-soft:#434c5e; --border-strong:#5e6d84;
  --text-primary:#eceff4; --text-secondary:#d8dee9; --text-muted:#81a1c1; --text-faint:#4c566a;
  --gold:#88c0d0; --gold-light:#9fd8e8; --gold-dark:#6aa0b0; --gold-bg:#2a3848;
  --green:#a3be8c; --green-bg:#1a2018; --green-border:#283028;
  --red:#bf616a; --red-bg:#1e1010; --red-border:#381818;
  --blue:#81a1c1; --blue-bg:#1e2840; --blue-border:#2a3850;
  --amber:#ebcb8b; --amber-bg:#1e1808;
  --sidebar-bg:#1e242e;
}

/* Catppuccin Mocha */
.theme-catppuccin {
  --bg-base:#181825; --bg-card:#1e1e2e; --bg-elevated:#313244; --bg-input:#45475a;
  --border:#585b70; --border-soft:#45475a; --border-strong:#6c7086;
  --text-primary:#cdd6f4; --text-secondary:#bac2de; --text-muted:#7f849c; --text-faint:#45475a;
  --gold:#cba6f7; --gold-light:#d8b4fe; --gold-dark:#b580f0; --gold-bg:#1a1030;
  --green:#a6e3a1; --green-bg:#1a2318; --green-border:#283528;
  --red:#f38ba8; --red-bg:#1e0c10; --red-border:#381020;
  --blue:#89b4fa; --blue-bg:#0e1828; --blue-border:#182438;
  --amber:#f9e2af; --amber-bg:#1e1808;
  --sidebar-bg:#141420;
}

/* Gruvbox */
.theme-gruvbox {
  --bg-base:#1d2021; --bg-card:#282828; --bg-elevated:#32302f; --bg-input:#3c3836;
  --border:#504945; --border-soft:#3c3836; --border-strong:#665c54;
  --text-primary:#ebdbb2; --text-secondary:#d5c4a1; --text-muted:#928374; --text-faint:#504945;
  --gold:#d79921; --gold-light:#fabd2f; --gold-dark:#b57614; --gold-bg:#1c1400;
  --green:#98971a; --green-bg:#1a1a08; --green-border:#282810;
  --red:#cc241d; --red-bg:#1e0808; --red-border:#380f0f;
  --blue:#458588; --blue-bg:#081818; --blue-border:#102828;
  --amber:#d65d0e; --amber-bg:#1a0c00;
  --sidebar-bg:#191c1d;
}

/* Monokai */
.theme-monokai {
  --bg-base:#1e1f1a; --bg-card:#272822; --bg-elevated:#31322c; --bg-input:#3a3b34;
  --border:#49483e; --border-soft:#3a3b34; --border-strong:#75715e;
  --text-primary:#f8f8f2; --text-secondary:#d0c8a8; --text-muted:#75715e; --text-faint:#49483e;
  --gold:#a6e22e; --gold-light:#c0f040; --gold-dark:#80c020; --gold-bg:#1a2010;
  --green:#a6e22e; --green-bg:#1a2010; --green-border:#2a3018;
  --red:#f92672; --red-bg:#200818; --red-border:#381018;
  --blue:#66d9e8; --blue-bg:#0a1e25; --blue-border:#103038;
  --amber:#e6db74; --amber-bg:#1e1c08;
  --sidebar-bg:#181914;
}

/* Solarized Dark */
.theme-solarized {
  --bg-base:#001e28; --bg-card:#002b36; --bg-elevated:#073642; --bg-input:#0a4050;
  --border:#144050; --border-soft:#0a4050; --border-strong:#1c5060;
  --text-primary:#fdf6e3; --text-secondary:#eee8d5; --text-muted:#657b83; --text-faint:#14404e;
  --gold:#268bd2; --gold-light:#2aa198; --gold-dark:#1a6ca0; --gold-bg:#003040;
  --green:#859900; --green-bg:#1a1e00; --green-border:#283000;
  --red:#dc322f; --red-bg:#1e0808; --red-border:#381010;
  --blue:#268bd2; --blue-bg:#002838; --blue-border:#004858;
  --amber:#cb4b16; --amber-bg:#1c0c00;
  --sidebar-bg:#001820;
}

/* ================================================================
   CATÉGORIE 3 : LIGHT PREMIUM (fond clair, moderne)
================================================================ */

/* Neige Bleue */
.theme-snow {
  --bg-base:#f0f4fa; --bg-card:#fafcff; --bg-elevated:#e4ecf8; --bg-input:#d8e4f4;
  --border:#c0d0e8; --border-soft:#d8e4f4; --border-strong:#a8c0dc;
  --text-primary:#080c18; --text-secondary:#1c2a40; --text-muted:#5878a8; --text-faint:#b8cce0;
  --gold:#2060e8; --gold-light:#3878ff; --gold-dark:#1040c0; --gold-bg:#e8f0ff;
  --green:#18903a; --green-bg:#eaffee; --green-border:#c8f0d4;
  --red:#c82020; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2060e8; --blue-bg:#e8f0ff; --blue-border:#c8d8f8;
  --amber:#cc7800; --amber-bg:#fff8e8;
  --sidebar-bg:#18283e;
}

/* Perle Chaude */
.theme-pearl {
  --bg-base:#f8f4ee; --bg-card:#fdfaf6; --bg-elevated:#f0ece4; --bg-input:#e8e2d8;
  --border:#d0c8b8; --border-soft:#e0d8c8; --border-strong:#b8a890;
  --text-primary:#180e04; --text-secondary:#382818; --text-muted:#806040; --text-faint:#c8b498;
  --gold:#a06010; --gold-light:#c08030; --gold-dark:#804800; --gold-bg:#fff4e0;
  --green:#1a8840; --green-bg:#f0fff4; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2458c8; --blue-bg:#eef4ff; --blue-border:#c8d8f8;
  --amber:#a06010; --amber-bg:#fff4e0;
  --sidebar-bg:#1a1008;
}

/* Cloud Blanc */
.theme-cloud {
  --bg-base:#edf2fb; --bg-card:#f5f8ff; --bg-elevated:#dfe8f8; --bg-input:#d0ddf4;
  --border:#b8ccec; --border-soft:#d0ddf4; --border-strong:#98b8e0;
  --text-primary:#040a18; --text-secondary:#182030; --text-muted:#4868a0; --text-faint:#b0c8e8;
  --gold:#0c80e8; --gold-light:#2098ff; --gold-dark:#0060c0; --gold-bg:#daeeff;
  --green:#188038; --green-bg:#eafff0; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#0c80e8; --blue-bg:#daeeff; --blue-border:#b8daff;
  --amber:#c07000; --amber-bg:#fff8e8;
  --sidebar-bg:#0e2040;
}

/* Papier Épuré */
.theme-paper {
  --bg-base:#f8f6f0; --bg-card:#fdfcf8; --bg-elevated:#eeeae0; --bg-input:#e4e0d4;
  --border:#ccc8b8; --border-soft:#dedad0; --border-strong:#b0a898;
  --text-primary:#180e04; --text-secondary:#382818; --text-muted:#786050; --text-faint:#c8b8a0;
  --gold:#201808; --gold-light:#402c18; --gold-dark:#100c04; --gold-bg:#eeeae0;
  --green:#1a8040; --green-bg:#f0fff4; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2058c8; --blue-bg:#eef4ff; --blue-border:#c8d8f8;
  --amber:#c06800; --amber-bg:#fff4e8;
  --sidebar-bg:#180e04;
}

/* Ivoire Doré */
.theme-ivory {
  --bg-base:#fdf8f0; --bg-card:#fffef8; --bg-elevated:#f4ede0; --bg-input:#ece4d0;
  --border:#d4c8a8; --border-soft:#e4dcc8; --border-strong:#bca890;
  --text-primary:#1a1000; --text-secondary:#382200; --text-muted:#806030; --text-faint:#c8a870;
  --gold:#c84800; --gold-light:#e86020; --gold-dark:#a03800; --gold-bg:#fff4e8;
  --green:#1a8040; --green-bg:#f0fff4; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2058c8; --blue-bg:#eef4ff; --blue-border:#c8d8f8;
  --amber:#c84800; --amber-bg:#fff4e8;
  --sidebar-bg:#1a1000;
}

/* Arctique Clair */
.theme-arctic {
  --bg-base:#eef6fc; --bg-card:#f6fbff; --bg-elevated:#ddeef8; --bg-input:#cce4f4;
  --border:#a8d0ec; --border-soft:#cce4f4; --border-strong:#80b8e4;
  --text-primary:#041420; --text-secondary:#082030; --text-muted:#285880; --text-faint:#98c8e8;
  --gold:#0870c0; --gold-light:#1090e0; --gold-dark:#0650a0; --gold-bg:#dcf0ff;
  --green:#18803a; --green-bg:#eafff2; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#0870c0; --blue-bg:#dcf0ff; --blue-border:#b8dcff;
  --amber:#b87000; --amber-bg:#fff8e8;
  --sidebar-bg:#042030;
}

/* Rose Quartz */
.theme-rose-quartz {
  --bg-base:#fdf0f6; --bg-card:#fff8fb; --bg-elevated:#f8e0ee; --bg-input:#f0ccdf;
  --border:#e0a8c8; --border-soft:#f0ccdf; --border-strong:#cc80a8;
  --text-primary:#200818; --text-secondary:#401028; --text-muted:#8c3858; --text-faint:#e8b0c8;
  --gold:#d81848; --gold-light:#f03060; --gold-dark:#b81038; --gold-bg:#ffe0ec;
  --green:#1a8040; --green-bg:#f0fff4; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2058c8; --blue-bg:#eef4ff; --blue-border:#c8d8f8;
  --amber:#b86000; --amber-bg:#fff4e8;
  --sidebar-bg:#200818;
}

/* Sauge Naturelle */
.theme-sage {
  --bg-base:#eff5ef; --bg-card:#f8fbf8; --bg-elevated:#dff0df; --bg-input:#cce5cc;
  --border:#a8d0a8; --border-soft:#cce5cc; --border-strong:#80b880;
  --text-primary:#081008; --text-secondary:#182018; --text-muted:#3a683a; --text-faint:#a0c8a0;
  --gold:#1a7a1a; --gold-light:#2a9a2a; --gold-dark:#105a10; --gold-bg:#d8f8d8;
  --green:#1a7a1a; --green-bg:#d8f8d8; --green-border:#b8f0b8;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2058c8; --blue-bg:#eef4ff; --blue-border:#c8d8f8;
  --amber:#aa6000; --amber-bg:#fff4e8;
  --sidebar-bg:#0a180a;
}

/* Sakura Printemps */
.theme-sakura {
  --bg-base:#fdf2f8; --bg-card:#fff8fc; --bg-elevated:#f8e4f4; --bg-input:#f0d0ea;
  --border:#e0a8d8; --border-soft:#f0d0ea; --border-strong:#cc80c0;
  --text-primary:#1e0818; --text-secondary:#401030; --text-muted:#903868; --text-faint:#f0b8d8;
  --gold:#d01890; --gold-light:#e830a8; --gold-dark:#a81070; --gold-bg:#ffe0f4;
  --green:#1a8040; --green-bg:#f0fff4; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2058c8; --blue-bg:#eef4ff; --blue-border:#c8d8f8;
  --amber:#b86000; --amber-bg:#fff4e8;
  --sidebar-bg:#1e0818;
}

/* Brume Lavande */
.theme-lavender-mist {
  --bg-base:#f4f0fc; --bg-card:#fbf8ff; --bg-elevated:#ece4f8; --bg-input:#e0d4f4;
  --border:#c8b0e8; --border-soft:#e0d4f4; --border-strong:#b090d8;
  --text-primary:#180828; --text-secondary:#301048; --text-muted:#684898; --text-faint:#d0b8f0;
  --gold:#7030e8; --gold-light:#8848ff; --gold-dark:#5818c8; --gold-bg:#ede4ff;
  --green:#1a8040; --green-bg:#f0fff4; --green-border:#c8f0d4;
  --red:#c02828; --red-bg:#fff0f0; --red-border:#f8d0d0;
  --blue:#2058c8; --blue-bg:#eef4ff; --blue-border:#c8d8f8;
  --amber:#aa6000; --amber-bg:#fff4e8;
  --sidebar-bg:#180828;
}

/* ================================================================
   CATÉGORIE 4 : FUSION & NATURE
================================================================ */

/* Coucher de Soleil */
.theme-sunset {
  --bg-base:#120608; --bg-card:#1c0a0e; --bg-elevated:#261018; --bg-input:#301620;
  --border:#501828; --border-soft:#301620; --border-strong:#602030;
  --text-primary:#fff0e8; --text-secondary:#f0a880; --text-muted:#904040; --text-faint:#481818;
  --gold:#ff5830; --gold-light:#ff7850; --gold-dark:#e03810; --gold-bg:#200808;
  --green:#40e880; --green-bg:#052010; --green-border:#0a3018;
  --red:#ff9090; --red-bg:#200808; --red-border:#381010;
  --blue:#80d0f8; --blue-bg:#041018; --blue-border:#0f2030;
  --amber:#ff9030; --amber-bg:#1a0800;
  --sidebar-bg:#0c0306;
}

/* Aurores Boréales */
.theme-northern-lights {
  --bg-base:#020e0c; --bg-card:#041614; --bg-elevated:#06201e; --bg-input:#082a28;
  --border:#103e3a; --border-soft:#082a28; --border-strong:#184e4a;
  --text-primary:#e8fff8; --text-secondary:#70e8c8; --text-muted:#208858; --text-faint:#0a3830;
  --gold:#00f0a0; --gold-light:#30ffb8; --gold-dark:#00c888; --gold-bg:#041c18;
  --green:#00f0a0; --green-bg:#042818; --green-border:#083c28;
  --red:#ff7080; --red-bg:#1e0808; --red-border:#381010;
  --blue:#40d8f8; --blue-bg:#041420; --blue-border:#0f2438;
  --amber:#ffd860; --amber-bg:#181400;
  --sidebar-bg:#01080a;
}

/* Volcan Rouge */
.theme-volcano {
  --bg-base:#120400; --bg-card:#1c0800; --bg-elevated:#260e00; --bg-input:#301400;
  --border:#4e2000; --border-soft:#301400; --border-strong:#623000;
  --text-primary:#fff8e8; --text-secondary:#f8c080; --text-muted:#905030; --text-faint:#482008;
  --gold:#ff3800; --gold-light:#ff5820; --gold-dark:#d82000; --gold-bg:#1e0800;
  --green:#40e880; --green-bg:#052008; --green-border:#0a3010;
  --red:#ff9090; --red-bg:#200808; --red-border:#381010;
  --blue:#80d0f8; --blue-bg:#041018; --blue-border:#0f2038;
  --amber:#ff8030; --amber-bg:#1a1000;
  --sidebar-bg:#0c0300;
}

/* Abysses Marines */
.theme-deep-sea {
  --bg-base:#01060e; --bg-card:#020c18; --bg-elevated:#041220; --bg-input:#06182a;
  --border:#0c2840; --border-soft:#06182a; --border-strong:#103450;
  --text-primary:#e0f8ff; --text-secondary:#50c8e8; --text-muted:#185870; --text-faint:#082838;
  --gold:#00d0f8; --gold-light:#20e8ff; --gold-dark:#00a8d0; --gold-bg:#031830;
  --green:#30f090; --green-bg:#041810; --green-border:#082818;
  --red:#ff7080; --red-bg:#1e0808; --red-border:#381010;
  --blue:#00d0f8; --blue-bg:#031830; --blue-border:#063048;
  --amber:#ffd860; --amber-bg:#181200;
  --sidebar-bg:#010508;
}

/* Magma Ardent */
.theme-magma {
  --bg-base:#0e0300; --bg-card:#180600; --bg-elevated:#220a00; --bg-input:#2c0e00;
  --border:#481800; --border-soft:#2c0e00; --border-strong:#5c2000;
  --text-primary:#fff8f0; --text-secondary:#f8d090; --text-muted:#985030; --text-faint:#502010;
  --gold:#ff6820; --gold-light:#ff8840; --gold-dark:#e04800; --gold-bg:#200800;
  --green:#40e880; --green-bg:#052008; --green-border:#0a3010;
  --red:#ff9090; --red-bg:#200808; --red-border:#381010;
  --blue:#80d0f8; --blue-bg:#041018; --blue-border:#0f2038;
  --amber:#ff9030; --amber-bg:#1a1000;
  --sidebar-bg:#080200;
}

/* Floraison Rose */
.theme-blossom {
  --bg-base:#100408; --bg-card:#180812; --bg-elevated:#20101e; --bg-input:#28162a;
  --border:#442048; --border-soft:#28162a; --border-strong:#542858;
  --text-primary:#fff0ff; --text-secondary:#f090d8; --text-muted:#985880; --text-faint:#4a2048;
  --gold:#f840c8; --gold-light:#ff60e0; --gold-dark:#d820a8; --gold-bg:#1e0828;
  --green:#40e890; --green-bg:#042010; --green-border:#083018;
  --red:#ff9090; --red-bg:#200808; --red-border:#381010;
  --blue:#c090f8; --blue-bg:#100e28; --blue-border:#1a1840;
  --amber:#ffd860; --amber-bg:#181200;
  --sidebar-bg:#0a0206;
}

/* Forêt Profonde */
.theme-forest {
  --bg-base:#040c04; --bg-card:#081408; --bg-elevated:#0e1c0e; --bg-input:#142614;
  --border:#203820; --border-soft:#142614; --border-strong:#2a4a2a;
  --text-primary:#eafaea; --text-secondary:#80d080; --text-muted:#2c6830; --text-faint:#143014;
  --gold:#4ae060; --gold-light:#70f880; --gold-dark:#28c040; --gold-bg:#081808;
  --green:#4ae060; --green-bg:#082010; --green-border:#103018;
  --red:#f87070; --red-bg:#1e0808; --red-border:#381010;
  --blue:#40d0f8; --blue-bg:#061420; --blue-border:#0f2438;
  --amber:#f8c040; --amber-bg:#181000;
  --sidebar-bg:#020802;
}

/* Tropique */
.theme-tropique {
  --bg-base:#021212; --bg-card:#041a1a; --bg-elevated:#082222; --bg-input:#0c2c2c;
  --border:#104040; --border-soft:#0c2c2c; --border-strong:#185050;
  --text-primary:#eafff8; --text-secondary:#50e8c8; --text-muted:#1a6a4c; --text-faint:#083838;
  --gold:#00c8a0; --gold-light:#20e8b8; --gold-dark:#00a880; --gold-bg:#041e18;
  --green:#40f890; --green-bg:#052010; --green-border:#0a3018;
  --red:#ff7080; --red-bg:#1e0808; --red-border:#381010;
  --blue:#00c8e8; --blue-bg:#051820; --blue-border:#0f2838;
  --amber:#f8d060; --amber-bg:#181200;
  --sidebar-bg:#01080a;
}

/* Royal Or */
.theme-royal {
  --bg-base:#080010; --bg-card:#0e0020; --bg-elevated:#140030; --bg-input:#1a0040;
  --border:#2a0060; --border-soft:#1a0040; --border-strong:#380080;
  --text-primary:#f8f0ff; --text-secondary:#c8a8f8; --text-muted:#605080; --text-faint:#301848;
  --gold:#ffd700; --gold-light:#ffe840; --gold-dark:#ccaa00; --gold-bg:#1c1200;
  --green:#40e880; --green-bg:#041810; --green-border:#082c18;
  --red:#ff7080; --red-bg:#1e0808; --red-border:#381010;
  --blue:#9080ff; --blue-bg:#0c0e30; --blue-border:#161848;
  --amber:#ffd700; --amber-bg:#1a1200;
  --sidebar-bg:#060010;
}

/* Cuivre Brûlé */
.theme-copper {
  --bg-base:#0e0800; --bg-card:#180e00; --bg-elevated:#221400; --bg-input:#2c1a00;
  --border:#482e00; --border-soft:#2c1a00; --border-strong:#5c3a00;
  --text-primary:#fff8f0; --text-secondary:#f8d0a0; --text-muted:#9a6030; --text-faint:#502c08;
  --gold:#d85000; --gold-light:#f06820; --gold-dark:#b04000; --gold-bg:#200a00;
  --green:#40e880; --green-bg:#051808; --green-border:#0a2c10;
  --red:#ff9090; --red-bg:#200808; --red-border:#381010;
  --blue:#80d0f8; --blue-bg:#041018; --blue-border:#0f2038;
  --amber:#d85000; --amber-bg:#1a0800;
  --sidebar-bg:#080400;
}

/* Cyberpunk 2077 */
.theme-cyberpunk {
  --bg-base:#040010; --bg-card:#080018; --bg-elevated:#0e0020; --bg-input:#140028;
  --border:#1e0040; --border-soft:#140028; --border-strong:#260050;
  --text-primary:#f0f8ff; --text-secondary:#c0d8ff; --text-muted:#5868a8; --text-faint:#1e2448;
  --gold:#ff0844; --gold-light:#ff3870; --gold-dark:#d00030; --gold-bg:#1e0010;
  --green:#08ff88; --green-bg:#001a0c; --green-border:#003018;
  --red:#ff4060; --red-bg:#1e0408; --red-border:#380810;
  --blue:#00e8ff; --blue-bg:#001828; --blue-border:#003040;
  --amber:#ffee00; --amber-bg:#1a1a00;
  --sidebar-bg:#030008;
}

/* Automne Doré */
.theme-autumn {
  --bg-base:#100a00; --bg-card:#1a1000; --bg-elevated:#241600; --bg-input:#2e1c00;
  --border:#4c3000; --border-soft:#2e1c00; --border-strong:#603c00;
  --text-primary:#fff8e0; --text-secondary:#f0d888; --text-muted:#987040; --text-faint:#502c00;
  --gold:#e09020; --gold-light:#f8b040; --gold-dark:#c07000; --gold-bg:#1e1200;
  --green:#50d880; --green-bg:#051808; --green-border:#0a2c10;
  --red:#f88060; --red-bg:#200808; --red-border:#381010;
  --blue:#80c8f8; --blue-bg:#041018; --blue-border:#0f2030;
  --amber:#e09020; --amber-bg:#1a1000;
  --sidebar-bg:#0a0500;
}

/* ================================================================
   UI DU SÉLECTEUR DE THÈMES
================================================================ */
.theme-picker-section { margin-bottom: 4px; }

.theme-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.theme-card {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  background: var(--bg-elevated);
  user-select: none;
}
.theme-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.theme-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent);
}
.theme-card.active .theme-card-name::after {
  content: ' ✓';
  opacity: 0.7;
}

.theme-card-preview {
  height: 40px;
  display: flex;
  overflow: hidden;
}
.theme-card-preview span {
  flex: 1;
  display: block;
}

.theme-card-info {
  padding: 7px 9px 8px;
}
.theme-card-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Search bar for themes */
.theme-search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.theme-search-wrap input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.theme-search-wrap input:focus { border-color: var(--gold); }
.theme-search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.5;
}

