/* =========================================================
   Conduite360 - feuille de style unique
   Aucun style en ligne dans les gabarits.
   Palette : bleu marin du logo + gris tres clairs.
   ========================================================= */

:root {
  /* Couleurs de marque */
  --navy-900: #071a33;
  --navy-800: #0b2545;
  --navy-700: #123a63;
  --navy-600: #1b4f83;
  --navy-100: #e7eefc;

  --accent:      #1d6fb8;
  --accent-dark: #17588f;

  /* Neutres */
  --bg:        #f4f7fb;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --border-strong: #cbd5e1;

  --text:      #1f2933;
  --text-soft: #475569;
  --muted:     #7a8798;

  /* Etats */
  --success:    #1b7f5a;
  --success-bg: #e8f6f0;
  --danger:     #b3261e;
  --danger-bg:  #fdecea;
  --warning:    #92610a;
  --warning-bg: #fdf4e3;
  --info:       #15507e;
  --info-bg:    #e9f2fb;

  /* Mesures */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06);
  --shadow:    0 2px 10px rgba(11, 37, 69, .07);
  --shadow-lg: 0 12px 32px rgba(11, 37, 69, .12);

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --container: 1140px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4 {
  font-weight: 600;
  color: var(--navy-800);
  line-height: 1.25;
  margin: 0 0 var(--space-4);
}
h1, .h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); }
h2, .h2 { font-size: clamp(1.35rem, 1.1rem + .9vw, 1.75rem); }
h3, .h3 { font-size: 1.2rem; }
h4, .h4 { font-size: 1.05rem; }

p { margin: 0 0 var(--space-4); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-5) 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--navy-800); color: #fff; padding: var(--space-3) var(--space-4);
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- En-tete ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 72px;
}

.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__logo { width: auto; object-fit: contain; }
.logo-root   { max-height: 40px; }
.logo-tenant { max-height: 44px; }
.brand__name {
  font-weight: 600;
  color: var(--navy-800);
  font-size: 1.05rem;
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
  line-height: 1.2;
}

.site-nav { display: flex; align-items: center; gap: var(--space-5); }
.site-nav__list { display: flex; align-items: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.site-nav__list a {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--text-soft);
  font-size: .95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.site-nav__list a:hover { background: var(--navy-100); color: var(--navy-800); text-decoration: none; }
.site-nav__list a.is-active { color: var(--navy-800); background: var(--navy-100); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 9px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--navy-800); border-radius: 2px; }

/* Menu utilisateur */
.user-menu { position: relative; }
.user-menu__trigger {
  display: flex; align-items: center; gap: var(--space-2);
  background: none; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px 5px 5px;
  cursor: pointer; font-family: inherit; font-size: .9rem; color: var(--text);
}
.user-menu__trigger:hover { border-color: var(--border-strong); background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy-800); color: #fff;
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 600;
}
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); }
.user-menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 200px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: var(--space-2); z-index: 50;
}
.user-menu__panel a, .user-menu__panel .linklike {
  display: block; width: 100%; text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); color: var(--text-soft); font-size: .92rem;
}
.user-menu__panel a:hover, .user-menu__panel .linklike:hover { background: var(--surface-2); color: var(--navy-800); text-decoration: none; }
.user-menu__role {
  display: block; padding: var(--space-2) var(--space-3);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--border); margin-bottom: var(--space-2);
}
.linklike { background: none; border: 0; font-family: inherit; font-size: inherit; cursor: pointer; }
.inline-form { display: block; margin: 0; }

/* ---------- Corps ---------- */
.site-main { flex: 1 0 auto; padding-block: var(--space-6) var(--space-7); }
.page-centered { display: grid; place-items: center; padding: var(--space-6); }

.page-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5);
}
.page-head h1 { margin: 0; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.page-subtitle { color: var(--text-soft); margin: var(--space-2) 0 0; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}
.card-narrow { max-width: 460px; width: 100%; margin-inline: auto; }
.card-wide   { max-width: 760px; }
.card__header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card__header h2, .card__header h3 { margin: 0; font-size: 1.05rem; }

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Statistiques */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--navy-700);
}
.stat__value { font-size: 1.9rem; font-weight: 700; color: var(--navy-800); line-height: 1.1; }
.stat__label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

