﻿:root {
    --mtl-leftcol: 260px;
    --ci-top-offset: 8px; /* marge visuelle depuis le haut de la fenêtre */
    --ci-bottom-offset: 16px; /* marge visuelle depuis le bas de la fenêtre */
}

/* ---- Styles de la page appelante (inchangés sauf scroll) ---- */
.chart-parent-multiple-chantier {
    height: calc(100vh - 40rem);
    overflow-y: auto;
    overflow-x: hidden;
    width: 98%;
}

.sticky-chart-style {
    position: sticky;
    top: 0;
    width: 100%;
    display: block;
    z-index: 4;
    background-color: white;
}

.exportCSV {
    display: none;
}

#chart-div {
    z-index: 3;
}

.apexcharts-toolbar {
    opacity: 0;
    position: absolute;
    left: -1000px;
}

#download-menu .rz-navigation-item-link:first-child {
    padding-block: 0px;
    padding-inline: 0px;
}

#chart-div .apexcharts-menu-icon {
    opacity: 0;
    position: absolute;
    left: -100px;
}

hr.rounded {
    border-top: 3px dashed #bbb;
    border-radius: 3px;
}

/* Footer éditeur */
.editor-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 16px 0px;
    z-index: 10;
}

    .editor-footer .gs-panel {
        max-height: 40vh;
        overflow: auto;
    }

.editor-footer {
    position: static !important; /* annule sticky/fixed */
    inset: auto !important; /* annule top/bottom/left/right éventuels */
    margin-top: 12px; /* petit espace avec la frise */
    z-index: 1; /* au-dessus du fond mais sous les tooltips si besoin */
}
/* Toolbar en haut */
.toolbarr {
    display: flex;
    flex-direction: row;
    vertical-align: top;
    gap: 2px;
    margin-top: 10px;
    justify-content: space-between;
}

.toolbarr-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .toolbarr-left .rz-form-field {
        margin: 0;
        display: flex;
        align-items: center;
    }

        .toolbarr-left .rz-form-field .rz-form-field-content,
        .toolbarr-left .rz-form-field .rz-inputtext {
            align-items: center;
        }

    .toolbarr-left .rz-button.rz-button-sm,
    .toolbarr-left .rz-togglebutton .rz-button {
        line-height: 1.2;
    }

.gantt {
    height: fit-content !important;
}

.rz-menu:not(.rz-profile-menu) .rz-navigation-menu {
    z-index: 3000 !important;
}

.gedit-root {
    position: relative; /* déjà présent, on complète juste */
    padding-top: 50px; /* espace pour la croix */
}

    .gedit-root:has(.ci-root) {
        height: 100dvh; /* pleine fenêtre visible, compatible mobile */
        overflow: hidden; /* évite un scroll extérieur */
        padding-bottom: 8px;
    }

        .gedit-root:has(.ci-root) .chart-parent-multiple-chantier {
            overflow: clip; /* mieux que hidden pour éviter la barre de scroll */
        }
/* croix plus visible et au-dessus du contenu */
.cmp-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    z-index: 3;
    cursor: pointer;
}

    .cmp-close:hover {
        background: #f9fafb;
        color: #0b1220;
    }

    .cmp-close svg {
        width: 14px;
        height: 14px;
        display: block;
    }


/* ===== Modale de chargement (ValidateModification) ===== */
.loading-modal {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #e6e6e6;
    border-top-color: #1976d2; /* bleu Radzen par défaut */
    animation: mspin 0.8s linear infinite;
}

@keyframes mspin {
    to {
        transform: rotate(360deg);
    }
}

.loading-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.loading-title {
    font-weight: 700;
    font-size: 14px;
}

.loading-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

/* Empty state — styles autonomes (utilise tes variables CSS si présentes) */
.empty-state {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    /* carte jolie */
    background: rgba(var(--primary-color-rgb, 21,87,103), 0.05);
    border: 1px solid rgba(var(--primary-color-rgb, 21,87,103), 0.12);
    border-radius: 16px;
    padding: 24px 28px;
    width: min(540px, 92vw);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    margin: 4px auto 12px;
    background: rgba(var(--primary-color-rgb, 21,87,103), 0.08);
    color: rgb(var(--primary-color-rgb, 21,87,103));
}

    .empty-state-icon .bi {
        font-size: 40px; /* grosse icône */
        line-height: 1;
    }

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(var(--primary-color-rgb, 21,87,103));
    margin-bottom: 6px;
}

