*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Thème clair (défaut) ── */
:root, [data-theme="light"] {
  --sidebar-bg: #012169;
  --sidebar-border: rgba(255,255,255,0.08);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #e2e8f0;
  --sidebar-active-bg: rgba(99,102,241,0.15);
  --sidebar-active-text: #818cf8;
  --sidebar-active-bar: #6366f1;

  --content-bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --danger: #f87171;
  --radius: 8px;
}

/* ── Thème sombre ── */
[data-theme="dark"] {
  --sidebar-bg: #012169;
  --sidebar-border: rgba(255,255,255,0.06);
  --sidebar-text: #64748b;
  --sidebar-text-hover: #cbd5e1;
  --sidebar-active-bg: rgba(99,102,241,0.2);
  --sidebar-active-text: #a5b4fc;
  --sidebar-active-bar: #6366f1;

  --content-bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #263347;
  --border: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #475569;

  --brand: #6366f1;
  --brand-hover: #818cf8;
  --danger: #f87171;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--content-bg);
  transition: background 0.2s, color 0.2s;
}

/* ── App shell ── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 78px;
  /* left = 11px pour que le logo soit à la même position qu'en mode réduit, où il
     est centré dans le rail de 64px ((64-42)/2 = 11px) → pas de saut du logo. */
  padding: 0 20px 0 11px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  /* Évite la barre horizontale transitoire pendant l'animation d'ouverture
     (overflow-y:auto force sinon overflow-x à auto). Inutile à 100 % : les
     libellés tiennent sans dépassement. */
  overflow-x: hidden;
}

.sidebar-bottom {
  padding: 8px;
  border-top: 1px solid var(--sidebar-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  /* padding horizontal 15px : centre l'icône sur l'axe x=32 (comme le logo et
     l'avatar), identique en mode agrandi et réduit → l'icône ne se décale plus. */
  padding: 9px 15px;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-hover);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--sidebar-active-bar);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Hauteur de ligne bornée : le libellé ne dépasse pas la hauteur de l'icône,
   donc l'item (et le fond "active") a la même hauteur en réduit et en agrandi. */
.nav-label {
  line-height: 1.2;
  white-space: nowrap;
}

.nav-badge-beta {
  margin-left: auto;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.25);
  flex-shrink: 0;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

/* ── User footer ── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  /* left réduit (12→8) pour aligner l'avatar agrandi sur sa position en mode réduit
     (centré dans le rail). Le mode réduit surcharge ce padding à 0. */
  padding: 5px 12px 5px 8px;
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  border-radius: 6px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
}

.sidebar-user-link:hover {
  background: rgba(255,255,255,0.06);
}

.sidebar-user-link.active {
  background: var(--sidebar-active-bg);
}

.sidebar-user-link.active .user-name {
  color: var(--sidebar-active-text);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2; /* nom + email tiennent dans la hauteur de l'avatar (32px) */
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  font-size: 0.75rem;
  line-height: 1.2; /* idem : évite que le bloc bas grandisse et fasse remonter la séparation */
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  display: flex;
  align-items: center;
  color: #475569;
  transition: color 0.15s;
  flex-shrink: 0;
}

.logout-btn:hover { color: var(--danger); }
.logout-btn svg { width: 16px; height: 16px; }

/* ── Bouton d'épinglage + mode survol de la sidebar ── */
.sidebar-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: var(--sidebar-text-hover);
}
.sidebar-toggle svg { width: 16px; height: 16px; }

/* Mode "survol" : rail réduit qui se déploie au survol, en overlay (le contenu
   ne se décale pas ; on réserve juste la largeur du rail via une marge). */
[data-sidebar="hover"] .sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 64px;
  z-index: 50;
  overflow-x: hidden;
  white-space: nowrap;
  transition: width 0.18s ease;
}
[data-sidebar="hover"] .sidebar:hover {
  width: 240px;
  box-shadow: 4px 0 24px rgba(0,0,0,0.28);
}
[data-sidebar="hover"] .main-content { margin-left: 64px; }

