/* ===== Salle de Conférences · CAPEF ===== */
:root {
  --bg: #f4f1e8; --surface: #fffdf8; --ink: #1c2a22; --muted: #68756c; --line: #e2dccb;
  --green: #1f5a3f; --green-d: #123a28; --green-dd: #0c2a1c; --green-l: #e3efe7;
  --gold: #c8962e; --gold-d: #96701a; --gold-l: #f7edd2;
  --red: #b3402d; --red-l: #f8e3de; --blue: #2d5f86; --blue-l: #e2edf6; --grey: #8a948d; --grey-l: #ebeae4;
  --r: 12px; --shadow: 0 1px 2px rgba(18,58,40,.06), 0 6px 18px rgba(18,58,40,.07);
  --serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --HH: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
body.noscroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .xs { font-size: .75rem; }
.hide { display: none !important; }

/* ----- Boutons ----- */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .95rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: #f3efe2; border-color: #d3cbb4; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1f1606; }
.btn.gold:hover { background: #d9a53d; }
.btn.danger { color: var(--red); border-color: #e7c1b8; }
.btn.danger:hover { background: var(--red-l); }
.btn.solid-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { padding: .32rem .6rem; font-size: .8rem; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: .4rem; border-radius: 8px; line-height: 0; color: inherit; }
.icon-btn:hover { background: rgba(0,0,0,.06); }

/* ----- Formulaires ----- */
label.f { display: block; font-size: .8rem; font-weight: 600; color: #3b4a41; margin-bottom: .9rem; }
label.f > span.req { color: var(--red); }
.in, label.f input:not([type=checkbox]):not([type=radio]), label.f select, label.f textarea, .in-sel {
  display: block; width: 100%; margin-top: .25rem; padding: .55rem .7rem; border: 1px solid #cfc8b3; border-radius: 9px; background: #fff; font-weight: 400; font-size: .95rem; }
.in-sel { margin-top: 0; width: auto; padding: .45rem .6rem; font-size: .85rem; }
label.f textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.row { display: flex; gap: .8rem; flex-wrap: wrap; } .row > * { flex: 1 1 140px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.chip span { display: inline-block; padding: .3rem .65rem; border: 1px solid #cfc8b3; border-radius: 99px; font-size: .8rem; background: #fff; font-weight: 500; }
.chip input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.chip input:focus-visible + span { outline: 2px solid var(--gold); }
.chip input:disabled + span { opacity: .45; }
.check { display: flex; gap: .5rem; align-items: center; font-size: .9rem; margin: .4rem 0; font-weight: 500; }

/* ----- Écran de connexion / installation ----- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: linear-gradient(160deg, var(--green-dd), var(--green) 70%); color: #f2efe2; padding: 3rem 3.2rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(200,150,46,.45); box-shadow: 0 0 0 40px rgba(200,150,46,.07), 0 0 0 90px rgba(200,150,46,.05); }
.auth-art h1 { font-size: 2.3rem; line-height: 1.1; margin: 1.2rem 0 .8rem; color: #fff; }
.auth-art p { max-width: 30rem; color: #cfe0d5; }
.auth-art .gold { color: var(--gold); }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .8rem; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: .7rem; align-items: flex-start; font-size: .93rem; color: #dbe8df; }
.auth-points b { color: #fff; display: block; }
.auth-points svg { flex: none; margin-top: 2px; color: var(--gold); }
.auth-form { display: grid; place-items: center; padding: 2rem 1.2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.auth-tabs { display: flex; gap: 1.2rem; margin: 1.2rem 0; border-bottom: 1px solid var(--line); }
.auth-tabs button { background: none; border: 0; padding: .5rem 0; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tabs button.on { color: var(--green); border-color: var(--gold); }
.logo { display: inline-flex; align-items: center; gap: .7rem; font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--gold); display: grid; place-items: center; color: var(--green-dd); flex: none; }

/* ----- Structure ----- */
.shell { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.side { background: var(--green-dd); color: #d8e6dc; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1.1rem .8rem; z-index: 30; }
.side .logo { color: #fff; padding: .2rem .5rem 1.1rem; }
.side .logo small { display: block; font-family: var(--sans); font-weight: 400; font-size: .7rem; color: #9db5a5; letter-spacing: .02em; }
.nav-group { margin-top: .9rem; }
.nav-group > .t { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); padding: 0 .7rem .35rem; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 9px; color: #cfe0d5; text-decoration: none; font-size: .92rem; font-weight: 500; margin-bottom: 2px; position: relative; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(200,150,46,.16); color: #fff; font-weight: 600; }
.nav a.on::before { content: ''; position: absolute; left: -.8rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.nav a svg { flex: none; opacity: .85; }
.badge { margin-left: auto; background: var(--gold); color: #251a05; font-size: .7rem; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; }
.badge.red { background: var(--red); color: #fff; }
.user-card { margin-top: auto; padding: .8rem .6rem 0; border-top: 1px solid rgba(255,255,255,.1); display: flex; gap: .7rem; align-items: center; font-size: .85rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--green-dd); display: grid; place-items: center; font-weight: 800; flex: none; }
.user-card .nm { color: #fff; font-weight: 600; line-height: 1.2; } .user-card .rl { color: #9db5a5; font-size: .75rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.5rem; border-bottom: 1px solid var(--line); background: rgba(244,241,232,.92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.top .burger { display: none; }
.top .ttl { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view { padding: 1.5rem; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.sync { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 600; padding: .25rem .6rem; border-radius: 99px; background: var(--grey-l); color: #4b574f; white-space: nowrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); }
.sync.ok i { background: #2d9a5e; } .sync.ok { background: var(--green-l); color: var(--green-d); }
.sync.wait i, .sync.off i { background: var(--gold); } .sync.off { background: var(--gold-l); color: #6b4d0a; }
.sync.err i { background: var(--red); } .sync.err { background: var(--red-l); color: var(--red); }

/* ----- Cartes & grilles ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; }
.card + .card { margin-top: 1rem; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; box-shadow: var(--shadow); position: relative; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green); }
.kpi.gold::before { background: var(--gold); } .kpi.red::before { background: var(--red); } .kpi.blue::before { background: var(--blue); }
.kpi .n { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.kpi .l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.cols2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
.cols2 > .card { margin: 0; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.05rem; margin-bottom: .2rem; }
.bar { height: 8px; background: var(--grey-l); border-radius: 99px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }

table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: .6rem; border-bottom: 1px solid #efe9d9; vertical-align: top; }
table.t tr:hover td { background: #faf6ea; }
.tbl-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.pill.confirmee { background: var(--green-l); color: var(--green-d); }
.pill.en_attente { background: var(--gold-l); color: #7a5608; }
.pill.refusee { background: var(--red-l); color: var(--red); }
.pill.annulee { background: var(--grey-l); color: #5a645d; }
.pill.terminee { background: var(--blue-l); color: var(--blue); }
.pill.admin { background: var(--green-d); color: #fff; } .pill.user { background: var(--grey-l); color: #4b574f; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .72rem; font-weight: 700; background: hsl(var(--h) 45% 92%); color: hsl(var(--h) 55% 28%); }

/* Cartes de réunion (listes) */
.mt { display: grid; grid-template-columns: 74px 1fr auto; gap: .9rem; padding: .85rem 0; border-bottom: 1px solid #efe9d9; align-items: start; }
.mt:last-child { border-bottom: 0; }
.mt .when { text-align: center; border-radius: 10px; padding: .4rem .2rem; background: hsl(var(--h) 40% 94%); border: 1px solid hsl(var(--h) 30% 85%); }
.mt .when b { display: block; font-family: var(--serif); font-size: 1.25rem; line-height: 1; }
.mt .when span { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mt .what { min-width: 0; cursor: pointer; }
.mt .what h3 { font-family: var(--sans); font-weight: 650; margin-bottom: .15rem; }
.mt .what .meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .2rem .8rem; }
.mt .act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem; }
.mt.notif .what h3::after { content: 'Nouveau'; margin-left: .5rem; font-size: .65rem; background: var(--gold); color: #251a05; padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
.day-sep { font-family: var(--serif); font-weight: 700; padding: .9rem 0 .2rem; color: var(--green-d); border-bottom: 2px solid var(--gold-l); }

/* ----- Agenda ----- */
.tools { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: .45rem .8rem; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.seg button.on { background: var(--green); color: #fff; }
.range-title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; min-width: 12ch; }
.grid-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 230px); min-height: 320px; }
.grid { min-width: calc(var(--cols) * 128px + 54px); }
.g-head { display: grid; grid-template-columns: 54px repeat(var(--cols), 1fr); position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.g-head > div { padding: .55rem .4rem; text-align: center; font-weight: 700; font-size: .85rem; border-left: 1px solid #efe9d9; }
.g-head > div small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.g-head > div.today { background: var(--gold-l); }
.g-head > div.off { color: var(--muted); background: #f5f2e8; }
.g-col.off { background-color: #f6f3ea; }
.g-col.today.off { background-color: #fdf6e4; }
.g-body { display: grid; grid-template-columns: 54px repeat(var(--cols), 1fr); }
.g-gut { position: relative; }
.g-gut span { position: absolute; right: 6px; font-size: .7rem; color: var(--muted); transform: translateY(-50%); }
.g-col { position: relative; border-left: 1px solid #efe9d9; cursor: cell;
  background-image: linear-gradient(to bottom, #efe9d9 1px, transparent 1px); background-size: 100% var(--HH); }
.g-col.today { background-color: #fffaeb; }
.ev { position: absolute; border: 0; text-align: left; cursor: pointer; padding: 3px 6px; overflow: hidden; border-radius: 7px; font-size: .74rem; line-height: 1.25;
  background: hsl(var(--h) 50% 91%); color: hsl(var(--h) 60% 20%); border-left: 4px solid hsl(var(--h) 50% 38%); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ev:hover { filter: brightness(.97); z-index: 3; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.ev b { display: block; font-weight: 700; }
.ev .ti { font-weight: 600; } .ev .sub { opacity: .75; display: block; }
.ev.nw { font-size: .68rem; padding: 2px 4px; line-height: 1.2; }
.ev.nw b { font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ev.nw .ti { display: block; }
.ev.en_attente { background: repeating-linear-gradient(135deg, hsl(var(--h) 50% 94%), hsl(var(--h) 50% 94%) 6px, #fff 6px, #fff 12px); border: 1px dashed hsl(var(--h) 45% 45%); border-left: 4px dashed hsl(var(--h) 45% 45%); }
.ev.modif::after { content: '⟳'; position: absolute; right: 4px; top: 1px; font-weight: 800; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.month .dh { padding: .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); text-align: center; background: #faf6ea; }
.month .dc { min-height: 104px; border-right: 1px solid #efe9d9; border-bottom: 1px solid #efe9d9; padding: .3rem; cursor: pointer; min-width: 0; }
.month .dc:nth-child(7n) { border-right: 0; }
.month .dc.other { background: #f8f5ec; color: #aaa; } .month .dc.today { background: var(--gold-l); } .month .dc.off { background: #f5f2e8; }
.month .dc .dn { font-size: .78rem; font-weight: 700; margin-bottom: 2px; }
.mchip { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font-size: .7rem; padding: 1px 5px; margin-bottom: 2px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: hsl(var(--h) 50% 90%); color: hsl(var(--h) 60% 20%); border-left: 3px solid hsl(var(--h) 50% 38%); }
.mchip.en_attente { background: #fff; border: 1px dashed hsl(var(--h) 45% 45%); }
.more { font-size: .7rem; color: var(--muted); font-weight: 600; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: .7rem; align-items: center; }
.legend i { display: inline-block; width: 22px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.legend .l1 { background: hsl(150 50% 88%); border-left: 4px solid hsl(150 50% 38%); }
.legend .l2 { background: repeating-linear-gradient(135deg, hsl(150 50% 92%), hsl(150 50% 92%) 4px, #fff 4px, #fff 8px); border: 1px dashed hsl(150 45% 40%); }

/* ----- Disponibilités ----- */
.dispo { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.dispo .dcol { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem; }
.dispo .dcol.today { border-color: var(--gold); }
.dispo h3 { font-family: var(--serif); margin-bottom: .5rem; }
.slot { display: block; width: 100%; text-align: left; margin-bottom: .35rem; padding: .4rem .6rem; border-radius: 8px; border: 1px solid #b6d3c0; background: var(--green-l); color: var(--green-d); font-weight: 600; font-size: .83rem; cursor: pointer; }
.slot:hover { background: #d3e7da; }
.busy { font-size: .78rem; color: var(--muted); padding: .25rem .1rem; border-top: 1px dashed var(--line); }

/* ----- Contrôle en direct dans le formulaire ----- */
.live { border-radius: 10px; padding: .7rem .8rem; background: #f6f3e8; border: 1px solid var(--line); font-size: .85rem; margin: .2rem 0 1rem; }
.chk { display: flex; gap: .5rem; margin: .25rem 0; align-items: flex-start; }
.chk::before { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; margin-top: 1px; }
.chk.ok::before { content: '✓'; background: #2d9a5e; } .chk.err::before { content: '!'; background: var(--red); }
.chk.warn::before { content: '!'; background: var(--gold); color: #251a05; } .chk.info::before { content: 'i'; background: var(--blue); }
.live .free { margin-top: .5rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.live .free button { border: 1px solid #b6d3c0; background: var(--green-l); border-radius: 99px; padding: .15rem .6rem; cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--green-d); }

/* ----- Modales & toasts ----- */
.modal-back { position: fixed; inset: 0; background: rgba(12,42,28,.55); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 3vh 1rem; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: pop .18s; margin-bottom: 3vh; }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.3rem .6rem; }
.modal-b { padding: .4rem 1.3rem 1.1rem; }
.modal-f { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; padding: .9rem 1.3rem; border-top: 1px solid var(--line); background: #faf6ea; border-radius: 0 0 16px 16px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: .5rem .9rem; font-size: .9rem; margin: .6rem 0; }
.dl dt { color: var(--muted); font-weight: 600; } .dl dd { margin: 0; }
.alert { padding: .7rem .9rem; border-radius: 10px; font-size: .86rem; margin: .7rem 0; border: 1px solid; }
.alert.warn { background: var(--gold-l); border-color: #e6cf93; color: #5d4308; }
.alert.err { background: var(--red-l); border-color: #e9bdb3; color: #7c2a1c; }
.alert.ok { background: var(--green-l); border-color: #bcd8c7; color: var(--green-d); }
.alert.info { background: var(--blue-l); border-color: #bcd3e6; color: #1f4565; }
.timeline { border-left: 2px solid var(--line); margin: .5rem 0 0 .4rem; padding-left: .9rem; font-size: .82rem; }
.timeline div { margin-bottom: .5rem; position: relative; } .timeline div::before { content: ''; position: absolute; left: -1.2rem; top: .35rem; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .5rem; }
.toast { background: var(--green-dd); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: .9rem; max-width: 360px; animation: pop .2s; border-left: 4px solid var(--gold); }
.toast.err { background: var(--red); border-color: #ffb4a6; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.rules { counter-reset: r; display: grid; gap: .8rem; padding: 0; list-style: none; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 40px 1fr; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; }
.rules li::before { content: counter(r); width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; }
.rules b { display: block; } .rules span { color: var(--muted); font-size: .88rem; }
.flow { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0 1.2rem; }
.flow div { flex: 1 1 180px; background: var(--green-l); border-radius: 10px; padding: .7rem .9rem; font-size: .85rem; } .flow b { display: block; color: var(--green-d); }

.print-head { display: none; }

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; } .auth-art { padding: 1.6rem; } .auth-art h1 { font-size: 1.6rem; } .auth-points { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .top .burger { display: inline-block; } .top { padding: .6rem .9rem; }
  .view { padding: 1rem .8rem 5rem; }
  .cols2 { grid-template-columns: 1fr; }
  .mt { grid-template-columns: 58px 1fr; } .mt .act { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .dl { grid-template-columns: 1fr; gap: .1rem; } .dl dd { margin-bottom: .5rem; }
  .month .dc { min-height: 72px; } .mchip { font-size: .62rem; }
  .grid-wrap { max-height: none; }
}
@media (max-width: 560px) { .sync { display: none; } .btn { padding: .5rem .75rem; } .top .btn span.lbl { display: none; } }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .side, .top, .tools, .no-print, #toasts, .legend { display: none !important; }
  .shell { display: block; } .view { padding: 0; max-width: none; }
  .print-head { display: block; text-align: center; margin-bottom: 8px; border-bottom: 2px solid #123a28; padding-bottom: 6px; }
  .print-head h1 { font-size: 15px; } .print-head p { margin: 2px 0 0; }
  .grid-wrap { max-height: none; overflow: visible; box-shadow: none; } .grid { min-width: 0; }
  .card, .kpi { box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===================================================================
   Version 2 — identité CAPEF, trois niveaux d'accès, notifications
   =================================================================== */

/* --- Emblème et marque --- */
.brand { display: flex; align-items: center; gap: .75rem; }
.brand .emblem { width: 44px; height: 54px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.brand b { font-family: var(--serif); font-size: 1.02rem; line-height: 1.15; display: block; }
.brand small { display: block; font-size: .68rem; color: var(--muted); letter-spacing: .01em; margin-top: 2px; }
.auth-art .brand b, .auth-art .brand small { color: #fff; }
.auth-art .brand small { color: #9db5a5; }
.auth-art .emblem { background: #fffdf8; border-radius: 8px; padding: 3px; }
.side-brand { padding: .2rem .5rem 1rem; }
.side-brand b { color: #fff; } .side-brand small { color: #9db5a5; }
.side-brand .emblem { background: #fffdf8; border-radius: 8px; padding: 2px; width: 40px; height: 48px; }

/* --- Niveaux d'accès --- */
.role-chip { display: inline-block; padding: .14rem .6rem; border-radius: 99px; font-size: .7rem; font-weight: 700; white-space: nowrap; letter-spacing: .01em; }
.role-chip.user  { background: var(--grey-l); color: #44504a; }
.role-chip.csc   { background: var(--gold-l); color: #70500a; }
.role-chip.admin { background: var(--green-d); color: #fff; }
.top .role-chip { display: none; }
@media (min-width: 1100px) { .top .role-chip { display: inline-block; } }
.roles-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.roles-legend > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; box-shadow: var(--shadow); }
.roles-legend p { margin: .4rem 0 0; font-size: .82rem; color: var(--muted); }

/* --- Barre supérieure --- */
.top .grow, .tools .grow { flex: 1; }
.bell-btn { position: relative; }
.bell-btn .dot { position: absolute; top: 1px; right: 1px; background: var(--red); color: #fff; font-size: .62rem; font-weight: 800; font-style: normal; min-width: 15px; height: 15px; border-radius: 99px; display: grid; place-items: center; padding: 0 3px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--green); opacity: 0; transition: opacity .2s; flex: none; }
.spin.on { opacity: 1; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: .8rem; color: var(--muted); }
.boot .spin { width: 26px; height: 26px; }

/* --- Formulaires et boutons --- */
.btn.wide { width: 100%; justify-content: center; }
.btn.ghost.wide { color: var(--muted); }
.icon-btn.danger { color: var(--red); }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
code.brk { word-break: break-all; font-size: .74rem; }
.link { background: none; border: 0; color: var(--green); font-size: .74rem; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; }
.right { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.spread { display: flex; justify-content: space-between; gap: .5rem; }
.chips-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
table.t tr.off td { opacity: .55; }
.occ { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.occ .big { font-family: var(--serif); font-size: 2rem; font-weight: 700; }

/* Interrupteur disponible / indisponible */
.switch { display: inline-block; position: relative; width: 36px; height: 20px; vertical-align: middle; margin-right: .35rem; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; background: var(--grey); border-radius: 99px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --- Lignes de réunion --- */
.mt .when .dow { display: block; font-size: .66rem; }
.mt .what .line { font-size: .8rem; font-weight: 600; margin-top: .2rem; }
.mt .what .line.red { color: var(--red); } .mt .what .line.gold { color: var(--gold-d); } .mt .what .line.green { color: var(--green); }
.mt.compact { grid-template-columns: 1fr auto; padding: .6rem 0; }
.mt .what:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.req-item { border-bottom: 1px solid #efe9d9; padding-bottom: .9rem; margin-bottom: .9rem; }
.req-item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.req-item .alert { margin: .5rem 0 0; }
.req-item .xs { margin: .4rem 0 0; }

/* --- Notifications --- */
.notif { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; padding: .7rem .2rem .7rem .9rem; border-bottom: 1px solid #efe9d9; position: relative; cursor: pointer; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: #faf6ea; }
.notif b { font-size: .92rem; font-weight: 650; }
.notif span { grid-column: 1; font-size: .83rem; color: var(--muted); }
.notif i { grid-row: 1; grid-column: 2; font-style: normal; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.notif.unread::before { content: ''; position: absolute; left: .15rem; top: 1rem; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.notif.unread b { color: var(--green-d); }
.push-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --- Choix du personnel convoqué --- */
.pers-pick { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; background: #fffdf8; margin-bottom: 1rem; }
.pers-grp { margin-bottom: .7rem; }
.pers-grp:last-child { margin-bottom: 0; }
.pers-h { display: flex; align-items: center; gap: .5rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: .25rem; border-bottom: 1px solid var(--line); margin-bottom: .35rem; }
.pers-grp.hi .pers-h { color: var(--green-d); }
.pers-h .xs { background: var(--green-l); color: var(--green-d); padding: 1px 6px; border-radius: 99px; text-transform: none; letter-spacing: 0; font-size: .64rem; }
.pers-h .link { margin-left: auto; }
.pers-pick .check { margin: .18rem 0; font-weight: 400; font-size: .86rem; }
.pers-pick .check i { font-style: normal; font-size: .78rem; }

/* --- Disponibilités --- */
.dcol.past { opacity: .5; }
.busy { cursor: pointer; }
.busy:hover { color: var(--ink); }

/* --- Agenda : jours non ouvrés --- */
.g-head .corner { border-left: 0; }

/* --- Impression --- */
.print-head img { height: 54px; display: block; margin: 0 auto 4px; }
@media print {
  .role-chip, .switch, .spin, .bell-btn { display: none !important; }
  .notif { break-inside: avoid; }
}

/* --- Petits écrans --- */
@media (max-width: 960px) {
  .brand .emblem { width: 38px; height: 46px; }
  .roles-legend { grid-template-columns: 1fr; }
  .pers-pick { max-height: 240px; }
}

/* Carte utilisateur : nom long sur deux lignes au plus */
.user-card .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .82rem; line-height: 1.25; }
.user-card .rl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Indicateurs : deux colonnes sur petit écran plutôt qu'une pile */
@media (max-width: 700px) {
  .grid-kpi { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi { padding: .7rem .5rem .7rem .8rem; }
  .kpi .n { font-size: 1.5rem; }
  .kpi .l { font-size: .72rem; line-height: 1.25; }
}

/* ======================= Organigramme =======================
   Trois niveaux lisibles d'un coup d'œil : l'institution en tête,
   les directions en blocs, les cellules en retrait sous leur tutelle. */
.org-root { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; margin-bottom: .9rem;
  background: var(--ink-05, #f3f6f3); border-radius: 10px; font-size: 1.02rem; }
.org-d { border: 1px solid var(--line, #e2e8e3); border-radius: 10px; margin-bottom: .7rem; overflow: hidden; }
.org-h { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem .8rem; background: var(--ink-03, #f8faf8); }
.org-sub { padding: .25rem .8rem .55rem 1.9rem; border-top: 1px solid var(--line, #e2e8e3); }
.org-c { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding: .4rem 0; border-bottom: 1px dashed var(--line, #e8eee9); }
.org-c:last-child { border-bottom: 0; }
.org-c::before { content: ''; width: 10px; height: 1px; background: var(--line, #cfdad1); flex: none; }
.org-n { flex: 1; min-width: 9rem; }
.org-h .right, .org-c .right { margin-left: auto; white-space: nowrap; }
.tag.sm { font-size: .66rem; padding: .05rem .4rem; }
@media (max-width: 640px) {
  .org-sub { padding-left: 1rem; }
  .org-n { min-width: 100%; order: -1; }
}

/* ======================= Présence =======================
   Une pastille discrète : présent, ou vu il y a peu. */
.pres { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; }
.pres i { width: 8px; height: 8px; border-radius: 50%; background: #c6d0c8; flex: none; }
.pres.on i { background: #2e9c5a; box-shadow: 0 0 0 3px rgba(46,156,90,.16); }
.pres.on { color: #1f6b3e; font-weight: 600; }

/* ======================= Convocation en bloc =======================
   Les gestes les plus fréquents en premier, le détail en dessous. */
.bloc-pick { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.bloc-pick .btn.sm { display: inline-flex; align-items: center; gap: .4rem; }
.bloc-pick .cnt { display: inline-block; min-width: 1.3rem; padding: 0 .3rem; border-radius: 999px;
  background: rgba(0,0,0,.07); font-size: .7rem; font-weight: 700; text-align: center; }
.bloc-pick .btn.danger .cnt { background: rgba(255,255,255,.2); }

/* Information des convoqués */
.avis { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.avis .small { flex-basis: 100%; }

/* Listes simples sans puces (présence, récapitulatifs) */
ul.plain { list-style: none; margin: .4rem 0 0; padding: 0; }
ul.plain li { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .3rem 0; border-bottom: 1px dashed var(--line); }
ul.plain li:last-child { border-bottom: 0; }

/* ======================= Récapitulatif de période =======================
   Invisible à l'écran — l'agenda est déjà sous les yeux — et imprimé
   sous le planning, parce que c'est là qu'il sert : en réunion, sur
   papier, quand on commente la période écoulée. */
.recap { display: none; }
.recap h3 { font-family: var(--serif); font-size: 13px; margin: 0 0 6px; }
.recap h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #444; margin: 0 0 3px; }
.recap-kpi { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.recap-kpi div { border: 1px solid #ccc; border-radius: 6px; padding: 4px 10px; min-width: 88px; }
.recap-kpi b { display: block; font-size: 17px; font-family: var(--serif); line-height: 1.1; }
.recap-kpi span { font-size: 9px; color: #555; }
.recap-cols { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 6px; }
.recap-col { flex: 1; min-width: 180px; }
.recap-col ul { list-style: none; margin: 0; padding: 0; }
.recap-col li { display: flex; justify-content: space-between; gap: 10px; font-size: 10px;
  border-bottom: 1px dotted #ccc; padding: 1px 0; }

/* Choix du format de document */
.doc-choix { display: grid; gap: .5rem; }
.doc-c { display: block; width: 100%; text-align: left; padding: .65rem .85rem; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.doc-c:hover { border-color: var(--green); background: var(--green-l); }
.doc-c b { display: block; font-size: .92rem; }
.doc-c span { display: block; font-size: .8rem; color: var(--muted); margin-top: .1rem; }

@media print {
  /* Le récapitulatif apparaît ici, et seulement ici. */
  .recap { display: block; margin-top: 10px; padding-top: 8px; border-top: 2px solid #123a28;
    break-inside: avoid; page-break-inside: avoid; }
}

/* ======================= Organigramme en arbre =======================
   La profondeur se lit à l'indentation et au trait de liaison, pas à des
   blocs imbriqués qui mangeraient la largeur sur un téléphone. */
.org-n2 { position: relative; }
.org-l { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .42rem .55rem; border-radius: 8px; }
.org-l:hover { background: rgba(0,0,0,.035); }
.org-n2.niv0 > .org-l { background: var(--ink-03, #f6f8f6); margin-top: .5rem;
  border-left: 3px solid var(--green); }
.org-k { margin-left: 1.15rem; padding-left: .7rem; border-left: 1px solid var(--line); }
.org-nom { flex: 1; min-width: 11rem; }
.org-nat { display: inline-block; margin-left: .4rem; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); }
.org-chef { white-space: nowrap; }
.org-t { width: 20px; height: 20px; flex: none; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); cursor: pointer; line-height: 1; font-weight: 700; color: var(--muted); padding: 0; }
.org-t:hover { border-color: var(--green); color: var(--green); }
.org-t.vide { border: 0; background: none; }
.org-l .right { margin-left: auto; white-space: nowrap; }
@media (max-width: 720px) {
  .org-nom { min-width: 100%; order: 3; }
  .org-chef { order: 4; flex-basis: 100%; }
  .org-k { margin-left: .5rem; padding-left: .5rem; }
}

/* Les groupes de l'écran de convocation suivent la profondeur de l'arbre */
.pers-grp { margin-left: calc(var(--prof, 0) * .7rem); }

/* Natures d'activité : une ligne par nature, les deux langues côte à côte */
.nat-l { display: flex; align-items: center; gap: .45rem; padding: .22rem 0; }
.nat-l .nat-i { width: 1.4rem; flex: none; font-size: .72rem; color: var(--muted); text-align: right; }
.nat-l input { flex: 1; min-width: 0; padding: .35rem .55rem; border: 1px solid var(--line);
  border-radius: 7px; background: var(--surface); }
.nat-l .nat-en { font-style: italic; color: var(--muted); }
@media (max-width: 640px) { .nat-l { flex-wrap: wrap; } .nat-l input { flex-basis: calc(100% - 3.4rem); } }

/* Zone du texte de convocation : chasse fixe, pour relire une mise en page */
textarea.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .82rem; line-height: 1.5; white-space: pre; overflow-x: auto; }

/* ======================= Bascule de langue =======================
   Deux lettres, discrètes, toujours au même endroit — dans le bandeau
   comme sur l'écran d'entrée, pour qu'un anglophone n'ait pas à
   comprendre le français avant de pouvoir changer de langue. */
.lang-pick { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.lang-pick button { border: 0; background: var(--surface); color: var(--muted); cursor: pointer;
  padding: .28rem .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .03em; line-height: 1.4; }
.lang-pick button + button { border-left: 1px solid var(--line); }
.lang-pick button:hover { background: var(--green-l); color: var(--green); }
.lang-pick button.on { background: var(--green); color: #fff; }
.auth-lang { display: flex; justify-content: flex-end; margin-bottom: .9rem; }
.top .lang-pick { margin-right: .2rem; }
@media (max-width: 640px) { .lang-pick button { padding: .24rem .4rem; font-size: .68rem; } }
