/* Flou (backdrop-filter) réservé aux couches réellement superposées : barres de navigation au-dessus
   du contenu qui défile et modales en verre (demande de Pierre). avoid-ai-design-ignore-file: K3 */
/* =============================================================================
   ESPACE ÉQUIPE (/app)
   ============================================================================= */

/* --- Coque : barre latérale (ordi) / barre d'onglets en bas (téléphone) ----- */
.shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100dvh;
}
.sidebar { display: none; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    padding-top: max(var(--space-3), env(safe-area-inset-top));
    background: rgba(16, 33, 63, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.shell > div { min-width: 0; }
.main {
    min-width: 0;
    padding: var(--space-5) var(--space-4) calc(88px + env(safe-area-inset-bottom));
}
.main__inner { max-width: 1280px; margin: 0 auto; }

.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    /* Autant de colonnes égales que de liens (3 pour l'équipe, 4 avec « Admin ») */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: var(--space-1) var(--space-2) max(var(--space-2), env(safe-area-inset-bottom));
    background: rgba(11, 24, 48, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
}
.tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: var(--space-2) 0;
    color: var(--mist);
    font-size: 0.6875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
}
.tabbar a[aria-current="page"] { color: var(--aurora); }
.tabbar svg, .nav svg { width: 22px; height: 22px; }

@media (min-width: 960px) {
    /* minmax(0, 1fr) : sinon la colonne s'élargit au contenu le plus large (filtres) */
    .shell { grid-template-columns: 236px minmax(0, 1fr); }
    .topbar, .tabbar { display: none; }
    .sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        gap: var(--space-5);
        height: 100dvh;
        padding: var(--space-5) var(--space-4);
        border-right: 1px solid var(--line);
        background: rgba(11, 24, 48, 0.35);
    }
    .main { padding: var(--space-6) var(--space-6) var(--space-8); }
}

.nav { display: grid; gap: 2px; }
.nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    color: var(--mist);
    font-weight: 600;
    font-size: var(--text-sm);
    text-decoration: none;
}
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-strong); color: var(--ink); }
.nav a[aria-current="page"] svg { color: var(--aurora); }
.nav__sep { height: 1px; margin: var(--space-2) var(--space-3); background: var(--line); }

.sidebar__user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: var(--text-sm);
}
.sidebar__user small { display: block; color: var(--mist); }
/* Avatar + nom cliquables → « Mon profil » */
.sidebar__profile {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: calc(-1 * var(--space-2));
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}
.sidebar__profile:hover, .sidebar__profile[aria-current="page"] { background: var(--surface-strong); }
.sidebar__profile span { min-width: 0; }
.sidebar__profile strong, .sidebar__profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__profile { display: inline-flex; border-radius: 50%; }

/* --- En-tête de page ---------------------------------------------------------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
}
.page-head h1 { font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl)); }
.page-head__sub { color: var(--mist); margin-top: var(--space-1); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* --- Panneaux ---------------------------------------------------------------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}
.panel--tight { padding: var(--space-4); }
.panel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.panel__head h2 { font-size: var(--text-lg); }
.panel__head a { color: var(--mist); font-size: var(--text-sm); }

.grid-2 { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: var(--space-4); }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: 2fr 1fr; } }

.muted { color: var(--mist); }
.small { font-size: var(--text-sm); }
.tnum { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: var(--space-3); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.prose { max-width: 70ch; white-space: pre-line; }

/* --- Étiquettes et badges ---------------------------------------------------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--c, var(--mist));
    background: color-mix(in srgb, var(--c, var(--mist)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c, var(--mist)) 35%, transparent);
    white-space: nowrap;
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 700;
    background: var(--surface-strong);
    color: var(--mist);
}
.badge--warn { background: rgba(255, 209, 102, 0.14); color: var(--warning); }
.badge--danger { background: rgba(255, 107, 107, 0.14); color: var(--danger); }
.badge--ok { background: rgba(245, 138, 31, 0.14); color: var(--aurora); }

/* --- Filtres / contrôle segmenté -------------------------------------------- */
.segmented {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.segmented a, .segmented button {
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--mist);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.segmented [aria-current="page"], .segmented [aria-pressed="true"] { background: var(--ink); color: var(--night); }

.filters {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-3);
    scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--mist);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.filter-chip[aria-pressed="true"] {
    color: var(--ink);
    border-color: var(--c, var(--aurora));
    background: color-mix(in srgb, var(--c, var(--aurora)) 16%, transparent);
}