/* Tuiles de navigation */
.tiles { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tile {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-5);
  color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--navy-600); }
.tile__title { font-weight: 600; color: var(--navy-800); margin-bottom: var(--space-1); }
.tile__desc { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: .65rem 1.25rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; font-weight: 500; line-height: 1.2;
  cursor: pointer; text-decoration: none;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--navy-800); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--navy-800); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1e17; color: #fff; }
.btn-ghost     { background: transparent; color: var(--text-soft); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--navy-800); }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.7rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- Formulaires ---------- */
.form { display: block; }
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-row { margin-bottom: var(--space-4); }
.form-row--full { grid-column: 1 / -1; }

.field { display: block; margin-bottom: var(--space-4); }
.field > span, .label {
  display: block; font-size: .88rem; font-weight: 500;
  color: var(--text-soft); margin-bottom: var(--space-2);
}
.field .hint { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: var(--space-1); }
.required { color: var(--danger); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="url"], input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="search"], select, textarea {
  width: 100%;
  padding: .6rem .75rem;
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 111, 184, .15);
}
input[type="file"] { font-size: .9rem; }
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }

fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); margin: 0 0 var(--space-5); }
legend { padding: 0 var(--space-2); font-weight: 600; color: var(--navy-800); font-size: .95rem; }

.checkbox { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.checkbox input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--navy-800); flex: none; }
.checkbox span { font-size: .93rem; color: var(--text-soft); }

.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .suffix {
  display: flex; align-items: center; padding: 0 var(--space-3);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted); font-size: .88rem; white-space: nowrap;
}
.form-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  align-items: center; margin-top: var(--space-5);
  padding-top: var(--space-5); border-top: 1px solid var(--border);
}
.form-inline { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.form-inline input[type="search"], .form-inline input[type="text"] { width: auto; min-width: 240px; }

/* ---------- Alertes ---------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent; border-left-width: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  font-size: .94rem;
}
.alert-success { background: var(--success-bg); border-color: var(--success); color: #12523a; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: #7f1b15; }
.alert-info    { background: var(--info-bg);    border-color: var(--info);    color: #113f63; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: #6b4707; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.table th, table.table td { padding: .7rem .9rem; text-align: left; vertical-align: middle; }
table.table thead th {
  background: var(--surface-2); color: var(--text-soft);
  font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.table tbody tr + tr { border-top: 1px solid var(--border); }
table.table tbody tr:hover { background: var(--surface-2); }
table.table td.actions { white-space: nowrap; text-align: right; }
table.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty-state { padding: var(--space-6); text-align: center; color: var(--muted); }
.empty-state p { margin-bottom: var(--space-4); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: .18em .6em;
  border-radius: 999px; font-size: .74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-active    { background: var(--success-bg); color: var(--success); }
.badge-pending   { background: var(--warning-bg); color: var(--warning); }
.badge-suspended { background: var(--danger-bg);  color: var(--danger); }
.badge-neutral   { background: var(--surface-2);  color: var(--muted); border: 1px solid var(--border); }
.badge-role      { background: var(--navy-100);   color: var(--navy-700); }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tab-button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: var(--space-3) var(--space-4);
  font-family: inherit; font-size: .95rem; font-weight: 500;
  color: var(--muted); cursor: pointer;
}
.tab-button:hover { color: var(--navy-800); }
.tab-button.is-active { color: var(--navy-800); border-bottom-color: var(--navy-800); }
.tab-panel[hidden] { display: none; }

/* ---------- Listes descriptives ---------- */
.detail-list { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 0; }
.detail-list div { min-width: 0; }
.detail-list dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.detail-list dd { margin: 0; color: var(--text); word-break: break-word; }

/* ---------- Page publique / marketing ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 1rem + 5vw, 4rem);
  margin-bottom: var(--space-6);
}
.hero h1 { color: #fff; max-width: 20ch; }
.hero p { color: rgba(255, 255, 255, .85); max-width: 60ch; font-size: 1.05rem; }
.hero .btn-secondary { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .4); }
.hero .btn-secondary:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.hero .btn-accent { background: #fff; color: var(--navy-800); }
.hero .btn-accent:hover { background: var(--navy-100); color: var(--navy-800); }

.section { margin-bottom: var(--space-7); }
.section__title { text-align: center; margin-bottom: var(--space-2); }
.section__lead { text-align: center; color: var(--text-soft); max-width: 60ch; margin: 0 auto var(--space-6); }

.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); }
.feature h3 { font-size: 1.05rem; margin-bottom: var(--space-2); }
.feature p { color: var(--text-soft); font-size: .94rem; margin: 0; }

.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-6); text-align: center; }
.price-card.is-featured { border-color: var(--navy-700); border-width: 2px; box-shadow: var(--shadow); }
.price-card__amount { font-size: 2.2rem; font-weight: 700; color: var(--navy-800); }
.price-card__period { color: var(--muted); font-size: .9rem; }
.price-card ul { list-style: none; padding: 0; margin: var(--space-5) 0; text-align: left; }
.price-card li { padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: .93rem; color: var(--text-soft); }

.school-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); }
.school-card__logo { max-height: 90px; margin-bottom: var(--space-4); }

/* ---------- Utilitaires ---------- */
.text-muted   { color: var(--muted); }
.text-soft    { color: var(--text-soft); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-small   { font-size: .87rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-3 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-6); }
.mb-3 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-6); }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.stack > * + * { margin-top: var(--space-4); }
.divider { border-top: 1px solid var(--border); margin: var(--space-5) 0; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: var(--space-3);
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: var(--space-4) var(--space-5);
  }
  .site-nav.is-open { display: flex; }
  .site-header__inner { position: relative; flex-wrap: wrap; }
  .site-nav__list { flex-direction: column; align-items: stretch; }
  .site-nav__list a { padding: var(--space-3); }
  .user-menu__panel { position: static; box-shadow: none; border: 0; padding: 0; }
  .brand__name { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .form-inline input[type="search"], .form-inline input[type="text"] { min-width: 0; width: 100%; }
}

