/* ==========================================================
   Repérix — feuille de style
   "Le repère de toute la famille."
   - Mobile-first, responsive, gros boutons
   - Variables CSS pour theming facile
   ========================================================== */

:root {
    --bg: #f6f7fb;
    --bg-card: #ffffff;
    --text: #1c2330;
    --text-soft: #5d6776;
    --muted: #8c95a4;
    --border: #e7eaf0;
    --primary: #6c8cff;
    --primary-dark: #4f6ddc;
    --primary-soft: #eef2ff;
    --danger: #e85a6c;
    --warn: #f7b955;
    --success: #41c98e;
    --shadow-sm: 0 1px 2px rgba(20, 27, 45, .06);
    --shadow-md: 0 4px 16px rgba(20, 27, 45, .08);
    --shadow-lg: 0 12px 32px rgba(20, 27, 45, .14);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #11151d;
        --bg-card: #1a1f2b;
        --text: #e8ecf3;
        --text-soft: #a9b2c1;
        --muted: #7a8493;
        --border: #29303d;
        --primary-soft: #1f2a4a;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
        --shadow-md: 0 4px 18px rgba(0, 0, 0, .4);
        --shadow-lg: 0 16px 36px rgba(0, 0, 0, .55);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; cursor: pointer; }

h1, h2, h3 { color: var(--text); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ============== Top navigation (desktop) ============== */
.top-nav {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1rem;
    padding: .75rem 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.brand {
    display: flex; align-items: center; gap: .55rem;
    color: var(--text); font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-emoji { font-size: 1.4rem; }

.top-nav-tabs {
    display: flex; gap: .25rem; flex: 1;
    margin-left: 1rem;
}
.top-nav-tabs a {
    padding: .55rem .9rem;
    border-radius: 999px;
    color: var(--text-soft);
    font-weight: 600;
}
.top-nav-tabs a:hover { background: var(--primary-soft); text-decoration: none; }
.top-nav-tabs a.active { background: var(--primary); color: #fff; }

.top-nav-user {
    display: flex; align-items: center; gap: .75rem;
}
.user-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .7rem;
    background: var(--primary-soft);
    border-radius: 999px;
    border-left: 3px solid var(--c, var(--primary));
    font-weight: 600;
}
.btn-link { color: var(--text-soft); }

/* ============== Bottom nav (mobile) ============== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: none;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: .35rem 0 calc(.35rem + var(--safe-bottom));
    z-index: 40;
}
.bottom-nav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center;
    padding: .35rem;
    color: var(--text-soft);
    font-size: .75rem;
    font-weight: 600;
}
.bottom-nav a.active { color: var(--primary); }
.bn-icon { font-size: 1.4rem; line-height: 1; }
.bn-label { margin-top: 2px; }

@media (max-width: 720px) {
    .top-nav-tabs, .top-nav-user .btn-link { display: none; }
    .bottom-nav { display: flex; }
    .page { padding-bottom: 90px !important; }
}

/* ============== Page wrapper ============== */
.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem;
}
.page--auth {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
    background: var(--bg);
}

.page-header { margin-bottom: 1.25rem; }
.page-header h1 { margin: 0 0 .35rem 0; }
.page-header .muted { margin: 0; }

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

/* ============== Boutons ============== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--primary-soft); color: var(--text);
    font-weight: 600; font-size: .95rem;
    transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger  { background: #ffe9ec; color: var(--danger); border-color: #ffd0d6; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block   { width: 100%; }
.btn-small   { padding: .35rem .7rem; font-size: .85rem; }

/* ============== Forms ============== */
.field {
    display: block; margin-bottom: .85rem;
}
.field > span {
    display: block;
    font-size: .85rem; font-weight: 600; color: var(--text-soft);
    margin-bottom: .35rem;
}
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=date],
.field input[type=datetime-local],
.field input[type=number],
.field select,
.field textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, .18);
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

.form-stack { display: flex; flex-direction: column; gap: .75rem; }