/* Rail réduit (hors survol) : icônes/avatar uniquement, centrés. */
[data-sidebar="hover"] .sidebar:not(:hover) .brand-name,
[data-sidebar="hover"] .sidebar:not(:hover) .sidebar-toggle,
[data-sidebar="hover"] .sidebar:not(:hover) .nav-label,
[data-sidebar="hover"] .sidebar:not(:hover) .nav-badge-beta,
[data-sidebar="hover"] .sidebar:not(:hover) .user-info,
[data-sidebar="hover"] .sidebar:not(:hover) .logout-btn {
  display: none;
}
/* Logo et icônes nav gardent leur positionnement par padding (11px / 15px) → même
   position qu'en agrandi, sans centrage flex qui divergeait au sous-pixel. */
[data-sidebar="hover"] .sidebar:not(:hover) .sidebar-user {
  padding: 5px 8px;
}

/* Juste après la bascule en mode survol : on maintient l'état réduit tant que le
   pointeur n'a pas quitté la sidebar (sinon elle resterait déployée sous le curseur). */
[data-sidebar="hover"] .sidebar.force-collapsed:hover {
  width: 64px;
  box-shadow: none;
}
[data-sidebar="hover"] .sidebar.force-collapsed:hover .brand-name,
[data-sidebar="hover"] .sidebar.force-collapsed:hover .sidebar-toggle,
[data-sidebar="hover"] .sidebar.force-collapsed:hover .nav-label,
[data-sidebar="hover"] .sidebar.force-collapsed:hover .nav-badge-beta,
[data-sidebar="hover"] .sidebar.force-collapsed:hover .user-info,
[data-sidebar="hover"] .sidebar.force-collapsed:hover .logout-btn {
  display: none;
}
[data-sidebar="hover"] .sidebar.force-collapsed:hover .sidebar-user {
  padding: 5px 8px;
}

/* Rail réduit : l'avatar (lien compte) rétrécit à sa taille et se centre dans le
   rail, aligné sur les icônes de nav (au lieu de rester collé à gauche). */
[data-sidebar="hover"] .sidebar:not(:hover) .sidebar-user-link,
[data-sidebar="hover"] .sidebar.force-collapsed:hover .sidebar-user-link {
  flex: 0 1 auto;
  gap: 0;
  padding: 0;
  margin: 0;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--content-bg);
  /* Pas d'animation de margin-left : elle ne change qu'au changement de mode
     (0 ↔ 64px) et l'animer provoque un à-coup du contenu au ré-épinglage. */
  transition: background 0.2s;
}

.page-header {
  display: flex;
  align-items: center;
  height: 78px;
  padding: 0 40px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 40px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-faint);
}

/* ── Planning ── */
.planning-body {
  padding: 0 40px 40px;
}

.planning-filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.filter-group input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
}

.filter-group input:focus {
  outline: none;
  border-color: var(--brand);
}

.search-input { min-width: 260px; }

/* Zone de résultats rechargée en AJAX : légère atténuation pendant le fetch. */
#planning-results.is-loading {
  opacity: 0.5;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

/* ── Grille de planning (collaborateurs × dates) ── */
/* Largeurs de colonnes fixes : le contenu ne fait pas grossir les cases,
   les summaries trop longs sont tronqués (ellipsis). table-layout:fixed n'agit
   que si une largeur explicite est donnée au tableau → on la calcule à partir
   du nombre de colonnes (--cols, fourni par le template). */
.planning-grid {
  border-collapse: collapse;
  font-size: 0.8125rem;
  table-layout: fixed;
  width: calc(180px + var(--cols, 0) * 76px);
}

.planning-grid .corner { width: 180px; }
.planning-grid .date-col { width: 76px; }
.planning-grid .row-head { overflow: hidden; text-overflow: ellipsis; }

