/* =========================================================
   Tremplins — Feuille de style de base
   Les couleurs viennent de variables --t-* injectées par Theme.php
   ========================================================= */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--t-font, 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif);
  background: var(--t-bg, #f6f8fb);
  color: var(--t-text, #1e2633);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--t-primary, #0b63d6); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; }
code { background: #eef1f6; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--t-text-muted, #5a6675); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--t-radius, 10px);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  font: inherit;
}
.btn-primary { background: var(--t-primary, #0b63d6); color: #fff; }
.btn-primary:hover { background: var(--t-primary-dark, #0949a0); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--t-text); }
.btn-ghost:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.btn-secondary { background: #eef1f6; color: var(--t-text); }

/* ---- Alerts ---- */
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-error { background: #fde8ec; color: var(--t-danger, #d9364c); border-color: #f5c0ca; }
.alert-success { background: #e2f6ee; color: var(--t-success, #0fae6e); border-color: #b6e5cf; }

/* ---- Topbar (layout app) ---- */
.topbar {
  background: var(--t-surface, #fff);
  border-bottom: 1px solid var(--t-border, #e1e6ee);
  position: sticky; top: 0; z-index: 50;
  height: 60px;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 20px; }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--t-text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { height: 36px; width: auto; object-fit: contain; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--t-primary); color: #fff; font-weight: 700;
}
.topbar-nav { display: flex; align-items: center; gap: 12px; }
.who { color: var(--t-text-muted); font-size: 13px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---- Sidebar toggle (hamburger) ---- */
.sidebar-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--t-text); padding: 6px; border-radius: 8px;
  transition: background .15s;
}
.sidebar-toggle:hover { background: rgba(0,0,0,.05); }
.icon-close { display: none; }
.sidebar-open .icon-menu { display: none; }
.sidebar-open .icon-close { display: block; }

/* ---- App shell (sidebar + main) ---- */
.app-shell {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* ---- Sidebar ---- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--t-surface, #fff);
  border-right: 1px solid var(--t-border, #e1e6ee);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--t-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .13s, color .13s;
}
.sidebar-item:hover { background: #f1f4f9; color: var(--t-primary); text-decoration: none; }
.sidebar-item.active { background: #eef3fb; color: var(--t-primary); font-weight: 600; }
.sidebar-icon { display: flex; align-items: center; flex-shrink: 0; opacity: .75; }
.sidebar-item.active .sidebar-icon,
.sidebar-item:hover .sidebar-icon { opacity: 1; }
.sidebar-label { flex: 1; }
.sidebar-divider { height: 1px; background: var(--t-border, #e1e6ee); margin: 8px 10px; }
.sidebar-group-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--t-text-muted);
  padding: 6px 12px 3px;
  margin-top: 2px;
}

/* ---- Sidebar footer (user info) ---- */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--t-border, #e1e6ee);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--t-primary); color: #fff;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { font-size: 12px; color: var(--t-text-muted); }
.sidebar-logout:hover { color: var(--t-danger, #d9364c); }

/* ---- Main content area ---- */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-content {
  flex: 1;
  padding: 32px 36px 48px;
  width: 100%;
}

/* ---- Sidebar overlay (mobile) ---- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.35);
  opacity: 0; transition: opacity .2s;
}
.sidebar-overlay.visible { opacity: 1; }

/* ---- Page hero (legacy, conservé) ---- */
.page-hero { margin-bottom: 28px; }
.page-hero .eyebrow { font-size: 13px; color: var(--t-text-muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px; }
.page-hero h1 { font-size: 28px; }
.lead { font-size: 16px; color: var(--t-text-muted); }

/* ---- Cards grid (legacy) ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: var(--t-radius, 10px);
  padding: 20px;
  box-shadow: 0 2px 6px rgba(30,38,51,.03);
  transition: transform .12s ease, box-shadow .12s ease;
}
.card h3 { font-size: 17px; }
.card-link { display: block; color: inherit; position: relative; padding-right: 36px; }
.card-link:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(30,38,51,.08); text-decoration: none; border-color: var(--t-primary); }
.card-link .chevron { position: absolute; right: 20px; top: 20px; color: var(--t-primary); font-size: 20px; }
.card-empty { border-style: dashed; background: transparent; box-shadow: none; }

/* ================================================================
   DASHBOARD
   ================================================================ */

/* -- Héros -- */
.dash-hero {
  background: linear-gradient(135deg, var(--t-primary, #0b63d6) 0%, var(--t-primary-dark, #0949a0) 100%);
  border-radius: 14px;
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.dash-hero::before,
.dash-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.dash-hero::before { width: 220px; height: 220px; right: 56px; top: -90px; }
.dash-hero::after  { width: 110px; height: 110px; right: 10px;  bottom: -50px; }
.dash-hero-body { position: relative; z-index: 1; }
.dash-hero-meta {
  font-size: 12px;
  font-weight: 600;
  opacity: .75;
  margin: 0 0 6px;
  text-transform: capitalize;
}
.dash-hero-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.2;
}
.dash-hero-sub {
  font-size: 14px;
  opacity: .8;
  margin: 0;
}
.dash-hero-avatar {
  position: relative; z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.3);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* -- Libellé de section -- */
.dash-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--t-text-muted);
  margin: 0 0 12px;
}

/* -- Grille des widgets -- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

/* -- Widget base -- */
.widget {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: var(--t-radius, 10px);
  padding: 14px 16px 12px;
  text-decoration: none;
  color: var(--t-text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: 0 1px 3px rgba(30,38,51,.04);
  position: relative;
  overflow: hidden;
}
.widget::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--wc, var(--t-primary));
  border-radius: var(--t-radius, 10px) var(--t-radius, 10px) 0 0;
}
.widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30,38,51,.09);
  border-color: var(--wc, var(--t-primary));
  text-decoration: none;
  color: var(--t-text);
}
.widget--wide { grid-column: span 2; }

/* -- En-tête de widget -- */
.widget-head { display: flex; align-items: center; gap: 10px; }
.widget-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--wb, #f0f9ff);
  color: var(--wc, var(--t-primary));
  flex-shrink: 0;
}
.widget-name { font-size: 14px; font-weight: 700; margin: 0; }

/* -- Pied de widget (CTA) -- */
.widget-foot {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  color: var(--wc, var(--t-primary));
  padding-top: 8px;
  border-top: 1px solid var(--t-border, #e1e6ee);
  margin-top: auto;
}

/* -- Type STAT -- */
.widget-stats { display: flex; gap: 6px; }
.wstat {
  flex: 1; display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px;
  background: var(--wb, #f5f3ff);
  border-radius: 7px;
}
.wstat-val { font-size: 18px; font-weight: 800; color: var(--wc, var(--t-primary)); line-height: 1.1; }
.wstat-lbl { font-size: 10px; color: var(--t-text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.wstat-trend { font-size: 10px; font-weight: 700; color: #16a34a; margin-top: 1px; }

/* -- Type FEED -- */
.widget-feed { list-style: none; margin: 0; padding: 0; }
.wfeed-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--t-border, #e1e6ee);
  min-width: 0;
}
.wfeed-item:last-child { border-bottom: none; }
.wfeed-icon { display: inline-flex; align-items: center; color: var(--wc); flex-shrink: 0; opacity: .75; }
.wfeed-label { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfeed-meta { font-size: 11px; color: var(--t-text-muted); white-space: nowrap; flex-shrink: 0; }

/* -- Type EVENT -- */
.widget-events { display: flex; flex-direction: column; gap: 8px; }
.wevent {
  display: flex; align-items: center; gap: 12px;
  background: var(--wb, #f0f9ff);
  border-radius: 8px;
  padding: 10px 12px;
}
.wevent-badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--wc, var(--t-primary)); color: #fff;
  border-radius: 6px; min-width: 38px; padding: 4px;
  flex-shrink: 0;
}
.wevent-day   { font-size: 18px; font-weight: 800; line-height: 1; }
.wevent-month { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.wevent-info  { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wevent-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wevent-sub   { font-size: 11px; color: var(--t-text-muted); }

/* -- Type INFO -- */
.widget-fields { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wfield { display: flex; flex-direction: column; gap: 0; }
.wfield-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--t-text-muted); }
.wfield-value { font-size: 13px; font-weight: 500; }

/* -- Type ACTIONS -- */
.widget-desc { font-size: 12px; color: var(--t-text-muted); margin: 0; line-height: 1.5; }
.widget-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  background: var(--wb, #ecfeff); color: var(--wc, var(--t-primary));
  border: 1px solid rgba(0,0,0,.06);
}

/* -- État vide complet -- */
.dash-empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 56px 24px; text-align: center;
  background: var(--t-surface); border: 1px solid var(--t-border);
  border-radius: 14px; box-shadow: 0 1px 4px rgba(30,38,51,.04);
}
.dash-empty-icon { color: var(--t-text-muted); opacity: .35; margin-bottom: 4px; }
.dash-empty-state h3 { margin: 0; font-size: 17px; }
.dash-empty-state p { margin: 0; font-size: 14px; color: var(--t-text-muted); line-height: 1.6; }

/* ---- Footer ---- */
.footer { padding: 20px 36px; border-top: 1px solid var(--t-border); color: var(--t-text-muted); font-size: 13px; }

/* ---- Auth layout ---- */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10000;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--t-primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.skip-link:focus:hover { color: #fff; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px;
  position: relative;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, color-mix(in srgb, var(--t-primary) 12%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, var(--t-bg) 0%, color-mix(in srgb, var(--t-bg) 70%, #e8ecf4) 100%);
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-main { outline: none; }
.auth-main:focus-visible {
  outline: 2px solid var(--t-primary);
  outline-offset: 4px;
  border-radius: 4px;
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand img { height: 56px; width: auto; max-width: 220px; object-fit: contain; margin-bottom: 12px; display: inline-block; }
.auth-brand__name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--t-text);
}
.auth-brand__tagline { margin: 8px 0 0; font-size: 14px; line-height: 1.45; max-width: 320px; margin-left: auto; margin-right: auto; }
.brand-mark-lg {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 14px;
  background: linear-gradient(145deg, var(--t-primary) 0%, var(--t-primary-dark) 100%);
  color: #fff; font-size: 24px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--t-primary) 35%, transparent);
}
.auth-card {
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border);
  border-radius: 16px;
  padding: 0;
  box-shadow:
    0 1px 2px rgba(30,38,51,.04),
    0 16px 40px rgba(30,38,51,.08);
  overflow: hidden;
}
.auth-card__head {
  padding: 26px 28px 0;
}
.auth-card__title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--t-text);
}
.auth-card__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.auth-card > .alert { margin: 16px 28px 0; }
.auth-card > .alert:first-of-type { margin-top: 20px; }
.form--auth { padding: 20px 28px 26px; }
.form--auth label:first-of-type { margin-top: 0; }
.auth-card__foot {
  padding: 16px 28px 22px;
  border-top: 1px solid var(--t-border);
  background: color-mix(in srgb, var(--t-bg) 45%, var(--t-surface));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  text-align: center;
}
.auth-card__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--t-primary);
  text-decoration: none;
}
.auth-card__link:hover { text-decoration: underline; }
.auth-card__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.auth-password-wrap {
  position: relative;
  margin-bottom: 0;
}
.auth-password-wrap .auth-password-input {
  padding-right: 48px;
  width: 100%;
}
.auth-password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--t-text-muted);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.auth-password-toggle:hover {
  background: rgba(0,0,0,.05);
  color: var(--t-text);
}
.auth-password-toggle:focus {
  outline: none;
}
.auth-password-toggle:focus-visible {
  outline: 2px solid var(--t-primary);
  outline-offset: 1px;
}

.auth-remember {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}
.auth-remember input[type=checkbox] {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--t-primary);
  cursor: pointer;
}
.auth-remember label {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
}

.btn-auth-submit {
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
}

.form label { display: block; font-weight: 600; margin: 10px 0 6px; font-size: 14px; }
.form input[type=email],
.form input[type=password],
.form input[type=text],
.form .auth-password-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--t-border);
  border-radius: 10px; font: inherit; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus,
.form .auth-password-input:focus {
  outline: none;
  border-color: var(--t-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-primary) 22%, transparent);
}
.form .btn { margin-top: 18px; width: 100%; }
.form--auth .btn-primary { margin-top: 22px; }

/* ---- Landing ---- */
.layout-landing { padding: 0; display: flex; flex-direction: column; min-height: 100vh; }
.landing-topbar {
  background: var(--t-surface, #fff);
  border-bottom: 1px solid var(--t-border, #dde2ec);
  padding: 12px 0;
}
.landing-topbar__inner { display: flex; align-items: center; justify-content: flex-start; gap: 16px; }
.landing-topbar__brand { display: flex; align-items: center; text-decoration: none; color: var(--t-text); }
.landing-topbar__brand:hover { text-decoration: none; }
.landing-topbar img { height: 40px; width: auto; max-width: 200px; object-fit: contain; }
.landing-topbar__title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--t-primary); }

.landing-content { flex: 1; padding: 0 0 56px; }

/* Accueil racine — présentation épurée + sélecteur */
.landing-wrap {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  text-align: center;
}
.landing-intro { margin-bottom: 32px; }
.landing-intro__title {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--t-text);
}
.landing-intro__tagline {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.landing-picker {
  text-align: left;
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: var(--t-radius, 10px);
  padding: 18px 20px 20px;
  box-shadow: 0 2px 10px rgba(30,38,51,.04);
}
.landing-picker__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--t-text);
}
.landing-select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--t-text);
  background: var(--t-bg, #f6f8fb);
  border: 1px solid var(--t-border);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236A6A7A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}
.landing-select:focus {
  outline: 2px solid var(--t-primary);
  outline-offset: 1px;
  border-color: var(--t-primary);
  background-color: #fff;
}

.landing-empty {
  text-align: center;
  padding: 40px 28px;
  max-width: 480px;
  margin: 0 auto;
}
.landing-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: #eef3fb;
  color: var(--t-primary);
}
.landing-empty h3 { margin-bottom: 8px; }

.landing-footer {
  margin-top: auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--t-border, #dde2ec);
  background: var(--t-surface, #fff);
}
.landing-footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 13px;
}
.landing-footer__dot { opacity: .5; }

/* ---- Errors ---- */
.layout-error { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--t-bg); }
.error-wrap { width: 100%; max-width: 560px; text-align: center; }
.error-logo { margin-bottom: 24px; }
.error-logo img { height: 52px; width: auto; }
.error-card { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 14px; padding: 40px 28px; box-shadow: 0 10px 30px rgba(30,38,51,.06); }
.error-code { font-size: 78px; font-weight: 800; color: var(--t-primary); line-height: 1; letter-spacing: -.02em; margin-bottom: 4px; }
.error-debug { text-align: left; margin: 18px 0; background: #f2f4f9; padding: 12px; border-radius: 8px; font-size: 12px; }
.error-debug pre { white-space: pre-wrap; word-break: break-all; margin: 10px 0 0; }

/* ---- Admin (connecté) ---- */
/* Header + main : même max-width et mêmes gouttières horizontales */
.admin-app .topbar .container,
.admin-app main.container {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}
.admin-app .topbar--admin {
  height: auto;
  min-height: 60px;
  background: linear-gradient(180deg, var(--t-surface, #fff) 0%, color-mix(in srgb, var(--t-surface, #fff) 92%, var(--t-bg, #f4f6fa) 8%) 100%);
  border-bottom: 1px solid var(--t-border, #e1e6ee);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.admin-app .topbar-inner--admin {
  height: auto;
  min-height: unset;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-top: 14px;
  padding-bottom: 14px;
}
.topbar-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand--admin {
  gap: 12px;
  align-items: center;
}
.brand--admin .brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.15;
}
.brand--admin .brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand--admin .brand-tagline {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--t-text-muted, #5a6675);
}
.topbar-admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--t-border, #e1e6ee) 85%, transparent);
}
.admin-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t-text-muted, #5a6675);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.admin-nav__link:hover {
  background: color-mix(in srgb, var(--t-primary) 8%, var(--t-surface, #fff));
  color: var(--t-primary);
  text-decoration: none;
}
.admin-nav__link.is-active {
  background: color-mix(in srgb, var(--t-primary) 14%, var(--t-surface, #fff));
  color: var(--t-primary);
  border-color: color-mix(in srgb, var(--t-primary) 28%, var(--t-border, #e1e6ee));
  box-shadow: 0 1px 2px rgba(30, 38, 51, 0.06);
}
.admin-app main.container {
  padding-top: 28px;
  padding-bottom: 48px;
}
.admin-content {
  min-width: 0;
  padding: 28px 32px 36px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(30, 38, 51, 0.05);
}
.admin-content > h1 {
  margin: 0 0 22px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--t-text);
}
.admin-content > h2 {
  margin: 28px 0 16px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--t-text);
}
.admin-content > h2:first-child {
  margin-top: 0;
}
.admin-content > .alert {
  margin-bottom: 16px;
}
.admin-content > .alert:last-of-type {
  margin-bottom: 20px;
}
.admin-content > .alert + h1 {
  margin-top: 0;
}
.admin-content > .cards {
  margin-bottom: 8px;
}
.admin-content > p.muted {
  margin: 18px 0 0;
  line-height: 1.55;
  max-width: 52rem;
}
.admin-back-row {
  margin: 0 0 24px;
  font-size: 14px;
}
.admin-back-row a {
  margin-right: 4px;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 18px;
}
.admin-toolbar input[type='text'],
.admin-toolbar select {
  padding: 9px 11px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}
.admin-actions {
  margin-bottom: 20px;
}
.admin-table-wrap {
  margin: 4px 0 24px;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--t-surface);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.admin-table-wrap table {
  margin: 0;
}

/* Tableau logs : ne pas étendre la page ; colonne contenu flexible + coupures */
table.admin-table--logs {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}
table.admin-table--logs th,
table.admin-table--logs td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
table.admin-table--logs th:nth-child(1),
table.admin-table--logs td:nth-child(1) {
  width: 6.25rem;
  vertical-align: middle;
}
table.admin-table--logs th:nth-child(2),
table.admin-table--logs td:nth-child(2) {
  width: 12rem;
  vertical-align: top;
}
table.admin-table--logs th:nth-child(3),
table.admin-table--logs td:nth-child(3) {
  width: auto;
  min-width: 0;
}
table.admin-table--logs th:nth-child(4),
table.admin-table--logs td:nth-child(4) {
  width: 3.25rem;
}
table.admin-table--logs th:nth-child(5),
table.admin-table--logs td:nth-child(5) {
  width: 3.25rem;
}
table.admin-table--logs th:nth-child(6),
table.admin-table--logs td:nth-child(6) {
  width: 6.5rem;
}
table.admin-table--logs th:nth-child(7),
table.admin-table--logs td:nth-child(7) {
  width: 9rem;
}

.admin-log-level {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.admin-log-level--debug {
  background: #eceff1;
  color: #37474f;
  border-color: #cfd8dc;
}
.admin-log-level--info {
  background: #e3f2fd;
  color: #0d47a1;
  border-color: #90caf9;
}
.admin-log-level--notice {
  background: #e0f7fa;
  color: #006064;
  border-color: #4dd0e1;
}
.admin-log-level--warning {
  background: #fff8e1;
  color: #e65100;
  border-color: #ffcc80;
}
.admin-log-level--error {
  background: #ffebee;
  color: #b71c1c;
  border-color: #ef9a9a;
}
.admin-log-level--critical {
  background: #fce4ec;
  color: #880e4f;
  border-color: #f48fb1;
}
.admin-log-level--alert {
  background: #f3e5f5;
  color: #4a148c;
  border-color: #ce93d8;
}
.admin-log-level--emergency {
  background: #263238;
  color: #eceff1;
  border-color: #455a64;
}
.admin-log-level--unknown {
  background: #f5f5f5;
  color: #616161;
  border-color: #e0e0e0;
}

.admin-log-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.35;
}
.admin-log-channel-line {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-text, #333);
}
.admin-log-action-line {
  font-size: 12px;
  color: var(--t-text-muted, #5a6675);
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  word-break: break-word;
}
.admin-table-wrap th:first-child,
.admin-table-wrap td:first-child {
  padding-left: 16px;
}
.admin-table-wrap th:last-child,
.admin-table-wrap td:last-child {
  padding-right: 16px;
}
.admin-form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.admin-campus-form > .card {
  margin-bottom: 24px;
  padding: 22px 24px;
}
.admin-campus-form > .card:last-of-type {
  margin-bottom: 28px;
}
.admin-campus-form .card > h2:first-child {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.1rem;
  font-weight: 700;
}
.admin-campus-form .card > p.muted:first-of-type {
  margin-top: -6px;
  margin-bottom: 18px;
}

.admin-brand-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 20px;
  align-items: start;
}
.admin-brand-file-row__fields {
  min-width: 0;
}
.admin-brand-file-row input[type='file'] {
  max-width: 100%;
  font-size: 14px;
}
.admin-brand-preview {
  padding: 12px;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius, 10px);
  background: var(--t-surface, #fff);
}
.admin-brand-preview--col {
  justify-self: end;
  align-self: start;
}
@media (max-width: 720px) {
  .admin-brand-file-row {
    grid-template-columns: 1fr;
  }
  .admin-brand-preview--col {
    justify-self: start;
  }
}
.admin-brand-preview__img {
  display: block;
  max-width: 200px;
  height: auto;
  object-fit: contain;
}
.admin-brand-preview__img--favicon {
  width: 32px;
  height: 32px;
}

.admin-theme-fields {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.admin-theme-row__head {
  margin-bottom: 10px;
}
.admin-theme-row__title {
  display: block;
  font-weight: 600;
  font-size: 14px;
}
.admin-theme-row__key {
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}
.admin-theme-row__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 92px;
  gap: 14px 18px;
  align-items: center;
}
.admin-theme-cell--presets {
  min-width: 0;
}
.admin-theme-cell--controls {
  min-width: 0;
}
.admin-theme-cell--preview {
  justify-self: center;
}
@media (max-width: 900px) {
  .admin-theme-row__grid {
    grid-template-columns: 1fr;
  }
  .admin-theme-cell--preview {
    justify-self: start;
  }
}
.admin-theme-row__grid--font {
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 900px) {
  .admin-theme-row__grid--font {
    grid-template-columns: 1fr;
  }
}
.admin-theme-cell--font-stack {
  min-width: 0;
}
.admin-font-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.admin-theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-preset-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  background: var(--t-surface, #fff);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}
.admin-preset-swatch:hover {
  border-color: var(--t-primary, #1a3a8e);
}
.admin-preset-swatch__chip {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.admin-preset-swatch__label {
  line-height: 1.25;
}

.admin-color-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.admin-color-picker {
  width: 48px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--t-surface, #fff);
}
.admin-color-hex {
  width: 100%;
  max-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font: inherit;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.admin-color-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}
.admin-color-preview-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--t-border);
  font-weight: 700;
  font-size: 15px;
}

.admin-theme-presets--radius {
  align-items: flex-end;
}
.admin-preset-radius {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  background: var(--t-surface, #fff);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  max-width: 96px;
}
.admin-preset-radius:hover {
  border-color: var(--t-primary, #1a3a8e);
}
.admin-preset-radius__box {
  display: block;
  width: 40px;
  height: 28px;
  background: linear-gradient(135deg, var(--t-primary, #5b7fd4), var(--t-accent, #7c9ef0));
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.admin-radius-input {
  width: 100%;
  max-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font: inherit;
}
.admin-radius-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-radius-preview {
  width: 56px;
  height: 56px;
  background: var(--t-surface, #fff);
  border: 2px dashed var(--t-border);
}

.admin-font-presets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}
.admin-preset-font {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  background: var(--t-surface, #fff);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.admin-preset-font:hover {
  border-color: var(--t-primary, #1a3a8e);
}
.admin-preset-font__name {
  font-size: 12px;
  font-weight: 600;
}
.admin-preset-font__sample {
  font-size: 14px;
  line-height: 1.35;
  color: var(--t-text, #333);
}
.admin-font-textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 72px;
}
.admin-font-preview-panel {
  padding: 14px 16px;
  border: 1px solid var(--t-border);
  border-radius: 10px;
  background: var(--t-bg, #f6f8fb);
}
.admin-font-preview-live {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--t-text, #333);
}

.admin-campus-list-actions {
  margin: 0 0 16px;
}
.admin-inline-form {
  display: inline;
  margin: 0;
}
.admin-inline-form .btn {
  padding: 4px 10px;
  font-size: 13px;
}
.admin-btn-danger {
  color: var(--t-danger, #b42318);
}
.admin-btn-danger:hover {
  color: #fff;
  background: var(--t-danger, #b42318);
  border-color: var(--t-danger, #b42318);
}

.admin-campus-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.admin-env-actions {
  margin: 20px 0 0;
}
.admin-mail-test {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  max-width: 640px;
  margin-bottom: 8px;
}
.admin-mail-test > div {
  flex: 1 1 260px;
}
.admin-mail-test label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
}
.admin-mail-test input[type='email'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  font: inherit;
}

/* Logs admin : ligne 1 = message ; ligne 2 = texte brut (aperçu bleu, clic = modale + copie) */
.admin-log-detail {
  vertical-align: top;
  min-width: 0;
  max-width: 100%;
}
.admin-log-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.admin-log-line-msg {
  font-size: 13px;
  line-height: 1.4;
  color: var(--t-text, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.admin-log-raw-trigger {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  border: 1px solid rgba(21, 101, 192, 0.35);
  border-radius: 8px;
  background: rgba(21, 101, 192, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.admin-log-raw-trigger:hover {
  background: rgba(21, 101, 192, 0.12);
  border-color: rgba(21, 101, 192, 0.55);
}
.admin-log-raw-trigger:focus {
  outline: 2px solid var(--t-primary, #1565c0);
  outline-offset: 2px;
}
.admin-log-raw-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', 'Liberation Mono', monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1565c0;
}
.admin-log-data-store {
  display: none;
}

.admin-log-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  box-sizing: border-box;
}
.admin-log-modal[hidden] {
  display: none;
}
.admin-log-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}
.admin-log-modal__panel {
  position: relative;
  z-index: 1;
  width: min(56rem, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--t-surface, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--t-border);
  overflow: hidden;
}
.admin-log-modal__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--t-border);
  background: var(--t-bg, #f6f8fb);
}
.admin-log-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.admin-log-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-log-modal__body {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  flex: 1 1 auto;
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', 'Liberation Mono', monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: var(--t-text, #1e293b);
  background: var(--t-surface, #fff);
  border: none;
  border-radius: 0;
}

table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--t-border); font-size: 14px; }
table th { background: #f6f8fb; font-weight: 600; }
table tr:hover td { background: #fafcff; }

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .sidebar-overlay { display: block; }

  .sidebar {
    position: fixed;
    top: 60px; left: 0; bottom: 0;
    z-index: 45;
    transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 20px rgba(0,0,0,.12);
  }
  .sidebar.open { transform: translateX(0); }

  .app-content { padding: 20px 16px 40px; }
  .footer { padding: 16px; }

  .dash-grid { grid-template-columns: 1fr !important; }
  .widget--wide { grid-column: span 1; }
  .dash-hero { padding: 20px; }
  .dash-hero-title { font-size: 20px; }
  .dash-hero-avatar { display: none; }
}

@media (max-width: 820px) {
  .admin-app .topbar .container,
  .admin-app main.container {
    padding-left: 18px;
    padding-right: 18px;
  }
  .admin-app main.container {
    padding-top: 20px;
    padding-bottom: 32px;
  }
  .admin-app .topbar-inner--admin {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .topbar-admin-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar-admin-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .admin-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
    padding-bottom: 4px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .admin-nav__link {
    flex-shrink: 0;
  }
  .admin-content {
    padding: 22px 18px 28px;
  }
  .page-hero h1 { font-size: 24px; }
}

/* =========================================================
   Modules — composants partagés
   ========================================================= */

/* ---- Page header (hero compact de module) ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 14px;
  margin-bottom: 20px;
}
.page-header-body { flex: 1; min-width: 240px; }
.page-header-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--t-text, #1e2633);
}
.page-header-sub {
  margin: 0;
  color: var(--t-text-muted, #5a6675);
  font-size: 14px;
}
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-breadcrumb {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--t-text-muted, #5a6675);
  margin-bottom: 6px;
}
.page-breadcrumb a { color: var(--t-text-muted, #5a6675); }

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--t-border, #e1e6ee);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tabs-item {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--t-text-muted, #5a6675);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tabs-item:hover { color: var(--t-primary); text-decoration: none; }
.tabs-item.active {
  color: var(--t-primary);
  border-bottom-color: var(--t-primary);
  font-weight: 600;
}
.tabs-item .tab-count {
  display: inline-block;
  background: #eef1f6;
  color: var(--t-text-muted);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}
.tabs-item.active .tab-count { background: var(--t-primary); color: #fff; }

/* ---- Cards (grille générique de modules) ---- */
.m-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.m-card {
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: var(--t-text, #1e2633);
}
.m-card:hover {
  border-color: var(--t-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  transform: translateY(-1px);
}
.m-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.m-card-title { font-size: 15px; font-weight: 600; margin: 0; }
.m-card-meta { color: var(--t-text-muted); font-size: 12px; }
.m-card-desc { color: var(--t-text-muted); font-size: 13px; margin: 0; line-height: 1.5; }
.m-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  color: var(--t-primary);
  font-weight: 500;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #eef1f6;
  color: var(--t-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-primary { background: rgba(11, 99, 214, 0.12); color: var(--t-primary); }
.badge-success { background: #e2f6ee; color: var(--t-success, #0fae6e); }
.badge-warning { background: #fff4e0; color: #c97706; }
.badge-danger  { background: #fde8ec; color: var(--t-danger, #d9364c); }
.badge-new     { background: #eef3fb; color: var(--t-primary); }

/* ---- Chips / filtres ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.chip {
  padding: 6px 12px;
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 999px;
  font-size: 13px;
  color: var(--t-text);
  background: var(--t-surface, #fff);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--t-primary); color: var(--t-primary); text-decoration: none; }
.chip.active {
  background: var(--t-primary);
  border-color: var(--t-primary);
  color: #fff;
}

/* ---- Notes / tableau devoirs ---- */
.table-notes {
  width: 100%;
  border-collapse: collapse;
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 12px;
  overflow: hidden;
}
.table-notes th,
.table-notes td {
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--t-border, #e1e6ee);
}
.table-notes th {
  background: #fafbfd;
  font-weight: 600;
  color: var(--t-text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.table-notes tbody tr:last-child td { border-bottom: 0; }
.table-notes tbody tr:hover { background: #fafbfd; }
.note-val { font-weight: 700; color: var(--t-primary); }
.note-bar {
  display: inline-block;
  height: 6px;
  border-radius: 3px;
  background: var(--t-primary);
  vertical-align: middle;
}
.note-cell-avg { color: var(--t-text-muted); font-size: 12px; }

/* ---- QR Box (concours) ---- */
.qr-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 12px;
}
.qr-box svg {
  width: 180px;
  height: 180px;
  display: block;
}
.qr-box-label {
  font-size: 12px;
  color: var(--t-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---- Calendrier simple (agenda) ---- */
.calendar {
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 12px;
  padding: 16px;
}
.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-title { font-weight: 700; font-size: 16px; text-transform: capitalize; }
.calendar-nav { display: flex; gap: 6px; }
.calendar-nav button {
  background: transparent;
  border: 1px solid var(--t-border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--t-text);
}
.calendar-nav button:hover { background: #f1f4f9; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekday {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--t-text-muted);
  padding: 6px 4px;
  text-align: center;
  font-weight: 600;
}
.calendar-day {
  aspect-ratio: 1 / 1;
  min-height: 66px;
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  font-size: 12px;
  overflow: hidden;
}
.calendar-day.out { opacity: 0.45; }
.calendar-day.today { border-color: var(--t-primary); box-shadow: inset 0 0 0 1px var(--t-primary); }
.calendar-day-num { font-weight: 600; font-size: 12px; }
.calendar-day .cal-ev {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(11, 99, 214, 0.14);
  color: var(--t-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ---- Key / password display (replays) ---- */
.kbd-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  padding: 4px 10px;
  background: #f1f4f9;
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 6px;
  font-size: 13px;
  color: var(--t-text);
  letter-spacing: 0.05em;
}

/* ---- Wizard / stepper (devoirs upload) ---- */
.stepper {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  counter-reset: step;
}
.stepper-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f6f8fb;
  border-radius: 8px;
  font-size: 13px;
  color: var(--t-text-muted);
  counter-increment: step;
}
.stepper-step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dfe5ef;
  color: var(--t-text-muted);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.stepper-step.active {
  background: rgba(11, 99, 214, 0.08);
  color: var(--t-primary);
  font-weight: 600;
}
.stepper-step.active::before { background: var(--t-primary); color: #fff; }
.stepper-step.done { color: var(--t-success, #0fae6e); }
.stepper-step.done::before {
  background: var(--t-success, #0fae6e);
  color: #fff;
  content: '\2713';
}

/* ---- Forms (modules) ---- */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--t-text);
}
.form-row .form-hint { font-size: 12px; color: var(--t-text-muted); margin-top: 4px; }
.form-row input[type='text'],
.form-row input[type='email'],
.form-row input[type='tel'],
.form-row input[type='date'],
.form-row input[type='password'],
.form-row input[type='url'],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--t-text);
}
.form-row textarea { min-height: 110px; resize: vertical; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--t-primary);
  box-shadow: 0 0 0 3px rgba(11, 99, 214, 0.12);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--t-border, #e1e6ee);
}
.form-card {
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 12px;
  padding: 22px 24px;
}
.form-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--t-border);
}

/* ---- Toggle switch ---- */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 42px;
  height: 24px;
  background: #dfe5ef;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.15s;
}
.toggle input:checked + .toggle-track { background: var(--t-primary); }
.toggle input:checked + .toggle-track::after { left: 21px; }

/* ---- Q&A thread ---- */
.qa-thread { display: flex; flex-direction: column; gap: 14px; }
.qa-item {
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 12px;
  padding: 16px 18px;
}
.qa-item.is-answer { background: #fafbfd; margin-left: 24px; }
.qa-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--t-text-muted);
}
.qa-item-author { font-weight: 600; color: var(--t-text); }
.qa-item-body { font-size: 14px; line-height: 1.55; }

/* ---- Notifications list ---- */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--t-surface, #fff);
  border: 1px solid var(--t-border, #e1e6ee);
  border-radius: 10px;
  text-decoration: none;
  color: var(--t-text);
}
.notif-item.unread { border-left: 3px solid var(--t-primary); background: #fafcff; }
.notif-item-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(11, 99, 214, 0.12);
  color: var(--t-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.notif-item-text { color: var(--t-text-muted); font-size: 13px; line-height: 1.45; }
.notif-item-meta { color: var(--t-text-muted); font-size: 11px; white-space: nowrap; }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--t-surface, #fff);
  border: 1px dashed var(--t-border, #e1e6ee);
  border-radius: 14px;
  color: var(--t-text-muted);
}
.empty-state h3 { color: var(--t-text); margin: 10px 0 6px; }
.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eef3fb;
  color: var(--t-primary);
  margin-bottom: 4px;
}

/* ---- Flash messages ---- */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid transparent;
}
.flash-success { background: #e2f6ee; color: var(--t-success, #0fae6e); border-color: #b6e5cf; }
.flash-error   { background: #fde8ec; color: var(--t-danger, #d9364c); border-color: #f5c0ca; }
.flash-info    { background: #eef3fb; color: var(--t-primary); border-color: #c7d9f3; }

/* ---- Info list (fiches : convocation, stage) ---- */
.info-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  align-items: baseline;
}
.info-list dt {
  color: var(--t-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.info-list dd {
  margin: 0;
  font-size: 14px;
  color: var(--t-text);
}

/* ---- Layout split ---- */
.split-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 800px) {
  .split-2 { grid-template-columns: 1fr; }
}

