/* =============================================================================
   projects.jimajin.fr — styles complémentaires à Bootstrap 5
   ============================================================================= */

:root {
    --app-bg: #f4f6f9;
}

/* --- Pages connectées ------------------------------------------------------ */
.app-body {
    background: var(--app-bg);
    min-height: 100vh;
}

.app-main {
    max-width: 1600px;
}

/* --- Pages de connexion / inscription (centrées) --------------------------- */
.auth-body {
    background: linear-gradient(135deg, #1f2937 0%, #0d6efd 100%);
    min-height: 100vh;
}

.auth-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card,
.auth-alert {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    border: 0;
    border-radius: 1rem;
}

/* --- Divers ---------------------------------------------------------------- */
.table > :not(caption) > * > * {
    padding-top: .65rem;
    padding-bottom: .65rem;
}

.toast-container {
    z-index: 1090;
}

.min-w-0 {
    min-width: 0;
}

/* --- Pastilles de couleur (projets, colonnes) ------------------------------ */
.project-dot,
.col-dot {
    display: inline-block;
    flex-shrink: 0;
    border-radius: 50%;
}

.project-dot {
    width: .9rem;
    height: .9rem;
    background: var(--project-color, #0d6efd);
}

.project-dot-sm {
    width: .6rem;
    height: .6rem;
}

.col-dot {
    width: .6rem;
    height: .6rem;
    background: var(--col-color, #6c757d);
    margin-right: .25rem;
}

.column-badge {
    background: color-mix(in srgb, var(--col-color, #6c757d) 15%, white);
    color: color-mix(in srgb, var(--col-color, #6c757d) 75%, black);
    border: 1px solid color-mix(in srgb, var(--col-color, #6c757d) 35%, white);
}

/* --- Avatars (initiales) ----------------------------------------------------- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    color: #fff;
    background: hsl(var(--avatar-hue, 210) 55% 45%);
    flex-shrink: 0;
    user-select: none;
}

.avatar-sm {
    width: 1.6rem;
    height: 1.6rem;
    font-size: .65rem;
}

.avatar-empty {
    background: #e9ecef;
    color: #adb5bd;
}

.avatar-more {
    background: #adb5bd;
}

.avatar-stack .avatar {
    border: 2px solid #fff;
    margin-left: -.4rem;
}

.avatar-stack .avatar:first-child {
    margin-left: 0;
}

/* --- Tableau de bord ---------------------------------------------------------- */
.stat-card {
    transition: transform .15s ease, box-shadow .15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08) !important;
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* --- Projets ----------------------------------------------------------------- */
.project-card {
    border-top: 4px solid var(--project-color) !important;
    transition: transform .15s ease, box-shadow .15s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .08) !important;
}

.project-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Vue liste ------------------------------------------------------------------- */
.task-table tbody tr {
    position: relative;   /* zone cliquable = toute la ligne (stretched-link) */
}

.task-row-done td {
    color: var(--bs-secondary-color);
}

.task-row-done td:first-child a {
    text-decoration: line-through !important;
}

/* --- Kanban ---------------------------------------------------------------------- */
.board-filter {
    width: auto;
    min-width: 9rem;
}

.kanban-board {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: calc(100vh - 13rem);
}

.kanban-column {
    flex: 0 0 300px;
    max-width: 300px;
    background: #e9edf2;
    border-radius: .75rem;
    border-top: 4px solid var(--col-color, #6c757d);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 11rem);
}

.kanban-column-header {
    padding: .75rem .75rem .5rem;
}

.kanban-column.over-wip [data-count] {
    background: var(--bs-danger) !important;
    color: #fff;
    border-color: var(--bs-danger) !important;
}

.kanban-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .25rem .5rem;
    min-height: 3.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    border-radius: .5rem;
    transition: background-color .15s ease;
}

.kanban-list.drag-over {
    background: rgba(13, 110, 253, .08);
    outline: 2px dashed rgba(13, 110, 253, .35);
    outline-offset: -2px;
}

/* Colonne vide */
.kanban-list:not(:has(.task-card))::after {
    content: "No tasks";
    display: block;
    text-align: center;
    color: var(--bs-secondary-color);
    font-size: .85rem;
    padding: .75rem 0;
}

.kanban-add {
    margin: .25rem .5rem .5rem;
    color: var(--bs-secondary-color);
    text-align: left;
}

.kanban-add:hover {
    color: var(--bs-primary);
}

.task-card {
    border: 0;
    border-left: 3px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
    cursor: grab;
    transition: box-shadow .15s ease, opacity .15s ease;
}

.task-card[data-priority="high"]   { border-left-color: var(--bs-danger); }
.task-card[data-priority="medium"] { border-left-color: var(--bs-warning); }
.task-card[data-priority="low"]    { border-left-color: var(--bs-secondary-bg-subtle); }

.task-card:hover,
.task-card:focus-visible {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
    outline: none;
}

.task-card.dragging {
    opacity: .45;
    cursor: grabbing;
}

.task-card.is-done .task-title {
    text-decoration: line-through;
    color: var(--bs-secondary-color);
}

.task-card.saving {
    opacity: .6;
    pointer-events: none;
}

.task-card.flash {
    animation: card-flash 1.2s ease;
}

@keyframes card-flash {
    0%   { box-shadow: 0 0 0 3px rgba(13, 110, 253, .55); }
    100% { box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
}

.task-title {
    font-size: .925rem;
    line-height: 1.3;
    word-break: break-word;
}

.task-actions .dropdown-toggle::after {
    display: none;
}

@media (max-width: 575.98px) {
    .kanban-column {
        flex-basis: 85vw;
        max-width: 85vw;
    }
}

/* --- Compte / mot de passe --------------------------------------------------- */
.avatar-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.25rem;
}

.otp-input {
    font-size: 1.35rem;
    letter-spacing: .4em;
    font-variant-numeric: tabular-nums;
}

/* --- Liens de documentation ---------------------------------------------------- */
.doc-link {
    position: relative;
    z-index: 2;            /* au-dessus des stretched-link des cartes */
}

/* --- Projets : recherche + vue tableau ------------------------------------------ */
.projects-search {
    flex: 1 1 260px;
    max-width: 420px;
}

.project-table .project-dot {
    width: .7rem;
    height: .7rem;
}

.project-table-desc {
    max-width: 420px;
}
