*, *::before, *::after {
    box-sizing: border-box;
}

a,
a:visited,
a:active {
    text-decoration: none;
    color: inherit;
}

a:hover,
a:focus {
    text-decoration: none;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.0625rem;
    line-height: 1.5;
    background: #f4f5fb;
    color: #111827;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.85rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left {
    flex-shrink: 0;
}

a.topbar-brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

a.topbar-brand-link:hover,
a.topbar-brand-link:focus {
    opacity: 0.92;
}

.topbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* ── Dropdown menu ───────────────────────────────────────────── */
.nav-dropdown {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 57px;
    right: 1rem;
    width: 240px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
}

.nav-dropdown.open {
    display: flex;
}

.nav-dropdown-user {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.1rem 0.85rem;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.nav-dropdown-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
}

.nav-dropdown-role {
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

.main-nav {
    display: flex;
    flex-direction: column;
    padding: 0.45rem 0.5rem;
    gap: 0.1rem;
}

.main-nav a {
    color: #4b5563;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.main-nav a:hover {
    background: #eef2ff;
    color: #4338ca;
}

.notif-link-menu {
    position: relative;
}

.notif-badge-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    margin-left: 0.3rem;
}

.nav-dropdown-footer {
    border-top: 1px solid #f3f4f6;
    padding: 0.5rem 0.5rem;
}

.nav-logout {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.93rem;
    color: #b91c1c;
    text-decoration: none;
    transition: background 0.15s;
}

.nav-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.logo-small {
    height: 32px;
    object-fit: contain;
}

.logo-placeholder {
    font-weight: 700;
    font-size: 1.2rem;
}

.notif-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #eef2ff;
}

.notif-icon {
    position: relative;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
}

.notif-icon::before,
.notif-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Corps de la cloche */
.notif-icon::before {
    bottom: 3px;
    width: 14px;
    height: 12px;
    border-radius: 7px 7px 3px 3px;
    border: 2px solid #4f46e5;
    border-top-width: 2px;
    background: transparent;
}