.alert {
    padding: .65rem .85rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-error { background: #ffe9ec; color: #c43a4d; border: 1px solid #ffc9d1; }

/* ============== Auth pages ============== */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    padding: 2.5rem 2rem 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo {
    font-size: 2.5rem;
    line-height: 1;
    display: inline-block;
    margin-bottom: .35rem;
}
.auth-title {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    text-align: center;
}
.auth-tagline {
    margin: .4rem 0 0 0;
    text-align: center;
    color: var(--text-soft);
    font-size: .9rem;
    font-style: italic;
}

/* Onglets Fonder / Rejoindre */
.auth-tabs {
    display: flex;
    gap: .25rem;
    margin-bottom: 1.5rem;
    background: var(--bg);
    border-radius: 999px;
    padding: 4px;
    border: 1px solid var(--border);
}
.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: .55rem .8rem;
    border-radius: 999px;
    color: var(--text-soft);
    font-weight: 600;
    font-size: .9rem;
    transition: background .15s ease, color .15s ease;
}
.auth-tabs a.active { background: var(--primary); color: #fff; }
.auth-tabs a:hover  { text-decoration: none; }

/* Formulaire d'authentification : labels au-dessus, alignement net */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-form label {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-soft);
}
.auth-form input {
    width: 100%;
    padding: .8rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-form input::placeholder { color: var(--muted); }
.auth-form input:hover  { border-color: #c8cfdc; }
.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, .18);
    background: var(--bg-card);
}

/* Bouton principal du formulaire d'auth */
.auth-form .btn-block {
    margin-top: .5rem;
    padding: .85rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.auth-foot {
    margin: 1.5rem 0 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-soft);
    font-size: .9rem;
}

/* Alerte dans la carte d'auth */
.auth-card .alert {
    margin-bottom: 1.25rem;
}

/* Footer discret avec slogan */
.app-footer {
    text-align: center;
    margin: 2rem 0 1rem 0;
    font-size: .8rem;
    color: var(--muted);
    font-style: italic;
}
.app-footer .heart { color: #ff7a90; }

/* ============== Calendrier ============== */
.cal-header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: .75rem; margin-bottom: .75rem;
}
.cal-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-title h1 {
    margin: 0; font-size: 1.35rem; min-width: 8em; text-align: center;
    text-transform: capitalize;
}
.cal-arrow {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text);
    font-size: 1.4rem; line-height: 1;
}
.cal-arrow:hover { background: var(--primary-soft); }