/* --- Listes ---------------------------------------------------------------- */
.list { list-style: none; display: grid; }
.list > li + li { border-top: 1px solid var(--line); }
.list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    text-decoration: none;
    min-width: 0;
}
a.list-item:hover .list-item__title { color: var(--aurora); }
.list-item__main { min-width: 0; flex: 1; }
.list-item__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list-item__meta { color: var(--mist); font-size: var(--text-sm); }
.list-item__date {
    flex: none;
    width: 52px;
    text-align: center;
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    line-height: 1;
}
.list-item__date b { display: block; font-size: var(--text-xl); }
.list-item__date span { font-size: var(--text-xs); color: var(--mist); }

.empty {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--mist);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
}

/* Bandeau de message flash */
.flash {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface-strong);
    border-left: 3px solid var(--aurora);
}
.flash__text { flex: 1; min-width: 0; }
/* Croix de fermeture : zone de clic de 32 px pour le doigt */
.flash__close {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2)) calc(-1 * var(--space-1)) 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--mist);
    cursor: pointer;
}
.flash__close:hover, .flash__close:focus-visible { background: var(--surface); color: var(--ink); }
.flash { transition: opacity .2s, transform .2s; }
.flash.is-closing { opacity: 0; transform: translateY(-4px); }
.flash--error { border-left-color: var(--danger); }
.flash--warning { border-left-color: var(--warning); }

/* =============================================================================
   CALENDRIER : façon planning papier
   ============================================================================= */
.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.cal-toolbar__title::first-letter { text-transform: uppercase; }
.cal-toolbar__title {
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    font-size: clamp(var(--text-2xl), 6vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}
.cal-toolbar__nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* Hauteurs partagées : ligne des numéros de jour et "piste" d'un bandeau d'événement */
.calendar-page { --daynum-h: 40px; --lane-h: 24px; }

.cal {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(11, 24, 48, 0.45);
}
.cal__weekdays, .cal__week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal__weekdays div {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--mist);
    border-bottom: 1px solid var(--line-strong);
}
.cal__week + .cal__week { border-top: 1px solid var(--line-strong); }
.cal__day {
    min-height: 128px;
    padding: var(--space-2);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    transition: background .15s;
    cursor: pointer;
}
.cal__day:first-child { border-left: 0; }
.cal__day--out { opacity: .38; }
.cal__day--weekend { background: rgba(255, 255, 255, 0.015); }
.cal__day.is-drop-target { background: rgba(245, 138, 31, 0.08); outline: 1px dashed var(--aurora); outline-offset: -3px; }
.cal__daynum {
    flex: none;
    height: 30px;
    /* Réserve la place des bandeaux d'événements posés juste sous le numéro */
    margin-bottom: calc(var(--lanes, 0) * var(--lane-h));
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    font-weight: 700;
    font-size: var(--text-lg);
    line-height: 1;
    color: var(--mist);
    font-variant-numeric: tabular-nums;
}
/* Aujourd'hui : numéro dans une pastille verte lumineuse */
.cal__day--today .cal__daynum span:first-child {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--aurora);
    color: var(--aurora-ink);
}
.cal__day--today { background: rgba(245, 138, 31, 0.05); }