/* Battant de la cloche */
.notif-icon::after {
    bottom: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4f46e5;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.btn-link {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-link:hover {
    text-decoration: underline;
}

.main-container {
    padding: 1.8rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Tâches — vue Kanban : pleine largeur de la fenêtre */
.main-container--taches-kanban {
    max-width: none;
    width: 100%;
    margin: 0;
    padding-left: clamp(0.75rem, 2vw, 2rem);
    padding-right: clamp(0.75rem, 2vw, 2rem);
    box-sizing: border-box;
    font-size: 1.0625rem;
}

/* Filtres tâches (desktop : ligne ; mobile : panneau — voir media query bas de page) */
.card--taches .taches-filters-inner {
    font-size: 1.02rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.35rem;
    align-items: center;
}

.card--taches .taches-filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.card--taches .taches-filters input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}

.taches-filters-wrap {
    position: relative;
    margin-top: 0.35rem;
}

.taches-mobile-toolbar {
    display: none;
}

.taches-filters-sheet-head {
    display: none;
}

.taches-desktop-only {
    display: block;
}

.taches-view-switch-row.taches-desktop-only {
    display: flex;
}

.taches-mobile-only-block {
    display: none;
}

.card {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 12px 30px rgba(148, 163, 184, 0.25);
    padding: 1.75rem 1.9rem;
    margin-bottom: 1.6rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.1rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.8rem 1.6rem;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 500;
    transition: transform 0.08s ease-out, box-shadow 0.12s ease-out, background 0.15s;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:visited {
    color: #ffffff;
}

.btn-primary *,
.btn-primary span {
    color: #ffffff;
}

.btn-primary:hover {
    transform: none;
}

.btn-secondary {
    background: #eef2ff;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e0e7ff;
    border-color: #c7d2fe;
}

.btn-sm {
    padding: 0.7rem 1.3rem;
    font-size: 1rem;
}

.btn + .btn {
    margin-left: 0.6rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.9rem;
}

.form-group label {
    font-size: 0.98rem;
    margin-bottom: 0.35rem;
    color: #6b7280;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    padding: 0.65rem 0.8rem;
    border-radius: 0.65rem;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    font-family: inherit;
    background: #f9fafb;
    color: #111827;
    outline: none;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.45);
    background: #ffffff;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.05rem;
}

th,
td {
    padding: 0.85rem 0.85rem;
    text-align: left;
}

thead {
    background: #f3f4f6;
}

thead th {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

tbody tr:nth-child(even) {
    background: #f9fafb;
}

tbody tr:hover {
    background: #e0e7ff;
    cursor: pointer;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 500;
    min-width: 92px;
    text-align: center;
    white-space: nowrap;
}

.status-non_demarre {
    background: #e5e7eb;
    color: #374151;
}

.status-en_attente {
    background: #f3e8ff;
    color: #7c3aed;
}

.status-en_cours {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-attente_precision {
    background: #fef3c7;
    color: #b45309;
}

.status-termine {
    background: #dcfce7;
    color: #15803d;
}

.badge-archived {
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 999px;
    padding: 0.12rem 0.55rem;
    font-size: 0.75rem;
}

.flex {
    display: flex;
}

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

.mt-1 { margin-top: 0.3rem; }
.mt-2 { margin-top: 0.6rem; }
.mt-3 { margin-top: 1.1rem; }

.text-muted {
    color: #6b7280;
}

.project-note {
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    font-size: 0.92rem;
}

.project-note-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.project-note-content {
    color: #374151;
    line-height: 1.5;
}

/* Tableau Vue d'ensemble Tâches */
.taches-table .taches-icon {
    color: #6b7280;
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.taches-table .taches-row-company .taches-icon {
    color: #4f46e5;
}

.taches-table .taches-row-project .taches-icon {
    color: #6366f1;
}

.taches-toggle-icon {
    display: inline-block;
    width: 1rem;
    font-size: 0.7rem;
    color: #6b7280;
    margin-right: 0.35rem;
    transition: transform 0.15s ease;
}

.taches-table .taches-row-company.taches-toggle-row {
    cursor: pointer;
}

.taches-table .taches-row-company .taches-company-link {
    pointer-events: auto;
}

.taches-table .taches-row-company td:first-child {
    font-weight: 600;
    font-size: 1.02rem;
}

.taches-table .taches-row-project td:first-child {
    font-weight: 500;
}

.taches-indent {
    display: inline-block;
    width: 1.2rem;
}

.taches-indent-2 {
    width: 2.4rem;
}

.taches-table .taches-row-company {
    background: linear-gradient(90deg, #eef2ff 0%, #e0e7ff 100%);
}

.taches-table .taches-row-company td {
    border-top: 1px solid #c7d2fe;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.taches-table .taches-row-spacer td {
    padding: 0;
    height: 4px;
    background: #d1d5db;
    border: none;
}

/* Barre d'avancement miniature pour les tâches */
.progress-pill-sm {
    padding: 0.12rem 0.35rem;
    gap: 0.25rem;
}

.progress-pill-sm .progress-pill-track {
    width: 40px;
    height: 4px;
}

.progress-pill-sm .progress-pill-text {
    font-size: 0.7rem;
    min-width: 1.8rem;
}

.taches-table .taches-row-task {
    cursor: pointer;
}

.taches-table .taches-row-task:hover {
    background: #e0e7ff;
}

.link {
    color: #111827;
    text-decoration: none;
}

.link:hover {
    text-decoration: none;
    color: #111827;
}

.alert {
    padding: 0.7rem 0.9rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
}

.alert-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.12rem 0.6rem;
    font-size: 0.8rem;
    background: #eff6ff;
    color: #1d4ed8;
}

td.table-actions {
    vertical-align: middle;
    text-align: right;
}

.table-actions {
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Groupe de boutons d'action (ex: retour / éditer / terminer) */
.comment-list {
    list-style: none;
    padding-left: 0;
}

.comment-item {
    margin-bottom: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-meta {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.comment-actions {
    margin-left: 0.5rem;
}

.comment-actions .link-comment {
    font-size: 0.8rem;
    color: #6366f1;
}

.comment-actions .link-comment:hover {
    text-decoration: underline;
}

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

.comment-edit-form textarea {
    width: 100%;
    min-height: 60px;
    margin-bottom: 0.5rem;
}

.task-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.85rem 0;
}

/* Ligne de boutons filtres */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Accès aux sites — cartes cliquables + lien Note (modal) */
.site-link-card {
    position: relative;
    display: block;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.15s;
}

.site-link-card:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.site-link-card-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 8px;
}

.site-link-card-inner {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.site-link-card-title {
    font-weight: 600;
}

.site-link-card-url {
    font-size: 0.85rem;
    margin-top: 0.35rem;
    word-break: break-all;
}

.site-link-card:hover .site-link-card-title {
    color: #4f46e5;
}

.site-link-note-open {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    pointer-events: auto;
    position: relative;
    z-index: 3;
    color: #6366f1;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-link-note-open:hover {
    color: #4f46e5;
}

/* Fenêtre modale — note */
.site-note-modal[hidden] {
    display: none !important;
}

.site-note-modal:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 1rem;
    box-sizing: border-box;
}

.site-note-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
}

.site-note-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(420px, 100vw - 2rem);
    max-height: min(70vh, 520px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.site-note-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.95rem;
}

.site-note-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 0.25rem;
}

.site-note-modal-close:hover {
    color: #111827;
}

.site-note-modal-body {
    padding: 1rem 0.85rem;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
}

/* Nav desktop (inline, visible uniquement sur grand écran) */
.topbar-nav-desktop {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex: 1;
    justify-content: flex-end;
}

.topbar-nav-desktop a {
    color: #4b5563;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.topbar-nav-desktop a:hover {
    background: #eef2ff;
    color: #4338ca;
}

.topbar-sep {
    width: 1px;
    height: 20px;
    background: #e5e7eb;
    margin: 0 0.4rem;
    flex-shrink: 0;
}

.topbar-username {
    font-size: 1rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Bouton hamburger (caché sur desktop, visible ≤ 900px) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 0.5rem;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #374151;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.15s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

tbody tr:hover .table-actions .btn-secondary {
    background: #ffffff;
    border-color: #e5e7eb;
}

tbody tr:hover .table-actions .btn-secondary:hover {
    background: #eef2ff;
}

.progress-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    background: #f3f4ff;
    border: 1px solid #e5e7eb;
}

.progress-pill-track {
    position: relative;
    width: 130px;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.progress-pill-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f46e5, #22c55e);
    transition: width 0.25s ease-out;
}

.progress-pill-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    min-width: 2.5rem;
    text-align: right;
}

/* ── Tablette large ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .main-container {
        padding: 1.4rem 1.2rem;
    }
}

/* ── Tablette (≤ 900px) : hamburger actif, nav desktop masquée ── */
@media (max-width: 900px) {
    .main-container {
        max-width: 100%;
        padding: 1rem 1rem;
        margin: 0;
    }

    .card {
        border-radius: 0.8rem;
        box-shadow: 0 6px 18px rgba(148, 163, 184, 0.18);
    }

    /* Masquer la nav desktop */
    .topbar-nav-desktop {
        display: none;
    }

    /* Afficher le hamburger */
    .hamburger-btn {
        display: flex;
    }
}

/* ── Mobile (≤ 640px) ──────────────────────────────────────────── */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .topbar {
        padding: 0.6rem 0.8rem;
    }

    /* Dropdown plus large sur mobile */
    .nav-dropdown {
        right: 0.5rem;
        width: calc(100vw - 1rem);
        max-width: 320px;
    }

    /* ── Conteneur pleine largeur ── */
    .main-container {
        padding: 0.75rem 0.75rem 1.4rem;
    }

    /* ── Cards ── */
    .card {
        padding: 1rem 1rem;
        margin-bottom: 0.9rem;
        border-radius: 0.85rem;
        box-shadow: 0 4px 14px rgba(148, 163, 184, 0.22);
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }

    /* ── Boutons pleine largeur dans les formulaires et headers ── */
    .form-group .btn,
    .card-header .btn,
    .btn-row .btn,
    .task-btn-group .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .task-btn-group {
        flex-direction: column;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn + .btn {
        margin-left: 0;
    }

    /* ── Actions dans les tableaux ── */
    .table-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        white-space: normal;
    }

    .table-actions .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }

    /* ── Tableaux → mode cartes ── */
    table {
        border: 0;
    }

    thead {
        display: none;
    }

    tbody tr {
        display: block;
        margin-bottom: 0.8rem;
        background: #ffffff;
        border-radius: 0.9rem;
        box-shadow: 0 4px 16px rgba(148, 163, 184, 0.2);
        padding: 0.75rem 0.85rem 0.6rem;
    }

    tbody tr:nth-child(even) {
        background: #ffffff;
    }

    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0;
        border-bottom: 1px solid #f3f4f6;
        gap: 0.5rem;
    }

    tbody td:last-child {
        border-bottom: none;
        padding-top: 0.6rem;
        flex-direction: column;
        align-items: stretch;
    }

    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #6b7280;
        flex-shrink: 0;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    tbody td:last-child::before {
        margin-bottom: 0.4rem;
    }

    .status-pill {
        min-width: 0;
        font-size: 0.78rem;
        padding: 0.18rem 0.55rem;
    }

    .progress-pill {
        gap: 0.3rem;
    }

    .progress-pill-track {
        width: 80px;
    }

    .progress-pill-text {
        font-size: 0.78rem;
        min-width: 2rem;
    }
}

