/* Lions Club Hautes Fagnes — webapp membres */
:root {
  --blue: #1b3f9c;
  --blue-600: #1f4bbf;
  --blue-50: #e9effc;
  --navy: #0f2459;
  --gold: #f2b705;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #17203a;
  --muted: #6a7389;
  --line: #e5e8f0;
  --green: #2e9b4f;
  --green-50: #e6f5eb;
  --orange: #e8920c;
  --orange-50: #fdf1dc;
  --red: #cf3f3a;
  --red-50: #fbe7e6;
  --grey-50: #eef0f4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 36, 89, .06), 0 4px 14px rgba(15, 36, 89, .06);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); min-height: 100%; }
body { font-size: 16px; line-height: 1.4; overscroll-behavior-y: none; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue-600); text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; background: var(--bg); }
@media (min-width: 600px) { #app { box-shadow: 0 0 0 1px var(--line); } }

main#view { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); min-height: 100vh; }
main#view.no-tabbar { padding-bottom: calc(var(--safe-bottom) + 24px); }

/* ---------- Barres ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.topbar .spacer { flex: 1; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.back, .link-btn {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: 0; padding: 6px 4px; color: var(--blue-600); font-size: 16px; cursor: pointer;
}
.back svg { width: 22px; height: 22px; margin-left: -6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--blue); cursor: pointer; position: relative;
}
.icon-btn:active { background: var(--blue-50); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.filled { background: var(--blue-600); color: #fff; border-radius: 50%; width: 36px; height: 36px; }
.icon-btn.filled svg { width: 20px; height: 20px; }
.dot-badge {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}

.page-title { padding: calc(var(--safe-top) + 18px) 16px 8px; display: flex; align-items: center; gap: 8px; }
.page-title h1 { font-size: 30px; line-height: 1.1; margin: 0; flex: 1; letter-spacing: -.02em; font-weight: 800; }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #7a8295; font-size: 11px; font-weight: 500; position: relative;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--blue-600); font-weight: 700; }
.tabbar .dot-badge { top: 6px; right: calc(50% - 22px); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand-fallback {
  width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; text-align: center;
  background: var(--blue); color: var(--gold); font-weight: 900; font-size: 9.5px; line-height: 1.05; letter-spacing: .02em;
  border: 2px solid var(--gold);
}
.profile .login-logo { width: 190px; height: auto; }
.profile .login-logo.brand-fallback { font-size: 22px; border-width: 3px; }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
details[open] > summary .chev { transform: rotate(90deg); }
summary::-webkit-details-marker { display: none; }
.brand-name { color: var(--blue); font-weight: 800; font-size: 15px; line-height: 1.1; letter-spacing: .01em; text-transform: uppercase; }

/* ---------- Héros (paysage des Fagnes, dessiné en CSS/SVG) ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    linear-gradient(180deg, rgba(10, 26, 60, .05) 0%, rgba(10, 26, 60, .55) 100%),
    var(--hero-img, none) center / cover no-repeat,
    linear-gradient(180deg, #6f9fd1 0%, #b9cfe3 38%, #e9d6a6 58%, #7c8f6a 70%, #2f4a35 100%);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 160' preserveAspectRatio='none'%3E%3Cpath d='M0 70 C60 40 120 60 180 45 S300 30 400 55 V160 H0Z' fill='%234f6b4b' opacity='.75'/%3E%3Cpath d='M0 100 C80 80 140 95 220 82 S340 70 400 90 V160 H0Z' fill='%232d4633'/%3E%3Cg fill='%231c3024'%3E%3Cpath d='M20 160 L32 104 L44 160Z'/%3E%3Cpath d='M48 160 L62 92 L76 160Z'/%3E%3Cpath d='M80 160 L90 112 L100 160Z'/%3E%3Cpath d='M300 160 L314 96 L328 160Z'/%3E%3Cpath d='M330 160 L342 108 L354 160Z'/%3E%3Cpath d='M356 160 L372 88 L388 160Z'/%3E%3Cpath d='M250 160 L260 118 L270 160Z'/%3E%3Cpath d='M120 160 L128 124 L136 160Z'/%3E%3C/g%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
/* Photos de la maquette (assets/img) : pas de silhouette dessinée */

.hero.photo::after { display: none; }
.hero-home.photo { background: linear-gradient(180deg, rgba(10,26,60,0) 30%, rgba(10,26,60,.45) 100%), url(img/bandeau-accueil.jpg) center 30% / cover no-repeat, #2d4633; min-height: 150px; display: grid; align-content: end; padding-bottom: 22px; }
.login.photo { background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(8,20,14,.35) 75%, rgba(8,20,14,.6) 100%), url(img/fond-connexion.jpg) center top / cover no-repeat, #0c1a14; }
.login .login-bottom { display: grid; gap: 4px; }
.login.open .hero-top h1 { display: none; }
.login.open .login-logo { width: 150px; height: auto; }

.hero-home { padding: 34px 20px 30px; text-align: center; }
.hero-home h2 { font-size: 40px; margin: 0; font-weight: 800; letter-spacing: -.01em; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.hero-home p { margin: 6px 0 0; font-size: 15px; opacity: .95; text-shadow: 0 1px 6px rgba(0,0,0,.4); }

/* ---------- Connexion ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--safe-top) + 36px) 24px calc(var(--safe-bottom) + 28px);
}
.login .hero-top { text-align: center; }
.login .login-logo { width: 210px; height: auto; margin: 0 auto 26px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(255,255,255,.35)); }
.login .login-logo.brand-fallback { width: 150px; height: 150px; font-size: 30px; border-width: 4px; }
.login h1 { margin-top: 40px !important; font-size: 26px; line-height: 1.25; margin: 0; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.login form { display: grid; gap: 12px; margin-top: 24px; }
.login label { font-size: 13px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.login .field { display: grid; gap: 6px; }
.login input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.94); color: var(--text); font-size: 16px;
}
.login .pw { position: relative; }
.login .pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.login .forgot { display: block; text-align: center; color: #fff; text-decoration: underline; margin-top: 14px; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.login .error { background: rgba(207, 63, 58, .95); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 14px; }

/* ---------- Boutons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 18px; border-radius: 14px; border: 0; cursor: pointer;
  font-size: 17px; font-weight: 600; background: var(--blue-600); color: #fff;
  box-shadow: 0 2px 8px rgba(31, 75, 191, .3);
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.secondary { background: #fff; color: var(--blue-600); box-shadow: none; border: 1px solid var(--line); }
.btn.ghost-light { background: transparent; color: #fff; border: 2px solid #fff; box-shadow: none; }
.btn.small { width: auto; padding: 9px 14px; font-size: 15px; border-radius: 12px; }
.btn svg { width: 20px; height: 20px; }

/* ---------- Cartes / sections ---------- */
.section { padding: 8px 16px; }
.section-title { font-size: 17px; font-weight: 700; color: var(--blue); margin: 18px 16px 8px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.tile {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 10px 16px; text-align: center; color: var(--text); display: grid; justify-items: center; gap: 4px;
  min-height: 132px; align-content: center;
}
.tile svg { width: 44px; height: 44px; color: var(--blue-600); margin-bottom: 6px; }
.tile strong { font-size: 16px; }
.tile span { font-size: 12px; color: var(--muted); }

.banner {
  margin: 16px 16px 0; padding: 14px 16px; border-radius: var(--radius);
  background: var(--blue-50); color: var(--navy); display: flex; gap: 12px; align-items: center;
}
.banner svg { width: 26px; height: 26px; color: var(--blue-600); flex: none; }
.banner .txt { flex: 1; font-size: 14px; }
.banner .txt strong { display: block; font-size: 15px; }
.banner.warn { background: var(--orange-50); }
.banner.warn svg { color: var(--orange); }

/* ---------- Listes ---------- */
.list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 16px; overflow: hidden; }
.list.flat { margin: 0; border-radius: 0; box-shadow: none; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; color: var(--text);
  border-bottom: 1px solid var(--line); min-height: 64px; background: #fff; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0;
}
.row:last-child { border-bottom: 0; }
.row:active { background: #f7f8fb; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s.wrap { white-space: normal; }
.row .chev { width: 20px; height: 20px; color: #a3a9b8; flex: none; }
.row .meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 3px; flex-wrap: wrap; }
.row .meta svg { width: 14px; height: 14px; flex: none; }
.row .meta > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; overflow: hidden;
  background: linear-gradient(135deg, #2b56c9, #16357f); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 18px; letter-spacing: .02em; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }
.avatar.xl { width: 128px; height: 128px; font-size: 40px; border: 4px solid #fff; box-shadow: 0 6px 20px rgba(15,36,89,.18); }

.search {
  margin: 4px 16px 10px; display: flex; align-items: center; gap: 8px;
  background: #e8ebf2; border-radius: 12px; padding: 0 12px;
}
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; background: transparent; padding: 11px 0; font-size: 16px; outline: none; min-width: 0; }
.search .clear { border: 0; background: #9aa1b2; color: #fff; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer; }
.search .clear svg { width: 12px; height: 12px; color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 12px; scrollbar-width: none; align-items: center; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 13px; border-radius: 10px; border: 0; background: #e8ebf2; color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--blue-600); color: #fff; }
.chip-icon { flex: none; border: 0; background: #e8ebf2; border-radius: 10px; width: 36px; height: 34px; display: grid; place-items: center; color: var(--blue); cursor: pointer; }
.chip-icon.active { background: var(--blue-600); color: #fff; }
.chip-icon svg { width: 18px; height: 18px; }

.count { color: var(--muted); font-size: 13px; padding: 0 20px 8px; }

/* ---------- Segments ---------- */
.segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin: 6px 16px 14px; background: #e3e7f0; border-radius: 12px; padding: 3px; }
.segment button { border: 0; background: transparent; padding: 9px 6px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segment button.active { background: var(--blue-600); color: #fff; box-shadow: 0 1px 4px rgba(15,36,89,.2); }

/* ---------- Agenda ---------- */
.month-label { font-size: 20px; font-weight: 700; margin: 14px 20px 8px; text-transform: capitalize; }
.datebox {
  width: 56px; flex: none; border-radius: 10px; overflow: hidden; text-align: center; background: var(--blue-50);
  border: 1px solid #d3ddf5; align-self: flex-start;
}
.datebox .d { background: var(--blue-600); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 0; text-transform: uppercase; letter-spacing: .04em; }
.datebox .n { font-size: 24px; font-weight: 800; color: var(--navy); line-height: 1.15; padding-top: 3px; }
.datebox .m { font-size: 10px; font-weight: 700; color: var(--navy); text-transform: uppercase; padding-bottom: 4px; letter-spacing: .03em; }
.datebox.lg { width: 70px; }
.datebox.lg .n { font-size: 32px; }
.datebox.past { filter: grayscale(.8); opacity: .8; }

.event-row { align-items: flex-start; padding: 14px; }
.event-row .t { white-space: normal; line-height: 1.25; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; }
.pill.present { background: var(--green-50); color: var(--green); }
.pill.absent { background: var(--red-50); color: var(--red); }
.pill.confirmer { background: var(--grey-50); color: #525b70; }
.pill.attente { background: var(--orange-50); color: #a8660a; }
.pill.invite { background: var(--blue-50); color: var(--blue); }

/* ---------- Détail événement ---------- */
.ev-head { display: flex; gap: 16px; padding: 18px 16px 10px; align-items: flex-start; }
.ev-head h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.ev-head .sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.info { padding: 4px 16px 6px; display: grid; gap: 10px; }
.info .it { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.info .it svg { width: 20px; height: 20px; color: var(--navy); flex: none; margin-top: 1px; }
.info .it a { word-break: break-word; }
.desc { margin: 8px 16px 0; font-size: 15px; color: #33405e; white-space: pre-line; }

.answer { margin: 16px; padding: 16px; }
.answer h3 { margin: 0 0 12px; color: var(--blue-600); font-size: 18px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 2px; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--text); white-space: nowrap;
}
.choice svg { width: 16px; height: 16px; flex: none; }
.choice.sel-present { background: var(--green); border-color: var(--green); color: #fff; }
.choice.sel-absent { background: var(--red); border-color: var(--red); color: #fff; }
.choice.sel-confirmer { background: #5b6478; border-color: #5b6478; color: #fff; }
.choice[disabled] { opacity: .6; cursor: default; }
.switch-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; background: var(--bg); border-radius: 12px; font-size: 15px; }
.switch-row .grow { flex: 1; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #c9cfdb; border-radius: 30px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
textarea.comment {
  width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px;
  resize: vertical; min-height: 52px; background: #fff;
}
.answer .btn { margin-top: 12px; }
.answer .note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.stat-row .s { white-space: normal; }
.stat-row .nums { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.35; }
.stat-row .nums b { color: var(--text); }
.total { padding: 10px 20px; font-size: 14px; color: var(--muted); }
.total b { color: var(--text); }

/* ---------- Fiche membre ---------- */
.profile { text-align: center; padding: 18px 16px 6px; display: grid; justify-items: center; gap: 4px; }
.profile h2 { margin: 10px 0 0; font-size: 23px; }
.profile .st { color: var(--navy); font-weight: 600; font-size: 15px; }
.profile .fn { color: var(--blue-600); font-weight: 700; font-size: 15px; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 16px 6px; }
.action {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 6px; display: grid; justify-items: center; gap: 6px;
  color: var(--blue-600); font-size: 13.5px; font-weight: 600; border: 0; cursor: pointer;
}
.action svg { width: 24px; height: 24px; }
.action.disabled { opacity: .4; pointer-events: none; }
.kv { display: grid; grid-template-columns: 24px 1fr 1.3fr; gap: 12px; align-items: start; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv svg { width: 20px; height: 20px; color: var(--navy); }
.kv .k { color: #3a4560; }
.kv .v { color: var(--text); word-break: break-word; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 8px; }
.tag { background: #fff; border: 1px solid #d3ddf5; color: var(--navy); padding: 6px 12px; border-radius: 999px; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.tag svg { width: 15px; height: 15px; color: var(--blue-600); }

/* ---------- Formulaires ---------- */
.form { padding: 8px 16px; display: grid; gap: 14px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.form legend { font-weight: 700; color: var(--blue); margin-bottom: 4px; font-size: 16px; }
.form label { display: grid; gap: 5px; font-size: 13.5px; color: #3a4560; font-weight: 600; }
.form input, .form textarea { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; background: #fff; font-weight: 400; color: var(--text); }
.form input:focus, .form textarea:focus, textarea.comment:focus, .login input:focus { outline: 2px solid var(--blue-600); outline-offset: 0; border-color: transparent; }
.form .ro { font-size: 13px; color: var(--muted); background: var(--blue-50); padding: 10px 12px; border-radius: 12px; }

/* ---------- Filtres ---------- */
.radio-row { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; font-size: 16px; width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.radio-row:last-child { border-bottom: 0; }
.radio-row .grow { flex: 1; }
.radio-row .rd { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9cfdb; display: grid; place-items: center; }
.radio-row.active { background: #f3f6fd; }
.radio-row.active .rd { border-color: var(--blue-600); background: var(--blue-600); color: #fff; }
.radio-row .rd svg { width: 14px; height: 14px; }

/* ---------- Calendrier ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; }
.cal-head h2 { margin: 0; font-size: 19px; color: var(--blue-600); text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 4px 12px 10px; text-align: center; }
.cal .wd { font-size: 13px; color: var(--muted); padding: 6px 0; font-weight: 600; }
.cal button {
  aspect-ratio: 1; max-height: 48px; border: 0; background: transparent; border-radius: 50%; font-size: 16px; cursor: pointer;
  display: grid; place-items: center; position: relative; margin: auto; width: 100%; max-width: 44px; color: var(--text);
}
.cal button.out { visibility: hidden; }
.cal button.has { background: var(--blue-600); color: #fff; font-weight: 700; }
.cal button.today { box-shadow: inset 0 0 0 2px var(--blue-600); font-weight: 700; }
.cal button.sel { outline: 3px solid var(--gold); outline-offset: 1px; }
.cal button.has.pastday { background: #9fb0da; }

/* ---------- Tiroir ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(12, 20, 45, .45); animation: fade .2s; }
.drawer .panel {
  position: absolute; top: 0; bottom: 0; left: max(0px, calc(50% - 280px)); width: min(86%, 340px); background: #fff;
  padding: calc(var(--safe-top) + 16px) 12px calc(var(--safe-bottom) + 16px); display: flex; flex-direction: column; gap: 4px;
  animation: slide .22s ease-out; box-shadow: 8px 0 30px rgba(0,0,0,.18); overflow-y: auto;
}
.drawer .head { display: flex; align-items: center; gap: 10px; padding: 0 4px 16px; }
.drawer a, .drawer button.item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; color: var(--text); font-size: 16px;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.drawer a svg, .drawer button.item svg { width: 22px; height: 22px; color: var(--navy); }
.drawer a.active { background: var(--blue-50); color: var(--blue-600); font-weight: 600; }
.drawer a.active svg { color: var(--blue-600); }
.drawer hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; width: auto; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Divers ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  background: #17203a; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; z-index: 60;
  max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: fade .2s;
}
.toast.err { background: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 40px 24px; font-size: 15px; }
.empty svg { width: 44px; height: 44px; color: #b7bfd1; margin: 0 auto 10px; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #d7deef; border-top-color: var(--blue-600); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.steps { margin: 8px 0 0; padding-left: 20px; font-size: 14.5px; color: #33405e; }
.steps li { margin: 6px 0; }
.kbd { display: inline-flex; vertical-align: middle; background: var(--blue-50); border-radius: 6px; padding: 1px 5px; }
.kbd svg { width: 16px; height: 16px; color: var(--blue-600); }
.version { text-align: center; color: #a3a9b8; font-size: 12px; padding: 18px; }
.skeleton { background: linear-gradient(90deg, #eceff5 25%, #f6f7fa 50%, #eceff5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =====================================================================
   v2 — gestion, ordinateur, composants supplémentaires
   ===================================================================== */
.wrap { padding: 0 0 8px; }
.wrap.narrow { max-width: 760px; margin: 0 auto; }
.wrap.wide { padding: 0 16px 24px; }
.pad-x { padding: 0 20px; }
.small { font-size: 13px; }
.mini { width: 14px; height: 14px; vertical-align: -2px; color: var(--blue-600); }
.stack { display: grid; gap: 12px; margin: 0 16px; }
.wrap.wide .stack { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .grid3, .grid4 { grid-template-columns: 1fr; } }
.form select { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 16px; background: #fff; font-weight: 400; color: var(--text); }
.form textarea { font-family: inherit; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 8px 0 16px; position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.form-actions .btn { width: auto; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.row-btns.left { justify-content: flex-start; }
.row-btns .btn { width: auto; }
.btn.danger { background: var(--red); color: #fff; box-shadow: none; }
.btn.secondary.danger { background: #fff; color: var(--red); border-color: #f1c9c7; }
.link-btn.danger { color: var(--red); }
.only-mobile {}
.nav-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 14px 14px 4px; }
.deadline { color: #a8660a; }
.deadline svg { color: #a8660a !important; }
.rapport { margin: 0 16px; font-size: 15px; }
.rapport h3 { margin: .6em 0 .3em; font-size: 16px; }
.photo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 0 12px; }
.photo-edit .avatar.xl { width: 96px; height: 96px; font-size: 30px; }
.avatar.xs { width: 32px; height: 32px; font-size: 12px; }
.login-h2 { color: #fff; margin: 0 0 6px; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.login-p { color: #fff; margin: 0 0 10px; font-size: 15px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.login form { gap: 12px; }

/* Menu contextuel, fenêtres, visionneuse */
.popmenu { position: absolute; z-index: 80; background: #fff; border-radius: 14px; box-shadow: 0 10px 32px rgba(15,36,89,.22); padding: 6px; min-width: 230px; animation: fade .15s; }
.popmenu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 11px 12px; border-radius: 10px; font-size: 15px; cursor: pointer; text-align: left; color: var(--text); }
.popmenu button:hover { background: var(--bg); }
.popmenu button svg { width: 20px; height: 20px; color: var(--navy); }
.popmenu button.danger, .popmenu button.danger svg { color: var(--red); }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal .scrim { position: absolute; inset: 0; background: rgba(12,20,45,.45); }
.modal .box { position: relative; background: #fff; border-radius: 18px; padding: 20px; width: min(440px, 100%); box-shadow: 0 16px 48px rgba(0,0,0,.25); animation: fade .15s; }
.modal .box p { margin: 0 0 6px; font-size: 16px; }
.modal .box h3 { margin: 0 0 8px; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.94); display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; }
.lightbox button { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lightbox button svg { width: 24px; height: 24px; }
.lb-x { top: calc(var(--safe-top) + 12px); right: 12px; }
.lb-p { left: 10px; top: 50%; } .lb-n { right: 10px; top: 50%; }
.lb-c { position: absolute; bottom: calc(var(--safe-bottom) + 16px); color: #fff; font-size: 14px; }
.lightbox .lb-c button { position: static; width: auto; height: auto; background: none; border-radius: 0; display: inline; }

/* Photos */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding: 0 16px; }
.album { color: var(--text); }
.album .cover { aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; background: var(--blue-50); display: grid; place-items: center; box-shadow: var(--shadow); }
.album .cover img { width: 100%; height: 100%; object-fit: cover; }
.album .cover svg { width: 40px; height: 40px; color: var(--blue-600); }
.album .t { font-weight: 700; margin-top: 8px; font-size: 15px; line-height: 1.25; }
.album .s { color: var(--muted); font-size: 13px; }
.album-head { padding: 12px 16px 6px; }
.album-head h2 { margin: 0; }
.grid-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; padding: 0 4px; }
.grid-photos .ph { border: 0; padding: 0; aspect-ratio: 1; overflow: hidden; background: #dfe4ee; cursor: pointer; }
.grid-photos img { width: 100%; height: 100%; object-fit: cover; }

/* Candidatures */
.cand h3 { margin: 0; font-size: 18px; }
.cand-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.cand-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.cand-f { margin: 4px 0; font-size: 14.5px; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 18px; }
.vote-box { margin-top: 12px; display: grid; gap: 10px; }
.vote-box .btn { margin: 0; }
.vote-res { margin-top: 10px; padding: 10px 12px; background: var(--bg); border-radius: 12px; font-size: 14px; }
.vote-res ul { margin: 6px 0 0; padding-left: 18px; }

/* Gestion : tableaux, indicateurs, barres d'outils */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.toolbar .chips { padding: 0; }
.toolbar .btn { width: auto; }
.toolbar select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 15px; background: #fff; }
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 12px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #f7f9fd; }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl .acts select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 14px; background: #fff; }
.tbl.small { font-size: 13.5px; }
.tbl .details { max-width: 420px; color: var(--muted); word-break: break-word; }
.tbl.matrix td.c { text-align: center; }
.tbl.matrix input { width: 20px; height: 20px; accent-color: var(--blue-600); }
.tbl.matrix tr.grp td { background: var(--blue-50); color: var(--navy); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.fn-small { color: var(--blue-600); font-weight: 600; font-size: 13px; }
.bar { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: var(--grey-50); vertical-align: middle; overflow: hidden; margin-left: 6px; }
.bar span { display: block; height: 100%; background: var(--green); }
@media (max-width: 760px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .tbl td { border: 0; padding: 4px 10px; }
  .tbl td[data-l]::before { content: attr(data-l) " : "; color: var(--muted); font-size: 12.5px; }
  .tbl .acts { text-align: left; }
  .tbl.matrix thead { display: table-header-group; }
  .tbl.matrix, .tbl.matrix tbody { display: table; } .tbl.matrix tr { display: table-row; } .tbl.matrix td { display: table-cell; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.kpi { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; }
.kpi b { display: block; font-size: 24px; color: var(--navy); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.ok b { color: var(--green); } .kpi.warn b { color: #a8660a; } .kpi.bad b { color: var(--red); }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 420px; overflow: auto; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px; }
.chk { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; font-size: 14px; font-weight: 400 !important; color: var(--text) !important; cursor: pointer; }
.chk:hover { background: var(--bg); }
.chk input, .chk-inline input { width: 18px; height: 18px; accent-color: var(--blue-600); flex: none; padding: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.chk-inline { display: inline-flex !important; align-items: center; gap: 7px; font-weight: 400 !important; font-size: 15px !important; color: var(--text) !important; }
.wrapchips { flex-wrap: wrap; overflow: visible; padding: 0 0 10px; }
.search input[data-q] { background: transparent; }
.wrap.wide .search { margin: 0 0 10px; }
.guest-form input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.list.bordered { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.doc-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.rte-bar { display: flex; gap: 6px; margin: 8px 0 6px; }
.rte-bar button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 14px; }
.rte { min-height: 140px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none; }
.rte:focus { outline: 2px solid var(--blue-600); }
.cols2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 1024px) { .cols2 { grid-template-columns: 1.2fr 1fr; gap: 28px; } }
.cols2 fieldset { margin-bottom: 14px; }
.role-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14.5px; }
.preview-notif { display: flex; gap: 12px; align-items: flex-start; background: rgba(240,242,248,.95); border-radius: 16px; padding: 12px 14px; font-size: 14px; box-shadow: var(--shadow); }
.preview-notif img { width: 36px; height: 36px; border-radius: 8px; }
.segment button[disabled] { opacity: .45; }
.acct { flex-basis: 100%; }

/* ---------- Ordinateur : barre latérale ---------- */
.sidebar { display: none; }
@media (min-width: 1024px) {
  #app { max-width: none; box-shadow: none; display: grid; grid-template-columns: 272px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: #fff; border-right: 1px solid var(--line); padding: 18px 12px;
  }
  .sidebar .head { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; }
  .sidebar a, .sidebar button.item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-size: 15px; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
  .sidebar a svg, .sidebar button.item svg { width: 20px; height: 20px; color: var(--navy); flex: none; }
  .sidebar a:hover { background: var(--bg); }
  .sidebar a.active { background: var(--blue-50); color: var(--blue-600); font-weight: 600; }
  .sidebar a.active svg { color: var(--blue-600); }
  #tabbar { display: none !important; }
  main#view { padding-bottom: 32px; min-width: 0; }
  main#view > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
  main#view > .topbar, main#view > .hero { max-width: none; }
  .hero-home.photo { min-height: 220px; }
  .hero-home h2 { font-size: 52px; }
  .only-mobile { display: none !important; }
  .page-title { padding-top: 28px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .form-actions { bottom: 0; }
  .toast { bottom: 24px; left: calc(50% + 136px); }
  body.public #app { display: block; }
  body.public .sidebar { display: none; }
  body.public main#view > * { max-width: none; }
  .login.photo { min-height: 100vh; display: grid; place-content: center; gap: 30px; background-position: center 30%; }
  .login .login-bottom { width: 400px; }
}
@media (min-width: 1024px) { main#view > .wrap.narrow, main#view > form.wrap.narrow { max-width: 760px; } }
.form label.chk { display: flex; }
.form label.chk-inline { display: inline-flex; }

/* v2.1 — groupes et documents */
a.tag { text-decoration: none; }
a.tag:hover { border-color: var(--blue-600); }
.row.doc { padding-top: 0; padding-bottom: 0; padding-right: 6px; }
.row-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 12px 0; min-width: 0; }
.doc-ext { font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 20px 10px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--blue-600); text-decoration: none; }
.crumbs span svg { width: 14px; height: 14px; vertical-align: -2px; }
.crumbs b { color: var(--navy); }
label.btn { cursor: pointer; }
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.sortable:hover { color: var(--blue-600); }
.tbl th.sortable .dir { font-size: 11px; margin-left: 3px; }
.rang { color: var(--muted); font-variant-numeric: tabular-nums; width: 2.5em; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; margin: 8px 0; }
.checkgrid label { display: flex; align-items: center; gap: 8px; font-weight: 400; padding: 6px 8px; border-radius: 8px; background: #f7f8fb; }
.checkgrid label.on { background: var(--blue-50); }
.checkgrid label.hide { display: none; }
a.brand { text-decoration: none; cursor: pointer; }
.diag { margin-top: 12px; font-size: 13px; color: var(--muted); }
.diag summary { cursor: pointer; }
.diag div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.testres { margin-top: 12px; display: grid; gap: 8px; font-size: 14px; }
.testres > div { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; }
.testres > div svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.testres .ok { background: #e7f6ec; color: #17603a; }
.testres .ko { background: #fdecec; color: #9b1c1c; }
.choices.four { grid-template-columns: repeat(2, 1fr); }
.choice > span { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.choice small { font-weight: 400; font-size: 12px; opacity: .8; margin-top: 2px; }
@media (min-width: 700px) { .choices.four { grid-template-columns: repeat(4, 1fr); } }

/* ---------- App native (App Store / Google Play) ---------- */
.lh-lock {
  position: fixed; inset: 0; z-index: 1000; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: calc(24px + var(--safe-top)) 32px calc(24px + var(--safe-bottom)); text-align: center;
}
.lh-lock img { width: 120px; height: 120px; margin-bottom: 8px; }
.lh-lock h1 { margin: 0; font-size: 22px; color: var(--navy, #0f2459); }
.lh-lock p { margin: 0 0 16px; color: var(--muted); }
.lh-lock .btn { width: 100%; max-width: 320px; }
/* Pas de sélection de texte accidentelle ni de menu « loupe » sur les éléments d'interface */
.native .tabbar, .native .topbar, .native .tile, .native .btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
