/* Charte Fedris : Trebuchet MS, orange C45911, bleu 2E74B5, bleu du logo 3A4999 */
:root {
  --orange: #C45911;
  --orange-soft: #FBE4D5;
  --blue: #2E74B5;
  --blue-soft: #DEEAF6;
  --indigo: #3A4999;
  --ink: #262626;
  --muted: #595959;
  --line: #D9D9D9;
  --bg: #F4F5F8;
  --card: #FFFFFF;
  --ok: #2E7D32;
  --err: #B3261E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Trebuchet MS", "Segoe UI", Arial, sans-serif; }
a { color: var(--blue); }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 12px; }
.muted { color: var(--muted); }

/* En-tête */
.top { background: #fff; border-bottom: 4px solid var(--orange); }
.top-inner { display: flex; align-items: center; gap: 18px; padding-top: 12px; padding-bottom: 12px; }
.logo { height: 52px; width: auto; }
.brand { flex: 1; min-width: 0; }
.brand-title { font-weight: bold; color: var(--indigo); font-size: 18px; }
.brand-sub { color: var(--muted); font-size: 13px; }
.tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tools a { text-decoration: none; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.tools a.on { background: var(--blue); border-color: var(--blue); color: #fff; }

main { padding-top: 22px; padding-bottom: 40px; }
h1 { color: var(--orange); font-size: 24px; margin: 0 0 10px; }
h2 { color: var(--orange); font-size: 19px; margin: 22px 0 10px; }
h2.section { margin-top: 30px; }
h3 { color: var(--blue); font-size: 16px; margin: 0 0 6px; }
h4 { color: var(--blue); font-size: 14px; margin: 16px 0 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px 14px; margin: 0 0 16px; }
.card.narrow { max-width: 560px; margin: 30px auto; }
.flash { padding: 10px 14px; border-radius: 4px; border-left: 4px solid var(--ok); background: #E8F5E9; }
.flash-err { border-color: var(--err); background: #FDECEA; }

/* Formulaire */
fieldset.meeting { min-width: 0; }
legend { font-size: 18px; font-weight: bold; color: var(--orange); padding: 0 6px; }
.qnum { display: inline-block; min-width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; background: var(--orange); color: #fff; font-size: 13px; margin-right: 4px; }
.planned { color: var(--indigo); margin: 0 0 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.row .label { font-weight: bold; margin-right: 6px; }
.pill { border: 1px solid var(--line); border-radius: 18px; padding: 5px 14px; cursor: pointer; user-select: none; }
.pill input { margin: 0 4px 0 0; vertical-align: -1px; }
.pill:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); font-weight: bold; }
.pill-no:has(input:checked) { border-color: var(--err); background: #FDECEA; }
.avail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; }
.is-no .avail { opacity: .45; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.cals { display: flex; flex-wrap: wrap; gap: 14px; }
.slots { display: grid; gap: 6px; margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.check:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.comment { display: block; font-size: 14px; }
textarea, input[type=text], input[type=email], input[type=password] { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #BFBFBF; border-radius: 4px; margin-top: 4px; }
textarea:focus, input:focus { outline: 2px solid var(--blue); outline-offset: 0; }

/* Calendrier */
table.cal { border-collapse: collapse; font-size: 13px; }
.cal caption { font-weight: bold; color: var(--blue); text-align: left; padding-bottom: 4px; }
.cal th { color: var(--muted); font-weight: normal; width: 38px; padding: 2px 0; }
.cal td { width: 38px; height: 34px; text-align: center; color: #A6A6A6; border: 1px solid #F0F0F0; }
.cal td.we { background: #FAFAFA; }
.cal td.opt { color: var(--ink); padding: 0; border-color: var(--line); }
.cal td.opt label, .cal td.opt > span { display: flex; align-items: center; justify-content: center; height: 34px; cursor: pointer; font-weight: bold; border: 2px solid var(--blue); border-radius: 4px; background: #fff; }
.cal td.opt > span { cursor: default; }
.cal td.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cal td.planned label, .cal td.planned > span { border-color: var(--orange); }
.cal td.opt label:has(input:checked), .cal td.opt.on > span { background: var(--blue); color: #fff; }
.cal td.planned label:has(input:checked), .cal td.planned.on > span { background: var(--orange); color: #fff; }
.cal td.opt label:has(input:focus-visible) { outline: 3px solid var(--indigo); }

.btn, .btn-sm { display: inline-block; font: inherit; border: 0; border-radius: 4px; background: var(--blue); color: #fff; padding: 9px 18px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #245E94; }
.btn-sm { padding: 4px 10px; font-size: 13px; background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-sm.danger { color: var(--err); border-color: var(--err); }
.btn-sm.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-sm + form.inline, form.inline + form.inline { margin-left: 4px; }
.actions { text-align: right; }
.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 18px 0 10px; }
.stack { display: grid; gap: 12px; }
form.inline { display: inline; }

/* Tableaux */
.scroll { overflow-x: auto; }
.headrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.headrow h1 { margin: 0; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
.grid th { background: var(--blue); color: #fff; text-align: left; padding: 7px 8px; font-weight: bold; }
.grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tbody tr:nth-child(even) td { background: #F7F7F7; }
.grid tr.best td { background: var(--orange-soft) !important; font-weight: bold; }
.grid .num, .grid .c { text-align: center; }
.grid.compact { margin-top: 10px; font-size: 13px; }
.linkcell { min-width: 260px; }
.linkcell input { width: 170px; font-size: 12px; padding: 4px 6px; margin: 0 4px 0 0; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #EEE; font-size: 12px; }
.tag-ok { background: #E8F5E9; color: var(--ok); }
.tag-wait { background: #FFF4E5; color: #8A5300; }
.tag-no { background: #FDECEA; color: var(--err); }
.bar { display: inline-block; width: 100%; min-width: 80px; height: 10px; background: #EEF2F7; border-radius: 5px; overflow: hidden; vertical-align: middle; }
.bar > span { display: block; height: 100%; background: var(--blue); }
.barcell { width: 40%; }
.proposal { font-weight: bold; color: var(--orange); }
.mtitle { font-size: 18px; color: var(--orange); }
.comments { margin: 0; padding-left: 18px; }
.att { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #EEE; }
.att-yes { background: #E8F5E9; color: var(--ok); }
.att-maybe { background: #FFF4E5; color: #8A5300; }
.att-no { background: #FDECEA; color: var(--err); }
.foot { color: var(--muted); font-size: 12px; padding-bottom: 24px; }

/* Menu d'administration et rôles */
.admin-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; border-bottom: 2px solid var(--line); }
.admin-menu a { padding: 9px 16px; text-decoration: none; color: var(--ink); font-weight: bold; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.admin-menu a:hover { color: var(--blue); }
.admin-menu a.on { color: var(--orange); border-bottom-color: var(--orange); }
.admin-menu .whoami { margin-left: auto; font-size: 13px; color: var(--muted); padding: 6px 0; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 12px; text-align: center; }
.role { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: bold; background: var(--blue-soft); color: var(--blue); }
.role-admin { background: var(--orange-soft); color: var(--orange); }
.role-secretaire { background: #EDE7F6; color: #5E35B1; }
.role-form select { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid #BFBFBF; border-radius: 4px; background: #fff; }
.card.narrow-wide { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.roles { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.roles legend { font-size: 14px; color: var(--ink); padding: 0 0 4px; }
.role-choice { align-items: flex-start; }
.role-choice input { margin-top: 4px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } .admin-menu .whoami { margin-left: 0; width: 100%; } }

/* Recherche par date */
.filter h2 { margin-top: 0; font-size: 16px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.filter-row label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.filter-row select, .filter-row input[type=date] { font: inherit; font-size: 14px; padding: 7px 8px; border: 1px solid #BFBFBF; border-radius: 4px; background: #fff; color: var(--ink); min-width: 160px; }
.filter-row select { min-width: 260px; }
.filter-or { color: var(--muted); font-style: italic; padding-bottom: 9px; }
.filter-row .btn-sm { padding: 8px 12px; }
.filter-active { display: inline-block; font-weight: bold; color: var(--blue); background: var(--blue-soft); padding: 4px 10px; border-radius: 4px; }

/* Chiffres par réunion (participation, dates, créneaux) */
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 8px; }
.figures h4 { margin-top: 4px; }
.figures .grid.compact { margin-top: 0; }
.bar-yes > span { background: var(--ok); }
.bar-maybe > span { background: #E0A030; }
.bar-no > span { background: var(--err); }
.bar-none > span { background: #A6A6A6; }
.att-none { background: #EEE; color: var(--muted); }
@media (max-width: 1000px) { .figures { grid-template-columns: 1fr; } }

/* Légendes */
.legend { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.legend > span { margin-left: 10px; }
.legend > span:first-child { margin-left: 0; }
.lg { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; border-radius: 4px; font-weight: bold; font-size: 12px; border: 2px solid var(--blue); color: var(--ink); background: #fff; }
.lg-planned { border-color: var(--orange); }
.lg-best { background: var(--orange-soft); border-color: var(--orange); }

/* Calendrier annuel */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 18px; }
table.cal.mini { width: 100%; font-size: 12px; }
.cal.mini th, .cal.mini td { width: auto; height: 26px; padding: 0; }
.cal.mini td.opt > span { height: 24px; border-width: 2px; }
.cal.mini td.on > span { background: var(--orange-soft) !important; color: var(--ink) !important; border-color: var(--orange); }
.cal.mini td.on.planned > span { background: var(--orange) !important; color: #fff !important; }

/* Grille de réponses par réunion (dates puis créneaux, une ligne par participant) */
table.poll { border-collapse: separate; border-spacing: 4px; font-size: 14px; }
.poll th, .poll td { text-align: center; }
.poll .who { text-align: left; font-weight: normal; min-width: 210px; position: sticky; left: 0; background: #fff; z-index: 1; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.poll thead .who { border-bottom: 0; }
.poll .nm { display: block; font-weight: bold; }
.poll th.opt { min-width: 74px; padding: 6px 4px 4px; color: #8C8C8C; font-weight: normal; vertical-align: bottom; border-radius: 6px 6px 0 0; }
.poll th.opt span { display: block; line-height: 1.25; }
.poll .star { font-size: 18px; color: #BFBFBF; margin-bottom: 4px; }
.poll .star.on, .legend .star.on { color: var(--orange); }
.poll .mon, .poll .wd { font-size: 11px; letter-spacing: .04em; }
.poll .day { font-size: 24px; font-weight: bold; color: #7F7F7F; }
.poll .time { font-size: 13px; color: #7F7F7F; padding-top: 30px; }
.poll th.best .day, .poll th.best .time { color: var(--orange); }
.poll th.best { background: var(--orange-soft); }
.poll tr.counts td { font-size: 13px; color: #7F7F7F; padding: 6px 0 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.poll tr.counts td.best { background: var(--orange-soft); color: var(--orange); font-weight: bold; }
.poll tr.counts th.who { font-size: 13px; color: var(--muted); font-weight: bold; vertical-align: bottom; padding-bottom: 10px; }
.ppl { width: 18px; height: 12px; fill: currentColor; vertical-align: -1px; }
.poll tbody td { background: #F5F5F5; border-radius: 4px; height: 44px; min-width: 74px; }
.poll tbody td.best { background: var(--orange-soft); }
.poll td.gap, .poll th.gap { background: transparent !important; min-width: 10px; width: 10px; border: 0; }
.mk { font-size: 18px; color: #8C8C8C; }
.mk-yes { color: var(--ok); }
.mk-maybe { color: #B26A00; font-size: 15px; }
.mk-no { color: #BFBFBF; }
.mk-na { color: #D0D0D0; }
.legend .mk { font-size: 15px; }

@media (max-width: 760px) {
  .avail { grid-template-columns: 1fr; }
  .top-inner { flex-wrap: wrap; }
  .logo { height: 40px; }
  .brand-sub { display: none; }
  .card { padding: 16px; }
  .cal th, .cal td { width: 36px; }
}

@media print {
  @page { size: A4; margin: 15mm; }
  body { background: #fff; font-size: 11px; }
  .noprint, .tools, .sticky, .foot { display: none !important; }
  .top { border-bottom-width: 3px; }
  .card { border: 0; padding: 0; margin-bottom: 14px; }
  h2.section { break-after: avoid; }
  .meeting-stats { break-inside: avoid; border-top: 1px solid var(--line); padding-top: 8px; }
  .grid th, .bar > span, .cal td.opt.on > span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grid tr.best td, .grid tbody tr:nth-child(even) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .scroll { overflow: visible; }
  .year { break-inside: avoid; }
  .year-grid { grid-template-columns: repeat(4, 1fr); }
  table.poll { font-size: 11px; border-spacing: 2px; }
  .poll .who { min-width: 150px; }
  .poll th.opt, .poll tbody td { min-width: 52px; }
  .poll tbody td { height: 26px; }
  .poll .day { font-size: 17px; }
  .poll .time { padding-top: 16px; }
  .poll th.best, .poll tbody td, .poll tr.counts td.best, .cal.mini td.opt > span, .lg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