/* Un reel dans une case : numéro + titre, encré de la couleur de sa catégorie */
.cal-reel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px;
    align-items: start;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--c) 13%, transparent);
    border-left: 3px solid var(--c);
    font-size: 0.75rem;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
}
.cal-reel:hover { background: color-mix(in srgb, var(--c) 24%, transparent); }
.cal-reel[draggable="true"] { cursor: grab; }
.cal-reel.is-dragging { opacity: .4; }
.cal-reel__num {
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    font-weight: 800;
    color: var(--c);
    font-variant-numeric: tabular-nums;
}
.cal-reel__title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cal-reel--published .cal-reel__title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }

/* Moment clé / activité / rendez-vous */
.cal-event {
    display: flex;
    gap: 4px;
    align-items: baseline;
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.6875rem;
    line-height: 1.3;
    color: var(--key-moment);
    text-decoration: none;
    min-width: 0;
}
.cal-event:hover { background: rgba(255, 126, 182, .1); }
.cal-event__time { font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.cal-event__icon { flex: none; align-self: center; display: inline-flex; }
.cal-event__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event--meeting { color: var(--mist); }
.cal-event--meeting:hover { background: var(--surface); }
.cal-event--activity { color: color-mix(in srgb, var(--key-moment) 70%, var(--ink)); }

/* Bandeaux d'événements (Period) : une "piste" par événement qui se chevauche */
.cal__band-slot {
    display: grid;
    align-items: center;
    min-width: 0;
    z-index: 1; /* au-dessus des cases des jours */
}
.cal__band {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 20px;
    margin: 0 4px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    background: color-mix(in srgb, var(--c) 30%, var(--night));
    border-left: 3px solid var(--c);
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}
.cal__band:hover, .cal__band:focus-visible {
    background: color-mix(in srgb, var(--c) 45%, var(--night));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 70%, transparent);
    outline: none;
}
.cal__band-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Petit "?" pour une date à confirmer */
.cal__band-tag {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    font-size: 0.625rem;
    background: color-mix(in srgb, var(--c) 60%, transparent);
}
/* L'événement continue sur la semaine précédente / suivante : bord coupé */
.cal__band--cont-left { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; border-left: 0; padding-left: 10px; }
.cal__band--cont-right { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.cal__band--tentative {
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--night)) 0 6px, color-mix(in srgb, var(--c) 12%, var(--night)) 6px 12px);
}

.cal-more { font-size: 0.6875rem; color: var(--mist); padding-left: 4px; }

/* Grille mensuelle sur grand écran, liste jour par jour sur téléphone */
.cal-agenda { display: none; }
@media (max-width: 760px) {
    .cal-agenda { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
}
.agenda-day {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}
.agenda-day--today { border-color: var(--aurora); box-shadow: 0 0 0 1px var(--aurora) inset; }
.agenda-day__date { text-align: center; font-family: var(--font-display); font-stretch: var(--display-stretch); line-height: 1; }
.agenda-day__date b { display: block; font-size: var(--text-2xl); }
.agenda-day__date span { font-size: var(--text-xs); color: var(--mist); }
.agenda-day__items { display: grid; gap: 6px; min-width: 0; }
.agenda-day__items .cal-reel { font-size: var(--text-sm); }
.agenda-day__items .cal-event { font-size: var(--text-sm); }
.agenda-day__items .cal-event__icon { flex: none; align-self: center; display: inline-flex; }
.cal-event__label { white-space: normal; }
.agenda-bands { display: flex; flex-wrap: wrap; gap: 6px; }
.agenda-bands .cal__band { margin: 0; height: 26px; font-size: var(--text-xs); }

/* Vue semaine : 7 colonnes sur ordi, empilées sur téléphone */
.week {
    display: grid;
    gap: var(--space-2);
}
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* Vue semaine : bandeaux continus au-dessus des colonnes (ordinateur) ou pastilles dans chaque jour (téléphone) */
.week-bands { display: none; }
.week__bands { display: grid; gap: 4px; }
.week__bands .cal__band { margin: 0; }
@media (min-width: 900px) {
    .week-bands {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        column-gap: var(--space-2);
        margin-bottom: var(--space-2);
    }
    .week-bands .cal__band { margin: 0; }
    .week__bands { display: none; }
}
.week__day {
    min-height: 140px;
    padding: var(--space-3);
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}
/* Aujourd'hui en vue semaine : même repère que la vue mois (numéro dans une pastille orange) + cadre plein */
.week__day--today { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal) inset; }
.week__day--today .week__head b {
    display: inline-grid;
    place-items: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--signal);
    color: var(--signal-ink);
    font-size: var(--text-lg);
}
.week__day--today .week__head span { color: var(--signal); font-weight: 700; }
.week__head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-1); }
.week__head b { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: var(--text-xl); }
.week__head span { color: var(--mist); font-size: var(--text-sm); text-transform: capitalize; }
.week__day .cal-event { font-size: var(--text-xs); }
.week__day .cal-event__icon { flex: none; align-self: center; display: inline-flex; }
.cal-event__label { white-space: normal; }

