@charset "utf-8";

/* =========================================================
   SAISIES MENSUELLES
   ========================================================= */


/* =========================
   En-tête de la page
   ========================= */

.saisie-page-header {
    padding: 24px 28px;
    margin-bottom: 24px;
    background: linear-gradient(
        135deg,
        rgba(31, 87, 86, 0.08),
        rgba(147, 217, 219, 0.14)
    );
    border: 1px solid #dcecec;
    border-radius: 18px;
}

.saisie-page-title {
    margin-bottom: 5px;
    color: #1f5756;
    font-size: 1.75rem;
    font-weight: 700;
}

.saisie-page-description {
    margin-bottom: 0;
    color: #6f8383;
}


/* =========================
   Sélecteur de période
   ========================= */

.periode-box {
    min-width: 190px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #d5e8e8;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(31, 87, 86, 0.06);
}

.periode-box label {
    color: #1f5756;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.periode-box .form-control {
    min-height: 42px;
    color: #1f5756;
    font-weight: 600;
    background-color: #f8fcfc;
    border-color: #cfe3e3;
    border-radius: 9px;
}

.periode-box .form-control:focus {
    background-color: #ffffff;
    border-color: #93d9db;
    box-shadow: 0 0 0 0.2rem rgba(147, 217, 219, 0.22);
}


/* =========================
   Carte partenaire
   ========================= */

.partenaire-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    margin-bottom: 26px;
    background: #ffffff;
    border: 1px solid #dceaea;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(31, 87, 86, 0.07);
}

.partenaire-header {
    position: relative;
    z-index: 70;
    min-height: 54px;
    padding: 10px 18px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #1f5756,
        #286f6d
    );
    border: 0;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 5px 14px rgba(31, 87, 86, 0.16);
}

.partenaire-nom {
    font-size: 1rem;
    font-weight: 700;
}

.partenaire-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 115px;
    padding: 7px 12px;
    color: #1f5756;
    font-size: 0.9rem;
    font-weight: 700;
    background: #ffffff;
    border-radius: 999px;
}


/* =========================
   Zone de défilement du tableau
   ========================= */

.saisie-table-wrapper {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 70vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 0 0 15px 15px;
    -webkit-overflow-scrolling: touch;
}

.saisie-table {
    width: max-content !important;
    min-width: 100%;
    margin-bottom: 0;
    border-collapse: separate !important;
    border-spacing: 0;
    table-layout: auto;
    border-color: #dceaea;
}

.saisie-table th,
.saisie-table td {
    padding: 4px 6px;
    vertical-align: middle;
    border-color: #dceaea;
}


/* =========================
   Ligne des services fixe
   ========================= */

.saisie-table thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 8px 6px;
    color: #1f5756;
    background: #f0f8f8;
    border-bottom: 2px solid #93d9db;
    font-size: 0.76rem;
    font-weight: 700;
}

.service-header {
    min-width: 78px;
    max-width: 105px;
    font-size: 0.7rem;
    line-height: 1.15;
    white-space: normal;
}


/* =========================
   Services nécessitant une lettre de mission
   ========================= */

.service-lettre-mission {
    color: #ffffff !important;
    background: linear-gradient(
        135deg,
        #df7943,
        #ee8b54
    ) !important;
    border-bottom-color: #c9612f !important;
}

.service-lettre-mission-light {
    background-color: #fff2ea;
}
/* =========================================================
   Familles de services
   ========================================================= */

/* =========================
   Travaux courants
   Rang 1 à 15
   ========================= */

.service-courant {
    color: #1d5f36 !important;
    background:
        linear-gradient(
            135deg,
            #bfe7c8,
            #d8f3df
        ) !important;

    border-bottom-color: #72b587 !important;
}

.service-courant-light {
    background-color: #edf8f0;
}


/* =========================
   Travaux d'embauche
   Rang 16 à 24
   ========================= */

.service-embauche {
    color: #1d4f73 !important;

    background:
        linear-gradient(
            135deg,
            #c9e5fb,
            #e1f1fd
        ) !important;

    border-bottom-color: #7cb3df !important;
}

.service-embauche-light {
    background-color: #eef6fc;
}

/* =========================
   Colonne Client fixe à gauche
   ========================= */

.saisie-table thead tr > th:first-child,
.saisie-table tbody tr > td:first-child {
    position: sticky !important;
    left: 0 !important;
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    background-clip: padding-box;
}

/* Coin supérieur gauche : fixe en haut et à gauche */
.saisie-table thead tr > th:first-child {
    top: 0 !important;
    z-index: 60;
    background-color: #e8f5f5 !important;
    border-right: 2px solid #1f5756 !important;
    box-shadow:
        6px 0 10px rgba(31, 87, 86, 0.15),
        0 4px 8px rgba(31, 87, 86, 0.08);
}

/* Cellules Client */
.saisie-table tbody tr > td:first-child {
    z-index: 40;
    background-color: #ffffff !important;
    border-right: 2px solid #cfe3e3 !important;
    box-shadow: 6px 0 10px rgba(31, 87, 86, 0.1);
}

