/* Styles Watys Boards (au-dessus de Bootstrap) */

body {
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
    min-height: 100vh;
}

[data-bs-theme="dark"] body {
    background: linear-gradient(180deg, #1a1d21 0%, #121417 100%);
}

.board-tile {
    min-height: 88px;
    transition: transform .15s ease, box-shadow .15s ease;
}

@media (min-width: 576px) {
    .board-tile {
        min-height: 110px;
    }
}

.board-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

.kanban-list {
    width: min(85vw, 280px);
}

@media (min-width: 768px) {
    .kanban-list {
        width: 280px;
    }
}

.kanban-card {
    cursor: default;
    border: 1px solid rgba(0, 0, 0, .08);
}

.kanban-board {
    min-height: 50vh;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    margin-inline: -0.5rem;
    padding-inline: 0.5rem;
}

.kanban-board > .kanban-list {
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .kanban-board {
        margin-inline: 0;
        padding-inline: 0;
        scroll-snap-type: none;
        min-height: 60vh;
    }
}

/* Pastille couleur sélectionnée dans les modales */
.color-swatch input:checked + span {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Icônes navbar (cloche + thème) */
.nav-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    line-height: 1;
    text-decoration: none;
}

.nav-icon-link.btn-link {
    border: 0;
    box-shadow: none;
}

.nav-notif-badge {
    font-size: 0.65rem;
    padding: 0.2em 0.4em;
    transform: translate(-30%, 20%) !important;
}

/* Accueil : pleine largeur + responsive */
.home-page-search .form-control {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 992px) {
    .home-page-search .form-control {
        max-width: 28rem;
    }
}

.home-page-layout {
    display: block;
}

@media (min-width: 992px) {
    .home-page-layout {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 1.5rem;
        align-items: start;
    }
}

@media (min-width: 1400px) {
    .home-page-layout {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 2rem;
    }
}

.home-page-main {
    min-width: 0; /* évite que la grille déborde sur petit écran */
}

.home-ws-rename {
    width: 100%;
}

.home-ws-rename .form-control {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 576px) {
    .home-ws-rename {
        width: auto;
        max-width: 16rem;
    }
}

.home-ws-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
}

.home-ws-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.home-ws-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    border-radius: 0.375rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.925rem;
    line-height: 1.25;
}

.home-ws-nav-item:hover {
    background: var(--bs-tertiary-bg);
}

.home-ws-nav-item.active {
    background: var(--bs-primary);
    color: #fff;
}

.home-ws-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-ws-count {
    flex-shrink: 0;
    font-size: 0.75rem;
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
}

.home-ws-nav-item.active .home-ws-count,
.home-ws-chip.active .home-ws-count {
    background: rgba(255, 255, 255, 0.25);
}

[data-bs-theme="dark"] .home-ws-count {
    background: rgba(255, 255, 255, 0.12);
}

/* Pastilles mobile : défilement horizontal fluide */
.home-ws-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.15rem 0 0.5rem;
    margin: 0 -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
}

.home-ws-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    color: inherit;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    white-space: nowrap;
    min-height: 2.25rem; /* zone tactile confortable */
}

.home-ws-chip.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

/* Grille de tableaux : remplit la largeur disponible (1 → plusieurs colonnes) */
.home-board-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

@media (min-width: 480px) {
    .home-board-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 992px) {
    .home-board-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (min-width: 1400px) {
    .home-board-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.15rem;
    }
}

.home-board-tile {
    min-width: 0;
}

/* ——— Responsive global (téléphone / tablette) ——— */

/* Évite le débordement horizontal de la page */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.page-narrow {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* Utilitaires manquants de Bootstrap */
@media (min-width: 576px) {
    .w-sm-auto { width: auto !important; }
}
@media (min-width: 992px) {
    .w-lg-auto { width: auto !important; }
}

/* Menu hamburger : liens plus confortables au doigt */
@media (max-width: 991.98px) {
    .mobile-nav-menu .nav-link,
    .mobile-nav-menu .btn-link {
        display: flex;
        align-items: center;
        min-height: 2.75rem;
    }

    .mobile-nav-menu .nav-icon-link {
        justify-content: flex-start;
        width: 100%;
        padding-left: 0.5rem !important;
    }

    .mobile-nav-menu .nav-notif-badge {
        position: static !important;
        transform: none !important;
        margin-left: 0.5rem;
    }
}

/* Barre d’outils tableau */
.board-toolbar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.65rem;
}

.board-toolbar-heading {
    flex: 1 1 8rem;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.board-toolbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media (min-width: 768px) {
    .board-toolbar-title {
        font-size: 1.35rem;
    }
}

.board-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.board-view-tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
}

.board-view-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--bs-primary);
    border-radius: 0.375rem;
    color: var(--bs-primary);
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
    background: transparent;
}

.board-view-tab:hover {
    background: rgba(13, 110, 253, 0.08);
    color: var(--bs-primary);
}

.board-view-tab.active {
    background: var(--bs-primary);
    color: #fff;
}

[data-bs-theme="dark"] .board-view-tab:hover {
    background: rgba(13, 110, 253, 0.2);
}

/* En-tête de page (carte, etc.) */
.page-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.page-header-bar .page-back-btn {
    max-width: 100%;
}

.page-header-bar-end {
    width: 100%;
}

@media (min-width: 576px) {
    .page-header-bar-end {
        width: auto;
        margin-left: auto;
    }
}

/* Listes qui s’empilent sur mobile */
.mobile-stack-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

@media (min-width: 576px) {
    .mobile-stack-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.mobile-table-wrap {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
}

.mobile-table-wrap .table {
    margin-bottom: 0;
}

/* Accueil : groupe de boutons sur une ligne */
@media (max-width: 575.98px) {
    .home-page-actions.btn-group {
        display: flex;
    }

    .home-page-actions.btn-group > .btn {
        flex: 1 1 0;
    }

    .home-page-search {
        margin-bottom: 0.75rem !important;
    }

    .home-ws-chips {
        margin-bottom: 0.75rem !important;
    }
}

/* Formulaires auth déjà étroits : un peu plus d’air */
@media (max-width: 575.98px) {
    main.flex-grow-1 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .board-page-kanban {
        /* Le footer + navbar mangent de la hauteur : le kanban doit scroller horizontalement ici */
    }
}

/* Swatches couleur un peu plus gros au doigt */
@media (max-width: 575.98px) {
    .color-swatch span {
        width: 32px !important;
        height: 32px !important;
    }
}

.text-break,
.min-w-0 {
    min-width: 0;
}

