/* ── Thème sombre (défaut) ── */
:root {
  --bg:     #07090f;
  --bg2:    #0f1420;
  --bg3:    #1a2235;
  --border: #1e2a3a;
  --text:   #e2e8f0;
  --muted:  #9ca3af;
  --muted2: #6b7280;
  --cyan:   #a7def4;
  --purple: #ebb5f7;
  --green:  #10b981;
  --amber:  #f59e0b;
  --red:    #ef4444;
  --grad:   linear-gradient(135deg,#a7def4,#ebb5f7);
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --card-hover: rgba(255,255,255,.02);
}

/* ── Thème clair ── */
.theme-light {
  --bg:     #f0f4f8;
  --bg2:    #ffffff;
  --bg3:    #e8edf4;
  --border: #cbd5e1;
  --text:   #0f172a;
  --muted:  #475569;
  --muted2: #64748b;
  --cyan:   #0891b2;
  --purple: #7c3aed;
  --green:  #059669;
  --amber:  #d97706;
  --red:    #dc2626;
  --grad:   linear-gradient(135deg,#0891b2,#7c3aed);
  --shadow: 0 4px 24px rgba(0,0,0,.1);
  --card-hover: rgba(0,0,0,.02);
}

/* ── Toggle bouton ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: .35rem .65rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all .2s;
  line-height: 1;
}
.theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ── Inputs & selects adaptatifs ── */
.theme-light input,
.theme-light select,
.theme-light textarea {
  background: var(--bg3) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.theme-light table {
  background: var(--bg2);
}

.theme-light th {
  background: var(--bg3) !important;
  color: var(--muted) !important;
}

.theme-light td {
  border-color: var(--border) !important;
}

.theme-light .section,
.theme-light .card,
.theme-light .stat,
.theme-light .eleve-card,
.theme-light .tool-card,
.theme-light .tarif-card {
  background: var(--bg2) !important;
  border-color: var(--border) !important;
}

.theme-light .section-header,
.theme-light .page-header {
  border-color: var(--border) !important;
}

/* ── Contrastes thème clair ── */
.theme-light .nav-badge {
  background: rgba(8,145,178,.15) !important;
  border-color: rgba(8,145,178,.4) !important;
  color: #0369a1 !important;
}

.theme-light .nav-links a {
  color: #334155 !important;
}

.theme-light .nav-links a:hover,
.theme-light .nav-links a.active {
  color: var(--cyan) !important;
  background: rgba(8,145,178,.08) !important;
}

/* Titres de section trop pâles */
.theme-light h1,
.theme-light h2,
.theme-light h3,
.theme-light .section-title,
.theme-light .page-title {
  color: #0f172a !important;
}

/* Labels et sous-titres */
.theme-light label,
.theme-light th {
  color: #475569 !important;
}

/* Texte muted plus foncé en clair */
.theme-light .nav-user {
  color: #475569 !important;
}

/* ── Vitrine nav thème clair ── */
body.theme-light nav {
  background: rgba(255,255,255,.95) !important;
  border-bottom-color: var(--border) !important;
}

body.theme-light .nav-links a {
  color: #334155 !important;
}

body.theme-light .nav-links a:hover {
  color: var(--cyan) !important;
}
