/* Scrollbar toujours visible — évite le décalage de layout entre pages courtes et longues */

/*html {
    overflow-y: scroll;
}*/

html, body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Container full width sauf pour login (qui utilise container-tight) */
.page-body .container-xl,
.navbar .container-xl {
    max-width: 100%;
}

@media (min-width: 992px) {
    .navbar-vertical.navbar-expand-lg {
        width: 16rem;
    }
}

@media (min-width: 992px) {
    .navbar-vertical.navbar-expand-lg .navbar-collapse .dropdown-menu .dropdown-item.active, .navbar-vertical.navbar-expand-lg .navbar-collapse .dropdown-menu .dropdown-item:active {
        background: white;
        color: #1F2937;
    }
}

.card-header {
    padding: 5px 20px;
}

    /* Restaure le padding standard quand le card-header contient des nav-tabs (sinon les onglets sont écrasés) */
    .card-header:has(.card-header-tabs) {
        padding: var(--tblr-card-cap-padding-y) var(--tblr-card-cap-padding-x);
    }

/* Quand un card-body ne contient qu'une table-responsive, retire le padding pour que la table soit bord-à-bord */
.card-body:has(> .table-responsive:only-child) {
    padding: 0;
}

.page-body {
    margin: 7px 0px;
}

@media (min-width: 992px) {
    .navbar-vertical.navbar-expand-lg .navbar-brand {
        padding: .25rem 0;
    }
    /* ============================================
   PROJECT WORKSPACE - 3-Panel Layout
   ============================================ */

    .project-workspace {
        display: flex;
        height: calc(100vh - 140px);
        background: var(--tblr-bg-surface);
        margin: -1rem;
    }
    /* LEFT PANEL: TaskGroups & Tasks */
    .taskgroup-panel {
        width: 60%;
        min-width: 300px;
        max-width: 80%;
        display: flex;
        flex-direction: column;
        background: var(--tblr-bg-surface);
        overflow: hidden;
        position: relative;
    }
    /* RESIZE HANDLE */
    .resize-handle {
        position: absolute;
        top: 0;
        right: 0;
        width: 6px;
        height: 100%;
        cursor: col-resize;
        background: var(--tblr-border-color);
        z-index: 100;
        transition: background-color 0.15s;
    }

        .resize-handle:hover {
            background: var(--tblr-primary);
        }

    .taskgroup-panel .panel-header {
        padding: 1rem;
        border-bottom: 1px solid var(--tblr-border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

        .taskgroup-panel .panel-header h5 {
            font-size: 0.9375rem;
            font-weight: 600;
        }

    .taskgroup-content {
        flex: 1;
        overflow-y: auto;
        padding: 0.5rem;
    }

    .taskgroup-section {
        margin-bottom: 0.25rem;
    }

    .taskgroup-header {
        display: flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.15s;
    }

        .taskgroup-header:hover {
            background: var(--tblr-bg-surface-secondary);
        }

        .taskgroup-header .chevron-icon {
            transition: transform 0.2s;
            margin-right: 0.5rem;
            color: var(--tblr-secondary);
        }

        .taskgroup-header.expanded .chevron-icon {
            transform: rotate(90deg);
        }

        .taskgroup-header .taskgroup-name {
            font-weight: 600;
            font-size: 0.8125rem;
        }

        .taskgroup-header .taskgroup-actions {
            display: flex;
            gap: 0.25rem;
            opacity: 0;
            transition: opacity 0.15s;
        }

        .taskgroup-header:hover .taskgroup-actions {
            opacity: 1;
        }

    .taskgroup-tasks {
        /*    padding-left: 0.5rem;
    border-left: 2px solid var(--tblr-border-color);
    margin-left: 0.75rem;
*/
    }

    .task-item {
        display: flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.15s;
    }

        .task-item:hover {
            background: var(--tblr-bg-surface-secondary);
        }

        .task-item.active {
            background: rgba(var(--tblr-primary-rgb), 0.1);
        }

        .task-item .task-name {
            font-size: 0.8125rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }

    .add-task-row {
        display: flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
        cursor: pointer;
        border-radius: 4px;
        opacity: 0.7;
        transition: opacity 0.15s, background-color 0.15s;
    }

        .add-task-row:hover {
            opacity: 1;
            background: var(--tblr-bg-surface-secondary);
        }
    /* RIGHT PANEL: Task Detail */
    .task-detail-panel {
        flex: 1;
        min-width: 300px;
        display: flex;
        flex-direction: column;
        background: var(--tblr-bg-surface);
        overflow: hidden;
    }

        .task-detail-panel.collapsed {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .task-detail-panel .detail-header {
            padding: 1rem;
            border-bottom: 1px solid var(--tblr-border-color);
        }

            .task-detail-panel .detail-header h5 {
                font-size: 1rem;
                font-weight: 600;
                line-height: 1.4;
            }

            .task-detail-panel .detail-header .task-actions {
                display: flex;
                gap: 4px;
            }

                .task-detail-panel .detail-header .task-actions .btn-icon {
                    width: 30px;
                    height: 30px;
                    padding: 0;
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    border-radius: 4px;
                    background-color: var(--tblr-bg-surface);
                    border: 1px solid var(--tblr-border-color);
                    transition: all 0.15s;
                    cursor: pointer;
                }

                    .task-detail-panel .detail-header .task-actions .btn-icon:hover {
                        background-color: var(--tblr-primary-lt);
                        border-color: var(--tblr-primary);
                    }

                    .task-detail-panel .detail-header .task-actions .btn-icon.text-danger:hover {
                        background-color: var(--tblr-danger-lt);
                        border-color: var(--tblr-danger);
                    }

        .task-detail-panel .detail-tabs {
            padding: 0 1rem;
            border-bottom: 1px solid var(--tblr-border-color);
            flex-wrap: nowrap;
            overflow-x: auto;
        }

            .task-detail-panel .detail-tabs .nav-link {
                font-size: 0.8125rem;
                padding: 0.75rem 0.75rem;
                white-space: nowrap;
                color: var(--tblr-secondary);
                border: none;
                border-bottom: 2px solid transparent;
                border-radius: 0;
            }

                .task-detail-panel .detail-tabs .nav-link:hover {
                    color: var(--tblr-body-color);
                    border-bottom-color: var(--tblr-border-color);
                }

                .task-detail-panel .detail-tabs .nav-link.active {
                    color: var(--tblr-primary);
                    border-bottom-color: var(--tblr-primary);
                    background: transparent;
                }

        .task-detail-panel .detail-content {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
        }

    .tab-pane-content {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .discussions-list {
        flex: 1;
        overflow-y: auto;
    }

    .discussion-input {
        padding-top: 1rem;
        border-top: 1px solid var(--tblr-border-color);
        margin-top: auto;
    }

    .subtask-item {
        display: flex;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--tblr-border-color-translucent);
    }

    .time-entry-item {
        padding: 0.75rem;
        border-radius: 4px;
        background: var(--tblr-bg-surface-secondary);
        margin-bottom: 0.5rem;
    }
    /* Empty state styling */
    .empty-state {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 2rem;
        text-align: center;
    }
    /* Responsive adjustments */
    @media (max-width: 992px) {
        .project-workspace {
            flex-direction: column;
            height: auto;
        }

        .taskgroup-panel {
            width: 100% !important;
            max-width: 100%;
            min-height: 300px;
            border-bottom: 1px solid var(--tblr-border-color);
        }

        .resize-handle {
            display: none;
        }

        .task-detail-panel {
            min-height: 400px;
        }

            .task-detail-panel.collapsed {
                display: none;
            }
    }
    /*@media (min-width: 1400px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: unset;
    }
}

@media (min-width: 1200px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl {
        max-width: unset;
    }
}*/

    @media (min-width: 992px) {
        .navbar-vertical.navbar-expand-lg .navbar-collapse .dropdown-menu .dropdown-item {
            padding: 3px 50px;
            font-size: 12px;
        }
    }
    /*html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* btn-2 : variante employée par les boutons d'action (édition, suppression, etc.).
   Elle n'était définie nulle part -> les boutons étaient quasi invisibles.
   On lui donne l'aspect d'un bouton secondaire bordé, bien lisible. */
.btn-2 {
    color: var(--tblr-secondary, #4b5563);
    background-color: #fff;
    border-color: var(--tblr-border-color, #dadfe5);
}

.btn-2:hover,
.btn-2:focus-visible {
    color: var(--tblr-primary, #066fd1);
    background-color: var(--tblr-active-bg, #f1f5f9);
    border-color: var(--tblr-border-color-active, #c1c9d1);
}

.btn-2.btn-icon.text-danger:hover,
.btn-2.text-danger:hover {
    color: var(--tblr-danger, #d63939) !important;
    border-color: var(--tblr-danger, #d63939);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-password-toggle-button {
    display: none;
}*/
    /* ============================================
   TASK DISCUSSION COMPONENT
   ============================================ */

    .task-discussion {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .modalized .task-discussion {
        max-height: 30vw;
    }

    .task-discussion .discussions-list {
        flex: 1;
        overflow-y: auto;
        padding-right: 0.5rem;
    }

    .discussion-item {
        padding: 0.75rem;
        border-radius: 6px;
        margin-bottom: 0.5rem;
        /*background: var(--tblr-bg-surface-primary);*/
        border: 1px solid rgb(229, 231, 235);
    }

        .discussion-item:hover {
            background: var(--tblr-bg-surface-secondary);
            border: 1px solid #e5e7eb;
        }

    .comment-content {
        white-space: pre-wrap;
        word-break: break-word;
    }

    .comment-image img {
        border: 1px solid var(--tblr-border-color);
    }

    .edit-comment-form textarea {
        resize: none;
    }

    .pasted-image-preview {
        background: var(--tblr-bg-surface-secondary);
        padding: 0.5rem;
        border-radius: 6px;
        border: 1px solid var(--tblr-border-color);
    }

    .discussion-editor {
        min-height: 60px;
        max-height: 200px;
        overflow-y: auto;
        flex: 1;
        outline: none;
    }

        .discussion-editor:empty:before {
            content: attr(data-placeholder);
            color: var(--tblr-secondary);
            pointer-events: none;
        }

        .discussion-editor:focus:empty:before {
            content: '';
        }

        .discussion-editor img {
            max-width: 100%;
            max-height: 300px;
            border-radius: 4px;
            margin: 4px 0;
            display: block;
        }

    .comment-content img {
        max-width: 200px;
        border-radius: 4px;
        margin: 4px 0;
        cursor: pointer;
        border: 2px solid #000;
    }

        .comment-content img:hover {
            opacity: 0.9;
        }
    /* Comment action buttons */
    .comment-actions {
        display: flex;
        gap: 4px;
    }

        .comment-actions .btn-icon {
            width: 30px;
            height: 30px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            background-color: var(--tblr-bg-surface);
            border: 1px solid var(--tblr-border-color);
            transition: all 0.15s;
        }

            .comment-actions .btn-icon:hover {
                background-color: var(--tblr-primary-lt);
                border-color: var(--tblr-primary);
            }

            .comment-actions .btn-icon.text-danger:hover {
                background-color: var(--tblr-danger-lt);
                border-color: var(--tblr-danger);
            }
    /* Time entry action buttons */
    .entry-actions {
        display: flex;
        gap: 4px;
    }

        .entry-actions .btn-icon {
            width: 30px;
            height: 30px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background-color: var(--tblr-bg-surface);
            border: 1px solid var(--tblr-border-color);
            transition: all 0.15s;
        }

            .entry-actions .btn-icon:hover {
                background-color: var(--tblr-primary-lt);
                border-color: var(--tblr-primary);
            }

            .entry-actions .btn-icon.text-danger:hover {
                background-color: var(--tblr-danger-lt);
                border-color: var(--tblr-danger);
            }
    /* Image preview fullscreen overlay */
    .image-preview-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

        .image-preview-overlay img {
            max-width: 95vw;
            max-height: 95vh;
            object-fit: contain;
        }
}

/* ============================================
   KANBAN BOARD
   ============================================ */

.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: calc(100vh - 250px);
}

.kanban-column {
    flex: 0 0 300px;
    min-width: 300px;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, opacity 0.2s;
}

.kanban-column-ghost {
    opacity: 0.4;
    background: var(--tblr-bg-surface-secondary);
    border: 2px dashed var(--tblr-primary);
}

.kanban-column-chosen {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.kanban-column-drag {
    opacity: 1;
}

.kanban-column-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface-secondary);
    border-radius: var(--tblr-border-radius) var(--tblr-border-radius) 0 0;
    cursor: grab;
}

    .kanban-column-header:active {
        cursor: grabbing;
    }

.kanban-column-body {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
    min-height: 200px;
}

.kanban-card {
    background: var(--tblr-card-bg);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .kanban-card:hover {
        box-shadow: var(--tblr-box-shadow-card);
        border-color: var(--tblr-primary);
    }

    .kanban-card:active {
        cursor: grabbing;
    }

.kanban-card-ghost {
    opacity: 0.4;
    background: rgba(var(--tblr-primary-rgb), 0.1);
    border: 2px dashed var(--tblr-primary);
}

.kanban-card-chosen {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: rotate(2deg);
}

.kanban-card-drag {
    opacity: 1;
}

.kanban-card-title {
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-word;
}

/* ============================================
   COMPACT FORMS — popups d'édition + DocumentEdit
   ============================================ */

.modal .modal-body .form-control,
.modal .modal-body .form-select,
.document-edit-form .form-control,
.document-edit-form .form-select {
    min-height: calc(1.4em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.modal .modal-body .form-label,
.document-edit-form .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.modal .modal-body .mb-3,
.document-edit-form .mb-3 {
    margin-bottom: 0.5rem !important;
}

.modal .modal-body .row,
.document-edit-form .row {
    --tblr-gutter-y: 0;
}

.modal .modal-body .card,
.document-edit-form .card {
    margin-bottom: 0.5rem;
}

.modal .modal-body .card-body,
.document-edit-form .card-body {
    padding: 0.5rem 0.75rem;
}

.modal .modal-body .card-header,
.document-edit-form .card-header {
    padding: 0.25rem 0.75rem;
}

.modal .modal-body .card-header .card-title,
.document-edit-form .card-header .card-title {
    font-size: 0.875rem;
}

/* Boutons normaux non touchés ; uniquement champs et libellés du formulaire */

/* ============================================
   FICHE CLIENT — vue pleine page à onglets (« Direction A »)
   Reproduit les tokens hifi du handoff (design_handoff_fiche_client_onglets).
   Classes globales (préfixe .fiche-) car partagées entre la page, l'en-tête et les onglets
   (le CSS scoped Blazor ne traverse pas les frontières de composants).
   ============================================ */

/* Conteneur centré 1280px (le .container-xl du projet est forcé full-width, cf. plus haut) */
.fiche-page {
    width: 100%; /* enfant flex de .page-body : sans largeur explicite, margin:auto le rétrécirait au contenu */
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- En-tête de fiche --- */
.fiche-header {
    background: #fff;
    border-bottom: 1px solid #e6e7eb;
    margin: -7px 0 0; /* compense le margin du .page-body pour coller la bande en haut */
}

.fiche-header .breadcrumb {
    font-size: 13px;
    margin: 0;
    padding: 14px 0 0;
}

.fiche-header .breadcrumb-item,
.fiche-header .breadcrumb-item > a {
    color: #5b6b82;
}

.fiche-header .breadcrumb-item.active {
    color: #1a2234;
    font-weight: 500;
}

.fiche-titlerow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 0 18px;
}

.fiche-avatar {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #e9f2fd;
    color: #206bc4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
}

.fiche-title {
    margin: 0;
    font-size: 21px;
    font-weight: 600;
    color: #1a2234;
    letter-spacing: -.01em;
}

.fiche-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 13px;
    color: #929aa6;
}

.fiche-meta .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #5b6b82;
}

.fiche-meta .sep {
    color: #dfe3e8;
}

/* --- Pills statut --- */
.fiche-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.fiche-pill.sm {
    padding: 2px 8px;
}

.fiche-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.fiche-pill.success { background: #eaf7ec; color: #2c8a3d; }
.fiche-pill.success .dot { background: #2fb344; }
.fiche-pill.warning { background: #fff4e0; color: #a86a00; }
.fiche-pill.warning .dot { background: #f59f00; }
.fiche-pill.danger { background: #fdecec; color: #d63939; }
.fiche-pill.danger .dot { background: #d63939; }

/* --- Boutons bespoke de la fiche (cibles pixel exactes du handoff) --- */
.fiche-btn {
    height: 36px;
    padding: 0 14px;
    background: #fff;
    color: #4b5563;
    border: 1px solid #dbe0e6;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.fiche-btn:hover { background: #f6f8fb; }
.fiche-btn:disabled { opacity: .6; cursor: default; }

.fiche-btn.primary {
    background: #206bc4;
    color: #fff;
    border-color: #206bc4;
    font-weight: 600;
    padding: 0 16px;
}

.fiche-btn.primary:hover { background: #1b5aa3; border-color: #1b5aa3; }

.fiche-btn.outline-primary {
    color: #206bc4;
    border-color: #bcd3ee;
    font-weight: 600;
}

.fiche-btn.outline-primary:hover { background: #f0f6fd; }

.fiche-btn.icon { width: 36px; padding: 0; justify-content: center; }
.fiche-btn.sm { height: 32px; font-size: 13px; padding: 0 12px; }

/* Groupe ‹ › précédent / suivant */
.fiche-navgroup {
    display: flex;
    border: 1px solid #dbe0e6;
    border-radius: 4px;
    overflow: hidden;
}

.fiche-navbtn {
    height: 36px;
    width: 34px;
    background: #fff;
    border: none;
    color: #5b6b82;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fiche-navbtn:first-child { border-right: 1px solid #eef0f3; }
.fiche-navbtn:hover { background: #f6f8fb; }
.fiche-navbtn:disabled { opacity: .4; cursor: default; }

/* --- Barre d'onglets --- */
.fiche-tabs {
    display: flex;
    gap: 26px;
    border-bottom: 1px solid #e6e7eb;
    margin: 18px 0 22px;
    overflow-x: auto;
    overflow-y: hidden; /* évite une scrollbar verticale parasite (overflow-x:auto force overflow-y:auto sinon) */
}

.fiche-tab {
    background: none;
    border: none;
    padding: 12px 2px;
    margin-bottom: -1px;
    font-size: 14px;
    font-weight: 500;
    color: #5b6b82;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.fiche-tab:hover { color: #1a2234; }

.fiche-tab.active {
    color: #206bc4;
    font-weight: 600;
    border-bottom-color: #206bc4;
}

/* --- Carte d'onglet --- */
.fiche-card {
    background: #fff;
    border: 1px solid #e6e7eb;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(15,34,67,.04);
}

.fiche-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid #eef0f3;
}

.fiche-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a2234;
}

.fiche-card-body { padding: 18px 16px 20px; }

.fiche-count {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #eef2f7;
    color: #5b6b82;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* --- Formulaire (onglet Identité) --- */
.fiche-overline {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #929aa6;
    margin: 0 0 12px;
}

.fiche-overline.mt { margin-top: 22px; }

.fiche-card .form-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #5b6b82;
    margin-bottom: 6px;
}

.fiche-card input.form-control,
.fiche-card select.form-select {
    height: 36px;
    border-color: #dbe0e6;
}

.fiche-card .form-control:focus,
.fiche-card .form-select:focus {
    border-color: #206bc4;
    box-shadow: 0 0 0 3px rgba(32,107,196,.12);
}

.fiche-ro {
    background: #f1f4f8 !important;
    color: #5b6b82 !important;
}

.fiche-grid { display: grid; gap: 14px 16px; }
.fiche-grid + .fiche-grid { margin-top: 14px; }
.fiche-grid-identite { grid-template-columns: 200px 1fr 120px; }
.fiche-grid-2 { grid-template-columns: 1fr 1fr; }
.fiche-grid-addr { grid-template-columns: 1fr 140px 1fr; }
.fiche-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.fiche-grid-langue { grid-template-columns: 140px 1fr; align-items: end; }
.fiche-grid-4 { grid-template-columns: repeat(4, 1fr); }

.fiche-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef0f3;
}

.fiche-flags .form-check { margin: 0; }
.fiche-flags .form-check-label { color: #1a2234; }
.fiche-check-danger .form-check-input:checked {
    background-color: #d63939;
    border-color: #d63939;
}

/* --- Tables (Contacts / Machines) --- */
.fiche-table { width: 100%; border-collapse: collapse; }

.fiche-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #929aa6;
    font-weight: 600;
    padding: 9px 12px;
    border-bottom: 1px solid #eef0f3;
}

.fiche-table th.center, .fiche-table td.center { text-align: center; }
.fiche-table th:first-child, .fiche-table td:first-child { padding-left: 16px; }

.fiche-table td {
    padding: 12px 12px;
    font-size: 14px;
    color: #5b6b82;
    border-bottom: 1px solid #f3f5f7;
    vertical-align: middle;
}

.fiche-table tbody tr:hover { background: #fafbfc; }
.fiche-table td.name { color: #1a2234; font-weight: 500; }
.fiche-table .muted { color: #9aa6b5; }
.fiche-table .email { color: #206bc4; }
.fiche-table .check { color: #2fb344; }
.fiche-table .rowaction {
    background: none;
    border: none;
    cursor: pointer;
    color: #9aa6b5;
    padding: 4px;
    display: inline-flex;
}
.fiche-table .rowaction:hover { color: #206bc4; }

.fiche-scroll-x { overflow-x: auto; }

/* --- Finance & risque --- */
.fiche-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.fiche-stat {
    border: 1px solid #eef0f3;
    border-radius: 4px;
    padding: 12px 14px;
    background: #fbfcfd;
}

.fiche-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #929aa6;
    font-weight: 600;
}

.fiche-stat-value { font-size: 22px; font-weight: 600; color: #1a2234; margin-top: 6px; }
.fiche-stat-sub { font-size: 12px; margin-top: 3px; color: #5b6b82; }
.fiche-stat-sub.up { color: #2c8a3d; display: flex; align-items: center; gap: 4px; }
.fiche-stat-sub.warn { color: #a86a00; }

.fiche-chart {
    margin-top: 18px;
    border: 1px solid #eef0f3;
    border-radius: 4px;
    padding: 14px 16px 12px;
}

.fiche-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.fiche-chart-title { font-size: 13px; font-weight: 600; color: #1a2234; }
.fiche-chart-unit { font-size: 12px; color: #929aa6; }

.fiche-bars { display: flex; align-items: flex-end; gap: 18px; min-height: 120px; padding: 14px 4px 0; }
.fiche-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fiche-bar { width: 100%; max-width: 46px; background: #cdddf2; border-radius: 3px 3px 0 0; }
.fiche-bar.current { background: #206bc4; }
.fiche-bar-val { font-size: 11px; color: #5b6b82; font-weight: 600; }
.fiche-bar-val.current { color: #206bc4; font-weight: 700; }
.fiche-bar-year { font-size: 11px; color: #929aa6; }
.fiche-bar-year.current { color: #1a2234; font-weight: 600; }

.fiche-finance-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* --- Documents --- */
.fiche-doc-list { padding: 6px 8px 8px; }

.fiche-doc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    border-bottom: 1px solid #f3f5f7;
}

.fiche-doc:last-child { border-bottom: none; }
.fiche-doc:hover { background: #fafbfc; }

.fiche-doc-thumb {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.fiche-doc-thumb.pdf { background: #fdecec; color: #d63939; }
.fiche-doc-thumb.kbo { background: #e9f2fd; color: #206bc4; }
.fiche-doc-main { flex: 1; min-width: 0; }
.fiche-doc-title { font-size: 14px; color: #1a2234; font-weight: 500; }
.fiche-doc-meta { font-size: 12px; color: #929aa6; margin-top: 1px; }

/* --- Mémos (timeline) --- */
.fiche-timeline {
    position: relative;
    padding-left: 26px;
    border-left: 2px solid #eef0f3;
    margin-left: 5px;
}

.fiche-tl-item { position: relative; padding-bottom: 18px; }
.fiche-tl-item:last-child { padding-bottom: 4px; }

.fiche-tl-dot {
    position: absolute;
    left: -32px;
    top: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd2db;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #eef0f3;
}

.fiche-tl-dot.active { background: #206bc4; box-shadow: 0 0 0 2px #cdddf2; }
.fiche-tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fiche-tl-author { font-size: 13px; font-weight: 600; color: #1a2234; }
.fiche-tl-date { font-size: 12px; color: #929aa6; }
.fiche-tl-text { font-size: 14px; color: #3d4d63; margin-top: 4px; line-height: 1.5; }

.fiche-link {
    background: none;
    border: none;
    color: #206bc4;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 0;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .fiche-grid-identite,
    .fiche-grid-addr,
    .fiche-grid-3,
    .fiche-grid-4 { grid-template-columns: 1fr 1fr; }
    .fiche-stats { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .fiche-grid-identite,
    .fiche-grid-2,
    .fiche-grid-addr,
    .fiche-grid-3,
    .fiche-grid-langue,
    .fiche-grid-4 { grid-template-columns: 1fr; }
}

/* =====================================================================================
   Popup « Nouveau client » (création rapide) — design_handoff_popup_creation_client.
   Cibles pixel exactes du handoff ; réutilise .fiche-btn pour les boutons.
   ===================================================================================== */
.nc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(24, 36, 51, .5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 64px 20px 20px;
    overflow-y: auto;
}

.nc-modal {
    width: 560px;
    max-width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(15, 34, 67, .3);
    outline: none;
}

/* --- En-tête --- */
.nc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f3;
}

.nc-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1a2234;
}

.nc-close {
    background: none;
    border: none;
    color: #929aa6;
    cursor: pointer;
    padding: 4px;
    display: flex;
    font-size: 20px;
    line-height: 1;
}

.nc-close:hover { color: #1a2234; }

/* --- Corps --- */
.nc-body { padding: 20px; }
.nc-field { margin-top: 14px; }

.nc-body .form-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #5b6b82;
    margin-bottom: 6px;
}

.nc-body input.form-control,
.nc-body select.form-select {
    height: 38px;
    border: 1px solid #dbe0e6;
    border-radius: 4px;
    font-size: 14px;
    color: #1a2234;
}

.nc-body .form-control:focus,
.nc-body .form-select:focus {
    border-color: #206bc4;
    box-shadow: 0 0 0 3px rgba(32, 107, 196, .12);
}

.nc-body .form-control.invalid {
    border-color: #d63939;
}

.nc-req { color: #d63939; }

.nc-help {
    font-size: 12px;
    color: #929aa6;
    margin-top: 6px;
}

.nc-error,
.nc-body .validation-message {
    font-size: 12px;
    color: #d63939;
    margin-top: 6px;
}

.nc-input-group {
    display: flex;
    gap: 8px;
}

.nc-input-group .form-control {
    flex: 1;
    min-width: 0;
}

.nc-input-group .fiche-btn {
    flex: none;
    height: 38px;
}

/* --- Grilles (gap 14px, identiques au handoff) --- */
.nc-grid { display: grid; gap: 14px; margin-top: 14px; }
.nc-grid-identite { grid-template-columns: 160px 1fr 90px; }
.nc-grid-addr { grid-template-columns: 1fr 130px; }
.nc-grid-2 { grid-template-columns: 1fr 1fr; }
.nc-grid-langue { grid-template-columns: 130px 1fr; }

/* --- Pied --- */
.nc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #eef0f3;
}

.nc-note {
    font-size: 12.5px;
    color: #929aa6;
}

.nc-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 576px) {
    .nc-grid-identite,
    .nc-grid-addr,
    .nc-grid-2,
    .nc-grid-langue { grid-template-columns: 1fr; }
}
