/* Application Formation Climlab — couleurs et formes reprises de la maquette */

/* Poppins hébergée avec l'application (aucun appel à Google). Licence SIL Open Font License 1.1. */
@font-face { font-family: Poppins; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: Poppins; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/Poppins-Medium.ttf') format('truetype'); }
@font-face { font-family: Poppins; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/Poppins-SemiBold.ttf') format('truetype'); }
@font-face { font-family: Poppins; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/Poppins-Bold.ttf') format('truetype'); }
:root {
  --p: #6C7BDD; --pd: #4655b8; --pdd: #2f3b8f; --t: #73CCD0;
  --pl: #eceefc; --tl: #e2f5f6;
  --ink: #262a45; --muted: #555b7a; --line: #e3e6f5; --bg: #f5f6fc; --field: #bfc4e0;
  --red: #92182b; --red-bg: #fde3e6; --ok: #1d6b45; --ok-bg: #e3f4ea; --warn: #754100; --warn-bg: #fff0d4;
  --surface: #fff; --surface2: #f8f9ff; --accent: #4655b8; --accent-h: #2f3b8f; --shadow: rgba(38,42,69,.18);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Poppins, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 13px; }
a { color: var(--pd); } a:hover { color: var(--pdd); }
h2 { margin: 0 0 12px; font-size: 16px; }
.m0 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.note { margin: 0; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Champs */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
input, select, textarea { font: 400 13px Poppins, system-ui, sans-serif; height: 36px; padding: 0 10px; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); color: var(--ink); }
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pl); border-color: var(--pd); }
label.check { flex-direction: row; align-items: center; gap: 7px; font-size: 13px; color: var(--ink); cursor: pointer; }
label.check input { width: 16px; height: 16px; margin: 0; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: 600 12px Poppins, system-ui, sans-serif; cursor: pointer; text-decoration: none; justify-content: center; }
.btn:hover { background: var(--accent-h); color: #fff; }
.btn2 { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border: 1.5px solid var(--p); border-radius: 9px; background: var(--surface); color: var(--pd); font: 600 12px Poppins, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.btn2:hover { background: var(--pl); }
.btn2.danger, .btn.danger { border-color: var(--red); color: var(--red); }
.btn.danger { background: var(--red); color: #fff; }
.btn:disabled, .btn2:disabled { opacity: .5; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Structure */
.app { display: flex; min-height: 100vh; }
.side { flex: 0 0 165px; background: var(--surface); border-right: 1px solid var(--line); padding: 14px 8px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.logo { display: block; margin: 0 auto 12px; }
.logo img { display: block; width: 60px; height: auto; }
.nav-link { display: flex; justify-content: space-between; align-items: center; padding: 8px 9px; border-radius: 9px; text-decoration: none; font-weight: 500; color: var(--ink); }
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link.on { font-weight: 600; background: var(--pl); color: var(--pd); }
.nav-link.off { color: #9aa0bf; cursor: default; }
.nav-link small { font-size: 10px; font-weight: 500; }
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 50px; }
.content { padding: 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.scroll-x { overflow-x: auto; }
.tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 16px; }

/* Menu du compte */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { width: 24px; height: 24px; border-radius: 24px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.menu-box { position: absolute; right: 0; top: 40px; width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 34px rgba(38,42,69,.18); z-index: 20; overflow: hidden; }
.menu-head { padding: 12px 16px; font-size: 14px; }
.menu-box form { margin: 0; }
.menu-item { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 13px Poppins, system-ui, sans-serif; cursor: pointer; }
.menu-item:hover { background: var(--bg); }

/* Tableaux */
table.grid { width: 100%; border-collapse: collapse; min-width: 760px; }
.grid th, .grid td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.grid thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.grid .num { width: 80px; }
.grid select.cell { min-width: 125px; }
.grid .actions { flex-wrap: nowrap; }
.grid td:first-child { min-width: 220px; }
.grid tr.archived td { opacity: .55; }
.cell { width: 100%; min-width: 0; height: 30px; padding: 0 6px; font: 400 13px Poppins, system-ui, sans-serif; border: 1px solid transparent; border-radius: 7px; background: transparent; color: inherit; }
.cell.strong { font-weight: 600; }
.cell:hover { border-color: var(--field); background: var(--surface); }
.cell:focus { border-color: var(--pd); background: var(--surface); outline: 2px solid var(--pl); }
.cell.saving { border-color: var(--t); }
.cell.saved { background: var(--ok-bg); transition: background .8s; }
.cell.bad { border-color: var(--red); background: var(--red-bg); }
select.cell { padding: 0 2px; }

/* Cartes formateurs */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.tcard.archived { opacity: .55; }
.who { display: flex; gap: 12px; align-items: center; }
.initial { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 46px; background: var(--tl); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.who .name { font-weight: 600; font-size: 14px; }
.facts { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.facts a { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 20px; background: var(--pl); color: var(--pd); font-size: 11px; font-weight: 600; }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.grey { background: var(--bg); color: var(--muted); }

/* Messages */
#flash { display: contents; }
.flash { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; }
.flash.err { background: var(--red-bg); color: var(--red); }
.alert { color: var(--red); background: var(--red-bg); border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; }
.ok-box { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 9px 14px; font-size: 13px; }

/* Popups */
.overlay { position: fixed; inset: 0; background: rgba(38,42,69,.45); z-index: 50; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; }
.dialog { margin: 70px 16px 16px; width: 100%; max-width: 620px; background: var(--surface); border-radius: 18px; box-shadow: 0 24px 70px rgba(38,42,69,.35); }
.dialog.wide { max-width: 760px; }
.dialog.narrow { max-width: 480px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.dlg-head h2 { margin: 0; font-size: 18px; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.x:hover { background: var(--bg); }
.dlg-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface2); border-radius: 0 0 18px 18px; }
.dlg-foot .push { margin-left: auto; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: start; }
.span2 { grid-column: 1 / -1; }
.sec-title { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--pd); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.abs-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 8px; align-items: end; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; }
.row-form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.row-form label { flex: 1 1 260px; }

/* Pages publiques (connexion, invitation) */
body.public { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; }
.public-box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.public-logo { display: block; width: 72px; height: auto; margin: 0 auto 18px; }
.public .btn { height: 38px; }
.log { margin: 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; }
code { font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 5px; }

/* ---------- Lot 2 : en-tête, tableau de bord, sessions ---------- */
[hidden] { display: none !important; }
.top { justify-content: flex-end; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-right: auto; }
.btn2.tall { height: 34px; gap: 7px; }
.btn2.on { background: var(--accent); color: #fff; border-color: var(--pd); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 18px; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.badge.zero { background: var(--ok); }
.menu summary { gap: 8px; padding: 0 10px; }
.menu-box.wide { width: 360px; max-width: 85vw; max-height: 70vh; overflow: auto; }
.menu-item .chip { margin-bottom: 4px; }
.alert-text { display: block; font-size: 12px; }
.period { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.period-nav { display: flex; align-items: center; gap: 12px; }
.period-label { font-size: 17px; font-weight: 700; min-width: 170px; text-align: center; }
.seg { display: flex; gap: 4px; background: var(--pl); padding: 4px; border-radius: 13px; }
.seg button { height: 30px; padding: 0 14px; border: 0; border-radius: 9px; font: 600 12px Poppins, system-ui, sans-serif; cursor: pointer; background: transparent; color: var(--pd); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; }
.kpi.tl { background: var(--tl); }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-big { font-size: 34px; font-weight: 700; line-height: 1.3; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 8px; background: var(--surface); margin: 2px 0 8px; }
.bar-in { height: 8px; border-radius: 8px; background: var(--accent); width: 0; }
.todo { padding: 12px 18px; }
.todo-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.todo-head h2 { margin: 0 6px 0 0; font-size: 15px; }
.count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 20px; background: var(--warn-bg); color: var(--warn); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.count.zero { background: var(--ok-bg); color: var(--ok); }
.todo-panel { margin-top: 10px; }
.todo-item { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12px; }
.todo-item > span { flex: 1 1 360px; }
.todo-item .btn { height: 28px; }
.todo-item .btn2 { height: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.filters label { flex: 1 1 150px; }
.summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; }
table.sessions { min-width: 1180px; }
.sessions th, .sessions td { padding: 5px 4px; font-size: 12px; }
.sessions .cell { font-size: 12px; height: 28px; }
.sessions .c-dates { width: 128px; }
.sessions .c-dates .cell { height: 24px; }
.sessions .c-ins { width: 104px; }
.sessions .c-ind { width: 52px; }
.sessions .c-status { width: 112px; }
.sessions .c-site { width: 96px; }
.sessions .c-gauge { width: 92px; }
.sessions td:first-child { min-width: 0; }
.sessions tr.st-annulee td { opacity: .5; }
.sessions tr.st-realisee td { color: var(--muted); }
.cell.center { text-align: center; padding: 0; }
.stepper { display: flex; align-items: center; gap: 2px; }
.mini { flex: 0 0 24px; width: 24px; height: 24px; padding: 0; border: 1.5px solid var(--p); border-radius: 7px; background: var(--surface); color: var(--pd); font: 700 14px Poppins, system-ui, sans-serif; cursor: pointer; line-height: 1; }
.mini:hover { background: var(--pl); }
.places { display: block; font-size: 10.5px; color: var(--muted); }
.gauge .chip { font-size: 10.5px; padding: 2px 8px; }
tr.group td { padding: 8px 12px; font-size: 13px; font-weight: 700; border-top: 0; }
tr.group td { background: var(--pl); color: var(--pd); }
tr.g-now td { background: var(--tl); color: #145c60; }
tr.g-past td { background: var(--bg); color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 10px; background: currentColor; margin-right: 10px; }
td.empty { padding: 26px; text-align: center; color: var(--muted); }
.results { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow: auto; }
.result { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: 400 13px Poppins, system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.result:hover { background: var(--pl); }
.result .chip { margin-left: auto; }
.sessions .c-form { width: 150px; }
.sessions .c-city { width: 150px; }
.sessions .c-partner { width: 140px; }
.sessions .c-trainer { width: 115px; }

/* Sélecteur de période */
.picker-wrap { position: relative; }
button.period-label { border: 0; background: none; font: 700 17px Poppins, system-ui, sans-serif; color: var(--ink); cursor: pointer; padding: 6px 12px; border-radius: 10px; }
button.period-label::after { content: ' ▾'; font-size: 12px; color: var(--muted); }
button.period-label:hover, button.period-label[aria-expanded="true"] { background: var(--pl); color: var(--pd); }
.picker { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 30; width: 290px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 34px rgba(38,42,69,.18); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pk-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.pk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pk { height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font: 500 12px Poppins, system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.pk:hover { background: var(--pl); }
.pk.now { border-color: var(--t); }
.pk.on { background: var(--accent); border-color: var(--pd); color: #fff; font-weight: 600; }
.pk-today { width: 100%; justify-content: center; }

/* Liens, rappels, marqueurs */
a.ext { font-weight: 600; text-decoration: none; }
a.ext:hover { text-decoration: underline; }
.link-box { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.reminder { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.reminder input[type=checkbox] { width: 16px; height: 16px; margin: 0; }
.reminder .r-text { flex: 1; }
.reminder.done .r-text { text-decoration: line-through; color: var(--muted); }
.reminder-add { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: center; }
.sessions .c-more { white-space: nowrap; }
.flags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.flag { font-size: 12px; cursor: default; text-decoration: none; }
a.flag { cursor: pointer; font-weight: 700; color: var(--pd); }
.c-site a.ext { display: block; font-size: 10.5px; }
.grid .c-url { min-width: 190px; }
.grid .c-url a.ext { display: block; font-size: 11px; }
.btn2:disabled { opacity: .35; cursor: default; } .mini:disabled { opacity: .35; cursor: default; }
.inline-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.linkish { border: 0; background: none; padding: 0; font: 500 12px Poppins, system-ui, sans-serif; color: var(--muted); text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--pd); }
.flash { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.flash .btn2 { height: 28px; }
a.menu-item { text-decoration: none; }

/* Historique et corbeille */
.history { display: flex; flex-direction: column; }
.h-entry { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.h-head { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: 13px; }
.h-type { font-size: 12px; font-weight: 600; color: var(--pd); }
.h-sum { flex: 1 1 320px; }
.h-meta { font-size: 12px; color: var(--muted); }
table.changes { border-collapse: collapse; font-size: 12px; margin-left: 4px; max-width: 900px; }
.changes th, .changes td { text-align: left; padding: 3px 12px 3px 0; border: 0; vertical-align: top; }
.changes th { color: var(--muted); font-weight: 600; }
.changes td.old { color: var(--muted); text-decoration: line-through; }
.more-row { display: flex; justify-content: center; padding-top: 12px; }

/* En-tête et zone de pilotage toujours visibles au défilement */
.top { position: sticky; top: 0; z-index: 40; height: 50px; box-sizing: border-box; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; box-sizing: border-box; }
.sticky-zone { position: sticky; top: 50px; z-index: 35; display: flex; flex-direction: column; gap: 10px; margin: -22px -24px 0; padding: 14px 24px 12px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 6px 12px -10px rgba(38,42,69,.25); }
.sticky-zone .filters.card { margin: 0; padding: 10px 16px; }
.sticky-zone .todo { padding: 8px 16px; }
.sticky-zone .todo-panel { max-height: 32vh; overflow-y: auto; }
.sticky-zone .filters label { font-size: 11px; }
.sticky-zone .filters select { height: 32px; }

/* ---------- Lot 3 : demandes ---------- */
.c-blue { background: #eceefc; color: #4655b8; }
.c-teal { background: #e2f4f5; color: #17606a; }
.c-orange { background: #ffe6d6; color: #8a3b0c; }
.c-yellow { background: #fff0d4; color: #754100; }
.c-green { background: #e3f4ea; color: #1d6b45; }
.c-red { background: #fde3e6; color: #92182b; }
.c-grey { background: #eeeff3; color: #555b7a; }
.c-purple { background: #f3e8fb; color: #6b2c91; }
select.status-sel { font-weight: 600; border: 1px solid transparent; }
.grid select.status-sel { height: 30px; font-size: 12px; width: 100%; min-width: 150px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips-title { flex: 0 0 96px; font-size: 13px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { height: 30px; padding: 0 12px; border-radius: 20px; border: 2px solid transparent; font: 600 12px Poppins, system-ui, sans-serif; cursor: pointer; }
.fchip.on { border-color: currentColor; }
.filters label.grow { flex: 2 1 260px; }
table.requests { min-width: 1120px; }
.requests .c-n { width: 50px; text-align: center; }
.requests .c-next { width: 140px; }
.requests .c-com, .requests .c-st { width: 170px; }
.cell.due { color: var(--red); font-weight: 700; border-color: var(--red-bg); background: var(--red-bg); }
.red-text { color: var(--red); }
button.linkish.strong { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 13px; text-align: left; }
button.linkish.strong:hover { color: var(--pd); text-decoration: underline; }
.warn-box { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 500; }
.sugg { display: flex; flex-direction: column; }
.sugg-item { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.req-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 4px 0; border-top: 1px solid var(--line); }
.chip.c-blue, .chip.c-teal, .chip.c-orange, .chip.c-yellow, .chip.c-green, .chip.c-red, .chip.c-grey, .chip.c-purple { font-size: 11px; }

/* ---------- Villes, lieux, carte ---------- */
.tools .grow-search { flex: 1 1 260px; margin-right: auto; }
img.logo { flex: 0 0 46px; width: 46px; height: 46px; object-fit: contain; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.logo-row { display: flex; gap: 12px; align-items: center; }
img.logo-preview { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; }
a.btn2 { text-decoration: none; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .map-layout { grid-template-columns: 1fr; } }
.map-card { padding: 10px; }
#map { height: 620px; border-radius: 12px; z-index: 1; }
.stats-card .seg { margin-bottom: 10px; display: inline-flex; }
#agg { min-width: 0; }
#agg tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.map-pop { display: flex; flex-direction: column; gap: 3px; font: 400 12px Poppins, system-ui, sans-serif; }
.map-pop img.logo { width: 40px; height: 40px; }
@media (min-width: 1101px) { .map-layout { grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr); } }
#agg th, #agg td { padding: 7px 6px; font-size: 12px; }
#agg .num { width: 56px; text-align: right; }
.bulletin-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.bulletin-row label.grow { flex: 1 1 220px; }
.grid .c-bul .actions { flex-wrap: nowrap; }
.menu-item.on { background: var(--pl); color: var(--pd); font-weight: 600; }
.extra-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.extra-line { font-size: 10.5px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 6px; }
ul.plan { margin: 0; padding-left: 18px; font-size: 12px; max-height: 45vh; overflow: auto; } ul.plan li { padding: 3px 0; }
.intra-note { color: #6b2c91; }
table.places { min-width: 1150px; }
.places td { vertical-align: top; }
.place-name { display: flex; gap: 8px; align-items: center; }
img.logo-sm { width: 28px; height: 28px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); flex: 0 0 28px; }
.places .chip { white-space: nowrap; }
.places td.nowrap, .nowrap { white-space: nowrap; }
.places td:nth-child(5) { min-width: 200px; }
.places .actions { flex-wrap: nowrap; }

/* ---------- Thème sombre (préférence du compte) ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --p: #7e8cf0; --pd: #aab4ff; --pdd: #ccd2ff; --t: #5fbfc4;
  --pl: #2a2f58; --tl: #163c40;
  --ink: #e7e9f6; --muted: #a6abc9; --line: #2f3456; --bg: #121428; --field: #4a5078;
  --red: #ff9aa8; --red-bg: #4b1f29; --ok: #86dcab; --ok-bg: #163a27; --warn: #ffc874; --warn-bg: #3f2e10;
  --surface: #1b1e36; --surface2: #222642; --accent: #5563cf; --accent-h: #6b78e0; --shadow: rgba(0,0,0,.5);
}
[data-theme="dark"] .menu-box, [data-theme="dark"] .picker { box-shadow: 0 14px 34px var(--shadow); }
[data-theme="dark"] tr.g-now td { color: #9fe3e6; }
[data-theme="dark"] .nav-link.off { color: #6c7196; }
[data-theme="dark"] img.logo, [data-theme="dark"] img.logo-sm, [data-theme="dark"] img.logo-preview { background: #fff; }
[data-theme="dark"] .logo img { filter: brightness(1.15); }
[data-theme="dark"] .c-blue, [data-theme="dark"] .c-teal, [data-theme="dark"] .c-orange, [data-theme="dark"] .c-yellow,
[data-theme="dark"] .c-green, [data-theme="dark"] .c-red, [data-theme="dark"] .c-grey, [data-theme="dark"] .c-purple { filter: saturate(.9) brightness(.92); }
[data-theme="dark"] .leaflet-container { background: #1b1e36; }

/* ---------- Icônes, menu latéral en sections ---------- */
.ico { flex: 0 0 auto; display: block; }
.nav-sec { margin: 12px 9px 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.logo + .nav-sec { margin-top: 0; }
.nav-link { justify-content: flex-start; gap: 9px; }
.nav-link .nav-txt { flex: 1 1 auto; }
.nav-link .ico { opacity: .8; }
.nav-link.on .ico { opacity: 1; }
.side { flex-basis: 190px; }
.menu-item { display: flex; align-items: center; gap: 10px; }
.menu-item .ico { color: var(--muted); }
.menu-item .switch { margin-left: auto; width: 32px; height: 18px; border-radius: 18px; background: var(--field); position: relative; transition: background .2s; }
.menu-item .switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 14px; background: #fff; transition: left .2s; }
.menu-item[aria-checked="true"] .switch { background: var(--accent); }
.menu-item[aria-checked="true"] .switch::after { left: 16px; }
#alerts-menu summary { padding: 0 8px; color: var(--pd); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
.burger { display: none; }
.quick .btn .ico { color: #fff; }

/* ---------- Fiche session : titre, onglets ---------- */
.dlg-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.digi-ico { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 7px; background: #1f7a8c; color: #fff; font: 700 14px Poppins, system-ui, sans-serif; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.digi-ico:hover { background: #155e6c; color: #fff; }
.digi-ico.off { background: var(--line); color: var(--muted); cursor: not-allowed; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; margin-top: -4px; }
.tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: 600 12.5px Poppins, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--pd); }
.tab[aria-selected="true"] { color: var(--pd); border-bottom-color: var(--accent); }
.tab-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 18px; background: var(--pl); color: var(--pd); font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; }
.tab-dot { width: 7px; height: 7px; border-radius: 7px; background: var(--t); }
.tab-pan { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Formateurs en liste ---------- */
table.trainers { min-width: 980px; }
.trainers td { vertical-align: top; }
.trainers .initial { flex-basis: 34px; width: 34px; height: 34px; font-size: 13px; }
.trainers .chips { max-width: 360px; }

/* ---------- Tablette et smartphone ---------- */
@media (max-width: 1024px) {
  .burger { display: inline-flex; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; height: 100%; width: 240px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px var(--shadow); }
  body.drawer-open .side { transform: none; }
  .side-shade { position: fixed; inset: 0; z-index: 55; background: rgba(18,20,40,.45); }
  .top { padding: 8px 14px; gap: 8px; }
  .content { padding: 16px 14px; gap: 16px; }
  .sticky-zone { margin: -16px -14px 0; padding: 10px 14px; }
  .quick .q-txt { display: none; }
  .quick .btn, .quick .btn2 { padding: 0 10px; }
  .card { padding: 16px; border-radius: 14px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
  .kpi { padding: 14px 16px; }
  .kpi-big { font-size: 26px; }
  #map { height: 420px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .acc-name { display: none; }
  .top { height: auto; min-height: 50px; }
  .tools { justify-content: stretch; gap: 8px; }
  .tools > * { flex: 1 1 auto; justify-content: center; }
  .filters label { flex: 1 1 100%; }
  .period { gap: 8px; }
  .period-label { min-width: 0; font-size: 15px; }
  .dialog { margin: 0; max-width: none !important; min-height: 100%; border-radius: 0; }
  .dlg-foot { border-radius: 0; position: sticky; bottom: 0; }
  .dlg-head { padding: 14px 16px 0; }
  .dlg-head h2 { font-size: 16px; }
  .dlg-body { padding: 14px 16px; }
  .dlg-foot { padding: 12px 16px; }
  .fgrid { grid-template-columns: 1fr; }
  .abs-row, .extra-row, .reminder-add { grid-template-columns: 1fr; }
  .menu-box { position: fixed; left: 8px; right: 8px; top: 56px; width: auto; }
  .menu-box.wide { width: auto; max-width: none; }
  input, select, textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
  .cell { font-size: 14px; }
  #map { height: 340px; }
  .map-layout { grid-template-columns: 1fr; }
}