@media (max-width: 560px) {
  .container { padding-inline: var(--space-4); }
  .card { padding: var(--space-4); }
  .card__header { margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) var(--space-4); padding: var(--space-3) var(--space-4); }
  table.table { font-size: .88rem; }
  .btn { width: 100%; }
  .btn-group .btn, .page-head__actions .btn { width: 100%; }
  .form-actions .btn { width: 100%; }
}

@media print {
  .site-header, .site-footer, .page-head__actions, .btn { display: none !important; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; padding: 0; }
}

/* =========================================================
   Modules ajoutes : calendrier, cohortes, facturation,
   finances, imports, rappels.
   ========================================================= */

/* ---------- Variantes de statistiques ---------- */
.stat--success { border-left-color: var(--success); }
.stat--success .stat__value { color: var(--success); }
.stat--danger  { border-left-color: var(--danger); }
.stat--danger .stat__value  { color: var(--danger); }
.stat--warning { border-left-color: var(--warning); }
.stat--warning .stat__value { color: var(--warning); }

/* ---------- Onglets sous forme de liens ---------- */
a.tab-button { text-decoration: none; display: inline-block; }
a.tab-button:hover { text-decoration: none; }

/* ---------- Calendrier ---------- */
.cal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3); margin-bottom: var(--space-4);
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: start;
}

.cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2);
  min-height: 140px;
}
.cal-day.is-today { border-color: var(--navy-700); box-shadow: inset 0 2px 0 var(--navy-700); }

.cal-day__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2); padding: 0 var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--border); margin-bottom: var(--space-2);
}
.cal-day__name { font-size: .78rem; font-weight: 600; color: var(--navy-800); line-height: 1.2; }
.cal-day__add {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--muted);
  font-weight: 600; line-height: 1; text-decoration: none;
}
.cal-day__add:hover { background: var(--navy-100); color: var(--navy-800); text-decoration: none; }