/* Légende */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); color: var(--mist); font-size: var(--text-sm); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* =============================================================================
   TIROIR DE DÉTAIL (fiche reel / événement) : <dialog> + turbo-frame
   ============================================================================= */
.drawer {
    width: min(560px, 100vw);
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--line-strong);
    background: #0B1528;
    color: var(--ink);
}
.drawer::backdrop { background: rgba(3, 6, 14, 0.6); backdrop-filter: blur(3px); }
.drawer[open] { animation: drawer-in .25s var(--ease); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.drawer__close { position: absolute; top: var(--space-3); right: var(--space-3); z-index: 2; }
.drawer__body { padding: var(--space-6) var(--space-5) var(--space-8); }
@media (max-width: 600px) {
    .drawer { width: 100vw; border-left: 0; }
    .drawer__body { padding: var(--space-6) var(--space-4) calc(var(--space-8) + env(safe-area-inset-bottom)); }
}

/* Fiche détail (réutilisée en page pleine et dans le tiroir) */
.sheet { display: grid; gap: var(--space-5); }
.sheet__title { font-size: clamp(var(--text-xl), 4vw, var(--text-2xl)); }
.sheet__num {
    font-family: var(--font-display); font-stretch: var(--display-stretch);
    font-weight: 800;
    font-size: 3.5rem;
    line-height: .9;
    color: var(--c, var(--aurora));
    letter-spacing: -0.04em;
}
.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}
.facts dt { color: var(--mist); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sheet section h3 { font-size: var(--text-base); margin-bottom: var(--space-2); color: var(--mist); }

/* Barre d'étapes du reel (Idée → Publié) */
.stages { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stages li {
    list-style: none;
    padding-top: 8px;
    border-top: 3px solid var(--line-strong);
    font-size: 0.6875rem;
    color: var(--mist-dim);
}
.stages li.is-done { border-color: var(--c, var(--aurora)); color: var(--mist); }
.stages li.is-current { border-color: var(--c, var(--aurora)); color: var(--ink); font-weight: 700; }

/* =============================================================================
   KANBAN
   ============================================================================= */
.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 86vw);
    gap: var(--space-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-3);
    margin: 0 calc(-1 * var(--space-4));
    padding-inline: var(--space-4);
}
@media (min-width: 900px) {
    .kanban { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding-inline: 0; }
}
.kanban__col {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    min-height: 60vh;
    border-radius: var(--radius-lg);
    background: rgba(11, 24, 48, 0.45);
    border: 1px solid var(--line);
}
.kanban__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--line);
}
.kanban__head h2 { font-size: var(--text-base); display: flex; align-items: center; gap: var(--space-2); }
.kanban__count { color: var(--mist); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.kanban__list { flex: 1; display: grid; align-content: start; gap: var(--space-2); padding: var(--space-3); min-height: 120px; }
.kanban__col[data-status="doing"] .kanban__head h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.kanban__col[data-status="todo"] .kanban__head h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mist); }
.kanban__col[data-status="done"] .kanban__head h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--aurora); }

