/* CrunchRoom — thème repris de openlab.utbm.fr (UTBM Innovation Crunch Lab)
   Couleurs : navigation #005357, titres #DA322B, boutons #d40e41 / #f39200 / #2f5aae / #9463ae / #7a7a7a
   Polices : Montserrat (titres), Roboto (interface), Lato (accroche) */

:root {
  --teal: #005357;
  --teal-dark: #003b3e;
  --teal-soft: #e6eff0;
  --title-red: #da322b;
  --crimson: #d40e41;
  --crimson-dark: #b00b36;
  --orange: #f39200;
  --blue: #2f5aae;
  --purple: #9463ae;
  --grey: #7a7a7a;
  --text: #272626;
  --muted: #54595f;
  --light-bg: #f4f5f7;
  --site-bg: #ffffff;
  --border: #dfe2e6;
  --field-border: #8c8c8c;
  --success: #1f8a4c;
  --radius: 3px;
  --radius-lg: 6px;
  --shadow: 0 1px 6px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .18);
  --font-title: 'Montserrat', Arial, Helvetica, sans-serif;
  --font-ui: 'Roboto', Arial, Helvetica, sans-serif;
  --font-tag: 'Lato', Arial, Helvetica, sans-serif;
  --hour-h: 48px;
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--site-bg); color: var(--text);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.6;
}
main { flex: 1; outline: none; }
a { color: var(--blue); }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
.skip { position: absolute; left: -999px; top: 0; background: var(--teal); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.topbar { background: #fff; box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0,0,0,.04); position: sticky; top: 0; z-index: 40; }
.topbar-inner { max-width: var(--container); margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--text); line-height: 1; }
.brand-kicker { font-family: var(--font-ui); font-weight: 700; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 22px; letter-spacing: .02em; color: var(--text); }
.brand-name span { color: var(--teal); }
.mainnav { display: flex; gap: 4px; }
.mainnav a { color: var(--teal); font-weight: 500; font-size: 16px; text-decoration: none; padding: 8px 10px; border-radius: var(--radius); }
.mainnav a:hover { background: var(--teal-soft); }
.mainnav a.active { box-shadow: inset 0 -2px 0 var(--teal); border-radius: 0; }

/* ---------- Bandeau ---------- */
.hero { background: var(--teal); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0; background:
  radial-gradient(circle at 90% 20%, rgba(243,146,0,.25), transparent 40%),
  radial-gradient(circle at 10% 120%, rgba(212,14,65,.25), transparent 45%); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; max-width: var(--container); margin: 0 auto; padding: 28px 16px 26px; }
.hero h1 { font-family: var(--font-title); font-weight: 700; font-size: clamp(26px, 5vw, 40px); margin: 0; }
.hero p { font-family: var(--font-tag); font-weight: 300; font-size: clamp(16px, 2.4vw, 20px); margin: 6px 0 0; opacity: .95; }
.hero .hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.container { max-width: var(--container); margin: 0 auto; padding: 20px 16px 40px; }
.section-title { font-family: var(--font-ui); font-weight: 600; color: var(--title-red); font-size: 24px; margin: 26px 0 12px; }
.section-title:first-child { margin-top: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  font-family: var(--font-ui); font-weight: 500; text-transform: uppercase; letter-spacing: .02em; font-size: 15px;
  padding: 12px 18px; border-radius: var(--radius); background: var(--crimson); color: #fff; text-decoration: none;
  transition: filter .15s, transform .05s; line-height: 1.2; min-height: 44px; }
.btn:hover { filter: brightness(.92); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-teal { background: var(--teal); }
.btn-orange { background: var(--orange); }
.btn-blue { background: var(--blue); }
.btn-purple { background: var(--purple); }
.btn-grey { background: var(--grey); }
.btn-ghost { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.btn-ghost:hover { background: var(--teal-soft); filter: none; }
.btn-light { background: #fff; color: var(--teal); }
.btn-sm { padding: 6px 10px; font-size: 13px; min-height: 34px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; text-decoration: underline; font: inherit; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--border); background: #fff; border-radius: var(--radius); cursor: pointer; color: var(--teal); font-size: 18px; }
.icon-btn:hover { background: var(--teal-soft); }

/* ---------- Badges, pastilles ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--light-bg); color: var(--text); white-space: nowrap; }
.badge-on-dark { background: rgba(255,255,255,.16); color: #fff; }
.badge-free { background: #e3f3ea; color: #146b3a; }
.badge-busy { background: #fde7ec; color: var(--crimson-dark); }
.badge-admin { background: #fff1db; color: #8a5300; }
.badge-cancel { background: #eee; color: #666; text-decoration: line-through; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--c, var(--teal)); flex: none; }

/* ---------- Cartes salles ---------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.room-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--border);
  border-top: 5px solid var(--c, var(--teal)); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.room-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.room-card h3 { font-family: var(--font-title); font-size: 18px; margin: 0; }
.room-card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.room-card .go { margin-top: auto; font-weight: 500; color: var(--c, var(--teal)); text-transform: uppercase; font-size: 13px; letter-spacing: .03em; }
.room-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; }
.room-strip .room-card { min-width: 220px; flex: 1; scroll-snap-align: start; }

/* ---------- Barre d'outils calendrier ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 12px; }
.cal-toolbar .date-label { font-family: var(--font-title); font-weight: 600; font-size: 18px; flex: 1 1 200px; }
.seg { display: inline-flex; border: 2px solid var(--teal); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--teal); padding: 7px 12px; cursor: pointer; font-weight: 500; text-transform: uppercase; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--teal); }
.seg button.on { background: var(--teal); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 12px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text); min-height: 36px; }
.chip:hover { border-color: var(--teal); }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip.on .dot { box-shadow: 0 0 0 2px #fff; }
.chip[disabled] { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.date-input { border: 2px solid var(--teal); border-radius: var(--radius); padding: 6px 8px; height: 40px; color: var(--teal); background: #fff; }

/* ---------- Grille horaire ---------- */
.tg-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.tg { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(var(--colmin, 110px), 1fr)); min-width: fit-content; position: relative; }
.tg-head { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--border); padding: 8px 6px; font-weight: 600; font-size: 13px; text-align: center; line-height: 1.25; }
.tg-head.corner { position: sticky; left: 0; z-index: 4; }
.tg-head .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tg-head.today { color: var(--crimson); }
.tg-head .room-head { display: inline-flex; align-items: center; gap: 6px; }
.tg-times { position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid var(--border); }
.tg-times div { height: var(--hour-h); font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.tg-times div:first-child { transform: none; }
.tg-col { position: relative; border-right: 1px solid var(--border); cursor: pointer; height: calc(var(--rows) * var(--hour-h));
  background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px), linear-gradient(to bottom, #f1f2f4 1px, transparent 1px);
  background-size: 100% var(--hour-h), 100% calc(var(--hour-h) / 2); }
.tg-col:last-child { border-right: 0; }
.tg-col:hover { background-color: #fbfcfc; }
.tg-col.locked { cursor: default; }
.tg-closed, .tg-past { position: absolute; left: 0; right: 0; pointer-events: none; }
.tg-closed { background: repeating-linear-gradient(135deg, rgba(0,0,0,.035) 0 6px, transparent 6px 12px); }
.tg-past { background: rgba(244,245,247,.7); }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--crimson); z-index: 2; pointer-events: none; }
.tg-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--crimson); }
.ev { position: absolute; z-index: 1; border-radius: var(--radius); padding: 3px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c) 16%, #fff); border-left: 4px solid var(--c); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); text-align: left; border-top: 0; border-right: 0; border-bottom: 0; }
.ev:hover { background: color-mix(in srgb, var(--c) 26%, #fff); z-index: 2; }
.ev .t { font-weight: 600; color: color-mix(in srgb, var(--c) 70%, #000); }
.ev .n { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .c { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.short { padding-top: 1px; padding-bottom: 1px; white-space: nowrap; }
.ev.short .n { display: inline; margin-left: 4px; }
.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.btn .i { width: 18px; height: 18px; }
.ev.admin { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, #fff) 0 8px, color-mix(in srgb, var(--c) 12%, #fff) 8px 16px); }
.ev.mine { box-shadow: 0 0 0 2px var(--c); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-box { width: 16px; height: 12px; border-radius: 2px; display: inline-block; }

/* ---------- Vue liste ---------- */
.agenda { display: flex; flex-direction: column; gap: 14px; }
.agenda-day h3 { font-family: var(--font-ui); font-weight: 600; font-size: 15px; color: var(--teal); margin: 0 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--teal-soft); }
.agenda-item { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 10px 12px; border-left: 4px solid var(--c); background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 6px; cursor: pointer; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; }
.agenda-item .time { font-weight: 600; font-variant-numeric: tabular-nums; }
.agenda-item .room { font-size: 13px; color: var(--muted); }
.empty { padding: 26px; text-align: center; color: var(--muted); background: var(--light-bg); border-radius: var(--radius-lg); }

/* ---------- Panneau de réservation ---------- */
.room-hero { border-top: 6px solid var(--c); background: var(--light-bg); }
.room-hero .hero-inner { padding-top: 22px; }
.room-hero h1 { font-family: var(--font-title); font-weight: 700; font-size: clamp(26px, 6vw, 38px); margin: 0; color: var(--text); }
.room-hero p { margin: 6px 0 0; color: var(--muted); }
.room-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.room-layout > * { min-width: 0; }
@media (min-width: 980px) { .room-layout { grid-template-columns: 420px minmax(0, 1fr); align-items: start; } .room-layout .book-panel { position: sticky; top: 84px; } }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; }
.panel h2 { font-family: var(--font-ui); font-weight: 600; color: var(--title-red); font-size: 22px; margin: 0 0 12px; }
.step { margin-bottom: 16px; }
.step-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; color: var(--teal); }
.step-label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.day-scroller { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.day-chip { flex: none; width: 62px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius-lg); padding: 6px 4px; text-align: center; cursor: pointer; scroll-snap-align: start; line-height: 1.2; }
.day-chip .dw { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.day-chip .dn { font-family: var(--font-title); font-size: 20px; font-weight: 700; }
.day-chip .dm { font-size: 11px; color: var(--muted); }
.day-chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.day-chip.on .dw, .day-chip.on .dm { color: rgba(255,255,255,.85); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
.slot { border: 1px solid var(--border); background: #fff; border-radius: var(--radius); padding: 8px 0; cursor: pointer; font-weight: 500; font-variant-numeric: tabular-nums; min-height: 40px; }
.slot:hover:not([disabled]) { border-color: var(--teal); color: var(--teal); }
.slot.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.slot.inrange { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.slot[disabled] { background: repeating-linear-gradient(135deg, #f4f5f7 0 5px, #eceef1 5px 10px); color: #a3a7ad; cursor: not-allowed; text-decoration: line-through; }
.summary { background: var(--teal-soft); border-left: 4px solid var(--teal); padding: 10px 12px; border-radius: var(--radius); font-weight: 500; margin-bottom: 14px; }
.summary strong { color: var(--teal); }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 500; font-size: 14px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=color]), .field select, .field textarea {
  width: 100%; border: 2px solid var(--field-border); border-radius: var(--radius); padding: 10px 12px; background: #fff; min-height: 46px; font-size: 16px; }
.field textarea { min-height: 80px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(0,83,87,.15); }
.field input[type=color] { width: 64px; height: 46px; border: 2px solid var(--field-border); border-radius: var(--radius); padding: 2px; background: #fff; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--teal); margin-top: 2px; flex: none; }
.req { color: var(--crimson); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: 2fr 1fr 1fr; } }
.alert { padding: 10px 14px; border-radius: var(--radius); margin: 10px 0; font-size: 14px; }
.alert-error { background: #fde7ec; color: #8d0a2c; border-left: 4px solid var(--crimson); }
.alert-info { background: #e8eef9; color: #1f3f7d; border-left: 4px solid var(--blue); }
.alert-warn { background: #fff4e0; color: #7a4a00; border-left: 4px solid var(--orange); }
.alert-success { background: #e3f3ea; color: #146b3a; border-left: 4px solid var(--success); }

.success { text-align: center; padding: 10px 0; }
.success .check-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; font-size: 34px; margin: 0 auto 10px; }
.success h2 { color: var(--success) !important; }
.success .actions { display: grid; gap: 8px; margin-top: 14px; }
.copy-row { display: flex; gap: 6px; margin-top: 6px; }
.copy-row input { flex: 1; min-width: 0; font-size: 13px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; background: var(--light-bg); }

/* ---------- Administration ---------- */
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.admin-tabs a, .admin-tabs button { white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 500; padding: 10px 14px; border: 0; background: none; cursor: pointer;
  text-transform: uppercase; font-size: 13px; letter-spacing: .03em; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.admin-tabs a.on { color: var(--teal); border-bottom-color: var(--teal); }
.admin-tabs .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.filters .field input, .filters .field select { min-height: 40px; padding: 6px 10px; font-size: 15px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; background: var(--light-bg); font-weight: 600; padding: 10px 12px; white-space: nowrap; color: var(--teal); text-transform: uppercase; font-size: 12px; letter-spacing: .03em; }
table.data td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }
table.data tr.cancelled td { color: #888; }
table.data tr.cancelled td:not(:last-child) { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
table.data td.actions { white-space: nowrap; text-align: right; }
.nowrap { white-space: nowrap; }
@media (max-width: 760px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border-top: 1px solid var(--border); padding: 8px 0; }
  table.data td { border: 0; padding: 3px 12px; }
  table.data td[data-l]::before { content: attr(data-l) ' : '; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; }
  table.data td.actions { text-align: left; padding-top: 8px; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; border-left: 4px solid var(--c, var(--teal)); }
.stat .v { font-family: var(--font-title); font-weight: 700; font-size: 26px; }
.stat .l { font-size: 13px; color: var(--muted); }
.login-box { max-width: 380px; margin: 30px auto; }

/* ---------- QR codes ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.qr-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.qr-print { padding: 18px 18px 14px; text-align: center; border-top: 8px solid var(--c, var(--teal)); }
.qr-print .qr-brand { font-family: var(--font-title); font-weight: 700; font-size: 14px; letter-spacing: .05em; color: var(--text); }
.qr-print .qr-brand span { color: var(--teal); }
.qr-print h3 { font-family: var(--font-title); font-weight: 700; font-size: 24px; margin: 8px 0 2px; }
.qr-print .qr-sub { color: var(--muted); font-size: 14px; }
.qr-print .qr-img { width: 100%; max-width: 220px; margin: 10px auto 6px; display: block; }
.qr-print .qr-img svg { width: 100%; height: auto; display: block; }
.qr-print .qr-cta { font-weight: 600; text-transform: uppercase; color: var(--crimson); letter-spacing: .04em; font-size: 14px; }
.qr-print .qr-url { font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 4px; }
.qr-actions { display: flex; gap: 6px; padding: 10px; background: var(--light-bg); border-top: 1px solid var(--border); flex-wrap: wrap; }
.qr-actions .btn { flex: 1; }

/* ---------- Modale & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(18,18,18,.55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 12px 12px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: up .2s ease-out; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; } .modal { border-radius: var(--radius-lg); } }
.modal h2 { font-family: var(--font-ui); font-weight: 600; color: var(--title-red); font-size: 22px; margin: 0 0 10px; padding-right: 36px; }
.modal-close { position: absolute; right: 12px; top: 12px; }
.modal-head { position: relative; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(calc(100% + 40px)); visibility: hidden; background: var(--text); color: #fff; padding: 12px 18px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 80; transition: transform .25s; width: max-content; max-width: calc(100vw - 32px); text-align: center; font-weight: 500; pointer-events: none; }
#toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }
#toast.error { background: var(--crimson); }
#toast.ok { background: var(--success); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

.loading { padding: 60px 16px; text-align: center; color: var(--muted); }
.footer { background: var(--teal); color: #fff; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 18px 16px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; font-size: 14px; }
.footer .tagline { font-family: var(--font-tag); font-weight: 300; }

@media (max-width: 520px) {
  .brand-name { font-size: 18px; }
  .topbar-inner { padding: 10px 12px; gap: 6px; }
  .mainnav { gap: 0; }
  .mainnav a { padding: 8px 6px; font-size: 15px; }
  .section-title { font-size: 21px; }
  .panel { padding: 14px; }
  :root { --hour-h: 44px; }
}

/* ---------- Impression des QR codes ---------- */
@media print {
  @page { size: A4; margin: 15mm; }
  body { background: #fff; }
  .topbar, .footer, .admin-tabs, .qr-actions, .no-print, #toast, .hero { display: none !important; }
  .container { padding: 0; max-width: none; }
  .qr-grid { display: block; }
  .qr-card { box-shadow: none; border: 0; break-after: page; page-break-after: always; }
  .qr-card:last-child { break-after: auto; page-break-after: auto; }
  body.print-one .qr-card:not(.printing) { display: none; }
  .qr-print { padding: 30mm 10mm 0; border-top-width: 14px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .qr-print .qr-brand { font-size: 22pt; }
  .qr-print h3 { font-size: 40pt; margin-top: 14mm; }
  .qr-print .qr-sub { font-size: 16pt; }
  .qr-print .qr-img { max-width: 120mm; margin: 12mm auto 8mm; }
  .qr-print .qr-cta { font-size: 20pt; }
  .qr-print .qr-url { font-size: 11pt; }
}
