/* =====================================================================
   PBA Connect v2 — feuille de style unique
   Marine PBA + or, couleur de parcours (BTS & Diplômes = bleu, Titres pro = vert d'eau)
   ===================================================================== */
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --ink: #0E2146;
  --ink-2: #18306A;
  --ink-3: #2A4383;
  --gold: #C9A14A;
  --gold-soft: #F4EBD5;
  --paper: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F9FAFC;
  --line: #E0E5EF;
  --line-strong: #C9D1E1;
  --text: #16213B;
  --muted: #5A6681;
  --faint: #8A94AB;
  --classique: #3152CF;
  --classique-soft: #E9EEFD;
  --tp: #0B7F72;
  --tp-soft: #E2F4F1;
  --ok: #1D7A4C;   --ok-soft: #E4F4EB;
  --warn: #9A6200; --warn-soft: #FBF1DC;
  --bad: #BE3A2B;  --bad-soft: #FBE9E6;
  --info: #3152CF; --info-soft: #E9EEFD;
  --p: var(--classique);
  --p-soft: var(--classique-soft);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-pop: 0 12px 32px -8px rgba(14, 33, 70, .28), 0 2px 6px rgba(14, 33, 70, .08);
  --side: 268px;
  --top: 60px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
body.is-tp { --p: var(--tp); --p-soft: var(--tp-soft); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 15px/1.5 var(--font); font-feature-settings: "tnum" 1, "cv01" 1;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--p); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 15px; height: 15px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------------
   Structure : en-tête + navigation horizontale (méga-menu) + pied de page
   Toute la largeur de l'écran est rendue au contenu (PC portables).
   Mobile / applications Android et iOS : barre d'onglets + menu plein écran.
   --------------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: 28px; }
body.app { min-height: 100vh; display: flex; flex-direction: column; }

