﻿.groupCriteria {
    padding: 4px;
    display: flex;
    flex-direction: row;
    flex-grow: 0;
    border: 1px solid darkgray;
    align-items: anchor-center;
    background: white;
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 4px 4px 0px 0px;
}
.settingGrid {
    display: flex;
    flex-direction: row;
    padding: 4px;
    flex-grow: 0;
    /* border: 1px solid darkgray; */
    align-items: anchor-center;
    background: white;
    position: absolute;
    right: 1px;
    top: 1;
    bottom: 1;
}

.headerCell {
    display: flex;
    text-align: center;
    justify-content: center;
    border-bottom: 1px solid #cccccc !Important;
    border-right: #cccccc 1px solid;
    background-color: white;
    background-image: none;
    padding-top: 3px;
    padding-bottom: 2px;
    padding-left: 13px;
    padding-right: 13px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    flex-grow: 0;
    flex-shrink: 0;
    align-items: center;
}

/* gestion resultat calcul acier */
.calculing {
    position: absolute;
    align-self: center;
    justify-self: anchor-center;
}

.gridResult {
    display: grid;
    grid-template-columns: repeat(7,1fr);
    grid-template-rows: repeat(15, 1fr);
    grid-auto-rows: 100px;
    width: 100%
}

.gridResultCol1 {
    grid-column-start: 1;
    grid-column-end: 3;
    grid-row-start: 1;
    grid-row-end: 2;
}

.gridResultCol2 {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 2;
    grid-row-end: 10;
}

.gridResultCol3 {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 10;
    grid-row-end: 13;
}

.gridResultCol4 {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 13;
    grid-row-end: 16;
}

.gridResultCell {
    border: 1px solid silver;
    border-style: none solid solid none;
    text-align: center;
    padding-top: 4px;
}

    .gridResultCell .myNumericBox {
        align-items: center;
        height: auto;
        width: 100%;
        text-align: center !important;
        padding: 0px
    }

.gridRowEven {
    background: whitesmoke
}


.myCellOK {
    background: green;
    color: white
}

.myCellWarning {
    background: orange;
    color: white
}

.myCellNOK {
    background: red;
    color: white
}

.results-panel {
    height: 100%;
}

/* grille principale */
.rg-resultGrid {
    display: flex;
    width: 100%;
    align-items: stretch;
    width: max-content;
    min-width: 100%;
}

.rg-resultFixed {
    display: grid;
    grid-template-columns: 60px 130px;
    grid-auto-rows: 20px;
    flex: 0 0 auto;
    border-right: 1px solid #ccc;
    border-top: 1px solid #ccc;
}

.rg-resultScroll {
    display: grid;
    grid-template-columns: 100px 100px 100px 150px 150px;
    grid-auto-rows: 32px;
    overflow-x: auto;
    overflow-y: visible;
    flex: 1 1 auto;
    min-width: 0;
    border-left: 1px solid #ccc;
    border-top: 1px solid #ccc;
}

    .rg-resultFixed > div,
    .rg-resultScroll > * {
        display: flex;
        align-items: center;
        padding: 0 6px;
        box-sizing: border-box;
    }

    .rg-resultScroll > .rg-headerCell {
        border-bottom: 1px solid #aaa;
    }

.rg-resultFixed,
.rg-resultScroll {
    grid-auto-rows: 20px;
}

    .rg-resultScroll mynumericbox,
    .rg-resultScroll .myNumericBox {
        height: 100%;
        min-height: 0;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: end;
        padding-right: 4px !important;
    }

    .rg-resultScroll > * {
        border-right: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
    }

    .rg-resultFixed > * {
        border-bottom: 1px solid #ccc;
        border-left: 1px solid #ccc;
        padding: 4px 6px;
        white-space: nowrap;
    }

.rg-groupCell {
    font-weight: bold;
    background: #f5f5f5;
}

.rg-labelCell {
    text-align: left;
    padding-left: 8px;
    background: #f5f5f5;
}

.rg-headerCell {
    background: #fafafa;
}

.rg-section-elu {
    grid-row: span 8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #f5f5f5;
    border-bottom: 1px solid #ccc;
}

.rg-section-elu-acc {
    grid-row: span 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #f5f5f5;
}

.rg-section-els {
    grid-row: span 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #f5f5f5;
}

.rg-sectionCell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #f5f5f5;
}

.rg-resultWrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

/* mobile */

.mobile .rg-resultWrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.mobile .rg-resultGrid {
    display: flex;
    width: 100%;
    min-width: 0;
}

.mobile .rg-resultFixed {
    flex: 0 0 auto;
}

.mobile .rg-resultScroll {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: calc(100vw - 215px);
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    display: grid;
    width: max-content;
    flex: 1 1 auto;
}

.mobile,
.mobile body,
.mobile .rg-resultWrapper,
.mobile .rg-resultGrid {
    overflow-x: hidden;
}

/* popup recherche */
.filterSetting {
    position: absolute;
    top: 36px;
    right: 0;
    background: white;
    border: 1px solid darkgray;
    border-radius: 4px;
    z-index: 1001;
    width: 100%;
}




/* ===== Ligne Affaire ===== */

.affaire-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

    .affaire-row:hover {
        background: #f5f9ff;
    }


.affaire-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.affaire-line1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.affaire-num {
    font-weight: 600;
    color: #2b4a6f;
    white-space: nowrap;
}