.task-card {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius);
    background: #0F1A30;
    border: 1px solid var(--line);
    cursor: grab;
    touch-action: manipulation;
}
.task-card:hover { border-color: var(--line-strong); }
.task-card.sortable-ghost { opacity: .35; }
.task-card.sortable-chosen { box-shadow: 0 12px 30px rgba(0, 0, 0, .45); border-color: var(--aurora); }
.task-card__title { font-weight: 700; line-height: 1.3; text-decoration: none; }
.task-card__title:hover { color: var(--aurora); }
.task-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.task-card__links { display: flex; flex-wrap: wrap; gap: 4px; }
.task-tag { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: rgba(122, 162, 255, .16); color: #B8CCFF; font-size: .7rem; font-weight: 700; line-height: 1.4; }
.task-card--done .task-card__title { color: var(--mist); text-decoration: line-through; }
.priority--urgent { --c: var(--danger); }
.priority--high { --c: var(--warning); }
.priority--normal { --c: var(--mist); }
.priority--low { --c: var(--mist-dim); }

.quick-add__button { display: block; width: 100%; padding: 0 var(--space-3) var(--space-3); border: 0; background: transparent; color: var(--mist); text-align: left; font: inherit; cursor: pointer; }
.quick-add__button:hover { color: var(--aurora); }

/* =============================================================================
   MODALES : verre dépoli, on devine la page derrière
   ============================================================================= */
.app-modal {
    position: relative;
    width: min(620px, calc(100vw - 2rem));
    max-height: min(90svh, 820px);
    margin: auto;
    padding: var(--space-6);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Barre de défilement fine et translucide (au lieu de la grosse barre grise du système) */
    scrollbar-width: thin;
    scrollbar-color: rgba(241, 244, 249, .22) transparent;
    color: var(--ink);
    /* Fond semi-transparent + flou de ce qu'il y a derrière : du verre, sans lueurs décoratives */
    background: linear-gradient(165deg, rgba(22, 34, 60, .74), rgba(16, 33, 63, .82));
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid rgba(241, 244, 249, .14);
    border-radius: 24px;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, .50),
        inset 0 1px 0 rgba(255, 255, 255, .08); /* reflet sur l'arête du haut */
}
.app-modal::backdrop {
    background: rgba(3, 8, 18, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
/* Apparition : légère montée + fondu */
.app-modal[open] { animation: modal-in .24s cubic-bezier(.2, .8, .2, 1); }
.app-modal[open]::backdrop { animation: modal-fade .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes modal-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .app-modal[open], .app-modal[open]::backdrop { animation: none; }
}

.app-modal h2 { margin: 0 3rem var(--space-5) 0; font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: var(--text-xl); }
.app-modal__close { position: absolute; top: var(--space-3); right: var(--space-3); }
.app-modal__content .management-form { display: grid; gap: var(--space-4); }
.app-modal__content .management-form__actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
/* Champs un peu translucides pour rester dans l'esprit "verre" */
.app-modal .field input:not([type="checkbox"]):not([type="radio"]),
.app-modal .field select,
.app-modal .field textarea {
    background: rgba(255, 255, 255, .045);
    border-color: rgba(241, 244, 249, .12);
}
.app-modal .field select option { background: var(--night); }

/* Modale de confirmation (assets/lib/confirm.js) : compacte et centrée */
.confirm-modal { width: min(420px, calc(100vw - 2rem)); padding: var(--space-6) var(--space-5) var(--space-5); text-align: center; }
.confirm-modal h2 { margin: var(--space-3) 0 var(--space-2); }
.confirm-modal__icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: var(--aurora);
    background: rgba(245, 138, 31, .12);
    box-shadow: 0 0 0 6px rgba(245, 138, 31, .06);
}
.confirm-modal--danger .confirm-modal__icon { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 7%, transparent); }
.confirm-modal__message { margin: 0 0 var(--space-5); color: var(--mist); line-height: 1.5; }
.confirm-modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.confirm-modal__actions .btn { width: 100%; }
.confirm-modal__actions .btn--ghost { border-color: var(--line-strong); }
.confirm-modal .btn--danger { background: var(--danger); border-color: var(--danger); color: #2A0509; }
.confirm-modal .btn--danger:hover { filter: brightness(1.08); }

/* Attribution d'une tâche : une pastille par personne (case à cocher cachée dedans) */
.person-picker { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.field .person-pick {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, .03);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background .15s, border-color .15s, transform .1s;
}
.person-pick input { position: absolute; opacity: 0; pointer-events: none; }
.field .person-pick:hover { border-color: color-mix(in srgb, var(--person) 60%, transparent); }
.field .person-pick:active { transform: scale(.97); }
.field .person-pick:has(input:checked) {
    background: color-mix(in srgb, var(--person) 22%, transparent);
    border-color: var(--person);
}
.person-pick:has(input:focus-visible) { outline: 2px solid var(--aurora); outline-offset: 2px; }
.person-pick__check { display: none; color: var(--person); }
.person-pick:has(input:checked) .person-pick__check { display: block; }

/* Vue "qui est sur quoi" */
.people { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .people { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1300px) { .people { grid-template-columns: repeat(4, 1fr); } }
.person-col__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.person-col__head h2 { font-size: var(--text-lg); }

/* =============================================================================
   TABLEAU DE BORD
   ============================================================================= */
.countdown-card {
    position: relative;
    overflow: hidden;
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(245, 138, 31, 0.25);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(245, 138, 31, 0.22), transparent 55%),
        radial-gradient(80% 120% at 0% 100%, rgba(76, 201, 240, 0.16), transparent 60%),
        #0D1B36;
}
.countdown-card__label { color: var(--mist); font-weight: 600; }
.countdown-card__trip { font-size: clamp(var(--text-xl), 4vw, var(--text-3xl)); margin-top: var(--space-1); }
.golden-rule {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    /* Dégradé bleu (Pierre) → orange (Lucas) : les couleurs du duo */
    background: linear-gradient(90deg, rgba(61, 139, 255, 0.10), rgba(245, 138, 31, 0.10));
}
.golden-rule p { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: var(--text-lg); font-weight: 700; }

.dash { display: grid; gap: var(--space-4); }
@media (min-width: 1100px) {
    .dash { grid-template-columns: repeat(12, 1fr); }
    .dash > .span-12 { grid-column: span 12; }
    .dash > .span-8 { grid-column: span 8; }
    .dash > .span-7 { grid-column: span 7; }
    .dash > .span-5 { grid-column: span 5; }
    .dash > .span-4 { grid-column: span 4; }
    .dash > .span-6 { grid-column: span 6; }
}

/* =============================================================================
   VOYAGES
   ============================================================================= */
.trip-hero {
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(76, 201, 240, 0.22), transparent 60%),
        #0D1B36;
    border: 1px solid var(--line);
    margin-bottom: var(--space-4);
}
.trip-hero h1 { font-size: clamp(var(--text-2xl), 7vw, 3.5rem); letter-spacing: -0.035em; }
.trip-hero__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); color: var(--mist); }