.hd { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); background: var(--ink); }
.hd-bar { position: relative; color: #fff; }
.hd-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--p); }
.hd-in { height: var(--top); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.brand-t { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.brand small { font-size: .7rem; color: var(--gold); font-weight: 600; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }

/* Sélecteur de parcours : l'élément signature */
.switch { padding: 3px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; background: rgba(255,255,255,.08); border-radius: 9px; flex: none; }
.switch a { display: block; text-align: center; padding: 6px 12px; border-radius: 6px; font-size: .8rem; font-weight: 600; color: #B9C3DB; line-height: 1.2; white-space: nowrap; }
.switch a:hover { color: #fff; text-decoration: none; }
.switch a[aria-current="true"] { color: #fff; background: var(--classique); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.switch a.sw-tp[aria-current="true"] { background: var(--tp); }
.switch-solo { padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: .8rem; font-weight: 600; color: #fff; display: inline-flex; align-items: center; gap: 8px; flex: none; }
.switch-solo i { width: 8px; height: 8px; border-radius: 50%; background: var(--p); box-shadow: 0 0 0 3px rgba(255,255,255,.12); }

.top-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.top-search input[type=search] { width: 100%; min-height: 38px; padding: 8px 34px 8px 38px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: .9rem; transition: background .15s, border-color .15s; }
.top-search input[type=search]::placeholder { color: #9AA7C6; }
.top-search input[type=search]:focus { background: #fff; color: var(--text); border-color: #fff; box-shadow: 0 0 0 3px rgba(201,161,74,.35); }
.top-search input[type=search]:focus::placeholder { color: var(--faint); }
.top-search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9AA7C6; pointer-events: none; }
.top-search:focus-within > .ic { color: var(--faint); }
.kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 .72rem/1 var(--font); color: #9AA7C6; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.top-search:focus-within .kbd { display: none; }
.top-search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; display: none; max-height: 60vh; overflow: auto; color: var(--text); }
.top-search-results.open { display: block; }
.top-search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 7px; color: var(--text); }
.top-search-results a:hover, .top-search-results a.hl { background: var(--surface-2); text-decoration: none; }
.top-search-results small { color: var(--muted); }

.hd-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.top-search + .hd-right { margin-left: 0; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; border: 0; background: transparent; color: #C9D2E8; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.icon-btn .dot { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--ink); }
.me { position: relative; }
.me > button { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; font: inherit; color: #fff; text-align: left; }
.me > button:hover { background: rgba(255,255,255,.08); }
.me-chev { color: #9AA7C6; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none; }
.me-txt { display: flex; flex-direction: column; line-height: 1.15; }
.me-name { font-size: .88rem; font-weight: 600; }
.me-role { font-size: .74rem; color: #9AA7C6; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; display: none; color: var(--text); }
.menu-pop.open { display: block; animation: pop-in .14s ease-out; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .danger { color: var(--bad); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.me-card b { display: block; font-size: .92rem; color: var(--ink); }
.me-card small { display: block; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }

/* Barre de navigation + méga-menu */
.mnav { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(14,33,70,.03), 0 6px 18px -14px rgba(14,33,70,.35); }
.mnav-in { display: flex; align-items: stretch; gap: 2px; height: 50px; }
.mg { position: static; display: flex; }
.mnav-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 0; background: none; font: 600 .9rem/1 var(--font); color: var(--muted); cursor: pointer; position: relative; white-space: nowrap; }
.mnav-btn .ic { width: 17px; height: 17px; }
.mnav-btn .chev { opacity: .5; transition: transform .15s; }
.mnav-btn:hover, .mg.open .mnav-btn { color: var(--ink); text-decoration: none; background: var(--surface-2); }
.mnav-btn.on { color: var(--ink); }
.mnav-btn.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--p); }
.mg.open .chev { transform: rotate(180deg); }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -20px rgba(14,33,70,.35); display: none; max-height: calc(100vh - 140px); overflow-y: auto; }
.mg.open .mega { display: block; animation: pop-in .14s ease-out; }
.mega-in { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding-top: 22px; padding-bottom: 26px; }
.mega-intro { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 12px; background: linear-gradient(160deg, var(--ink), var(--ink-3)); color: #fff; align-self: start; }
.mega-intro b { font-size: 1.15rem; letter-spacing: -.01em; }
.mega-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--p-soft); color: var(--p); flex: none; }
.mega-intro .mega-ic { background: rgba(255,255,255,.12); color: var(--gold); }
.mega-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 24px; align-content: start; }
.mega-sec { font-size: .72rem; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px 10px; }
.mega-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: .9rem; }
.mega-link .ic { width: 17px; height: 17px; color: var(--faint); }
.mega-link span { flex: 1; min-width: 0; }
.mega-link em { font-style: normal; font-size: .68rem; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 2px 7px; border-radius: 99px; }
.mega-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.mega-link:hover .ic { color: var(--p); }
.mega-link.on { background: var(--p-soft); color: var(--ink); font-weight: 600; }
.mega-link.on .ic { color: var(--p); }
.mega-link.soon { color: var(--muted); }

.content { flex: 1; padding-top: 26px; padding-bottom: 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .lead { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs .ic-sm { width: 12px; height: 12px; opacity: .6; }
.parcours-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--p); background: var(--p-soft); padding: 2px 9px; border-radius: 99px; vertical-align: middle; }

/* ---------------------------------------------------------------------
   Blocs
   --------------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 18px; }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-aside { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

/* Chiffres clés : une rangée sobre, pas de cartes multiples */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi b { display: block; font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .84rem; color: var(--muted); }
.kpi a { color: inherit; }
.kpi.alert b { color: var(--bad); }

/* Listes simples */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; }
.list .s { font-size: .84rem; color: var(--muted); }

/* Créneau de cours */
.slot { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: start; }
.slot:first-child { border-top: 0; }
.slot time { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.3; }
.slot time small { display: block; font-weight: 400; color: var(--muted); }
.slot .bar { border-left: 3px solid var(--c, var(--p)); padding-left: 12px; }
.slot.cancelled .bar { opacity: .55; text-decoration: line-through; }

/* ---------------------------------------------------------------------
   Formulaires et boutons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; min-height: 38px;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 .9rem/1.2 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: var(--faint); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-p { background: var(--p); border-color: var(--p); color: #fff; }
.btn-p:hover { filter: brightness(1.08); background: var(--p); }
.btn-danger { color: var(--bad); border-color: #EBC3BD; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date],
input[type=time], input[type=tel], input[type=url], input[type=file], select, textarea {
  width: 100%; padding: 8px 11px; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .92rem;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p-soft); }
input[readonly] { background: var(--surface-2); }
.field { margin-bottom: 14px; }
.field.err input, .field.err select, .field.err textarea { border-color: var(--bad); }
.field .error { color: var(--bad); font-size: .8rem; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--p); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 650; color: var(--ink); margin-bottom: 10px; font-size: 1rem; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }

/* Barre de filtres */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.filters .f { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.filters .f label { margin: 0; font-size: .76rem; color: var(--muted); font-weight: 600; }
.filters .f-grow { flex: 1; min-width: 220px; }
.filters select, .filters input { min-height: 36px; font-size: .88rem; }

/* ---------------------------------------------------------------------
   Tableaux
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-size: .78rem; font-weight: 650; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.t th a { color: inherit; }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:hover td { background: #FAFBFE; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t .who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
table.t .who .avatar { width: 30px; height: 30px; font-size: .7rem; background: var(--p-soft); color: var(--p); }
table.t .who b { display: block; font-weight: 600; color: var(--ink); }
table.t .who small { color: var(--muted); }
table.t td.actions { text-align: right; white-space: nowrap; }
table.t.compact td, table.t.compact th { padding: 7px 10px; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.pager { display: flex; gap: 4px; }
.pager a, .pager span { min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--text); background: var(--surface); font-size: .85rem; }
.pager span.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager a:hover { text-decoration: none; border-color: var(--faint); }

/* Badges d'état */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: #EDF0F6; color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-p { background: var(--p-soft); color: var(--p); }
.b-tp { background: var(--tp-soft); color: var(--tp); }
.b-classique { background: var(--classique-soft); color: var(--classique); }

/* Onglets */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--p); }
.tabs .count { font-weight: 500; color: var(--faint); margin-left: 4px; }

/* Fiche descriptive */
dl.facts { display: grid; grid-template-columns: 190px 1fr; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .86rem; padding: 8px 0; border-top: 1px solid var(--line); }
dl.facts dd { margin: 0; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
dl.facts dt:first-of-type, dl.facts dt:first-of-type + dd { border-top: 0; }

.profile-head { display: flex; gap: 18px; align-items: center; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.2rem; background: var(--p-soft); color: var(--p); }

/* Messages */
.flashes { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow-pop); font-size: .9rem; animation: flash-in .25s ease-out; }
.flash.error { background: var(--bad); }
.flash button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0; }
@keyframes flash-in { from { transform: translateY(8px); opacity: 0; } }
.notice { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--info-soft); color: var(--ink); font-size: .9rem; margin-bottom: 18px; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.ok { background: var(--ok-soft); }
.notice .ic { color: var(--info); margin-top: 1px; }
.notice.warn .ic { color: var(--warn); }
.notice.bad .ic { color: var(--bad); }
.notice.ok .ic { color: var(--ok); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--faint); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); color: var(--text); }
dialog::backdrop { background: rgba(14, 33, 70, .45); }
dialog .panel-head { border-bottom: 1px solid var(--line); }
dialog form[method=dialog] { margin: 0; }