.affaire-libelle {
    font-weight: 500;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.affaire-line1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.affaire-num {
    display: inline-block;
    min-width: 110px; /* 🔑 largeur stable pour tous les numéros */
    text-align: left;
    font-weight: 600;
    color: #2b4a6f;
    white-space: nowrap;
}


.affaire-libelle {
    font-weight: 500;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.affaire-line2 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.affaire-sep {
    color: #999;
}

.affaire-chantier {
    font-weight: 400;
}

.affaire-client {
    font-style: italic;
}

.affaire-status {
    flex: 0 0 60px; /* largeur fixe */
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.statut {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

.statut-en-cours {
    background: #dff5ea;
    color: #1e7f4d;
}

.statut-clos {
    background: #eeeeee;
    color: #555;
}

.statut-annule {
    background: #fde2e2;
    color: #a02020;
}

.statut-autre {
    background: #fff3cd;
    color: #8a6d3b;
}

.affaire-row.selected {
    background: #cfe9ff;
    border-left: 4px solid #2a7cff;
}


.grid .row-template .cell {
    border: none;
}

@media (max-width: 768px) {
    .affaire-libelle {
        white-space: normal; /* 🔓 autorise retour à la ligne */
        overflow: hidden;
        text-overflow: initial;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2; /* 🔑 2 lignes max */

        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.3;
    }
}

.row-template.is-selected .affaire-row {
    border-left: 4px solid #3b82f6;
    padding-left: 8px;
}

/* row contact */
.contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

/* Colonne gauche */
.contact-left {
    width: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Icônes */
.contact-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Bloc principal */
.contact-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Ligne identité */
.contact-line1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-civilite {
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    color: #555;
}

.contact-prenom {
    font-weight: 500;
    color: #444;
}

.contact-nom {
    font-weight: 600;
    font-size: 1.05rem;
}

/* Fonction */
.contact-line2 {
    font-size: 0.85rem;
    color: #666;
}

/* Coordonnées */
.contact-line3 {
    font-size: 0.8rem;
    color: #444;
    display: flex;
    gap: 14px;
}
.principal-badge {
    background: #ffd24d;
    color: #7a5500;
    padding: 4px 4px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    width: 28px;
    height: 28px;
    margin: 10px;
}
.contact-item {
    display: inline-flex; /* ou flex */
    align-items: center; /* <- alignement vertical */
    gap: 6px;
}

/* calcul row */
.calcul-row {
    display: flex;
    padding: 10px 12px;
/*    gap: 16px;*/
    align-items: center;
    flex-direction: column;
}

.calcul-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

/* Ligne 1 */
.calcul-line1 {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.calcul-ref {
    font-weight: 600;
    font-size: 1rem;
}

.calcul-type {
    background: #eef2f7;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #555;
}

/* Ligne 2 */
.calcul-line2 {
    font-size: 0.85rem;
    color: #444;
    display: flex;
    gap: 6px;
}

.calcul-line3 {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    gap: 6px;
}

.calcul-label {
    color: #888;
    min-width: 70px;
}

/* Bloc droit */
.calcul-meta {
    min-width: 200px;
    display: flex;
    flex-direction: row;
    gap: 2px;
    align-items: flex-end;
    font-size: 0.75rem;
    color: #666;
    justify-content: flex-start;
    width: 100%;
    flex-flow: wrap;
}

.calcul-date {
    display: flex;
    gap: 4px;
    align-items: center;
}

.meta-label {
    color: #999;
}

.calcul-user {
    font-style: italic;
    color: #888;
}

/* UtilisateurRow*/
.user-row {
    display: flex;
    padding: 10px 12px;
}

.user-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Ligne 1 : identité */
.user-line1 {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
}

.user-role {
    font-weight: 600;
    color: #444;
    min-width: 60px;
}

.user-login {
    font-family: monospace;
    background: #f2f4f7;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #333;
}

.user-name {
    font-weight: 500;
    color: #222;
}

/* Ligne 2 : statuts */
.user-line2 {
    display: flex;
    gap: 24px;
    font-size: 0.85rem;
    color: #555;
    align-items: center;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .user-status .label {
        color: #777;
    }
.user-role {
    background: #eef2f7;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* row client */
.client-row {
    display: flex;
    padding: 8px 10px;
    gap: 10px;
}

.client-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Ligne 1 */
.client-line1 {
    display: flex;
    gap: 10px;
    align-items: center;
}

.client-nom {
    font-weight: 600;
    font-size: 1.05rem;
}

.client-type {
    background: #eef2f7;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #555;
}

/* Ligne 2 */
.client-line2 {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    gap: 6px;
}

/* Ligne 3 */
.client-line3 {
    font-size: 0.85rem;
    color: #444;
}

/* Statut */
.client-status {
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.litige-on {
    background: #ffd6d6;
    color: #b40000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.client-line2,
.client-line3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.client-icon {
    opacity: 0.6;
    font-size: 0.9rem;
    min-width: 16px;
    text-align: center;
}

.client-adresse {
    color: #444;
}

.client-cp,
.client-ville {
    color: #666;
}

.client-contact-nom {
    font-weight: 500;
    color: #333;
}

.client-contact-fct {
    color: #777;
    font-style: italic;
}

.client-row.litige-row {
    border-left: 4px solid #d9534f;
    background: linear-gradient(to right, #fff5f5, transparent 120px);
}

.litige-on {
    background: #ffe5e5;
    color: #b40000;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}


/* NumericThreshold */
.num-threshold-neg {
    background: #ffcccc;
}

.num-threshold-mid {
    background: #ffe0b3;
}

.num-threshold-ok {
    background: #ccffcc;
}