.tabs {
    display: flex;
    gap: var(--space-1);
    overflow-x: auto;
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}
.tabs a {
    flex: none;
    padding: var(--space-3) var(--space-3);
    color: var(--mist);
    font-weight: 600;
    font-size: var(--text-sm);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--aurora); }

.activity-card {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    text-decoration: none;
}
.activity-card:hover { border-color: var(--line-strong); }
.activity-card__when { color: var(--key-moment); font-weight: 700; font-size: var(--text-sm); }
.activity-card__title { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: var(--text-lg); font-weight: 700; line-height: 1.2; }

.budget-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.budget-table th, .budget-table td { padding: var(--space-2) 0; text-align: left; border-bottom: 1px solid var(--line); }
.budget-table td:last-child, .budget-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.budget-table tfoot td { font-weight: 800; border-bottom: 0; font-size: var(--text-base); }

.checklist { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .checklist { grid-template-columns: repeat(2, 1fr); } }
.check {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 44px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.check:hover { background: var(--surface); }
.check input { width: 20px; height: 20px; accent-color: var(--aurora); flex: none; }
.check input:checked + span { color: var(--mist-dim); text-decoration: line-through; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--aurora); border-radius: inherit; }

/* =============================================================================
   CONNEXION
   ============================================================================= */
.auth {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: var(--space-4);
}
.auth__card {
    width: min(400px, 100%);
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
    background: rgba(11, 21, 40, 0.8);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(10px);
}
.auth__card h1 { font-size: var(--text-2xl); }
/* Carnet d'idées partagé */
.ideas-compose { margin-bottom: 1.25rem; }
.ideas-form { display: grid; gap: 0.8rem; }
.ideas-form textarea { width: 100%; min-height: 8rem; resize: vertical; padding: 0.85rem 1rem; border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 12px; background: var(--surface, rgba(255,255,255,.035)); color: inherit; font: inherit; line-height: 1.55; }
.ideas-form textarea:focus { outline: 2px solid var(--aurora); outline-offset: 2px; }
.ideas-form__footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ideas-list { display: grid; gap: 0.85rem; }
.idea-card { padding: 1.15rem 1.25rem; }
.idea-card__meta { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.idea-card__delete { margin-left: auto; }
.idea-card__content { margin: 0.9rem 0 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.ideas-empty { text-align: center; padding: 2.5rem 1rem; }
.ideas-empty > span { font-size: 1.8rem; }
.ideas-empty h2 { margin: 0.75rem 0 0.35rem; }
.ideas-empty p { margin: 0; }
@media (max-width: 540px) {
    .idea-card__meta { flex-wrap: wrap; }
    .idea-card__meta time { flex: 1 1 calc(100% - 3.5rem); margin-left: 2.7rem; }
    .idea-card__delete { margin-left: auto; }
}
.task-card__delete { display: flex; justify-content: flex-end; margin-top: 0.45rem; }

/* Gestion native du site */
.management-back { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--mist); text-decoration: none; font-size: var(--text-sm); margin-bottom: 0.5rem; }
.management-back:hover { color: var(--ink); }
.management-table-wrap { overflow-x: auto; padding: 0; }
.management-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.management-table th, .management-table td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.management-table th { color: var(--mist); font-size: var(--text-sm); font-weight: 600; }
.management-table tr:last-child td { border-bottom: 0; }
.management-table__actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.4rem; white-space: nowrap; }
.management-table__actions form { margin: 0; }
.management-form-panel { max-width: 880px; }
.management-form { display: grid; gap: 1rem; }
.management-form > div { min-width: 0; }
.management-form input:not([type=checkbox]):not([type=color]), .management-form select, .management-form textarea { width: 100%; }
.management-form textarea { min-height: 7rem; }
.management-form input[type=checkbox] { width: auto; accent-color: var(--aurora); }
.management-form__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.danger { color: #ff8d9a !important; }

/* Formulaires : deux champs côte à côte (ex. dates Du / Au), empilés sur petit écran */
.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.field--check label { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; color: var(--ink); }
.field--check input { width: 18px; height: 18px; accent-color: var(--aurora); }

/* Popup d'événement : « Supprimer » à gauche, loin du bouton d'enregistrement */
.event-form__delete { margin-right: auto; }

/* Admin › Utilisateurs : avatar + nom dans la première colonne, compte désactivé grisé */
.user-cell { display: inline-flex; align-items: center; gap: var(--space-3); }
.management-table tr.is-inactive td:not(.management-table__actions) { opacity: .5; }
/* Sélecteur de couleur : une pastille cliquable au lieu d'une barre pleine largeur
   (sélecteur assez précis pour passer devant la règle générique des champs de base.css) */
.management-form .field input[type="color"] {
    width: 64px;
    height: 44px;
    padding: 4px;
    cursor: pointer;
}
.field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.field input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }

