/* Polish au-dessus de Tailwind */

html {
    font-feature-settings: "cv11","ss01";
}

/* Sortable JS */
.sortable-ghost {
    opacity: 0.35;
    background: #e0e7ff !important;
}
.sortable-drag {
    box-shadow: 0 12px 24px -8px rgba(15, 23, 42, .25);
    transform: rotate(0.5deg);
}
[data-status-column] {
    min-height: 60px;
}

/* Cards items kanban */
.item-card {
    transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.item-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.item-card:active {
    cursor: grabbing;
}

/* line-clamp 2 fallback (Tailwind v3 inclut déjà line-clamp utility) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
dialog {
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}
dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

/* Scrollbar discrète sur le Kanban */
#kanban {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
#kanban::-webkit-scrollbar { height: 8px; }
#kanban::-webkit-scrollbar-track { background: transparent; }
#kanban::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
#kanban::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Boutons primaires : focus visible cohérent */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Modale : sur petits écrans, occuper la largeur disponible proprement. */
dialog {
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 2rem);
}
@media (max-width: 640px) {
    dialog {
        margin: 0.5rem;
        width: calc(100vw - 1rem);
        border-radius: 1rem;
    }
}

/* Zones tactiles : assurer une cible minimale confortable sur mobile. */
@media (max-width: 640px) {
    button, a, input[type="checkbox"], input[type="radio"], [role="button"] {
        touch-action: manipulation;
    }
    /* Empêche le zoom iOS sur focus d'input (tailles < 16px). */
    input, select, textarea {
        font-size: 16px;
    }
}

/* Kanban : scroll horizontal fluide + snap au niveau des colonnes sur mobile. */
@media (max-width: 640px) {
    #kanban {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    #kanban > section {
        scroll-snap-align: start;
    }
}

/* Tableaux : enveloppe scrollable horizontalement quand nécessaire. */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-scroll table { min-width: 100%; }