.empty-state-subtitle {
    font-size: 0.95rem;
    color: rgba(0,0,0,0.6);
}

/* Mode sombre (si tu utilises prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
    .empty-state {
        background: rgba(255,255,255,0.04);
        border-color: rgba(255,255,255,0.12);
        box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    }

    .empty-state-subtitle {
        color: rgba(255,255,255,0.7);
    }
}

/* Variante inline si un jour tu le veux dans le flux sans centrage absolu */
.empty-state.inline {
    position: static;
    transform: none;
    margin: 24px auto;
}

/* ===== Panneau ChantierInformation ===== */

.ci-root {
    position: relative;
    display: flex;
    flex-direction: column;
    /* S'aligne sur ta zone de travail (écran timeline) :
       On prend une hauteur raisonnable, et surtout on permet le scroll interne */
    max-height: calc(100vh - 16rem);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden; /* pas de scroll global sur la root */
    max-height: none !important;
    height: calc(100dvh - var(--ci-top-offset) - var(--ci-bottom-offset));
    /* option : effet "ancré" visuellement sous un header sticky */
    position: sticky;
    top: var(--ci-top-offset);
    margin-bottom: var(--ci-bottom-offset);
}

/* Header fixe, avec bouton fermer à gauche + titre */
.ci-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ci-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
}

.ci-header-spacer {
    width: 1px;
}

/* bouton fermer (réutilise ton style existant) */
.cmp-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    cursor: pointer;
}

    .cmp-close:hover {
        background: #f3f4f6;
    }

/* Corps en 2 colonnes */
.ci-body {
    flex: 1 1 auto;
    min-height: 0; /* clé: autorise le scroll interne */
    display: grid;
    grid-template-columns: clamp(240px, 27%, 520px) 1fr; /* colonne gauche ~27% */
    gap: 0;
}

/* Colonne gauche (infos) */
.ci-left {
    overflow: auto; /* scroll dédié */
    padding: 10px 10px 14px 10px;
    border-right: 1px solid #e5e7eb;
    background: #fff;
    min-height: 0;
}

/* Colonne droite (grille + tags) */
.ci-right {
    display: flex;
    flex-direction: column;
    min-height: 0; /* clé: autorise le scroll interne */
    background: #fff;
}

/* Wrapper scrollable pour la grille */
.ci-gridwrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0px 10px 0 10px;
}
/* Bloc tags en bas, collé à la grille */
.ci-tags {
    padding: 10px 12px 12px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.ci-tags-label {
    font-size: 0.95rem;
    height: 30px;
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.ci-tag {
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    height: 30px;
}

/* Champs gauche : gardés mais mieux contenus */
.chantier-field-label {
    width: 40%;
    text-align: right;
    padding: 5px;
    align-items: center;
    margin-bottom: 0;
}

.field-value {
    width: 60%;
}

.field-label-and-value {
    display: flex;
    gap: 10px;
    padding: 3px 6px;
}

    .field-label-and-value:nth-child(even) {
        background-color: var(--rz-grid-stripe-background-color);
    }

/* Radzen grid : occupe toute la hauteur de son wrapper */
.ci-gridwrap .rz-datatable,
.ci-gridwrap .rz-grid {
    height: 100%;
    min-height: 420px; /* pour éviter un trop petit contenu si peu de lignes */
}

/* Optionnel : sur petits écrans, la colonne passe en vertical */
@media (max-width: 1100px) {
    .ci-body {
        grid-template-columns: 1fr;
    }

    .ci-left {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* Réserve la place du filtre même quand il est “caché” */
.invalidity-slot {
}
    /* ajuste la largeur du champ */
    .invalidity-slot.is-hidden {
        visibility: hidden;
    }
/* cache visuellement mais garde la place */
