:root {
    /* Thème clair/sombre : `light-dark()` suit `color-scheme`, fixé par html[data-theme]
       (auto = préférence du système, cf contrôleur Stimulus "theme"). */
    color-scheme: light dark;
    --color-bg: light-dark(#f5f6f8, #1d2125);
    --color-surface: light-dark(#ffffff, #22272b);
    --color-surface-muted: light-dark(#f1f2f4, #2c333a);
    --color-list: light-dark(#f1f2f4, #101204);
    --color-border: light-dark(#e2e4e9, #3b444c);
    --color-text: light-dark(#172b4d, #dee4ea);
    --color-text-muted: light-dark(#626f86, #9fadbc);
    --color-primary: light-dark(#0c66e4, #579dff);
    --color-primary-hover: light-dark(#0055cc, #85b8ff);
    --color-primary-soft: light-dark(#e9f2ff, #1c2b41);
    --color-on-primary: light-dark(#ffffff, #1d2125);
    --color-danger: light-dark(#c9372c, #f87168);
    --color-danger-hover: light-dark(#ae2e24, #fd9891);
    --color-danger-soft: light-dark(#ffeceb, #42221f);
    --color-success: light-dark(#1f845a, #4bce97);
    --color-success-soft: light-dark(#dcfff1, #1c3329);
    --color-warning: light-dark(#a54800, #fea362);
    --color-warning-soft: light-dark(#fff3eb, #3a2c1f);
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px rgba(9, 30, 66, 0.2);
    --shadow-md: 0 4px 12px rgba(9, 30, 66, 0.12), 0 0 1px rgba(9, 30, 66, 0.2);
    --shadow-lg: 0 12px 32px rgba(9, 30, 66, 0.25);
    --focus-ring: 0 0 0 3px rgba(12, 102, 228, 0.3);
    --topbar-height: 56px;
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

[hidden] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Barre supérieure */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--topbar-height);
    padding: 0 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
}

.topbar__brand:hover {
    text-decoration: none;
}

.logo {
    flex: none;
    width: 1.4em;
    height: 1.4em;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Recherche globale */
.topbar__search {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.topbar__search .icon {
    position: absolute;
    left: 0.55rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

.topbar__search input {
    width: 12rem;
    padding: 0.35rem 0.6rem 0.35rem 1.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-muted);
    color: var(--color-text);
    font: inherit;
    font-size: 0.85rem;
    transition: width 0.15s ease;
}

.topbar__search input:focus {
    width: 16rem;
    outline: none;
    background: var(--color-surface);
    box-shadow: var(--focus-ring);
}

.board-page .topbar__search input:not(:focus) {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.board-page .topbar__search input:not(:focus)::placeholder,
.board-page .topbar__search:not(:focus-within) .icon {
    color: rgba(255, 255, 255, 0.85);
}

.search-page__form {
    display: flex;
    gap: 0.5rem;
    max-width: 40rem;
    margin-bottom: 1rem;
}

.search-page__form input {
    flex: 1;
}

.search-page__count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.topbar__nav > a {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.topbar__nav > a:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
    text-decoration: none;
}

.topbar__nav > a.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

/* Menu du compte (avatar) : profil, thème, déconnexion */
.topbar__account {
    margin-left: 0.25rem;
}

.topbar__user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.6rem 0.25rem 0.25rem;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.topbar__user:hover,
.topbar__account[open] > .topbar__user {
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.topbar__user.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.board-page .topbar__user:hover,
.board-page .topbar__account[open] > .topbar__user {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.topbar__account-email {
    margin: 0 0 0.35rem;
    padding: 0.25rem 0.6rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cloche des notifications (menu du haut) */
.topbar__nav > a.topbar__notifications {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.05rem;
}

/* Masqué à l'écran mais lu par les lecteurs d'écran (nom accessible du lien), affiché dans le menu mobile. */
.topbar__notifications-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    font-size: 0.9rem;
}

.topbar__badge {
    position: absolute;
    top: 0;
    right: 0.1rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.topbar__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 0 10px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
}

.topbar__toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    color: var(--color-text);
}

main {
    padding: 1.5rem;
    max-width: 1440px;
    margin: 0 auto;
}

.board-page main {
    max-width: none;
    /* La vue tableau occupe exactement la hauteur restante : la barre de défilement horizontale
       des colonnes reste ainsi toujours visible en bas de l'écran. */
    flex: 1;
    min-height: 0;
    /* Le `margin: 0 auto` de `main` empêcherait l'étirement en largeur : `main` prendrait alors la
       largeur de toutes les colonnes et le défilement horizontal ne se déclencherait jamais. */
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0.5rem;
}

/* Avatars / badges */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #0c66e4, #6e5dc6);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: none;
}

.avatar--small {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.7rem;
}

.avatar--tiny {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.6rem;
}

.avatar--large {
    width: 4rem;
    height: 4rem;
    font-size: 1.3rem;
}

/* Avatar photo (cf templates/_avatar.html.twig) */
img.avatar {
    object-fit: cover;
    background: var(--color-surface-muted);
}

.user-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

.badge--primary {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.badge--success {
    background: var(--color-success-soft);
    color: var(--color-success);
}

/* Messages flash */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border-left: 4px solid currentColor;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    animation: flash-in 0.25s ease-out;
}

.flash.is-leaving {
    animation: flash-out 0.2s ease-in forwards;
}

.flash__message {
    flex: 1;
    overflow-wrap: anywhere;
}

.flash__close {
    border: none;
    background: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
}

.flash__close:hover {
    opacity: 1;
}

.flash--success {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.flash--error,
.flash--danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

@keyframes flash-out {
    to { opacity: 0; transform: translateY(-6px); }
}

/* Formulaires */
.form-page {
    max-width: 440px;
    margin: 3rem auto;
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-page h1 {
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
}

.form-page__intro {
    margin: 0 0 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.form-page__footer {
    margin: 1.25rem 0 0;
    font-size: 0.9rem;
}

.form-row__label-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.form-row__label-line a {
    font-size: 0.8rem;
}

.form-row {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-row label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.form-row input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.form-row textarea,
.form-row select,
.panel__form input[type="text"],
.panel__form input[type="email"],
.add-card-form input,
.add-list-form input,
.checklist__add input,
.search-page__form input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus,
.panel__form input:focus,
.add-card-form input:focus,
.add-list-form input:focus,
.checklist__add input:focus,
.search-page__form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.form-row select[multiple] {
    min-height: 7rem;
    padding: 0.35rem;
}

.form-row input[type="color"],
.panel__form input[type="color"] {
    width: 3rem;
    height: 2.4rem;
    padding: 0.15rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    cursor: pointer;
}

.form-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
}

.form-row .form-error,
.form-row ul li {
    color: var(--color-danger);
    font-size: 0.8rem;
}

/* Groupes de cases à cocher (choix « expanded » : étiquettes, assignés, tableaux d'un utilisateur),
   rendus par Symfony sous la forme <div id=…><div><input><label></div>…</div> : affichés en « puces ». */
.form-row > div:not(.rich-text-field, .description-preview) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.form-row > div:not(.rich-text-field, .description-preview) > div {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
}

.form-row > div:not(.rich-text-field, .description-preview) > div:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.form-row > div:not(.rich-text-field, .description-preview) > div label {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.85rem;
    cursor: pointer;
}

.form-row--inline {
    flex-direction: row;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
}

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-surface-muted);
}

.btn--danger {
    background: var(--color-danger);
}

.btn--danger:hover {
    background: var(--color-danger-hover);
}

.btn--danger-ghost {
    background: transparent;
    color: var(--color-danger);
    border-color: var(--color-border);
}

.btn--danger-ghost:hover {
    background: var(--color-danger-soft);
    border-color: var(--color-danger);
}

.btn--small {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

/* En-tête de page (titre + actions) */
.page-header,
.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.page-header__actions,
.board-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
}

/* Bouton « Suivre » translucide, lisible sur le fond du tableau */
.btn--board {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn--board:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* Page des notifications */
.notifications {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 760px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notifications__item {
    position: relative;
}

/* Bouton ✕ posé sur le coin de la notification (hors du lien, qui ouvre la carte) */
.notifications__delete {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
}

.notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2.75rem 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text-muted);
}

.notification:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.notification--unread {
    border-left: 4px solid var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-text);
}

.notification__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
}

.notification__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.notification__text strong {
    color: var(--color-text);
}

.notification__meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* État vide (cf templates/_empty_state.html.twig) */
.empty-state {
    max-width: 32rem;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-muted);
    text-align: center;
}

.empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    background: var(--color-surface-muted);
    font-size: 1.4rem;
}

.empty-state__title {
    margin: 0;
    color: var(--color-text);
    font-weight: 600;
}

.empty-state__text {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
}

.boards-grid__empty {
    grid-column: 1 / -1;
}

/* Liste des tableaux */
.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.board-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    height: 110px;
    font-weight: 600;
    color: var(--color-text);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.board-card:hover {
    border-color: var(--color-primary);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.board-card--themed {
    position: relative;
    overflow: hidden;
    border: none;
    color: #fff;
    background-size: cover;
    background-position: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.board-card--themed::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Assombrit le haut (nom) et le bas (compteurs) pour rester lisible sur une image claire. */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 45%, transparent 55%, rgba(0, 0, 0, 0.35));
    pointer-events: none;
}

.board-card__name,
.board-card__footer {
    position: relative;
    z-index: 1;
}

.board-card__name {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.board-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.board-card__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.6rem;
    min-width: 0;
}

.board-card__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.board-card__stat--overdue {
    padding: 0 0.35rem;
    border-radius: 4px;
    background: var(--color-danger);
    color: #fff;
    text-shadow: none;
}

.board-card__members {
    display: flex;
    flex: none;
    text-shadow: none;
}

.board-card__members .avatar {
    margin-left: -0.3rem;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.board-card__more {
    background: rgba(0, 0, 0, 0.45);
}

.board-card--themed:hover {
    filter: brightness(0.95);
}

.board-card--new {
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    border: 2px dashed var(--color-border);
    background: transparent;
}

.board-card--new:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

/* Vue tableau (colonnes + cartes) */
body.board-page {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.board-page .topbar {
    background: rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.board-page .topbar__nav > a,
.board-page .topbar__brand,
.board-page .topbar__user {
    color: #fff;
}

.board-page .topbar__nav > a:hover,
.board-page .topbar__nav > a.is-active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.board-page .topbar__toggle span {
    color: #fff;
}

.board-page .board-header {
    margin-bottom: 0.75rem;
}

.board-page .board-header h1 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.board-lists {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.75rem;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.2);
}

.board-list {
    background: var(--color-list);
    border-radius: var(--radius-lg);
    width: 256px;
    flex: 0 0 256px;
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
    max-height: 100%;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
}

.board-list.sortable-ghost {
    opacity: 0.4;
}

.board-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.board-list__cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 8px;
    overflow-y: auto;
    padding: 2px;
}

.card {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 0.45rem 0.6rem;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    color: var(--color-text);
    display: block;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    transition: box-shadow 0.15s;
}

.card:hover {
    text-decoration: none;
    box-shadow: 0 0 0 2px var(--color-primary);
}

/* Actions rapides : crayon au survol (cf card_quick_controller.js) et menu partagé du tableau. */
.card__quick {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text-muted);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s;
}

.card:hover .card__quick,
.card:focus-visible .card__quick {
    opacity: 1;
}

.card__quick:hover {
    color: var(--color-text);
    background: var(--color-surface-muted);
}

@media (hover: none) {
    .card__quick {
        display: none;
    }
}

.card-quick {
    position: fixed;
    z-index: 40;
    min-width: 240px;
    padding: 0.5rem;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
}

.card-quick[hidden] {
    display: none;
}

.card-quick turbo-frame[busy]:empty::before {
    content: "Chargement…";
    display: block;
    padding: 0.4rem 0.5rem;
    color: var(--color-text-muted);
}

.card-quick__panel form {
    margin: 0;
}

.card-quick__move {
    padding: 0.4rem 0.5rem;
}

.card-quick__move label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.card-quick__move-row {
    display: flex;
    gap: 0.4rem;
}

.card-quick__move-row select {
    flex: 1;
    min-width: 0;
}

.card.sortable-ghost {
    opacity: 0.4;
}

.card__labels {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.card__label {
    display: inline-block;
    width: 40px;
    height: 8px;
    border-radius: 4px;
}

.card__meta {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.add-card-form,
.add-list-form {
    margin-top: 0.5rem;
}

.add-card-form--top {
    margin: 0 0 0.5rem;
}

.add-card-form input,
.add-list-form input {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
}

.add-card-form input {
    border-color: transparent;
    background: transparent;
}

.add-card-form input:hover {
    background: rgba(9, 30, 66, 0.06);
}

.add-card-form input:focus {
    background: var(--color-surface);
}

.board-list--new {
    background: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(4px);
    box-shadow: none;
}

.board-list--new .add-list-form {
    margin-top: 0;
}

.board-list--new .btn {
    width: 100%;
}

.board-list__drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
    padding: 0.2rem 0.3rem;
    line-height: 1;
}

.board-list__rename-form {
    flex: 1;
    min-width: 0;
}

.board-list__name-input {
    width: 100%;
    border: none;
    background: transparent;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--color-text);
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
}

.board-list__name-input:hover,
.board-list__name-input:focus {
    background: var(--color-surface);
}

.board-list__name-input:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}



/* Listes simples (étiquettes, membres, …) */
.panel__list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.panel__list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
}

.panel__list-item:hover {
    background: var(--color-surface-muted);
}

.panel__list-item form {
    margin-left: auto;
}



.panel__badge {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.panel__empty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.panel__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.panel__form input[type="text"],
.panel__form input[type="email"] {
    flex: 1;
    min-width: 140px;
    width: auto;
    padding: 0.4rem 0.6rem;
}

/* Modale de confirmation (contrôleur Stimulus "confirm") */
.dialog {
    width: min(420px, calc(100vw - 2rem));
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: var(--color-surface);
    color: var(--color-text);
}

.dialog[open] {
    animation: dialog-in 0.18s ease-out;
}

.dialog::backdrop {
    background: rgba(9, 30, 66, 0.5);
    backdrop-filter: blur(2px);
}

.dialog__body {
    padding: 1.5rem;
}

.dialog__title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.dialog__message {
    margin: 0 0 1.5rem;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* Modale de détail de carte (Turbo Frame) */
#modal:not(:empty) {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 30, 66, 0.54);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4vh 1rem;
    overflow-y: auto;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 560px;
    animation: dialog-in 0.18s ease-out;
}

/* Carte réaffichée après un enregistrement (cf card_modal_controller.js) : pas de nouvelle animation d'ouverture. */
.modal.modal--refreshed {
    animation: none;
}

/* Modale de carte : contenu (description, pièces jointes) à gauche, commentaires en colonne à droite */
.modal--card {
    max-width: 1040px;
}

.modal__columns {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
}

.modal__side {
    border-left: 1px solid var(--color-border);
    padding-left: 1.5rem;
}

.modal__side h2 {
    margin-top: 0;
}

.modal--card .rich-text-field trix-editor[input^="card_description"] {
    min-height: 220px;
}

/* Description de carte en lecture (contrôleur Stimulus "description-editor") : double-clic pour éditer */
.description-preview {
    min-height: 3rem;
    overflow-wrap: anywhere;
    cursor: text;
}

.description-preview img {
    cursor: zoom-in;
}

.description-preview__empty {
    color: var(--color-text-muted);
}

/* Autocomplétion des mentions « @ » dans un commentaire (contrôleur Stimulus "mention") */
.rich-text-field {
    position: relative;
}

.mention-menu {
    position: absolute;
    z-index: 10;
    min-width: 220px;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.mention-menu__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.mention-menu__item--active {
    background: var(--color-primary-soft);
}

img.mention-menu__avatar {
    object-fit: cover;
}

.mention-menu__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal__header h1 {
    font-size: 1.25rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.modal__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.modal__close:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
    text-decoration: none;
}

.modal__breadcrumb {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0.2rem 0 0;
}

.modal__delete-form {
    margin-top: 0.75rem;
}

.comments {
    list-style: none;
    margin: 0.75rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment {
    background: var(--color-surface-muted);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
}

/* Historique de la carte, intercalé avec les commentaires */
.activity {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0 0.25rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.activity strong {
    color: var(--color-text);
}

.activity .label-chip {
    font-size: 0.7rem;
}

.activity__date {
    margin-left: 0.25rem;
    font-size: 0.75rem;
}

.is-activity-hidden .activity {
    display: none;
}

.timeline-toggle {
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.comment__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
}

.comment__date {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.comment__content {
    margin: 0.3rem 0 0;
    overflow-wrap: anywhere;
}

.comment__content.trix-content {
    font-size: 0.8rem;
}

.comment__content img {
    cursor: zoom-in;
}

.add-comment-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.add-comment-form .rich-text-field {
    align-self: stretch;
}

/* Champs HTML (description, commentaires) édités via Trix. Le <textarea>/<input> réel, rempli
   par Trix, reste caché : c'est <trix-editor> qui affiche l'UI et le WYSIWYG. */
.rich-text-field input[type="hidden"],
.rich-text-field textarea {
    display: none;
}

.rich-text-field trix-toolbar .trix-button-row {
    flex-wrap: wrap;
    overflow-x: visible;
    /* Les boutons Trix sont dimensionnés en em : réduire la police réduit toute la barre */
    font-size: 0.8em;
}

.rich-text-field trix-toolbar .trix-button-group {
    margin-bottom: 6px;
}

.rich-text-field trix-editor {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    min-height: 90px;
    background: var(--color-surface);
}

.rich-text-field trix-editor:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

/* Rendu du contenu HTML généré par Trix (description de carte, commentaires) */
.trix-content {
    font-size: 0.9rem;
    line-height: 1.5;
}

.trix-content p:first-child {
    margin-top: 0;
}

.trix-content p:last-child {
    margin-bottom: 0;
}

.trix-content ul,
.trix-content ol {
    padding-left: 1.25rem;
}

.trix-content blockquote {
    margin: 0.5rem 0;
    padding-left: 0.75rem;
    border-left: 3px solid var(--color-border);
    color: var(--color-text-muted);
}

.trix-content pre {
    background: var(--color-bg);
    padding: 0.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
}

.trix-content .attachment-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trix-content action-text-attachment img,
.trix-content .attachment img {
    max-width: 100%;
    border-radius: var(--radius);
}

.attachments {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    background: var(--color-surface-muted);
}

.attachment > a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment__meta {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.attachment form {
    margin-left: auto;
}

.add-attachment-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.add-attachment-form input[type="file"] {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
}

/* Écrans d'administration */
.table-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
}

.admin-table th,
.admin-table td {
    padding: 0.65rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.admin-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.admin-table tbody tr:hover > td {
    background: var(--color-surface-muted);
}

.admin-table__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* Administration des tableaux */
.admin-table__row--archived td {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
}

.board-swatch {
    display: block;
    width: 48px;
    height: 32px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}

.board-swatch--large {
    width: 100%;
    height: 110px;
    margin-bottom: 1rem;
    border-radius: var(--radius);
}

.admin-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    align-items: start;
}

.admin-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.admin-section h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

/* Page « Mon profil » */
.profile-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-identity__email {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Double authentification (profil) */
.two-factor-qr {
    text-align: center;
}

.two-factor-qr img {
    padding: 0.75rem;
    background: #fff;
    border-radius: var(--radius-lg);
}

.two-factor-secret {
    word-break: break-all;
    font-size: 0.95rem;
}

.two-factor-backup-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    font-size: 1.05rem;
}

.two-factor-disable-form {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* DataTables (contrôleur Stimulus "datatable") : alignement sur le design system */
div.dt-container {
    font-size: 0.9rem;
}

div.dt-container .dt-layout-row {
    gap: 0.75rem;
}

div.dt-container .dt-search input,
div.dt-container .dt-length select {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--color-text);
}

div.dt-container .dt-search input {
    min-width: 220px;
    margin-left: 0;
}

div.dt-container .dt-search input:focus,
div.dt-container .dt-length select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

div.dt-container .dt-info {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

div.dt-container .dt-paging .dt-paging-button {
    border-radius: var(--radius) !important;
    border: 1px solid transparent !important;
    padding: 0.3rem 0.7rem !important;
    color: var(--color-text) !important;
}

div.dt-container .dt-paging .dt-paging-button:hover {
    background: var(--color-surface-muted) !important;
    color: var(--color-text) !important;
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--color-primary-soft) !important;
    color: var(--color-primary) !important;
    border-color: transparent !important;
}

div.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.4;
}

table.dataTable.admin-table > thead > tr > th,
table.dataTable.admin-table > tbody > tr > td {
    padding: 0.65rem 0.9rem;
}

table.dataTable.admin-table > thead > tr > th {
    border-bottom: 1px solid var(--color-border);
}

table.dataTable.admin-table td.dt-empty {
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
}

table.dataTable.admin-table > tbody > tr.dtr-expanded > td {
    border-bottom: none;
}

table.dataTable > tbody > tr.child ul.dtr-details {
    width: 100%;
}

table.dataTable > tbody > tr.child ul.dtr-details > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    border-bottom-color: var(--color-border);
}

table.dataTable > tbody > tr.child span.dtr-title {
    min-width: 110px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

/* ---------------------------------------------------------------- */
/* Composants d'interface (icônes, menus, filtres, modale de carte…) */
/* ---------------------------------------------------------------- */

/* Icônes SVG (templates/_icon.html.twig) : taille du texte, couleur courante */
.icon {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
    vertical-align: -0.18em;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Lien d'évitement : visible uniquement au clavier */
.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 200;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
    background: var(--color-primary);
    color: var(--color-on-primary);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

main:focus {
    outline: none;
    box-shadow: none;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    list-style: none;
    flex: 0 0 auto;
}

.icon-button::-webkit-details-marker {
    display: none;
}

.icon-button:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
    text-decoration: none;
}

.icon-button--round {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--color-surface-muted);
}

.icon-button--danger:hover {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.board-list .icon-button {
    width: 1.75rem;
    height: 1.75rem;
}

.link-button {
    padding: 0;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font: inherit;
    font-size: 0.78rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.link-button:hover {
    color: var(--color-text);
}

.link-button--danger:hover {
    color: var(--color-danger);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.btn--ghost:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.btn--icon {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.btn--board.is-pressed {
    background: rgba(255, 255, 255, 0.85);
    color: #172b4d;
}

/* Menus déroulants <details> (filtres, sélection membres/étiquettes, actions de carte) */
.dropdown {
    position: relative;
}

.dropdown > summary {
    list-style: none;
    cursor: pointer;
}

.dropdown > summary::-webkit-details-marker {
    display: none;
}

.dropdown__panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    min-width: 220px;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    animation: dialog-in 0.12s ease-out;
}

.dropdown--end .dropdown__panel,
.board-header__actions .dropdown__panel {
    left: auto;
    right: 0;
}

.dropdown__panel--wide {
    width: min(320px, calc(100vw - 2rem));
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--color-text);
    font: inherit;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.dropdown__item:hover {
    background: var(--color-surface-muted);
}

.dropdown__item--danger {
    color: var(--color-danger);
}

.dropdown__item--danger:hover {
    background: var(--color-danger-soft);
}

.dropdown__separator {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

.dropdown__count {
    min-width: 1.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #fff;
    color: #172b4d;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

.picker {
    display: inline-block;
}

/* Cases à cocher des filtres et des sélecteurs */
.filter-group {
    margin: 0 0 0.75rem;
    padding: 0;
    border: none;
}

.filter-group legend {
    margin-bottom: 0.3rem;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.filter-option:hover {
    background: var(--color-surface-muted);
}

.filter-option input {
    accent-color: var(--color-primary);
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.filter-option__hint {
    color: var(--color-text-muted);
}

.label-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 1.4rem;
    padding: 0.1rem 0.55rem;
    border-radius: 4px;
    background: var(--label-color, var(--color-text-muted));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.due-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--color-text-muted);
}

.due-dot--overdue { background: var(--color-danger); }
.due-dot--soon { background: #e2b203; }
.due-dot--upcoming { background: var(--color-primary); }
.due-dot--done { background: var(--color-success); }
.due-dot--none { background: var(--color-border); }

/* Vue tableau : en-tête (vues, recherche, filtres) */
.board {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.board-header__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.board-header__actions {
    align-items: center;
}

.board-views {
    display: flex;
    gap: 2px;
    padding: 2px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.25);
}

.board-views__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
}

.board-views__link:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.board-views__link[aria-current] {
    background: rgba(255, 255, 255, 0.9);
    color: #172b4d;
}

.board-search {
    position: relative;
}

.board-search__icon {
    position: absolute;
    top: 50%;
    left: 0.55rem;
    transform: translateY(-50%);
    color: #fff;
    pointer-events: none;
}

.board-search__input {
    width: 190px;
    padding: 0.3rem 0.6rem 0.3rem 1.9rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    transition: width 0.15s, background 0.15s;
}

.board-search__input::placeholder {
    color: rgba(255, 255, 255, 0.85);
}

.board-search__input:focus {
    width: 240px;
    outline: none;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--focus-ring);
}

.board-search__input:focus::placeholder {
    color: var(--color-text-muted);
}

.board-search:focus-within .board-search__icon {
    color: var(--color-text-muted);
}

.board-filter__summary {
    align-self: flex-start;
    margin: -0.25rem 0 0.6rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.8rem;
}

.board-empty {
    align-self: flex-start;
    max-width: 420px;
    margin-bottom: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
}

.board-empty p {
    margin: 0;
}

.board-empty__title {
    font-weight: 600;
    margin-bottom: 0.25rem !important;
}

.board-list__count {
    padding: 0 0.4rem;
    border-radius: 999px;
    background: rgba(9, 30, 66, 0.08);
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.board-list__count:empty {
    display: none;
}

/* Vignette de carte */
.card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary);
}

.card__cover {
    display: block;
    width: calc(100% + 1.2rem);
    max-height: 150px;
    margin: -0.45rem -0.6rem 0.45rem;
    border-radius: var(--radius) var(--radius) 0 0;
    object-fit: cover;
}

.card__labels {
    cursor: pointer;
}

.card__label {
    min-width: 40px;
    width: auto;
    background: var(--label-color);
    transition: height 0.12s;
}

.card__label-name {
    display: none;
}

.show-label-names .card__label {
    height: auto;
    padding: 0 0.4rem;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.3rem;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.show-label-names .card__label-name {
    display: inline;
}

/* Texte des étiquettes noir ou blanc selon la clarté de la couleur choisie par l'administrateur
   (le blanc est illisible sur jaune, orange ou vert clair) : bascule à L = 0,62 en OKLCH. */
@supports (color: oklch(from red l c h)) {
    .label-chip,
    .show-label-names .card__label {
        color: oklch(from var(--label-color, #6b778c) clamp(0, (0.62 - l) * 1000, 1) 0 0);
        text-shadow: none;
    }
}

.card__title {
    display: block;
}

.card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.card__badge--overdue {
    background: var(--color-danger);
    color: #fff;
}

.card__badge--soon {
    background: #f5cd47;
    color: #172b4d;
}

.card__badge--done {
    background: var(--color-success);
    color: #fff;
}

.card__badge--upcoming {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
}

.card__assignees {
    display: inline-flex;
    margin-left: auto;
}

.card__assignees .avatar + .avatar {
    margin-left: -0.35rem;
}

/* Champs d'ajout rapide : boutons affichés au focus ou dès qu'une saisie est en cours */
.inline-form__actions {
    display: none;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

form:focus-within > .inline-form__actions,
form:has(input:not(:placeholder-shown)) > .inline-form__actions {
    display: flex;
}

.inline-form__hint {
    margin-left: auto;
    color: var(--color-text-muted);
    font-size: 0.7rem;
}

.board-list--new .inline-form__hint {
    color: #fff;
}

/* Modale de carte */
turbo-frame#modal[busy]:empty {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 30, 66, 0.3);
}

turbo-frame#modal[busy]:empty::after {
    content: "";
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

turbo-frame#modal[busy] .modal {
    cursor: progress;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal--card {
    position: relative;
    overflow: hidden;
}

.modal__cover {
    display: block;
    width: calc(100% + 3rem);
    max-height: 200px;
    margin: -1.5rem -1.5rem 1rem;
    object-fit: cover;
    background: var(--color-surface-muted);
}

.modal__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.modal__toolbar form {
    margin: 0;
}

.move-form {
    min-width: 240px;
}

.move-form .form-row {
    margin-bottom: 0.6rem;
}

.card-title-input {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.25rem 0.4rem;
    margin-left: -0.4rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    resize: none;
    overflow: hidden;
    field-sizing: content;
}

.card-title-input:hover {
    background: var(--color-surface-muted);
}

.card-title-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: var(--focus-ring);
}

.save-status {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.5rem;
    color: var(--color-success);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.save-status.is-visible {
    opacity: 1;
}

.save-status.is-warning {
    color: var(--color-warning);
    font-weight: 600;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin: 1rem 0 0.5rem;
}

.card-meta__item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.card-meta__label {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card-meta__values {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.due-input {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 0.85rem;
}

.card-section {
    margin-top: 1.25rem;
}

.card-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-section__header h2,
.modal__side > h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.95rem;
}

.modal__side > h2 {
    margin-bottom: 0.75rem;
}

/* Checklists de la modale de carte */
.checklist__progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.checklist__percent {
    min-width: 2.5rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.checklist__bar {
    flex: 1;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--color-surface-muted);
    overflow: hidden;
}

.checklist__bar-fill {
    display: block;
    height: 100%;
    background: var(--color-primary);
    transition: width 0.2s ease;
}

.checklist__bar-fill.is-complete {
    background: var(--color-success);
}

.checklist__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 6px;
}

.checklist-item:hover {
    background: var(--color-surface-muted);
}

.checklist-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0 0.25rem;
    cursor: pointer;
}

.checklist-item__edit {
    flex: 1;
    min-width: 0;
}

.checklist-item__input {
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    color: var(--color-text);
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
}

.checklist-item__input:focus {
    outline: none;
    background: var(--color-surface);
    box-shadow: var(--focus-ring);
}

.checklist-item.is-done .checklist-item__input:not(:focus) {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.checklist-item__delete {
    opacity: 0;
}

.checklist-item:hover .checklist-item__delete,
.checklist-item__delete:focus-visible {
    opacity: 1;
}

.checklist__add {
    margin-top: 0.35rem;
}

.checklist-new {
    margin-top: 1rem;
}

.description-preview {
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius);
}

.description-preview:hover {
    background: var(--color-surface-muted);
}

.rich-text-field__actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

/* Pièces jointes : vignette, taille lisible, couverture, zone de dépôt */
.attachment {
    align-items: flex-start;
}

.attachment__thumb {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 52px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.attachment__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.attachment__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.85rem;
}

.attachment__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.attachment__actions form {
    margin: 0;
}

.dropzone {
    position: relative;
    margin-top: 0.5rem;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.15s, background 0.15s;
}

.dropzone.is-dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.dropzone__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}

.dropzone__label strong {
    color: var(--color-primary);
}

.dropzone:focus-within {
    border-color: var(--color-primary);
}

.dropzone.is-uploading .dropzone__label {
    visibility: hidden;
}

.dropzone__progress {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Commentaires : actions, mention */
.comment__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.comment__actions form {
    margin: 0;
}

.comment__edited {
    color: var(--color-text-muted);
    font-size: 0.72rem;
}

.comment .add-comment-form {
    margin-top: 0.5rem;
}

.mention {
    padding: 0 0.2rem;
    border-radius: 4px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-weight: 600;
}

/* Cartes archivées */
.archived-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.archived-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    background: var(--color-surface-muted);
}

.archived-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.archived-card__meta {
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.archived-card form {
    margin: 0;
}

/* Aide des raccourcis clavier */
.shortcuts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    margin: 1rem 0 1.5rem;
    align-items: center;
}

.shortcuts dt {
    text-align: right;
}

.shortcuts dd {
    margin: 0;
}

kbd {
    display: inline-block;
    min-width: 1.6rem;
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--color-surface-muted);
    font-family: inherit;
    font-size: 0.8rem;
    text-align: center;
}

/* Messages temporaires (assets/toast.js) */
.toasts {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(420px, calc(100vw - 2rem));
    transform: translateX(-50%);
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    background: var(--color-text);
    color: var(--color-surface);
    font-size: 0.9rem;
    animation: flash-in 0.2s ease-out;
}

.toast--error {
    background: var(--color-danger);
    color: #fff;
}

.toast:has(.toast__action) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toast__action {
    flex: none;
    padding: 0.25rem 0.6rem;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.toast__action:hover {
    background: color-mix(in srgb, currentColor 15%, transparent);
}

/* Flash « Annuler » (archivage) : informatif, flottant en bas sur la vue tableau */
.flash--info {
    align-items: center;
    background: var(--color-surface);
    color: var(--color-text);
    border-left-color: var(--color-primary);
}

.flash--info form {
    margin: 0;
}

.board-page .flash--info {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 60;
    max-width: calc(100vw - 2rem);
    margin: 0;
    box-shadow: var(--shadow-lg);
}

/* Icône du thème courant (menu du compte, page de connexion) */
.topbar__theme-icon--dark {
    display: none;
}

:root[data-theme="dark"] .topbar__theme-icon--light {
    display: none;
}

:root[data-theme="dark"] .topbar__theme-icon--dark {
    display: inline;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .topbar__theme-icon--light {
        display: none;
    }

    :root[data-theme="auto"] .topbar__theme-icon--dark {
        display: inline;
    }
}

.topbar__nav > a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Mode sombre : barre d'outils Trix (icônes en images noires) */
:root[data-theme="dark"] trix-toolbar .trix-button--icon::before {
    filter: invert(1);
}

:root[data-theme="dark"] trix-toolbar .trix-button {
    border-color: var(--color-border);
    background: var(--color-surface-muted);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] trix-toolbar .trix-button--icon::before {
        filter: invert(1);
    }

    :root[data-theme="auto"] trix-toolbar .trix-button {
        border-color: var(--color-border);
        background: var(--color-surface-muted);
    }
}

/* Calendrier des échéances */
body.board-page--scroll {
    overflow: auto;
}

.board-page--scroll main {
    flex: none;
}

.calendar {
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
}

.calendar__toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.calendar__title {
    min-width: 11rem;
    margin: 0;
    text-align: center;
}

.calendar__toolbar .btn {
    margin-left: auto;
}

.calendar__grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar__grid th {
    padding: 0.3rem;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.calendar__day {
    height: 7.5rem;
    padding: 0.3rem;
    border: 1px solid var(--color-border);
    vertical-align: top;
}

.calendar__day--other {
    background: var(--color-surface-muted);
}

.calendar__day--other .calendar__date {
    color: var(--color-text-muted);
}

.calendar__date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    margin-bottom: 0.2rem;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
}

.calendar__day--today .calendar__date {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.calendar__card {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.2rem;
    padding: 0.15rem 0.35rem;
    border-left: 3px solid var(--color-primary);
    border-radius: 4px;
    background: var(--color-surface-muted);
    color: var(--color-text);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar__card:hover {
    background: var(--color-primary-soft);
    text-decoration: none;
}

.calendar__card--overdue {
    border-left-color: var(--color-danger);
}

.calendar__card--soon {
    border-left-color: #e2b203;
}

.calendar__card--done {
    border-left-color: var(--color-success);
    color: var(--color-text-muted);
    text-decoration: line-through;
}

/* Raccourcis d'échéance (modale de carte) */
.due-shortcuts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.chip-button {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}

.chip-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.due-complete {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.calendar__card-label {
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--label-color);
}

/* Page « Mes cartes » */
.my-cards {
    max-width: 860px;
    margin-bottom: 1.5rem;
}

.my-cards__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.6rem;
}

.my-cards__list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.my-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
}

.my-card:hover {
    text-decoration: none;
    box-shadow: 0 0 0 2px var(--color-primary);
}

.my-card__swatch {
    flex: 0 0 auto;
    width: 40px;
    height: 28px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
}

.my-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.my-card__title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.my-card__meta {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.my-card__labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 30%;
}

/* Écrans d'authentification (connexion, double authentification, mot de passe oublié) :
   security/_auth_layout.html.twig. Panneau de présentation à gauche, carte du formulaire à droite. */
.auth-page .topbar {
    display: none;
}

/* La mise en page occupe tout l'écran : sans le retrait ni la largeur maximale de `main`,
   qui ajouteraient un défilement vertical inutile. */
.auth-page main {
    max-width: none;
    padding: 0;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.auth__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.auth__brand--light {
    color: #fff;
}

/* Panneau de présentation : dégradé + aperçu stylisé d'un tableau. */
.auth__showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    padding: 2.5rem 3rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.85);
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.18), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(159, 143, 239, 0.55), transparent 45%),
        linear-gradient(140deg, light-dark(#0c66e4, #09326c) 0%, light-dark(#5e4db2, #352c63) 65%, light-dark(#8f46c2, #50267a) 100%);
}

.auth__showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
    pointer-events: none;
}

.auth__mockup {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    align-self: center;
    width: min(100%, 460px);
    transform: perspective(1200px) rotateX(8deg) rotateY(-10deg) rotateZ(2deg);
}

.auth__mockup-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 40px rgba(9, 30, 66, 0.25);
}

.auth__mockup-title {
    width: 55%;
    height: 8px;
    margin: 0.2rem 0 0.25rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
}

/* Vignette factice : pastille d'étiquette (<i>, couleur via --label) et deux lignes de texte. */
.auth__mockup-card {
    display: block;
    height: 46px;
    padding: 0.5rem;
    border-radius: 8px;
    background:
        linear-gradient(#dcdfe4, #dcdfe4) no-repeat 0.5rem calc(100% - 1.05rem) / 72% 6px,
        linear-gradient(#e9ebee, #e9ebee) no-repeat 0.5rem calc(100% - 0.55rem) / 45% 6px,
        #fff;
    box-shadow: 0 1px 2px rgba(9, 30, 66, 0.25);
}

.auth__mockup-card--tall {
    height: 68px;
}

.auth__mockup-card--done {
    opacity: 0.75;
}

.auth__mockup-card i {
    display: block;
    width: 34px;
    height: 6px;
    border-radius: 3px;
    background: var(--label);
}

.auth__mockup-card--lifted {
    transform: rotate(-4deg) translate(-6px, -2px);
    box-shadow: 0 16px 30px rgba(9, 30, 66, 0.35);
    animation: auth-float 5s ease-in-out infinite;
}

@keyframes auth-float {
    50% { transform: rotate(-2deg) translate(-4px, -8px); }
}

.auth__pitch {
    position: relative;
    max-width: 30rem;
}

.auth__pitch p {
    margin: 0;
    font-size: 1rem;
}

.auth__pitch .auth__pitch-title {
    margin-bottom: 0.6rem;
    color: #fff;
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Colonne du formulaire */
.auth__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem 2.5rem;
    background-color: var(--color-bg);
    background-image: radial-gradient(color-mix(in srgb, var(--color-text-muted) 18%, transparent) 1px, transparent 1px);
    background-size: 20px 20px;
}

.auth__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-self: stretch;
}

/* La marque est déjà dans le panneau de présentation : réservée au mobile dans cette colonne. */
.auth__topline .auth__brand {
    visibility: hidden;
}

.auth__theme {
    display: inline-flex;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.auth__theme:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.auth__card {
    width: 100%;
    max-width: 420px;
    margin: auto 0;
    padding: 2.5rem 2.25rem 2.25rem;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(9, 30, 66, 0.06), 0 24px 48px -12px rgba(9, 30, 66, 0.18);
    animation: auth-in 0.35s ease-out;
}

@keyframes auth-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.auth__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1.25rem;
    border-radius: 14px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 1.4rem;
}

.auth__card h1 {
    margin-bottom: 0.4rem;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

.auth__intro {
    margin: 0 0 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.925rem;
}

.auth__intro strong {
    color: var(--color-text);
}

.auth__card .flash {
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    box-shadow: none;
}

.auth__form .form-row {
    margin-bottom: 1.1rem;
}

.auth__form .form-row label {
    font-size: 0.85rem;
    color: var(--color-text);
}

.auth__form .form-row__label-line a {
    font-weight: 500;
}

/* Champs : réglages via variables, pour ne pas surenchérir sur la spécificité de `.form-row input:not(…)`. */
.auth__form .form-row input:not([type="checkbox"]):not([type="radio"]):not([type="color"]) {
    height: var(--auth-input-height, 2.9rem);
    padding: 0 var(--auth-input-padding-right, 0.9rem) 0 var(--auth-input-padding-left, 0.9rem);
    border-radius: 10px;
    background: var(--color-surface);
    font-family: var(--auth-input-font, inherit);
    font-size: var(--auth-input-font-size, 1rem);
}

.auth__form .form-row input:not(:focus):hover {
    border-color: color-mix(in srgb, var(--color-text-muted) 60%, transparent);
}

.auth__form input::placeholder {
    color: color-mix(in srgb, var(--color-text-muted) 70%, transparent);
}

.auth__form .form-row ul,
.auth__form > ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Erreurs globales du formulaire (ex. confirmation du mot de passe différente). */
.auth__form > ul {
    margin-bottom: 1.1rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    background: var(--color-danger-soft);
}

.auth__form > ul li {
    color: var(--color-danger);
    font-size: 0.875rem;
}

/* Champ avec icône à gauche (et bouton « œil » à droite pour un mot de passe). */
.auth-field {
    --auth-input-padding-left: 2.6rem;
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field > .icon {
    position: absolute;
    left: 0.9rem;
    color: var(--color-text-muted);
    font-size: 1.05rem;
    pointer-events: none;
    transition: color 0.15s;
}

.auth-field:focus-within > .icon {
    color: var(--color-primary);
}

.auth-field[data-controller="password-visibility"] {
    --auth-input-padding-right: 2.9rem;
}

.auth-field__toggle {
    position: absolute;
    right: 0.4rem;
    display: inline-flex;
    padding: 0.45rem;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--color-text-muted);
    font-size: 1.05rem;
    cursor: pointer;
}

.auth-field__toggle:hover {
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.auth-field__toggle-hide,
.auth-field.is-visible .auth-field__toggle-show {
    display: none;
}

.auth-field.is-visible .auth-field__toggle-hide {
    display: inline;
}

/* Code de double authentification : grands caractères espacés. */
.auth__code {
    --auth-input-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --auth-input-font-size: 1.5rem;
    --auth-input-height: 3.5rem;
    text-align: center;
    letter-spacing: 0.4em;
}

.auth__code::placeholder {
    letter-spacing: 0.4em;
}

.auth__submit {
    position: relative;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--color-primary) 70%, transparent);
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.auth__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -8px color-mix(in srgb, var(--color-primary) 80%, transparent);
}

.auth__submit:active {
    transform: none;
}

.auth__submit .icon {
    transition: transform 0.15s;
}

.auth__submit:hover .icon {
    transform: translateX(3px);
}

/* Envoi en cours : Turbo pose aria-busy sur le formulaire, le libellé laisse place à un indicateur. */
.auth__form[aria-busy="true"] .auth__submit {
    color: transparent;
    pointer-events: none;
}

.auth__form[aria-busy="true"] .auth__submit::after {
    content: "";
    position: absolute;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--color-on-primary);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.auth__note {
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.auth__footer {
    max-width: 420px;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.auth__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.auth__back:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* ---------------------------------------------------------------- */
/* Responsive                                                       */
/* ---------------------------------------------------------------- */
@media (max-width: 800px) {
    /* Authentification : le panneau de présentation disparaît, la marque passe au-dessus de la carte. */
    .auth {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth__showcase {
        display: none;
    }

    .auth__topline .auth__brand {
        visibility: visible;
    }

    .modal__columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .modal__side {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--color-border);
        padding-top: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    main {
        padding: 1rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    .topbar {
        padding: 0 1rem;
    }

    .topbar__toggle {
        display: inline-flex;
    }

    .topbar__nav {
        display: none;
        position: absolute;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.5rem;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
    }

    .topbar__nav.is-open {
        display: flex;
    }

    .topbar__nav > a {
        padding: 0.65rem 0.75rem;
    }

    .topbar__search {
        margin: 0 0 0.35rem;
    }

    .topbar__search input,
    .topbar__search input:focus {
        width: 100%;
    }

    .board-page .topbar__search input:not(:focus) {
        border-color: var(--color-border);
        background: var(--color-surface-muted);
        color: var(--color-text);
    }

    .board-page .topbar__search input:not(:focus)::placeholder,
    .board-page .topbar__search:not(:focus-within) .icon {
        color: var(--color-text-muted);
    }

    .topbar__notifications-label {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
    }

    .topbar__badge {
        position: static;
    }

    /* Menu du compte : toujours ouvert (cf nav_toggle_controller.js) et affiché à plat en tête du menu. */
    .topbar__account {
        order: -1;
        margin: 0 0 0.35rem;
        padding-bottom: 0.35rem;
        border-bottom: 1px solid var(--color-border);
    }

    .topbar__user {
        padding: 0.5rem 0.75rem;
        pointer-events: none;
    }

    .topbar__account .dropdown__panel {
        position: static;
        min-width: 0;
        max-height: none;
        padding: 0;
        border: none;
        box-shadow: none;
        font-size: 0.9rem;
    }

    .topbar__account .dropdown__item {
        padding: 0.65rem 0.75rem;
    }

    .topbar__account-email,
    .topbar__account .dropdown__separator {
        display: none;
    }

    /* Le menu déroulant est opaque : on retrouve les couleurs normales sur la vue tableau. */
    .board-page .topbar__nav a,
    .board-page .topbar__nav .topbar__user {
        color: var(--color-text);
    }

    .board-page .topbar__nav > a:hover,
    .board-page .topbar__nav > a.is-active {
        background: var(--color-surface-muted);
        color: var(--color-text);
    }

    .form-page {
        margin: 1rem auto;
        padding: 1.25rem;
    }

    .boards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .board-card {
        height: 90px;
    }

    /* Colonnes : défilement horizontal « page par page » façon application mobile. */
    .board-lists {
        scroll-snap-type: x mandatory;
        margin: 0 -1rem;
        padding: 0 1rem 1rem;
        scroll-padding: 0 1rem;
    }

    .board-list {
        width: 85vw;
        flex-basis: 85vw;
        max-width: 320px;
        scroll-snap-align: start;
    }

    /* Carte : la modale occupe tout l'écran. */
    .modal-overlay {
        padding: 0;
    }

    .modal {
        min-height: 100%;
        border-radius: 0;
        padding: 1rem;
    }

    .table-card {
        padding: 0.75rem;
    }

    div.dt-container .dt-layout-row:not(.dt-layout-table) {
        flex-direction: column;
        align-items: stretch;
    }

    div.dt-container .dt-layout-row:not(.dt-layout-table) > .dt-layout-cell {
        justify-content: flex-start;
    }

    div.dt-container .dt-search,
    div.dt-container .dt-search input {
        width: 100%;
        min-width: 0;
    }

    .dialog__actions {
        flex-direction: column-reverse;
    }

    .dialog__actions .btn {
        width: 100%;
    }

    .board-header__actions {
        width: 100%;
    }

    .board-search,
    .board-search__input,
    .board-search__input:focus {
        width: 100%;
    }

    .modal__cover {
        width: calc(100% + 2rem);
        margin: -1rem -1rem 1rem;
    }

    .calendar {
        padding: 0.5rem;
        overflow-x: auto;
    }

    .calendar__grid {
        min-width: 640px;
    }

    .my-card {
        flex-wrap: wrap;
    }

    .my-card__labels {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth__panel {
        padding: 1rem 1rem 1.5rem;
    }

    .auth__card {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: 16px;
    }

    .topbar__brand span {
        display: none;
    }

    .page-header__actions,
    .page-header__actions .btn {
        width: 100%;
    }
}

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