/* Popup au survol d'un plan */
.plan-pop {
  position: fixed;
  z-index: 1000;
  display: none;
  max-width: 340px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.8125rem;
  line-height: 1.4;
  pointer-events: none;
}
.plan-pop.open { display: block; }
.plan-pop-key {
  font-weight: 600;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.plan-pop-summary { font-weight: 500; }
.plan-pop-desc {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  white-space: pre-wrap;
}

.planning-grid th,
.planning-grid td {
  border: 1px solid var(--border);
}

.planning-grid thead th {
  background: var(--surface-hover);
  padding: 5px 6px;
  text-align: center;
  white-space: nowrap;
  color: var(--text-muted);
}

.planning-grid .corner,
.planning-grid .row-head {
  position: sticky;
  left: 0;
  z-index: 4; /* au-dessus des briques lors du scroll horizontal */
  text-align: left;
  white-space: nowrap;
  padding: 6px 12px;
  background: var(--surface);
}

.planning-grid .corner { z-index: 5; background: var(--surface-hover); }

.date-col .dow {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.date-col .dnum {
  display: block;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.row-head { font-weight: 500; color: var(--text); }

.grid-cell {
  padding: 0;
  height: 34px;
}

/* Pas de séparateur horizontal entre les sous-lignes d'un même collaborateur :
   on retire les bordures haut/bas des cases, et on ne remet la ligne qu'en bas
   de la dernière sous-ligne (= séparation entre collaborateurs). */
.planning-grid .grid-cell {
  border-top: 0;
  border-bottom: 0;
}
.planning-grid tbody.collab tr:last-child .grid-cell {
  border-bottom: 1px solid var(--border);
}

/* La case de début d'un plan ancre la brique (overlay) et passe au-dessus des
   cases suivantes qu'elle recouvre. */
.grid-cell.brick-start {
  position: relative;
  z-index: 2;
}

/* Colonne du jour courant : légère surbrillance (en-tête + cases). */
.planning-grid .today {
  background-color: color-mix(in srgb, #ff858d 22%, transparent);
}
.planning-grid thead th.today {
  background-color: color-mix(in srgb, #ff858d 38%, var(--surface-hover));
}

/* Jours chômés (week-ends + fériés) : fond rayé, en-tête et cases vides.
   background-attachment: fixed → le motif est ancré au viewport (repère global),
   donc les bandes se prolongent d'une case rayée à l'autre (horizontalement ET
   verticalement) au lieu de repartir à zéro dans chaque case. */
.planning-grid .off {
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0,
    transparent 6px,
    color-mix(in srgb, var(--text-faint) 20%, transparent) 6px,
    color-mix(in srgb, var(--text-faint) 20%, transparent) 12px
  );
  background-attachment: fixed;
}

/* Une brique = une allocation, posée en OVERLAY (position absolue) par-dessus
   les cases jour ancrées derrière (leurs bordures + rayures restent visibles).
   Elle s'étend sur --span jours ; le remplissage vertical translucide (bas →
   haut) reflète la charge : 8h = pleine hauteur, 4h = à moitié. */
.alloc {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc(var(--span, 1) * 76px - 4px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 8px;
  border: 1px solid var(--brand);
  border-radius: 4px;
  /* Brique OPAQUE (pas de transparence) : partie basse teintée = charge,
     partie haute = fond uni ; hauteur du remplissage = heures / 8h. */
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--brand) 22%, var(--surface)) var(--fill, 100%),
    var(--surface) var(--fill, 100%)
  );
  white-space: nowrap;
  overflow: hidden;
}

.alloc-key {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.alloc-key:hover { text-decoration: underline; }

.alloc-h {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Box d'affichage de la période : début à gauche, flèche centrée, fin à droite. */
.range-display {
  display: flex;
  align-items: center;
  width: 240px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
}

.range-display:hover,
.range-display:focus {
  outline: none;
  border-color: var(--brand);
}

.range-display .range-start { flex: 1; text-align: left; }
.range-display .range-end   { flex: 1; text-align: right; }
.range-display .range-arrow {
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 600;
  color: var(--brand);
}

.planning-filters .btn-primary { margin-top: 0; }

/* ── Date-range picker ── */
.dp-wrap { position: relative; display: inline-block; }

.dp-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  display: none;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.dp-popup.open { display: block; }

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dp-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.dp-nav {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}
.dp-nav:hover { background: var(--surface-hover); color: var(--text); }

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 32px);
  gap: 2px;
}

.dp-dow span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-faint);
  padding: 4px 0;
}

