:root{
  --bg:#0f1217;
  --panel:#141a22;
  --panel2:#10151d;
  --border:#222a35;
  --text:#e7eaf0;
  --muted:#9aa4b2;
  --muted2:rgba(255,255,255,.45);
  --shadow:0 14px 36px rgba(0,0,0,.55);
  --r:16px;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:radial-gradient(1200px 600px at 20% -10%, #18202c, var(--bg));
  color:var(--text);
  font-family:system-ui, Segoe UI, Roboto, Arial;
  overflow-x:hidden;
}

.wrap{
  max-width:1100px;
  margin:auto;
  padding:18px;
}

/* ================= HEADER ================= */
.topbar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.topbar h1{
  margin:0;
  margin-right:auto;
  font-size:22px;
  letter-spacing:.2px;
}

/* ================= INPUTS ================= */
input, select{
  background:#141a22;
  border:1px solid rgba(255,255,255,.10);
  color:var(--text);
  padding:8px 12px;
  border-radius:12px;
  outline:none;
  min-width:200px;
  height:36px;
}
select{
  background:#141a22;
}
select option{
  background:#141a22;
  color:#e7eaf0;
}
input::placeholder{ color:var(--muted2); }

/* ================= BOUTONS ================= */
.btn{
  height:36px;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  transition:.15s ease;
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  font-size:13px;
}
.btn:hover{ background:rgba(255,255,255,.07); transform:translateY(-1px); }
.btn.primary{
  background:rgba(90,140,255,.18);
  border-color:rgba(90,140,255,.35);
}
.btn.primary:hover{ background:rgba(90,140,255,.26); }
.btn.danger{
  background:rgba(255,120,120,.10);
  border-color:rgba(255,140,140,.28);
  color:rgba(255,160,160,.95);
}
.btn.danger:hover{ background:rgba(255,120,120,.16); }

/* ✅ boutons désactivés (verrouillage) */
.btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  filter:none;
  transform:none;
}

/* ================= STRUCTURE ================= */
.sep{height:1px;background:rgba(255,255,255,.08);margin:14px 0}

.count{
  margin: 8px 0 12px;
  color:var(--muted);
  font-size:14px;
}
.count b{ color:var(--text); }

/* Grille plus dense */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:14px;
}

/* ================= PANELS (nouvelle séance) ================= */
.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--r);
  padding:14px;
  box-shadow: var(--shadow);
}
.panel h3{ margin:0 0 12px; font-size:16px; font-weight:700; }

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
}

/* ================= CARTE ================= */
.card{
  position:relative;
  background:
    linear-gradient(160deg, rgba(255,255,255,.045) 0%, rgba(255,255,255,.018) 100%),
    var(--panel);
  border:1px solid rgba(255,255,255,.07);
  border-top:3px solid var(--cat-c, rgba(255,255,255,.15));
  border-radius:var(--r);
  padding:14px 14px 12px;
  box-shadow:0 4px 18px rgba(0,0,0,.38);
  transition:transform .18s ease, box-shadow .18s ease;
  display:flex;
  flex-direction:column;
  animation:fadeSlideIn .22s ease both;
}
.card:hover{
  transform:translateY(-3px);
  box-shadow:0 16px 44px var(--cat-glow, rgba(0,0,0,.55)), 0 4px 12px rgba(0,0,0,.35);
}

/* En-tête compact (chips) */
.card-head{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:8px;
}

/* ================= BADGES (chips) ================= */
.badges{
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* Badge commun */
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  padding:6px 10px;
  font-weight:700;
  font-size:12px;
  line-height:1;
}
.badge .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:currentColor;
}

/* ✅ badge verrouillage (discret, cohérent) */
.badge-lock{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.18);
  color:var(--muted);
  font-weight:700;
  font-size:12px;
}

/* ===== CATÉGORIE (compact) ===== */
.badge[class^="cat-"]{
  font-size:12px;
  font-weight:800;
  letter-spacing:.3px;
  padding:6px 10px;
}

/* ===== TITRE ===== */
.card-title{
  margin:0 0 12px;
  font-size:15px;
  font-weight:700;
  letter-spacing:.15px;
  line-height:1.35;
  color:var(--text);
}