/* Appel : grille de statuts */
.roll td.st { white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 6px 11px; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; border-left: 1px solid var(--line); background: var(--surface); }
.seg label:first-of-type { border-left: 0; }
.seg input:checked + label.s-present { background: var(--ok); color: #fff; }
.seg input:checked + label.s-absent { background: var(--bad); color: #fff; }
.seg input:checked + label.s-retard { background: var(--warn); color: #fff; }
.seg input:checked + label.s-depart_anticipe { background: var(--ink-3); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--p); outline-offset: -2px; }

/* Planning semaine */
.week { display: grid; grid-template-columns: repeat(var(--days, 5), minmax(150px, 1fr)); gap: 0; overflow-x: auto; }
.week .day { border-left: 1px solid var(--line); min-height: 220px; }
.week .day:first-child { border-left: 0; }
.week .day-h { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: 650; color: var(--ink); position: sticky; top: 0; background: var(--surface); }
.week .day-h small { display: block; font-weight: 400; color: var(--muted); }
.week .day-h.today { color: var(--p); box-shadow: inset 0 -2px 0 var(--p); }
.week .ev { margin: 8px; padding: 8px 10px; border-radius: 7px; background: color-mix(in srgb, var(--c, var(--p)) 10%, white); border-left: 3px solid var(--c, var(--p)); font-size: .82rem; line-height: 1.35; }
.week .ev b { display: block; color: var(--ink); font-size: .84rem; }
.week .ev .h { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.week .ev.cancel { opacity: .55; text-decoration: line-through; }
.week .ev.event { background: var(--gold-soft); border-left-color: var(--gold); }
.week .ev a { color: inherit; }

/* Page publique (connexion) */
.public { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); background: var(--surface); }
.public-art {
  position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.public-art::after {
  content: ""; position: absolute; inset: auto -20% -35% auto; width: 80%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(201,161,74,.35), rgba(201,161,74,0) 62%);
}
.public-art .brand { padding: 0; }
.public-art .brand img { width: 44px; height: 44px; border-radius: 10px; }
.public-art .brand b { font-size: 1.2rem; }
.public-art h1 { margin-bottom: 16px; color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; max-width: 14ch; line-height: 1.1; position: relative; z-index: 1; }
.public-art p { color: #B9C4DE; max-width: 42ch; position: relative; z-index: 1; }
.public-art .tracks { display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.public-art .tracks span { padding: 6px 12px; border-radius: 99px; font-size: .82rem; font-weight: 600; border: 1px solid rgba(255,255,255,.18); color: #E3E8F4; }
.public-art .tracks span:first-child { border-color: rgba(49,82,207,.9); background: rgba(49,82,207,.25); }
.public-art .tracks span:last-child { border-color: rgba(11,127,114,.9); background: rgba(11,127,114,.25); }
.public-form { display: grid; place-items: center; padding: 40px 24px; }
.public-form .box { width: 100%; max-width: 380px; }
.public-form h2 { font-size: 1.5rem; margin-bottom: 6px; }
.public-form .lead { color: var(--muted); margin-bottom: 26px; }
.pw { position: relative; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 6px; }
.public-form .alt { margin-top: 20px; font-size: .88rem; text-align: center; color: var(--muted); }
.legal { margin-top: 36px; font-size: .76rem; color: var(--faint); text-align: center; }
.legal a { color: var(--faint); }

/* Impression */
@media print {
  .hd, .ft, .tabbar, .sheet, .filters, .actions, .btn, .flashes { display: none !important; }
  .content { padding: 0; max-width: none; }
  .panel { border: 0; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .mnav-btn { padding: 0 10px; font-size: .86rem; }
  .mnav-btn > .ic { display: none; }
  .mega-in { grid-template-columns: 1fr; }
  .mega-intro { display: none; }
  .hd-in { gap: 12px; }
  .me-txt { display: none; }
}
@media (max-width: 1100px) {
  .grid-aside, .grid-3 { grid-template-columns: 1fr; }
  .brand-t { display: none; }
}
@media (max-width: 920px) {
  .wrap { padding-inline: 16px; }
  .mnav, .hd-switch, .top-search, .me-txt, .me-chev { display: none; }
  .hd-in { height: 56px; gap: 10px; }
  .brand small { display: none; }
  .content { padding-top: 18px; padding-bottom: 28px; }
  .ft { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }
  .flashes { bottom: calc(78px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }
  .grid-2, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .public { grid-template-columns: 1fr; }
  .public-art { padding: 28px 24px; min-height: auto; gap: 24px; }
  .public-art h1 { font-size: 1.6rem; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dd { border-top: 0; padding-top: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi b { font-size: 1.35rem; }
  .page-head.hero { padding: 20px; border-radius: 14px; }
  .page-head.hero h1 { font-size: 1.4rem; }
  .page-head.hero .actions { width: 100%; }
  .page-head.hero .actions .btn { flex: 1; }
}
@media (max-width: 600px) {
  table.t.stack-sm thead { display: none; }
  table.t.stack-sm tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.t.stack-sm td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; }
  table.t.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
  table.t.stack-sm td.actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Appel : champs complémentaires affichés selon le statut choisi */
.roll .rmin, .roll .dmot { display: none; margin-top: 6px; min-height: 30px; padding: 4px 8px; font-size: .82rem; }
.roll .rmin { width: 80px; }
.roll .dmot { width: 100%; }
.roll td.st:has(input[value=retard]:checked) .rmin { display: block; }
.roll td.st:has(input[value=depart_anticipe]:checked) .dmot { display: block; }
.roll .seg label { padding: 6px 10px; }
.actions form { display: inline-flex; margin: 0; }

/* ---------------------------------------------------------------------
   Pied de page
   --------------------------------------------------------------------- */
.ft { margin-top: auto; background: var(--ink); color: #B9C3DB; font-size: .88rem; position: relative; }
.ft::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--classique) 0 33%, var(--gold) 33% 66%, var(--tp) 66%); }
.ft-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 36px; padding-top: 44px; padding-bottom: 36px; }
.ft h3 { color: #fff; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 14px; }
.ft-col > a { display: block; color: #B9C3DB; padding: 4px 0; width: fit-content; }
.ft a:hover { color: #fff; text-decoration: none; }
.ft-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ft-brand img { border-radius: 10px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.ft-brand b { display: block; color: #fff; font-size: 1.05rem; }
.ft-brand small { display: block; color: var(--gold); font-weight: 600; font-size: .74rem; }
.ft-about p { max-width: 40ch; color: #9AA7C6; margin-bottom: 16px; }
.ft-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ft-contact li { display: flex; gap: 10px; align-items: flex-start; }
.ft-contact .ic-sm { color: var(--gold); margin-top: 3px; }
.ft-contact a { color: #D6DDEE; }
.ft-apps { margin-bottom: 22px; display: grid; gap: 8px; }
.ft-apps h3 { margin-bottom: 6px; }
.store { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); color: #fff; width: 100%; max-width: 220px; }
.store:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); }
.store .ic { width: 22px; height: 22px; color: var(--gold); }
.store span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 650; font-size: .95rem; }
.store small { font-weight: 500; font-size: .7rem; color: #9AA7C6; }
.ft-social { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-social a { padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.16); color: #D6DDEE; font-size: .8rem; font-weight: 600; }
.ft-social a:hover { border-color: var(--gold); color: var(--gold); }
.ft-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.ft-bottom-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; font-size: .78rem; color: #8796B9; }
.ft-meta { display: inline-flex; align-items: center; gap: 8px; }
.ft-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
html.in-app .ft-apps { display: none; }
@media (max-width: 1100px) { .ft-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .ft-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; padding-top: 32px; padding-bottom: 24px; }
  .ft-about, .ft-grid > .ft-col:last-child { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------------
   Mobile / applications : barre d'onglets + menu plein écran
   --------------------------------------------------------------------- */
.tabbar {
  display: none; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -18px rgba(14,33,70,.5);
}
.tabbar a, .tabbar button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
  border: 0; background: none; font: 600 .68rem/1.1 var(--font); color: var(--faint); cursor: pointer; border-radius: 10px;
}
.tabbar .ic { width: 22px; height: 22px; }
.tabbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar a:hover { text-decoration: none; }
.tabbar .on { color: var(--p); }
.tabbar .on .ic { transform: translateY(-1px); }

.sheet { position: fixed; inset: 0; z-index: 70; background: var(--paper); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); animation: sheet-in .2s ease-out; }
.sheet[hidden] { display: none; }
@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 6px; background: var(--ink); color: #fff; }
.sheet-head .me-card b { color: #fff; }
.sheet-head .me-card small { color: #9AA7C6; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }
.sheet .switch { display: grid; width: 100%; background: var(--ink); margin-bottom: 12px; }
.sheet .switch a { padding: 10px; font-size: .86rem; }
.sheet .switch-solo { display: flex; background: var(--ink); margin-bottom: 12px; padding: 10px 12px; }
.sheet-search { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.sheet-g { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.sheet-g summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-weight: 650; color: var(--ink); cursor: pointer; }
.sheet-g summary::-webkit-details-marker { display: none; }
.sheet-g summary .chev { margin-left: auto; color: var(--faint); transition: transform .15s; }
.sheet-g[open] summary .chev { transform: rotate(180deg); }
.sheet-g[open] { padding-bottom: 8px; }
.sheet-g .mega-sec { margin: 8px 14px 4px; }
.sheet-g .mega-link { margin: 0 6px; padding: 11px 10px; font-size: .94rem; }
.sheet-foot { margin-top: 16px; display: grid; gap: 4px; }
.sheet-foot a, .sheet-foot button { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; text-align: left; width: 100%; }
.sheet-foot button { color: var(--bad); }
.sheet-foot form { margin: 0; }
.sheet-foot p { margin: 12px 4px 0; }
body.sheet-open { overflow: hidden; }

/* Accueil : bandeau d'en-tête */
.page-head.hero {
  position: relative; overflow: hidden; align-items: center; padding: 26px 28px; border-radius: 16px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--p) 55%, transparent) 0%, transparent 55%), linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%);
  box-shadow: 0 18px 40px -26px rgba(14,33,70,.7);
}
.page-head.hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(201,161,74,.16); pointer-events: none; }
.page-head.hero h1 { color: #fff; font-size: 1.7rem; }
.page-head.hero .lead { color: #C7D0E6; }
.page-head.hero .parcours-tag { background: rgba(255,255,255,.14); color: #fff; }
.page-head.hero .actions { position: relative; z-index: 1; }
.page-head.hero .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.page-head.hero .btn:hover { background: rgba(255,255,255,.18); }
.page-head.hero .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.page-head.hero .btn-primary:hover { background: #D6B266; }

/* Chiffres clés en cartes */
.kpis { gap: 14px; background: none; border: 0; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 16px 20px; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--p); }
.kpi.alert::before { background: var(--bad); }
.kpi + .kpi, .kpi:first-child { border: 1px solid var(--line); }
.panel { border-radius: 14px; box-shadow: 0 1px 2px rgba(14,33,70,.04); }

/* Page « bientôt » */
.soon-page { text-align: center; padding: 48px 24px; }
.soon-ic { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: var(--warn); }
.soon-ic .ic { width: 28px; height: 28px; }
.soon-page h2 { margin-bottom: 10px; }
.soon-page p { max-width: 54ch; margin: 0 auto 22px; }
.soon-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 920px) {
  .tabbar { display: flex; }
  .hd-right { margin-left: auto !important; }
  .brand-t { display: flex; }
  .page-head.hero { padding: 18px; }
  .page-head.hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-head.hero .actions .btn { white-space: normal; text-align: center; min-height: 44px; font-size: .84rem; }
  .page-head.hero::after { width: 180px; height: 180px; right: -70px; bottom: -80px; border-width: 26px; }
}