.cal-views {
    display: inline-flex; padding: 4px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 999px;
}
.cal-view-btn {
    padding: .45rem .85rem; border: none; background: transparent;
    border-radius: 999px; font-weight: 600; color: var(--text-soft);
}
.cal-view-btn.active { background: var(--primary); color: #fff; }

/* Filters */
.cal-filters {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem; margin-bottom: 1rem;
    display: flex; flex-direction: column; gap: .5rem;
}
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.filter-label { font-size: .8rem; color: var(--text-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; min-width: 90px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    border: 2px solid var(--c, var(--border));
    background: var(--bg);
    color: var(--text-soft);
    font-size: .85rem; font-weight: 600;
    transition: background .15s ease, color .15s ease;
}
.chip.active { background: var(--c); color: #fff; }
.chip-emoji { font-size: 1rem; }

.switch { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.switch input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
.switch-inline { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }

/* Body : 3 vues */
.cal-body { min-height: 300px; }
.cal-loading { padding: 3rem; text-align: center; color: var(--muted); }

/* --- Vue Agenda (liste chronologique) --- */
.agenda { display: flex; flex-direction: column; gap: 1rem; }
.agenda-day {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.agenda-day--selected {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent), var(--shadow-sm);
}
.agenda-upcoming-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .35rem .6rem;
    margin: .25rem 0 0;
    padding: .35rem .15rem 0;
    border-top: 1px dashed var(--border);
}
.agenda-upcoming-title {
    font-weight: 800;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-soft);
}
.agenda-truncated,
.agenda-empty-day { padding: .25rem .35rem; line-height: 1.35; }
.agenda-day-header {
    padding: .6rem .9rem;
    background: var(--primary-soft);
    display: flex; align-items: center; gap: .5rem;
    font-weight: 700;
}
.agenda-day-header.today { background: var(--primary); color: #fff; }
.agenda-day-header .dow  { text-transform: uppercase; font-size: .8rem; opacity: .8; letter-spacing: .04em; }
.agenda-day-header .num  { font-size: 1.4rem; line-height: 1; }
.agenda-day-list { padding: .35rem; display: flex; flex-direction: column; gap: .35rem; }

.agenda-event {
    display: flex; align-items: stretch; gap: .65rem;
    padding: .6rem .65rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--c, var(--primary));
    transition: background .15s ease;
    cursor: pointer;
}
.agenda-event:hover { background: var(--primary-soft); }
.ae-time { min-width: 65px; color: var(--text-soft); font-size: .85rem; font-weight: 600; }
.ae-time .dash { display: block; opacity: .5; font-size: .65rem; }
.ae-content { flex: 1; min-width: 0; }
.ae-title { font-weight: 700; }
.ae-meta { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin-top: .15rem; font-size: .8rem; color: var(--text-soft); }
.ae-cat { display: inline-flex; align-items: center; gap: .25rem; }
.ae-priv { color: var(--warn); font-weight: 700; }
.ae-recur { display: inline-flex; align-items: center; gap: .15rem; }
.ae-people { display: flex; gap: 2px; flex-shrink: 0; }
.ae-people .pp {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-card);
    background: var(--c); color: #fff;
    font-size: .75rem;
    margin-left: -6px;
}
.ae-people .pp:first-child { margin-left: 0; }

.agenda-empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.agenda-empty .emoji { font-size: 3rem; display: block; margin-bottom: .5rem; }

/* --- Bandeaux jours fériés / vacances (vue Agenda) ---
   Information de fond, pas un évènement → look discret et pâle. */
.holiday-banner {
    display: flex; align-items: center; gap: .4rem;
    padding: .3rem .65rem;
    background: transparent;
    border: 1px dashed transparent;
    border-radius: 999px;
    margin: .25rem .35rem;
    font-size: .8rem;
    font-style: italic;
}
.holiday-banner.public {
    color: #b08a3a;
    border-color: #f0e2b0;
    background: #fffdf6;
}
.holiday-banner.school {
    color: #5a8db8;
    border-color: #d6e7f5;
    background: #f6fafd;
}
.holiday-banner .hb-icon { opacity: .8; font-style: normal; }
.holiday-banner .hb-name { font-weight: 600; }
.holiday-banner .hb-range { opacity: .7; font-style: italic; font-weight: 400; }

/* Fond pâle des journées en vacances/fériés (vue Agenda) */
.agenda-day.day-holiday-public { background: #fffdf6; }
.agenda-day.day-holiday-school { background: #f6fafd; }
.agenda-day.day-holiday-public .agenda-day-header:not(.today) { background: #fbf3df; color: #946d20; }
.agenda-day.day-holiday-school .agenda-day-header:not(.today) { background: #e9f1f9; color: #2c6da3; }

/* --- Vue Mois --- */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.month-dow {
    background: var(--bg-card);
    padding: .5rem .35rem;
    text-align: center;
    font-size: .75rem; font-weight: 700; color: var(--text-soft);
    text-transform: uppercase; letter-spacing: .05em;
}
.month-cell {
    background: var(--bg-card);
    min-height: 110px;
    padding: .35rem;
    display: flex; flex-direction: column;
    overflow: hidden;
    cursor: pointer;
}
.month-cell.other-month { background: var(--bg); color: var(--muted); }
.month-cell.is-today .month-num {
    background: var(--primary); color: #fff;
    border-radius: 999px; padding: 0 .4rem; min-width: 24px; text-align: center;
}
/* Vue mois : pas de fond teinté vacances/fériés — uniquement les petits libellés le signalent,
   sinon tout ressemble au « mois précédent/suivant » grisé et ce n'est pas lisible. */
.month-num { font-weight: 700; font-size: .9rem; align-self: flex-start; }

/* Libellé vacances/férié — UNIQUEMENT au premier jour visible, italique pâle */
.month-holiday-label {
    font-size: .68rem;
    font-style: italic;
    line-height: 1.1;
    margin-top: 1px;
    padding: 1px 3px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .85;
}
.month-holiday-label.public { color: #a17418; background: #fbf2dc; }
.month-holiday-label.school { color: #2868a8; background: #e7f1f9; }

/* Empile plusieurs indicateurs vacances/fériés sans casser la grille */
.month-holiday-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 3px;
    flex-shrink: 0;
}
.month-events { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; overflow: hidden; }
.month-pill {
    display: flex; align-items: center; gap: 4px;
    background: var(--c, var(--primary));
    color: #fff;
    border-radius: 5px;
    padding: 2px 5px;
    font-size: .72rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.month-pill.allday { background: var(--c, var(--primary)); }
.month-pill .dot { width: 6px; height: 6px; background: #fff; border-radius: 50%; flex-shrink: 0; }
.month-more { font-size: .7rem; color: var(--text-soft); padding-left: 3px; cursor: pointer; }

@media (max-width: 720px) {
    .month-cell { min-height: 70px; padding: .2rem; }
    .month-pill { font-size: .65rem; padding: 1px 3px; }
}

/* --- Vue Semaine --- */
.week-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.week-allday-row {
    display: grid;
    grid-template-columns: 60px repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.week-allday-row .lbl { padding: .35rem; font-size: .75rem; color: var(--muted); }
.week-allday-cell { padding: .25rem; min-height: 28px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.week-allday-cell.is-holiday-public { background: #fefaf0; }
.week-allday-cell.is-holiday-school { background: #f5f9fc; }

/* Libellé vacances/férié dans la rangée all-day de la vue Semaine */
.week-holiday-label {
    font-size: .68rem;
    font-style: italic;
    line-height: 1.1;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .85;
}
.week-holiday-label.public { color: #a17418; background: #fbf2dc; }
.week-holiday-label.school { color: #2868a8; background: #e7f1f9; }

.week-holiday-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}
.week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, minmax(0, 1fr));
    position: relative;
}
.week-hour {
    grid-column: 1;
    min-height: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: .7rem;
    color: var(--muted);
    padding: 0 4px;
}
.week-hour.week-hour--compact {
    font-size: .62rem;
    color: var(--text-soft);
}
.week-cell {
    min-height: 0;
    align-self: stretch;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    cursor: pointer;
}
.week-day-header {
    text-align: center;
    padding: .5rem .25rem;
    font-weight: 700;
    border-left: 1px solid var(--border);
    font-size: .85rem;
}
.week-day-header.today { color: var(--primary); }
.week-day-header .num { font-size: 1.25rem; display: block; }

.week-event {
    position: absolute;
    background: var(--c, var(--primary));
    color: #fff;
    border-radius: 6px;
    padding: 3px 5px;
    font-size: .75rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    z-index: 2;
}
.week-event .we-title { font-weight: 700; }
.week-event .we-time  { opacity: .85; font-size: .68rem; }

@media (max-width: 720px) {
    .week-allday-row, .week-grid { grid-template-columns: 38px repeat(7, minmax(0, 1fr)); }
    .week-day-header { font-size: .7rem; }
    .week-day-header .num { font-size: 1rem; }
    .week-hour { font-size: .6rem; }
}

/* ============== FAB ============== */
.fab {
    position: fixed;
    right: 18px;
    bottom: calc(80px + var(--safe-bottom));
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--primary); color: #fff;
    border: none;
    font-size: 2rem; line-height: 1;
    box-shadow: var(--shadow-lg);
    z-index: 30;
    transition: transform .12s ease;
}
.fab:hover { transform: scale(1.06); }
.fab:active { transform: scale(.96); }
@media (min-width: 721px) {
    .fab { bottom: 28px; }
}

/* ============== Modal ============== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(20, 27, 45, .55);
    animation: fade-in .2s ease;
}
.modal-card {
    position: relative;
    width: 100%; max-width: 560px;
    max-height: 92vh; overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    animation: slide-up .25s cubic-bezier(.2, .9, .3, 1);
}
@media (min-width: 640px) {
    .modal { align-items: center; }
    .modal-card { border-radius: var(--radius-lg); }
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-close {
    background: transparent; border: none; font-size: 1.6rem; line-height: 1;
    color: var(--text-soft); padding: 0 .25rem;
}
.modal-body { padding: 1.25rem; }
.modal-foot {
    display: flex; gap: .5rem; align-items: center;
    padding-top: 1rem; margin-top: 1rem;
    border-top: 1px solid var(--border);
}

@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }

/* Member picker dans la modal d'event */
.member-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.member-pick {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .65rem; border-radius: 999px;
    border: 2px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    user-select: none;
    font-size: .85rem; font-weight: 600;
    color: var(--text-soft);
}
.member-pick input { display: none; }
.member-pick:has(input:checked) { background: var(--c); color: #fff; border-color: var(--c); }
.mp-emoji { font-size: 1rem; }

/* Récurrence bloc */
.recur-block summary { cursor: pointer; padding: .5rem 0; font-weight: 700; color: var(--text-soft); }
.recur-grid { display: grid; grid-template-columns: 1fr 90px 1fr; gap: .5rem; }
@media (max-width: 480px) { .recur-grid { grid-template-columns: 1fr; } }
.byday-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .5rem; }
.byday-chip input { display: none; }
.byday-chip span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 2px solid var(--border); border-radius: 999px;
    font-weight: 700; cursor: pointer;
    background: var(--bg);
}
.byday-chip input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============== Famille ============== */
.invite-card {
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, var(--primary) 0%, #9b6cff 100%);
    color: #fff;
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}
.invite-card .muted { color: rgba(255,255,255,.85); }
.invite-card .btn-ghost { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.4); }
.invite-card .btn-ghost:hover { background: rgba(255,255,255,.3); }
.invite-code {
    font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", monospace;
    font-size: 1.6rem;
    letter-spacing: .2em;
    font-weight: 700;
}

.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.member-card {
    display: flex; align-items: center; gap: .75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--c);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    box-shadow: var(--shadow-sm);
}
.member-emoji { font-size: 2rem; line-height: 1; }
.member-info  { flex: 1; min-width: 0; }
.member-name  { font-weight: 700; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.member-meta  { color: var(--text-soft); }
.badge {
    display: inline-flex; align-items: center;
    background: var(--primary); color: #fff;
    border-radius: 999px; padding: 1px 8px; font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
.badge-soft { background: var(--primary-soft); color: var(--primary-dark); }
.member-actions { flex-shrink: 0; }

/* ============== Catégories ============== */
.cat-list { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.cat-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .65rem .35rem;
    border-bottom: 1px solid var(--border);
}
.cat-item:last-child { border-bottom: none; }
.cat-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.cat-icon { font-size: 1.2rem; }
.cat-name { flex: 1; font-weight: 600; }

/* Color & emoji pickers */
.color-picker, .emoji-picker {
    display: flex; flex-wrap: wrap; gap: .35rem;
}
.color-picker .swatch {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
}
.color-picker .swatch.active { border-color: var(--text); }
.emoji-picker .em {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 2px solid transparent;
    cursor: pointer;
}
.emoji-picker .em.active { border-color: var(--primary); background: var(--primary-soft); }

/* Toast */
.toast {
    position: fixed; left: 50%; bottom: 100px;
    transform: translateX(-50%);
    background: var(--text); color: #fff;
    padding: .65rem 1rem; border-radius: 999px;
    font-size: .9rem; box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-8px); }
.toast.error { background: var(--danger); }