/* ===== OBJECTIF ===== */
.badge[class^="obj-"]{
  font-size:12px;
  opacity:.95;
}

/* ================= META ================= */
.meta{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}
.meta b{ color:var(--text); font-weight:600; }

/* ================= ACTIONS ================= */
.actions{
  margin-top:12px;
  display:flex;
  gap:10px;
}

/* ================= COULEURS CAT + TEINTE ================= */
.cat-u7{color:#7dd3fc;border-color:#7dd3fc55;--catTint:rgba(125,211,252,.14)}
.cat-u9{color:#a5b4fc;border-color:#a5b4fc55;--catTint:rgba(165,180,252,.14)}
.cat-u11{color:#86efac;border-color:#86efac55;--catTint:rgba(134,239,172,.14)}
.cat-u13{color:#f9a8d4;border-color:#f9a8d455;--catTint:rgba(249,168,212,.14)}
.cat-u15{color:#fca5a5;border-color:#fca5a555;--catTint:rgba(252,165,165,.14)}
.cat-u17{color:#fbbf24;border-color:#fbbf2455;--catTint:rgba(251,191,36,.16)}
.cat-seniors{color:#c4b5fd;border-color:#c4b5fd55;--catTint:rgba(196,181,253,.14)}
.cat-default{color:#9aa4b2;--catTint:rgba(154,164,178,.10)}

/* ================= OBJECTIFS ================= */
.obj-conservation{color:#34d399;border-color:#34d39955}
.obj-transition{color:#60a5fa;border-color:#60a5fa55}
.obj-finition{color:#fb7185;border-color:#fb718555}
.obj-pressing{color:#f97316;border-color:#f9731655}
.obj-defense{color:#a3a3a3;border-color:#a3a3a355}
.obj-prepa{color:#eab308;border-color:#eab30855}

/* ================= TOAST ================= */
.toast{
  position:fixed;
  bottom:16px;
  left:50%;
  transform:translateX(-50%);
  background:rgba(0,0,0,.55);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  padding:10px 14px;
  border-radius:12px;
  box-shadow:0 18px 45px rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  font-size:13px;
}

/* ================= RESPONSIVE ================= */
@media(max-width:900px){
  .grid{grid-template-columns:1fr}
  input, select{min-width:unset; width:100%}
}
/* ================= MODALE APERÇU TEMPLATE ================= */

.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden{
  display: none;
}

.modal-content{
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)),
    linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  width: 720px;
  max-width: calc(100vw - 24px);
  max-height: 80vh;
  overflow-y: auto;
  padding: 18px;
}

.block-preview{
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.block-preview:last-child{
  border-bottom: none;
}

/* ============================================
   NOUVELLES SECTIONS – amélioration interface
   ============================================ */

/* ===== TOPBAR LAYOUT ===== */
.topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
  margin-right:auto;
}
.topbar-left h1{ margin-right:0 }
.topbar-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

/* Badge compteur dans le header */
.count-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  padding:2px 10px;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  min-width:28px;
}

/* Bouton icône carré */
.icon-btn{
  min-width:unset;
  padding:8px 10px;
  font-size:15px;
}

/* ===== ANIMATION CARTES ===== */
@keyframes fadeSlideIn{
  from{opacity:0;transform:translateY(8px)}
  to  {opacity:1;transform:translateY(0)}
}

/* ===== KPI LIGNE DANS LA CARTE ===== */
.card-kpi{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
}
.card-kpi span{
  display:flex;
  align-items:center;
  gap:4px;
}

/* ===== APERÇU NOTES ===== */
.notes-preview{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
  padding:7px 10px;
  background:rgba(255,255,255,.025);
  border-radius:8px;
  border-left:2px solid rgba(255,255,255,.08);
}

/* ===== ÉTAT VIDE ===== */
.empty-state{
  grid-column:1/-1;
  text-align:center;
  padding:52px 24px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
}
.empty-icon{ font-size:38px }
.empty-title{ font-size:17px; font-weight:700 }
.empty-sub{ font-size:13px; color:var(--muted) }

/* ===== ÉTAT CHARGEMENT ===== */
.loading-state{
  grid-column:1/-1;
  text-align:center;
  padding:36px;
  color:var(--muted);
  font-size:14px;
}

/* ===== MODALE NOUVELLE SÉANCE ===== */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.60);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:300;
  padding:16px;
  backdrop-filter:blur(4px);
}
.modal-overlay.hidden{ display:none }

.modal-box{
  background:
    linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02)),
    var(--panel);
  border:1px solid rgba(255,255,255,.13);
  border-radius:var(--r);
  box-shadow:0 28px 64px rgba(0,0,0,.65);
  width:min(560px,100%);
  padding:22px;
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}
.modal-head h2{ margin:0; font-size:17px }

.modal-body input,
.modal-body select{
  width:100%;
  margin-top:6px;
  min-width:unset;
}

.field-label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-top:14px;
}
.field-label:first-child{ margin-top:0 }
.required{ color:#f87171 }

.modal-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr));
  gap:10px;
  margin-top:14px;
}
.field-group{ display:flex; flex-direction:column }
.field-group .field-label{ margin-top:0 }
.field-group input,
.field-group select{ margin-top:4px; min-width:unset }

.modal-foot{
  display:flex;
  gap:8px;
  margin-top:20px;
}

/* ===== TOAST COLORÉ ===== */
.toast-success{
  background:rgba(52,211,153,.15);
  border-color:rgba(52,211,153,.32);
  color:#34d399;
}
.toast-error{
  background:rgba(248,113,113,.15);
  border-color:rgba(248,113,113,.32);
  color:#f87171;
}
.toast-info{
  background:rgba(0,0,0,.55);
  border-color:rgba(255,255,255,.12);
  color:var(--text);
}

/* ============================================
   MODALE NOUVELLE SEANCE – style identique au bloc
   ============================================ */

/* Boite de dialog identique au modal bloc de session.html */
.modal-block-style{
  width:min(560px,100%);
  background:rgba(18,21,27,.98);
  border:1px solid #222a35;
  border-radius:18px;
  padding:14px;
  box-shadow:0 20px 70px rgba(0,0,0,.45);
}

.mbs-label{
  color:var(--muted);
  font-size:12px;
  display:block;
  margin-bottom:4px;
}

.mbs-cols{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
@media(max-width:500px){
  .mbs-cols{grid-template-columns:1fr}
}

.modal-block-style input,
.modal-block-style select{
  width:100%;
  min-width:unset;
}

/* ===== Anciens styles conservés (chips, etc.) ===== */

.modal-new-session{
  width:min(620px,100%);
  padding:0;
  overflow:hidden;
}

.modal-new-session .modal-head{
  padding:18px 22px;
  border-bottom:1px solid rgba(255,255,255,.08);
  margin-bottom:0;
  gap:12px;
}

.modal-head-icon{
  font-size:20px;
  line-height:1;
  flex-shrink:0;
}

.modal-new-session .modal-head h2{
  flex:1;
  font-size:17px;
}

/* Scrollable sections area */
.modal-sections{
  padding:0 22px;
  max-height:62vh;
  overflow-y:auto;
}

.modal-section{
  padding:16px 0;
  border-bottom:1px solid rgba(255,255,255,.06);
}

/* Section label – uppercase small caps */
.msec-label{
  display:block;
  font-size:11px;
  font-weight:700;
  letter-spacing:.7px;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:10px;
}

/* Title input – larger */
.modal-title-input{
  width:100%;
  min-width:unset;
  height:44px;
  font-size:15px;
  padding:10px 14px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  transition:.15s ease;
}
.modal-title-input:focus{
  border-color:rgba(90,140,255,.5);
  background:rgba(90,140,255,.06);
  box-shadow:0 0 0 3px rgba(90,140,255,.12);
}

/* Date input compact */
#newDate{
  min-width:unset;
  height:38px;
  width:auto;
}

/* ===== CHIPS GRID ===== */
.chips-grid{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 13px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  transition:.15s ease;
  user-select:none;
  line-height:1;
}
.chip:hover{
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.08);
  transform:translateY(-1px);
}

.chip-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:currentColor;
  flex-shrink:0;
}

/* Chip selected – category colors */
.chip.cat-u7.selected    {background:rgba(125,211,252,.18);border-color:#7dd3fc88;color:#7dd3fc}
.chip.cat-u9.selected    {background:rgba(165,180,252,.18);border-color:#a5b4fc88;color:#a5b4fc}
.chip.cat-u11.selected   {background:rgba(134,239,172,.18);border-color:#86efac88;color:#86efac}
.chip.cat-u13.selected   {background:rgba(249,168,212,.18);border-color:#f9a8d488;color:#f9a8d4}
.chip.cat-u15.selected   {background:rgba(252,165,165,.18);border-color:#fca5a588;color:#fca5a5}
.chip.cat-u17.selected   {background:rgba(251,191,36,.18); border-color:#fbbf2488;color:#fbbf24}
.chip.cat-seniors.selected{background:rgba(196,181,253,.18);border-color:#c4b5fd88;color:#c4b5fd}
.chip.cat-default.selected{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.3);color:var(--text)}

/* Chip selected – objective colors */
.chip.obj-conservation.selected{background:rgba(52,211,153,.15); border-color:#34d39988;color:#34d399}
.chip.obj-transition.selected  {background:rgba(96,165,250,.15); border-color:#60a5fa88;color:#60a5fa}
.chip.obj-finition.selected    {background:rgba(251,113,133,.15);border-color:#fb718588;color:#fb7185}
.chip.obj-pressing.selected    {background:rgba(249,115,22,.15); border-color:#f9731688;color:#f97316}
.chip.obj-defense.selected     {background:rgba(163,163,163,.15);border-color:#a3a3a388;color:#a3a3a3}
.chip.obj-prepa.selected       {background:rgba(234,179,8,.15);  border-color:#eab30888;color:#eab308}
.chip.obj-default.selected     {background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.3);color:var(--text)}

/* Footer */
.modal-new-session .modal-foot{
  padding:16px 22px;
  margin-top:0;
  border-top:1px solid rgba(255,255,255,.08);
}

.btn-create{
  height:40px;
  font-size:14px;
  font-weight:700;
  padding:10px 22px;
  border-radius:12px;
  letter-spacing:.2px;
}

/* ===================================================================
   CARTE SEANCE – NOUVEAU DESIGN PROFESSIONNEL
   =================================================================== */

/* --- Couleurs par catégorie (border-top + glow au hover) --- */
.card[data-cat="u7"]     {--cat-c:#7dd3fc;--cat-glow:rgba(125,211,252,.22);--cat-bg:rgba(125,211,252,.09)}
.card[data-cat="u9"]     {--cat-c:#a5b4fc;--cat-glow:rgba(165,180,252,.22);--cat-bg:rgba(165,180,252,.09)}
.card[data-cat="u11"]    {--cat-c:#86efac;--cat-glow:rgba(134,239,172,.22);--cat-bg:rgba(134,239,172,.09)}
.card[data-cat="u13"]    {--cat-c:#f9a8d4;--cat-glow:rgba(249,168,212,.22);--cat-bg:rgba(249,168,212,.09)}
.card[data-cat="u15"]    {--cat-c:#fca5a5;--cat-glow:rgba(252,165,165,.22);--cat-bg:rgba(252,165,165,.09)}
.card[data-cat="u17"]    {--cat-c:#fbbf24;--cat-glow:rgba(251,191,36,.24); --cat-bg:rgba(251,191,36,.09)}
.card[data-cat="seniors"]{--cat-c:#c4b5fd;--cat-glow:rgba(196,181,253,.22);--cat-bg:rgba(196,181,253,.09)}
.card[data-cat="default"]{--cat-c:rgba(154,164,178,.45);--cat-glow:rgba(0,0,0,.35);--cat-bg:rgba(154,164,178,.06)}

/* --- Chips compacts (en-tête de carte) --- */
.sc{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:3px 9px 3px 7px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.15px;
  line-height:1.6;
  border:1px solid transparent;
}
.sc .dot{
  width:6px;
  height:6px;
  border-radius:50%;
  flex-shrink:0;
  background:currentColor;
}
/* Chip catégorie : fond teinté depuis les vars de la carte */
.sc-cat{
  background:var(--cat-bg, rgba(255,255,255,.05));
  color:var(--cat-c, var(--muted));
  border-color:var(--cat-c, rgba(255,255,255,.14));
}
/* Chip objectif */
.sc-obj{
  background:rgba(255,255,255,.04);
  border-color:rgba(255,255,255,.10);
  color:var(--muted);
}
.sc-obj.obj-conservation{color:#34d399;border-color:rgba(52,211,153,.28)}
.sc-obj.obj-transition  {color:#60a5fa;border-color:rgba(96,165,250,.28)}
.sc-obj.obj-finition    {color:#fb7185;border-color:rgba(251,113,133,.28)}
.sc-obj.obj-pressing    {color:#f97316;border-color:rgba(249,115,22,.28)}
.sc-obj.obj-defense     {color:#a3a3a3;border-color:rgba(163,163,163,.28)}
.sc-obj.obj-prepa       {color:#eab308;border-color:rgba(234,179,8,.28)}
/* Chip verrouillage */
.sc-lock{
  margin-left:auto;
  background:rgba(255,255,255,.04);
  border-color:rgba(255,255,255,.14);
  color:var(--muted);
  padding:3px 8px;
  font-size:11px;
}

/* Chip note étoile */
.sc-rating{
  margin-left:auto;
  background:rgba(245,158,11,.12);
  border-color:rgba(245,158,11,.3);
  color:#fbbf24;
  font-size:11px;font-weight:600;
}

/* --- Ligne de stats (3 cellules) --- */
.card-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1px;
  background:rgba(255,255,255,.06);
  border-radius:10px;
  overflow:hidden;
  margin-bottom:10px;
}
.stat-cell{
  background:rgba(255,255,255,.03);
  padding:7px 10px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.stat-val{
  font-size:13px;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.stat-lbl{
  font-size:9px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
}

/* --- Pied de carte --- */
.card-foot{
  display:flex;
  gap:6px;
  align-items:center;
  margin-top:auto;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.06);
}
.card-open{
  flex:1;
  justify-content:center;
  font-weight:600;
  letter-spacing:.15px;
  background:rgba(var(--cat-c-raw, 90,140,255),.12);
  border-color:rgba(var(--cat-c-raw, 90,140,255),.28);
}
.card-open:hover{
  background:rgba(var(--cat-c-raw, 90,140,255),.20);
}
.card-actions{display:flex;gap:4px}
.card-actions .btn{
  min-width:unset;
  padding:8px 10px;
  font-size:14px;
}

/* ===================== VIEW TOGGLE ===================== */
.view-toggle{
  display:flex;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  overflow:hidden;
}
.vtbtn{
  border-radius:0;
  border:none;
  padding:7px 11px;
  opacity:.42;
  transition:opacity .15s, background .15s;
  min-width:unset;
}
.vtbtn:hover{ opacity:.75 }
.vtbtn.active{
  opacity:1;
  background:rgba(255,255,255,.10);
}

/* ===================== TIMELINE VIEW ===================== */
.timeline{
  display:flex;
  flex-direction:column;
  max-width:860px;
  margin:0 auto;
  padding-bottom:60px;
}
.tl-month-group{ margin-bottom:4px }

.tl-month-header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:28px 0 14px;
  position:sticky;
  top:0;
  background:linear-gradient(to bottom, #0f1217 82%, transparent);
  z-index:2;
}
.tl-month-name{
  font-size:11px;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
  white-space:nowrap;
}
.tl-month-sep{
  flex:1;
  height:1px;
  background:var(--border);
}
.tl-month-count{
  font-size:11px;
  color:var(--muted);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:999px;
  padding:2px 9px;
  white-space:nowrap;
}

/* item grid: date | spine | card */
.tl-item{
  display:grid;
  grid-template-columns:52px 22px 1fr;
  gap:0 14px;
  align-items:start;
  animation:tl-fade-in .32s ease both;
}

.tl-date-col{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  padding-top:17px;
}
.tl-day{
  font-size:26px;
  font-weight:800;
  line-height:1;
  color:var(--text);
  font-variant-numeric:tabular-nums;
}
.tl-weekday{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  margin-top:3px;
}

.tl-spine{
  display:flex;
  flex-direction:column;
  align-items:center;
  height:100%;
}
.tl-dot{
  width:13px;
  height:13px;
  border-radius:50%;
  background:var(--tl-color,#60a5fa);
  margin-top:21px;
  flex-shrink:0;
  box-shadow:0 0 10px var(--tl-color,#60a5fa);
  transition:transform .18s;
}
.tl-item:hover .tl-dot{ transform:scale(1.4) }
.tl-connector{
  width:2px;
  flex:1;
  background:linear-gradient(to bottom, rgba(255,255,255,.08) 0%, transparent 100%);
  margin-top:5px;
  min-height:18px;
}

.tl-card{
  background:var(--panel);
  border:1px solid var(--border);
  border-left:3px solid var(--tl-color,#60a5fa);
  border-radius:12px;
  padding:13px 16px 15px;
  margin-bottom:14px;
  cursor:pointer;
  transition:transform .15s, box-shadow .15s;
}
.tl-card:hover{
  transform:translateX(4px);
  box-shadow:0 6px 28px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.05);
}

.tl-card-head{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:8px;
  flex-wrap:wrap;
}
.tl-title{
  font-size:15px;
  font-weight:700;
  color:var(--text);
  margin:0 0 7px;
  line-height:1.3;
}
.tl-notes{
  font-size:12px;
  color:var(--muted);
  margin:0 0 9px;
  line-height:1.5;
}
.tl-meta{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  align-items:center;
}
.tl-meta-item{
  display:flex;
  align-items:center;
  gap:5px;
  font-size:12px;
  color:var(--muted);
}
.tl-meta-item b{
  color:var(--text);
  font-weight:600;
}
.tl-card-foot{
  display:flex;
  justify-content:flex-end;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.05);
}

@keyframes tl-fade-in{
  from{ opacity:0; transform:translateX(-12px) }
  to{   opacity:1; transform:translateX(0) }
}

@media(max-width:560px){
  .tl-item{ grid-template-columns:40px 18px 1fr; gap:0 10px }
  .tl-day{ font-size:20px }
  .tl-date-col{ padding-top:14px }
  .tl-dot{ margin-top:17px }
}

/* ============================================================
   RESPONSIVE — Mobile & Tablette
   900px = tablette  |  640px = grand phone  |  420px = petit phone
   ============================================================ */

/* Utilitaire scroll horizontal pour tables */
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }

/* --- Wrap --- */
@media(max-width:640px){
  .wrap{ padding:10px; }
}

/* --- Topbar --- */
@media(max-width:640px){
  .topbar{ padding:10px 12px; gap:6px; }
  .topbar h1{ font-size:17px; }
  .topbar-right{ gap:5px; flex-wrap:wrap; }
}

/* --- Inputs & Selects --- */
@media(max-width:640px){
  .wrap input,
  .wrap select{
    min-width:unset;
  }
}

/* --- Boutons (taille reduite petits ecrans) --- */
@media(max-width:420px){
  .btn{
    height:32px;
    padding:5px 9px;
    font-size:12px;
  }
}

/* --- Panel --- */
@media(max-width:640px){
  .panel{ padding:10px; }
}

/* --- Modal : plein ecran sur petits phones --- */
@media(max-width:480px){
  .modal-overlay{
    align-items:flex-end;
    padding:0;
  }
  .modal-box{
    width:100%;
    max-width:100%;
    border-radius:16px 16px 0 0;
    padding:18px 14px 24px;
    max-height:92vh;
    overflow-y:auto;
  }
}

/* --- Grille cartes (deja auto-fill, juste ajustement min) --- */
@media(max-width:420px){
  .grid{ grid-template-columns:1fr; }
}

/* --- .sep entre sections --- */
@media(max-width:640px){
  .sep{ margin:10px 0; }
}