.cal-empty { color: var(--muted); font-size: .78rem; text-align: center; padding: var(--space-3) 0; margin: 0; }

.cal-item {
  display: block; margin-bottom: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--navy-700);
  background: var(--navy-100);
  color: var(--text); text-decoration: none;
  font-size: .78rem; line-height: 1.35;
}
.cal-item:hover { text-decoration: none; filter: brightness(.97); }
.cal-item__time  { display: block; font-weight: 600; color: var(--navy-800); }
.cal-item__title { display: block; }
.cal-item__meta  { display: block; color: var(--muted); font-size: .72rem; }

.cal-item--theorie  { border-left-color: var(--accent); background: var(--info-bg); }
.cal-item--done     { border-left-color: var(--muted); background: var(--surface-2); }
.cal-item--canceled { border-left-color: var(--danger); background: var(--danger-bg); text-decoration: line-through; }
.cal-item--no_show  { border-left-color: var(--warning); background: var(--warning-bg); }

.cal-slot {
  font-size: .72rem; color: var(--text-soft);
  padding: 3px var(--space-2); margin-bottom: var(--space-1);
  border-radius: var(--radius-sm); background: var(--surface-2);
  border-left: 3px solid var(--success);
}
.cal-slot--blocked { border-left-color: var(--danger); color: var(--muted); }

.cal-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-top: var(--space-4); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.dot--sortie  { background: var(--navy-700); }
.dot--theorie { background: var(--accent); }
.dot--dispo   { background: var(--success); }
.dot--blocked { background: var(--danger); }

/* ---------- Fiches et notes ---------- */
.note-item { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.note-item:last-child { border-bottom: 0; }
.note-item__meta { font-size: .78rem; color: var(--muted); margin-bottom: var(--space-1); }
.note-item p:last-child { margin-bottom: 0; }

.cours-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4); margin-bottom: var(--space-3);
  border: 1px solid var(--border); border-left: 4px solid var(--navy-700);
  border-radius: var(--radius); background: var(--surface-2);
}
.cours-item__date { font-weight: 600; color: var(--navy-800); margin-bottom: var(--space-1); }

/* ---------- Formulaire en tableau (lignes de facture) ---------- */
table.table-form input[type="text"] { width: 100%; min-width: 90px; }
table.table-form td { padding: var(--space-2); }

/* ---------- Graphique a barres ---------- */
.chart {
  display: flex; align-items: flex-end; gap: var(--space-2);
  height: 220px; padding: var(--space-4) 0 0;
  border-bottom: 1px solid var(--border);
}
.chart__col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%;
}
.chart__bar {
  width: 100%; max-width: 46px;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-800));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.chart__value { font-size: .7rem; color: var(--text-soft); margin-bottom: 4px; }
.chart__label { font-size: .7rem; color: var(--muted); margin-top: var(--space-2); }

.bar-row { margin-bottom: var(--space-4); }
.bar-row__head { display: flex; justify-content: space-between; gap: var(--space-3); font-size: .9rem; margin-bottom: 4px; }
.bar-row__track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-row__fill  { display: block; height: 100%; background: var(--navy-700); border-radius: 999px; }

/* ---------- Bloc de journal ---------- */
.log-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--space-4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; line-height: 1.6; color: var(--text-soft);
  white-space: pre-wrap; word-break: break-word; overflow-x: auto; margin: 0;
}

/* ---------- Selection multiple ---------- */
select[multiple] { padding: var(--space-2); min-height: 150px; background-image: none; }

/* ---------- Responsive des nouveaux blocs ---------- */
@media (max-width: 1100px) {
  .site-nav__list a { padding: var(--space-2); font-size: .88rem; }
}

@media (max-width: 980px) {
  .cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-day { min-height: 0; }
}

@media (max-width: 560px) {
  .cal-week { grid-template-columns: 1fr; }
  .chart { height: 170px; }
  .chart__value { display: none; }
  .cours-item { flex-direction: column; align-items: stretch; }
  .cal-toolbar { flex-direction: column; align-items: stretch; }
}

@media print {
  .cal-day { break-inside: avoid; }
}