.saisie-table tbody tr:nth-child(even) > td:first-child {
    background-color: #fafdfd !important;
}

.saisie-table tbody tr:hover > td:first-child {
    background-color: #eef8f8 !important;
}


/* =========================
   Lignes clients
   ========================= */

.saisie-table tbody tr:nth-child(even)
td:not(.service-lettre-mission-light):not(:first-child) {
    background-color: #fafdfd;
}

.saisie-table tbody tr:hover
td:not(.service-lettre-mission-light):not(:first-child) {
    background-color: #eef8f8;
}

.saisie-table tbody tr:hover .service-lettre-mission-light {
    background-color: #ffe9dc;
}

.client-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.58rem;
}

.client-link {
    display: block;
    overflow: hidden;
    max-width: 180px;
    color: #1f5756;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.15;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-link:hover {
    color: #ee8b54;
}

.client-gestionnaire {
    margin-top: 1px;
    color: #7c8e8e;
    font-size: 0.68rem;
    line-height: 1.1;
}


/* =========================
   Cellules de saisie
   ========================= */

.saisie-cell {
    min-width: 76px;
    padding: 3px 5px !important;
}

.cell-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saisie-quantite {
    width: 58px;
    min-width: 58px;
    min-height: 30px;
    padding: 3px 15px 3px 5px;
    color: #1f5756;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    background: #ffffff;
    border: 1px solid #d2e3e3;
    border-radius: 7px;
}

.saisie-quantite:hover {
    border-color: #93d9db;
}

.saisie-quantite:disabled {
    color: #455d5d;
    background-color: #f8fbfb;
    cursor: default;
    opacity: 1;
}

.service-lettre-mission-light .saisie-quantite:disabled {
    background-color: #ffffff;
    border-color: #f0c6ad;
}


/* =========================
   Commentaires
   ========================= */

.commentaire-bulle {
    position: absolute;
    top: 2px;
    right: 2px;

    width: 18px;
    height: 18px;

    padding: 0;
    border: none;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: all .15s ease;
}

.commentaire-bulle i{
    font-size: 11px;
}

.commentaire-bulle.sans-commentaire{
    background:#f3f5f7;
    color:#9aa5b1;
}

.commentaire-bulle.avec-commentaire{
    background:#ee8b54;
    color:#fff;
}

.commentaire-bulle:hover{
    transform:scale(1.15);
}
.cell-content {
    position: relative;
}

.commentaire-bulle {
    z-index: 20;
    pointer-events: auto;
}
.cell-content .saisie-quantite {
    padding-right: 22px;
}

/* =========================
   Totaux
   ========================= */

.total-column,
.total-client {
    min-width: 100px;
}

.total-client {
    padding-right: 10px !important;
    color: #1f5756;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    background-color: #edf7f7;
}

.partenaire-footer th {
    padding: 8px 10px;
    color: #1f5756;
    background: #dff0f0 !important;
    border-top: 2px solid #93d9db;
    font-weight: 700;
}


/* =========================
   Total général
   ========================= */

.total-general-card {
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #1f5756,
        #2b7472
    );
    border: 0;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(31, 87, 86, 0.18);
}

.total-general-card .card-body {
    padding: 22px 26px;
}

.total-general-label {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.total-general-montant {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 800;
}


/* =========================
   Barre de défilement
   ========================= */

.saisie-table-wrapper::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.saisie-table-wrapper::-webkit-scrollbar-track {
    background: #edf5f5;
}

.saisie-table-wrapper::-webkit-scrollbar-thumb {
    background: #93bcbc;
    border: 3px solid #edf5f5;
    border-radius: 999px;
}

.saisie-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6f9f9e;
}


/* =========================
   Responsive
   ========================= */

@media (max-width: 767px) {
    .saisie-page-header {
        padding: 20px;
    }

    .periode-box {
        width: 100%;
    }

    .saisie-table-wrapper {
        max-height: 65vh;
    }

    .saisie-table thead tr > th:first-child,
    .saisie-table tbody tr > td:first-child {
        width: 190px;
        min-width: 190px;
        max-width: 190px;
    }

    .client-link {
        max-width: 150px;
    }
}
/* =========================================================
   Séparateur visuel des partenaires
   ========================================================= */

.partenaire-separator th {
    position: static !important;
    left: auto !important;
    z-index: auto !important;

    padding: 14px 18px !important;

    color: #ffffff !important;
    background:
        linear-gradient(
            90deg,
            #1f5756,
            #2c7a78
        ) !important;

    border-top: 10px solid #f4f7f7 !important;
    border-bottom: 3px solid #174746 !important;

    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 3px 8px rgba(31, 87, 86, 0.18);
}

.partenaire-separator th:first-child {
    position: static !important;
    left: auto !important;
}

.partenaire-separator .partenaire-nom {
    display: flex;
    align-items: center;
    gap: 10px;
}

.partenaire-separator .partenaire-nom::before {
    content: "🏢";
    display: inline-block;
    font-size: 1.15rem;
}