/* Photo de profil dans le rond de l'avatar (même bordure à la couleur de la personne que les initiales) */
.avatar--photo { overflow: hidden; padding: 0; }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Page « Mon profil » : infos à gauche, mot de passe à droite (empilés sur téléphone) */
.profile-grid { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 1000px) { .profile-grid { grid-template-columns: 3fr 2fr; } }
.profile-grid .panel .management-form { display: grid; gap: var(--space-4); }
.profile-photo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.profile-photo__preview { position: relative; flex: none; width: 96px; height: 96px; }
.profile-photo__preview .avatar { font-size: 2rem; }
/* Nouvelle photo choisie : posée par-dessus l'ancienne, même cercle */
/* [hidden] doit gagner sur la règle globale img { display: block } */
.profile-photo__new[hidden] { display: none; }
.profile-photo__new { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 2px solid var(--aurora); }
.profile-photo__fields { flex: 1; min-width: 220px; display: grid; gap: var(--space-2); }
.profile-photo__fields input[type="file"] { padding: var(--space-2); cursor: pointer; }


/* Liste jour par jour : tous les jours du mois ; les jours vides restent compacts */
.agenda-day { scroll-margin-top: 84px; }  /* la barre du haut ne cache pas le jour visé depuis la mini-grille */
.agenda-day--empty { padding-block: var(--space-2); align-items: center; }
.agenda-day--empty .agenda-day__date b { font-size: var(--text-lg); }
.agenda-day--empty .agenda-day__date { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
/* Bandeaux d'événements : passent à la ligne au lieu d'être coupés */
.agenda-bands .cal__band { height: auto; min-height: 26px; padding-block: 4px; white-space: normal; line-height: 1.25; }
.agenda-bands .cal__band-label { white-space: normal; overflow: visible; }

/* Tableaux de gestion sur téléphone : chaque ligne devient une carte (pas de défilement horizontal).
   Un tableau de 680 px dans un écran de 360 px élargissait toute la page dans Chrome mobile. */
@media (max-width: 640px) {
    .management-table { min-width: 0; }
    .management-table thead { display: none; }
    .management-table tr { display: grid; gap: var(--space-1); padding: var(--space-4); border-bottom: 1px solid var(--line); }
    .management-table td { display: flex; gap: var(--space-2); padding: 0; border: 0; }
    .management-table td[data-label]::before { content: attr(data-label); min-width: 4.5rem; color: var(--mist); font-size: var(--text-sm); }
    .management-table__actions { margin-top: var(--space-2); }
}

/* --- Calendrier sur téléphone : LA MÊME grille que sur ordinateur, compactée -------------
   Toucher un jour = popup de création ; toucher un bandeau = popup de modification.
   Les textes des reels / RDV deviennent de petits traits de couleur (le détail est dans la liste dessous). */
.cal__wd-short { display: none; }
@media (max-width: 760px) {
    .calendar-page { --daynum-h: 30px; --lane-h: 16px; }
    .cal__wd-long { display: none; }
    .cal__wd-short { display: inline; }
    .cal__weekdays div { padding: var(--space-2) 0; text-align: center; }
    .cal__day { min-height: 68px; padding: 4px 2px; gap: 2px; }
    .cal__daynum { height: 22px; justify-content: center; font-size: 0.9rem; }
    .cal__day--today .cal__daynum span:first-child { min-width: 22px; height: 22px; }
    .cal__band { height: 13px; margin: 0 1px; padding: 0 3px; border-left-width: 2px; font-size: 0.5625rem; border-radius: 3px; }
    .cal__band-tag { display: none; }
    .cal__day .cal-reel, .cal__day .cal-event {
        display: block;
        height: 5px;
        min-height: 0;
        margin: 0 2px;
        padding: 0;
        border: 0;
        border-radius: 3px;
        font-size: 0;            /* le texte est masqué : un trait de couleur suffit dans la grille */
        overflow: hidden;
    }
    .cal__day .cal-reel { background: var(--c); }
    .cal__day .cal-event { background: var(--key-moment); }
    .cal__day .cal-event--meeting { background: var(--mist); }
    .cal__day .cal-reel > *, .cal__day .cal-event > * { display: none; }
}