.dp-day {
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.8125rem;
  border-radius: 6px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: var(--surface-hover); }
.dp-muted { color: var(--text-faint); }
.dp-today { box-shadow: inset 0 0 0 1px var(--brand); }
.dp-in-range { background: var(--sidebar-active-bg); border-radius: 0; }
.dp-start, .dp-end { background: var(--brand); color: #fff; }
.dp-start { border-radius: 6px 0 0 6px; }
.dp-end { border-radius: 0 6px 6px 0; }
.dp-start.dp-end { border-radius: 6px; }

/* Disposition du popup : calendrier à gauche, choix rapides à droite. */
.dp-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Choix rapides à droite du calendrier */
.dp-presets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  align-self: stretch;
}

.dp-preset {
  text-align: left;
  white-space: nowrap;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.8125rem;
  border-radius: 6px;
  cursor: pointer;
}

.dp-preset:hover {
  background: var(--sidebar-active-bg);
  color: var(--brand);
}

.notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  background: var(--surface-hover);
  padding: 1px 5px;
  border-radius: 4px;
}

.notice-warn { border-left: 3px solid #f59e0b; }
.notice-error { border-left: 3px solid var(--danger); }

.table-wrap {
  /* S'adapte à la largeur de la grille : le cadre épouse le tableau plutôt que
     de s'étirer sur toute la largeur, et scrolle horizontalement si la période
     dépasse l'espace disponible. */
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-hover);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-hover); }

.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .muted { color: var(--text-muted); white-space: normal; }

.data-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--brand);
}

.data-table .tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-hover);
  color: var(--text-muted);
}

.group-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.group-list li {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-hover);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Settings ── */
.settings-body {
  padding: 0 40px 40px;
  max-width: 680px;
}

.settings-section {
  margin-bottom: 40px;
}

.settings-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.settings-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Theme picker */
.theme-picker {
  display: flex;
  gap: 16px;
}

.theme-card {
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid var(--border);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 140px;
  flex-shrink: 0;
}

.theme-card:hover {
  border-color: var(--brand);
}

.theme-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.theme-preview {
  display: flex;
  height: 88px;
  gap: 0;
}

.theme-preview--light { background: #f8fafc; }
.theme-preview--dark  { background: #0f172a; }

.tp-sidebar {
  width: 36px;
  height: 100%;
  flex-shrink: 0;
}

.theme-preview--light .tp-sidebar { background: #0f172a; }
.theme-preview--dark  .tp-sidebar { background: #0a0f1e; }

.tp-content {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp-bar {
  height: 8px;
  border-radius: 4px;
}

.tp-bar--short { width: 60%; }

.theme-preview--light .tp-bar { background: #e2e8f0; }
.theme-preview--dark  .tp-bar { background: #1e293b; }

.theme-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.theme-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.theme-card.active .theme-radio {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 2px var(--surface);
}

/* Account info */
.account-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 16px;
}

.info-row + .info-row {
  border-top: 1px solid var(--border);
}

.info-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.info-value {
  font-size: 0.875rem;
  color: var(--text);
}

/* ── Login page ── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0f1e 0%, #1e293b 100%);
}

.login-container {
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px 40px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.login-brand { text-align: center; }

.login-logo {
  display: block;
  width: 280px;
  height: auto; /* suit le ratio de l'image (large) → pas de bandes vides */
  margin: 0 auto 4px;
}

.login-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.login-subtitle {
  color: #64748b;
  font-size: 0.875rem;
  margin-top: 24px;
  margin-bottom: 14px;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}

.form-group input::placeholder { color: #9ca3af; }

.form-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-primary { background: var(--brand); color: #fff; margin-top: 8px; }
.btn-primary:hover { background: var(--brand-hover); }

.btn-microsoft { background: #0078d4; color: #fff; }
.btn-microsoft:hover { opacity: 0.9; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #9ca3af;
  font-size: 0.8125rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