/* ── Tâches : bascule vue liste / Kanban ───────────────────────── */
.taches-view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.taches-view-switch .btn.taches-view-switch--active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.taches-view-switch-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.taches-kanban-info-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.taches-kanban-info-btn:hover {
    background: #e0e7ff;
    color: #4f46e5;
    border-color: #a5b4fc;
}

.taches-kanban-info-btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.taches-kanban-info-icon {
    display: block;
    margin-top: 1px;
}

.taches-kanban-info-panel {
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    max-width: 52rem;
}

.taches-kanban-info-panel[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Vue Kanban horizontale (un projet = une colonne) */
.taches-kanban-wrap {
    overflow-x: auto;
    overflow-y: visible;
    margin: 0 -0.25rem;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.taches-kanban {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1.15rem;
    min-height: 300px;
    padding: 0.35rem 0.25rem 0.55rem;
    width: max-content;
    min-width: 100%;
}

.taches-kanban-col {
    flex: 0 0 320px;
    width: 320px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.taches-kanban-col.sortable-ghost {
    opacity: 0.45;
}

.taches-kanban-col.sortable-chosen {
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.taches-kanban-col-drag {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    min-height: 2.35rem;
    margin: -0.15rem 0.1rem -0.15rem -0.2rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 1.15rem;
    line-height: 1;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.taches-kanban-col-drag:hover {
    color: #64748b;
    background: #f1f5f9;
}

.taches-kanban-col-drag:active {
    cursor: grabbing;
}

.taches-kanban-col-drag:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.taches-kanban-col-header {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.85rem 0.85rem 0.85rem 0.7rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 600;
    border-radius: 9px 9px 0 0;
    border-left: 4px solid #4a72f5;
    border-bottom: 1px solid #e2e8f0;
}

.taches-kanban-col-header a {
    color: #0f172a;
}

.taches-kanban-col-header a:hover {
    color: #4f46e5;
}

.taches-kanban-col-icon {
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1.2;
}

.taches-kanban-col-titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.taches-kanban-col-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    font-weight: 600;
    text-decoration: none;
}

.taches-kanban-col-name:hover {
    text-decoration: underline;
}

.taches-kanban-col-company {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #64748b;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.taches-kanban-col-company:hover {
    color: #4f46e5;
    border-bottom-color: #c7d2fe;
}

.taches-kanban-col-count {
    flex-shrink: 0;
    min-width: 1.85rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 0.28rem 0.5rem;
}

.taches-kanban-col-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem;
    min-height: 140px;
}

.taches-kanban-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem 0.5rem 0.35rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
    color: #111827;
    transition: box-shadow 0.12s;
}

.taches-kanban-card:hover {
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.taches-kanban-card-handle {
    flex-shrink: 0;
    align-self: stretch;
    width: 2rem;
    min-height: 2.75rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.taches-kanban-card-handle:hover {
    background: #e2e8f0;
    color: #64748b;
}

.taches-kanban-card-handle:active {
    cursor: grabbing;
}

.taches-kanban-card-link {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.3rem 0.45rem 0.3rem 0.15rem;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
}

.taches-kanban-card-link:hover {
    background: rgba(79, 70, 229, 0.04);
}

.taches-kanban-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
    margin-top: 0.4rem;
    flex-shrink: 0;
}

.taches-kanban-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.taches-kanban-card-title {
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}

.taches-kanban-card-badge {
    align-self: flex-start;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: lowercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: #f5a623;
    color: #fff;
}

.taches-kanban-card-badge--muted {
    background: #e5e7eb;
    color: #4b5563;
}

.taches-kanban-card-sortable-ghost {
    opacity: 0.45;
}

.taches-kanban-card-sortable-drag {
    opacity: 0.92;
}

.taches-kanban-col.taches-kanban-col--filter-hidden {
    display: none !important;
}

.main-container--taches-kanban .card .taches-kanban-col.taches-kanban-col--filter-hidden {
    display: none !important;
}

.taches-kanban-add {
    align-self: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.taches-kanban-add:hover {
    background: #d1d5db;
    color: #374151;
}

button.taches-kanban-add {
    font: inherit;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

/* Modale nouvelle tâche (Kanban) */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    width: 100%;
    max-width: 560px;
    margin: auto;
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-dialog--task .modal-body {
    overflow-y: auto;
    padding: 1.25rem 1.5rem 1.5rem;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0;
    flex-shrink: 0;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 0.5rem;
}

/* Kanban mobile : une colonne = toute la largeur, swipe horizontal */
@media (max-width: 768px) {
    .main-container--taches-kanban .card .taches-kanban-wrap {
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        margin-bottom: 0;
        padding-bottom: 0.5rem;
        box-sizing: border-box;
    }

    .main-container--taches-kanban .card .taches-kanban {
        gap: 0;
        padding: 0.25rem 0 0.5rem;
        width: max-content;
        min-width: 100%;
    }

    .main-container--taches-kanban .card .taches-kanban-col {
        flex: 0 0 100vw;
        width: 100vw;
        max-width: 100vw;
        scroll-snap-align: start;
        box-sizing: border-box;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .taches-kanban-dots {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.35rem;
        padding: 0.35rem 0 0;
        margin-top: 0.15rem;
    }

    .taches-kanban-dots[hidden] {
        display: none !important;
    }

    .taches-kanban-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #cbd5e1;
        transition: background 0.15s, transform 0.15s;
    }

    .taches-kanban-dot--active {
        background: #4f46e5;
        transform: scale(1.2);
    }

    /* Tâches mobile : Kanban seul, en-tête compact, filtres en feuille */
    .taches-desktop-only {
        display: none !important;
    }

    .taches-mobile-only-block {
        display: list-item;
    }

    .card--taches .taches-header-subtitle {
        display: none;
    }

    .card--taches .card-header--taches {
        margin-bottom: 0.35rem;
    }

    .card--taches .card-title {
        font-size: 1.2rem;
    }

    .main-container--taches-kanban .card {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .taches-mobile-toolbar {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-bottom: 0.2rem;
    }

    .taches-filters-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 399;
        background: rgba(15, 23, 42, 0.45);
        border: none;
        margin: 0;
        padding: 0;
        cursor: pointer;
    }

    .taches-filters-backdrop:not([hidden]) {
        display: block;
    }

    .card--taches .taches-filters#taches-filters-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 400;
        max-height: 80vh;
        overflow-y: auto;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.18);
        background: #ffffff;
        border: 1px solid #e2e8f0;
        transform: translateY(110%);
        transition: transform 0.28s ease;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .card--taches .taches-filters#taches-filters-panel.taches-filters--open {
        transform: translateY(0);
    }

    .taches-filters-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid #e2e8f0;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
    }

    .taches-filters-sheet-title {
        font-size: 1.05rem;
        font-weight: 600;
        color: #0f172a;
    }

    .card--taches .taches-filters-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem 1.1rem 1.35rem;
    }

    .card--taches .taches-filter-label {
        align-items: flex-start;
    }

    .taches-filters-help {
        margin-top: 0.25rem;
        padding-top: 0.75rem;
        border-top: 1px solid #e2e8f0;
    }

    .taches-filters-help summary {
        cursor: pointer;
        font-weight: 600;
        color: #475569;
    }
}

/* ── Page Calendrier : graphique de contributions (style GitHub) ───────── */
.card--calendrier {
    max-width: 1100px;
}

.contrib-graph-wrap {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.contrib-graph {
    --contrib-gap: 3px;
    --contrib-cell: 11px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: max-content;
    max-width: 100%;
}

/* Bandeau des mois : position absolue (pas une case de 11px par semaine) pour éviter « jui », « ao », « oc »… */
.contrib-months-strip {
    position: relative;
    margin-left: 2.15rem;
    margin-bottom: 0.4rem;
    min-height: 1.15rem;
    flex-shrink: 0;
}

.contrib-month-label {
    position: absolute;
    top: 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    line-height: 1.2;
}

.contrib-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.35rem;
    flex-shrink: 0;
}

.contrib-dow {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--contrib-gap);
    padding-top: 0;
    width: 1.75rem;
    flex-shrink: 0;
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1;
}

