/* ─── Kanban board ─── */
.kanban-board {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
    min-height: calc(100vh - 140px);
}

.kanban-col {
    flex: 0 0 292px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
}

.kanban-col__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.kanban-col__title { font-weight: 600; font-size: 14px; }
.kanban-col__count {
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: 20px; font-size: 12px; padding: 1px 8px; color: var(--color-muted);
}

.kanban-col__cards {
    flex: 1; overflow-y: auto; padding: .625rem;
    display: flex; flex-direction: column; gap: 8px; min-height: 60px;
}

/* ─── Kanban card ─── */
.kanban-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .75rem;
    cursor: grab;
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow .15s, border-color .15s;
    border-left: 3px solid transparent;
}
.kanban-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    text-decoration: none;
}
.kanban-card--ghost { opacity: .4; }
.kanban-card--drag  { box-shadow: 0 8px 24px rgba(0,0,0,.15); cursor: grabbing; }

.priority--urgente { border-left-color: #EF4444; }
.priority--haute   { border-left-color: #F59E0B; }
.priority--normale { border-left-color: #3B82F6; }
.priority--basse   { border-left-color: #D1D5DB; }

/* Card interne */
.kanban-card__top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .4rem; gap: 6px;
}
.kanban-card__labels { display: flex; gap: 4px; flex-wrap: wrap; }
.kanban-label-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

.kanban-card__title {
    font-size: 14px; font-weight: 500; line-height: 1.4;
    margin-bottom: .4rem; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Checklist progress */
.kanban-card__checklist {
    display: flex; align-items: center; gap: 6px; margin-bottom: .4rem;
}
.kc-progress-bar {
    flex: 1; height: 4px; background: var(--color-bg);
    border-radius: 4px; overflow: hidden;
}
.kc-progress-fill {
    height: 100%; background: var(--color-primary);
    border-radius: 4px; transition: width .3s;
}
.kc-progress-fill--done { background: var(--color-success); }
.kc-progress-text { font-size: 11px; color: var(--color-muted); white-space: nowrap; }
.kc-progress-text--done { color: var(--color-success); font-weight: 600; }

/* Card footer */
.kanban-card__footer {
    display: flex; align-items: center; gap: 6px; margin-top: .4rem;
}
.kc-avatars { display: flex; }
.kc-avatars .kc-avatar + .kc-avatar { margin-left: -6px; }
.kc-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: #EEF2FF; color: var(--color-primary);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border: 2px solid #fff;
}
.kc-avatar--more {
    background: #E5E7EB; color: var(--color-muted); font-size: 9px;
}
.kc-counters { display: flex; gap: 6px; margin-left: auto; }
.kc-counter  { font-size: 11px; color: var(--color-muted); }
.kc-due--late { color: var(--color-danger); font-weight: 600; }

/* ─── Type badges ─── */
.ticket-type {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 7px; border-radius: 4px; flex-shrink: 0;
}
.ticket-type--incident  { background: #FEE2E2; color: #991B1B; }
.ticket-type--devis     { background: #DBEAFE; color: #1E40AF; }
.ticket-type--vote      { background: #EDE9FE; color: #5B21B6; }
.ticket-type--rdv       { background: #FEF3C7; color: #92400E; }
.ticket-type--tache     { background: #F3F4F6; color: #374151; }
.ticket-type--question  { background: #D1FAE5; color: #065F46; }

/* ─── Modal ─── */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 100;
    align-items: center; justify-content: center;
}
.modal-overlay--open { display: flex; }
.modal {
    background: var(--color-surface); border-radius: 12px;
    width: 100%; max-width: 520px; max-height: 90vh;
    overflow-y: auto; padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal__title  { font-size: 18px; font-weight: 600; }
.modal__close  { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--color-muted); line-height: 1; padding: 0; }
.modal__close:hover { color: var(--color-text); }
.modal__footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ─── Sujet détail ─── */
.sujet-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) { .sujet-layout { grid-template-columns: 1fr; } }

.sujet-main    { display: flex; flex-direction: column; gap: 1rem; }
.sujet-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.sujet-meta-bar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-bottom: .25rem;
}
.sujet-label-badge {
    font-size: 12px; font-weight: 500;
    padding: 2px 8px; border-radius: 20px;
}

.sujet-section { }
.sujet-section__title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--color-muted); margin-bottom: .875rem;
}
.sidebar-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--color-muted); margin-bottom: .75rem;
    display: flex; align-items: center; gap: 6px;
}
.count-badge {
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: 20px; font-size: 11px; font-weight: 400;
    padding: 0 6px; color: var(--color-muted);
}

/* Description inline */
.desc-form { }
.desc-textarea {
    resize: vertical; min-height: 80px;
    border-color: transparent; background: var(--color-bg);
    transition: border-color .15s, background .15s;
}
.desc-textarea:focus {
    border-color: var(--color-primary); background: var(--color-surface);
}
.desc-actions { display: flex; gap: 8px; margin-top: .5rem; }

/* ─── Checklists ─── */
.checklist-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: .5rem;
}
.checklist-progress-text { font-size: 12px; color: var(--color-muted); }

.checklist-progress-bar {
    height: 6px; background: var(--color-bg);
    border-radius: 6px; overflow: hidden; margin-bottom: .75rem;
}
.checklist-progress-fill {
    height: 100%; background: var(--color-primary);
    border-radius: 6px; transition: width .3s;
}
.checklist-progress-fill--done { background: var(--color-success); }

.checklist-items { display: flex; flex-direction: column; gap: 4px; }

.checklist-item {
    display: flex; align-items: center; gap: 8px;
    padding: .375rem .5rem; border-radius: 6px;
    transition: background .1s;
}
.checklist-item:hover { background: var(--color-bg); }
.checklist-item--checked .checklist-item__content {
    text-decoration: line-through; color: var(--color-muted);
}

.checklist-checkbox {
    flex-shrink: 0; width: 18px; height: 18px;
    border: 2px solid var(--color-border); border-radius: 4px;
    background: var(--color-surface); cursor: pointer;
    font-size: 11px; font-weight: 700; color: var(--color-success);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s;
}
.checklist-item--checked .checklist-checkbox {
    background: var(--color-success); border-color: var(--color-success); color: #fff;
}
.checklist-checkbox:hover { border-color: var(--color-primary); }

.checklist-item__content { flex: 1; font-size: 14px; }
.checklist-item__assign {
    width: 22px; height: 22px; border-radius: 50%;
    background: #EEF2FF; color: var(--color-primary);
    font-size: 10px; font-weight: 700; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.checklist-item__due {
    font-size: 11px; color: var(--color-muted); white-space: nowrap;
}
.checklist-item__due--late { color: var(--color-danger); font-weight: 600; }
.checklist-item__del {
    background: none; border: none; cursor: pointer; color: var(--color-muted);
    font-size: 16px; line-height: 1; padding: 0 2px; opacity: 0;
    transition: opacity .15s;
}
.checklist-item:hover .checklist-item__del { opacity: 1; }
.checklist-item__del:hover { color: var(--color-danger); }

.add-item-form {
    display: flex; gap: 6px; margin-top: .75rem; flex-wrap: wrap;
}
.add-item-form .form-input { font-size: 13px; padding: .45rem .75rem; }
.add-item-input { flex: 1; min-width: 160px; }

/* ─── Vote ─── */
.vote-bar-wrap {
    display: flex; height: 8px; border-radius: 8px;
    overflow: hidden; margin-bottom: .75rem; background: var(--color-bg);
}
.vote-bar-seg { height: 100%; transition: width .3s; }
.vote-bar-seg--pour       { background: #10B981; }
.vote-bar-seg--contre     { background: #EF4444; }
.vote-bar-seg--abstention { background: #D1D5DB; }

.vote-legend {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: .875rem;
}
.vote-pill {
    font-size: 12px; padding: 3px 10px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 4px;
}
.vote-pill--pour       { background: #D1FAE5; color: #065F46; }
.vote-pill--contre     { background: #FEE2E2; color: #991B1B; }
.vote-pill--abstention { background: #F3F4F6; color: #374151; }
.vote-pill small { opacity: .7; font-size: 11px; }

.vote-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.vote-btn--active-pour       { background: #10B981; color: #fff; border-color: #10B981; }
.vote-btn--active-contre     { background: #EF4444; color: #fff; border-color: #EF4444; }
.vote-btn--active-abstention { background: #9CA3AF; color: #fff; border-color: #9CA3AF; }

/* ─── Activité / Commentaires ─── */
.activity-item {
    display: flex; gap: 10px; padding: .75rem 0;
    border-bottom: 1px solid var(--color-border);
}
.activity-item:last-of-type { border-bottom: none; }

.activity-avatar {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
    background: #EEF2FF; color: var(--color-primary);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.activity-avatar--me { background: var(--color-primary); color: #fff; }

.activity-body { flex: 1; min-width: 0; }
.activity-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: .25rem; }
.activity-date { font-size: 12px; color: var(--color-muted); }
.activity-content { font-size: 14px; white-space: pre-wrap; }

.comment-compose { display: flex; gap: 10px; align-items: flex-start; margin-top: 1rem; }
.comment-form { margin-top: .5rem; }

/* ─── Participants ─── */
.participant-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.participant-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #EEF2FF; color: var(--color-primary);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: default;
}

/* ─── Labels selector ─── */
.label-selector { display: flex; flex-direction: column; gap: 6px; }
.label-option {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; cursor: pointer; padding: 2px 0;
}
.label-option input[type=checkbox] { cursor: pointer; }
.label-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}

/* ─── Documents liés (sidebar) ─── */
.doc-link-item {
    display: flex; align-items: center; gap: 8px;
    padding: .375rem 0; border-bottom: 1px solid var(--color-border);
    text-decoration: none; color: var(--color-text); font-size: 13px;
}
.doc-link-item:last-child { border-bottom: none; }
.doc-link-item:hover { color: var(--color-primary); }
.doc-link-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-link-size { font-size: 11px; color: var(--color-muted); white-space: nowrap; }
.doc-link-icon { flex-shrink: 0; }

/* ─── Divers ─── */
.text-danger { color: var(--color-danger); }
