:root {
  --brand: #cf2030;
  --brand-ink: #fff;
  --bg: #f6f6f8;
  --surface: #ffffff;
  --text: #17171c;
  --muted: #6b6b76;
  --border: #e3e3e8;
  --ok: #1f9d55;
  --warn: #d9861c;
  --bad: #d23b30;
  --info: #5865e6;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e12;
    --surface: #17171d;
    --text: #ececf1;
    --muted: #9a9aa6;
    --border: #2a2a33;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

/* --- Connexion --- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; letter-spacing: .02em; font-size: 14px; }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.15; }
.brand-name small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg); font-size: 16px; }
.field input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.btn { border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 650; font-size: 15px; background: var(--brand); color: var(--brand-ink); cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 16px; line-height: 1.45; }
.hint a { color: var(--brand); }

/* --- Coquille --- */
.shell { display: flex; min-height: 100dvh; }
.side { width: 240px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; }
.side .brand { padding: 0 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 560; font-size: 15px; }
.nav-item:hover { background: var(--bg); }
.nav-item.on { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.side-foot .who { font-weight: 600; }
.side-foot .role { color: var(--muted); margin-bottom: 8px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
.main { flex: 1; min-width: 0; }
.page-head { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding: calc(env(safe-area-inset-top) + 12px) 24px 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.page-body { padding: 18px 24px 40px; max-width: 900px; }
.tabbar { display: none; }

/* --- Accueil --- */
.hello { font-size: 15px; color: var(--muted); margin: 0 0 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mod-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.mod-card:hover { border-color: var(--brand); }
.mod-ic { width: 40px; height: 40px; border-radius: 11px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.mod-ic svg { width: 22px; height: 22px; }
.mod-card b { display: block; font-size: 15.5px; margin-bottom: 2px; }
.mod-card span { font-size: 13px; color: var(--muted); }
.soon { opacity: .55; border-style: dashed; }

/* --- Mobile --- */
@media (max-width: 760px) {
  .side { display: none; }
  .page-head { padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; }
  .page-body { padding: 14px 16px calc(env(safe-area-inset-bottom) + 160px); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; text-decoration: none; color: var(--muted); padding: 4px 0; }
  .tabbar a.on { color: var(--brand); }
  .tabbar svg { width: 22px; height: 22px; }
}

/* --- Sélecteur de réunion (mercredis) --- */
.mp { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.mp-select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; text-transform: capitalize; max-width: 210px; }
.mp-arrow { width: 36px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; }
@media (max-width: 760px) { .mp { width: 100%; } .mp-select { flex: 1; max-width: none; } }