.contrib-dow-label {
    display: block;
    height: var(--contrib-cell);
    line-height: var(--contrib-cell);
    visibility: hidden;
}

.contrib-dow-label--show {
    visibility: visible;
}

.contrib-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--contrib-gap);
    flex-shrink: 0;
    min-width: min-content;
}

.contrib-week {
    display: flex;
    flex-direction: column;
    gap: var(--contrib-gap);
    flex-shrink: 0;
    width: var(--contrib-cell);
    min-width: var(--contrib-cell);
}

.contrib-cell {
    display: block;
    width: var(--contrib-cell);
    height: var(--contrib-cell);
    border-radius: 2px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.contrib-cell--l0 {
    background: #ebedf0;
    outline: 1px solid rgba(27, 31, 35, 0.06);
}

.contrib-cell--l1 {
    background: #9be9a8;
}

.contrib-cell--l2 {
    background: #40c463;
}

.contrib-cell--l3 {
    background: #30a14e;
}

.contrib-cell--l4 {
    background: #216e39;
}

.contrib-cell--future {
    background: transparent;
    outline: none;
    visibility: hidden;
}

.contrib-legend-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.contrib-legend-bottom .contrib-cell {
    width: 11px;
    height: 11px;
}

@media (max-width: 640px) {
    .contrib-months-strip {
        margin-left: 1.85rem;
    }

    .contrib-month-label {
        font-size: 0.68rem;
    }
}

