/* =========================
   Charte ISITEC International - 2026
   Couleurs et typo officielles centralisees ici.
   ========================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Palette charte */
    --isi-blue: #019DE0; /* Bleu Isitec - signature */
    --isi-blue-dark: #0182bb;
    --isi-night: #1C1D3D; /* Bleu nuit - textes & contrastes */
    --isi-night-soft: #2a2c60;
    --isi-gray: #747374; /* Gris - textes secondaires */
    --isi-gray-soft: #cfd3da;
    --isi-bg-soft: #f5f7fa;

    /* Etats fonctionnels (conserves) */
    --isi-danger: #c62828;
    --isi-success: #16a34a;
    --isi-warning: #f59e0b;
}

/* =========================
   Base
   ========================= */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', 'Helvetica', Arial, sans-serif;
    color: var(--isi-night);
}

* {
    box-sizing: border-box;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', 'Helvetica', Arial, sans-serif;
    font-weight: 700;
    /* color non force : herite du parent. Body cascade --isi-night par defaut, et un
       conteneur avec color:white (header gradient, sidebar brand...) impose son blanc
       au titre - sinon on avait du noir invisible sur les bandeaux bleu marine. */
    color: inherit;
}

a {
    color: var(--isi-blue);
}

/* =========================
   Navigation
   ========================= */

nav {
    background-color: var(--isi-night);
    height: 5%;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

    nav li {
        list-style: none;
        display: inline;
        margin-right: 15px;
    }

        nav li a {
            color: #fff;
            text-decoration: none;
        }

/* =========================
   Layout generique (si utilise ailleurs)
   ========================= */

.flex-container {
    height: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.row {
    width: auto;
}

.flex-item {
    padding: 5px;
    margin: 10px;
    line-height: 20px;
    text-align: center;
}

.text-normal {
    border: 1px solid var(--isi-gray-soft);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 1.05em;
    font-family: 'Montserrat', Arial, sans-serif;
}

.button-confirm {
    border: 1px solid var(--isi-blue);
    background: var(--isi-blue);
    color: #fff;
    font-weight: 700;
    font-size: 1.05em;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, transform .05s;
    font-family: 'Montserrat', Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .3px;
}

    .button-confirm:hover {
        background: var(--isi-blue-dark);
    }

    .button-confirm:active {
        transform: translateY(1px);
    }

.menu-card {
    border: 1px solid var(--isi-gray-soft);
    border-radius: 14px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 29, 61, 0.08);
}

/* =========================
   Tables generiques
   ========================= */

.table-main td, .table-main th {
    padding: 10px;
}

.table-main th {
    background-color: var(--isi-night);
    color: #fff;
}

/* =========================
   Hexagone - element signature ISITEC
   ========================= */

.isi-hex {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--isi-blue);
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
}

.isi-hex-pattern {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'><g fill='none' stroke='%23ffffff' stroke-opacity='0.18' stroke-width='1'><polygon points='14,1 28,9 28,25 14,33 0,25 0,9'/><polygon points='42,1 56,9 56,25 42,33 28,25 28,9'/><polygon points='28,17 42,25 42,41 28,49 14,41 14,25'/></g></svg>");
    background-repeat: repeat;
}

.isi-hex-pattern-dark {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='48' viewBox='0 0 56 48'><g fill='none' stroke='%23019DE0' stroke-opacity='0.22' stroke-width='1'><polygon points='14,1 28,9 28,25 14,33 0,25 0,9'/><polygon points='42,1 56,9 56,25 42,33 28,25 28,9'/><polygon points='28,17 42,25 42,41 28,49 14,41 14,25'/></g></svg>");
    background-repeat: repeat;
}

/* =========================
   OF Page
   ========================= */

.of-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 12px;
}

.of-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 14px;
}

.of-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    color: var(--isi-night);
}

.of-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* =========================
   Buttons
   ========================= */

.btnj {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Montserrat', Arial, sans-serif;
}

.btnj-primary {
    background: var(--isi-blue);
    color: #fff;
}

    .btnj-primary:hover {
        background: var(--isi-blue-dark);
    }

.btnj-secondary {
    background: #f2f3f5;
    color: var(--isi-night);
    border: 1px solid var(--isi-gray-soft);
}

    .btnj-secondary:hover {
        background: #e8eaee;
    }

.btnj-danger {
    background: var(--isi-danger);
    color: #fff;
}

    .btnj-danger:hover {
        filter: brightness(0.95);
    }

/* Bouton icone (poubelle) */
.btnj-icon-danger {
    width: 40px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0;
    background: var(--isi-danger);
    color: #fff;
    text-decoration: none;
    border: none;
}

    .btnj-icon-danger:hover {
        filter: brightness(0.95);
    }

/* =========================
   Cards
   ========================= */

.card {
    background: #fff;
    border: 1px solid #e3e6ee;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(28, 29, 61, 0.06);
    margin-bottom: 14px;
}

.card-h {
    padding: 12px 14px;
    border-bottom: 1px solid #eef0f6;
    font-weight: 800;
    color: var(--isi-night);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-b {
    padding: 14px;
}

/* =========================
   Form grid
   ========================= */

.form-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 10px 14px;
    align-items: center;
}

    .form-grid .lbl,
    .form-grid label {
        text-align: right;
        color: var(--isi-night);
        font-weight: 600;
    }

/* Inputs */
.input,
select,
textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--isi-gray-soft);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    font-family: 'Montserrat', Arial, sans-serif;
}

    .input:focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: var(--isi-blue);
        box-shadow: 0 0 0 3px rgba(1, 157, 224, 0.15);
    }

    .input.small {
        width: 220px;
    }

.msg {
    margin: 6px 0 0;
    font-weight: 600;
}

/* =========================
   GridView (generique)
   ========================= */

.grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* important */
}

    .grid th {
        background: var(--isi-night);
        color: #fff;
        padding: 10px;
        text-align: left;
        white-space: nowrap;
    }

    .grid td {
        padding: 10px;
        border-bottom: 1px solid #eee;
        vertical-align: top;
        overflow: hidden;
    }

    .grid tr:nth-child(even) td {
        background: #fafafa;
    }

    /* Controls dans le Grid */
    .grid td select,
    .grid td input,
    .grid td textarea {
        width: 100%;
        min-width: 0;
    }

    /* Liens (si tu as des HyperLinkField) */
    .grid a {
        color: var(--isi-blue);
        font-weight: 600;
        text-decoration: none;
    }

        .grid a:hover {
            text-decoration: underline;
        }

/* =========================
   OF - Lignes (colonne par colonne)
   IMPORTANT: depend de l'ordre des colonnes dans gvLines
   1 Metier | 2 Lieu | 3 Reference | 4 Designation | 5 Qte | 6 Temps | 7 Delete
   ========================= */

/* Cible le GridView meme si l'id est prefixe */
[id$="gvLines"] {
    table-layout: fixed;
    width: 100%;
}

    /* 1 Metier */
    [id$="gvLines"] th:nth-child(1),
    [id$="gvLines"] td:nth-child(1) {
        width: 140px;
    }

    /* 2 Lieu */
    [id$="gvLines"] th:nth-child(2),
    [id$="gvLines"] td:nth-child(2) {
        width: 110px;
    }

    /* 3 Reference */
    [id$="gvLines"] th:nth-child(3),
    [id$="gvLines"] td:nth-child(3) {
        width: 160px;
    }

    /* 4 Designation (agrandie) */
    [id$="gvLines"] th:nth-child(4),
    [id$="gvLines"] td:nth-child(4) {
        width: 45%;
    }

    /* 5 Qte (reduite) */
    [id$="gvLines"] th:nth-child(5),
    [id$="gvLines"] td:nth-child(5) {
        width: 70px;
        text-align: center;
    }

    /* 6 Temps */
    [id$="gvLines"] th:nth-child(6),
    [id$="gvLines"] td:nth-child(6) {
        width: 190px;
    }

    /* 7 Suppr */
    [id$="gvLines"] th:nth-child(7),
    [id$="gvLines"] td:nth-child(7) {
        width: 56px;
        text-align: right;
    }

/* =========================
   Interieurs des cellules
   ========================= */

/* Designation */
.of-designation {
    min-height: 70px;
    resize: vertical;
    line-height: 1.35;
    white-space: pre-wrap;
}

/* Qte centre */
.of-qte {
    width: 100%;
    text-align: center;
}

/* Temps: input + unite */
.of-temps-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.of-temps {
    flex: 0 0 90px;
    text-align: center;
}

.of-unite {
    flex: 0 0 70px;
}


/* =========================
   Filebar
   ========================= */

.filebar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* =========================
   Responsive
   ========================= */

@media (max-width: 640px) {
    .of-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

        .form-grid .lbl, .form-grid label {
            text-align: left;
        }

    .input.small {
        width: 100%;
    }
}
/* =========================
   Demande de conge (centre + tableau aligne sur la card)
   ========================= */

.leave-page {
    max-width: 980px;
    margin: 28px auto;
    padding: 0 12px;
}

    /* Titre centre */
    .leave-page .leave-h2,
    .leave-page h2 {
        text-align: center !important;
        margin: 8px 0 14px;
        font-size: 30px;
        font-weight: 800;
        color: var(--isi-night);
    }

    /* Card centree */
    .leave-page .jorani-card {
        max-width: 820px;
        margin: 18px auto 12px auto;
        border-radius: 14px;
        box-shadow: 0 10px 26px rgba(28, 29, 61, .08);
    }

    /* 2 colonnes : date + moment */
    .leave-page .jorani-row2 {
        display: grid;
        grid-template-columns: 1.4fr 1fr;
        gap: 12px;
        align-items: end;
    }

    /* Labels */
    .leave-page .jorani-field label {
        display: block;
        font-size: 13px;
        font-weight: 700;
        margin: 0 0 6px;
        color: var(--isi-night);
    }

    /* Inputs carte */
    .leave-page .jorani-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--isi-gray-soft);
        border-radius: 10px;
        font-size: 14px;
        background: #fff;
    }

    /* Textarea */
    .leave-page .jorani-textarea {
        min-height: 140px;
        resize: vertical;
    }

    /* Actions centrees */
    .leave-page .jorani-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 14px;
    }

    /* Bloc liste centre */
    .leave-page .leave-list {
        max-width: 820px; /* meme largeur que la card */
        margin: 14px auto 0 auto; /* centre */
        border-top: 1px solid #ddd;
        padding-top: 12px;
    }

        /* Table centree + style plus "card" */
        .leave-page .leave-list .table-main {
            width: 100%;
            margin: 0 auto;
            border-collapse: collapse;
            background: #fff;
            border: 1px solid #e3e6ee;
            border-radius: 12px;
            overflow: hidden; /* coins arrondis */
        }

            /* Header / cells */
            .leave-page .leave-list .table-main th {
                background: var(--isi-night);
                color: #fff;
                padding: 10px;
                text-align: left;
                white-space: nowrap;
            }

            .leave-page .leave-list .table-main td {
                padding: 10px;
                border-bottom: 1px solid #eee;
            }

            /* Lien supprimer */
            .leave-page .leave-list .table-main a {
                color: var(--isi-danger);
                font-weight: 700;
                text-decoration: none;
            }

                .leave-page .leave-list .table-main a:hover {
                    text-decoration: underline;
                }

@media (max-width: 720px) {
    .leave-page .jorani-row2 {
        grid-template-columns: 1fr;
    }

    .leave-page .jorani-card,
    .leave-page .leave-list {
        max-width: 100%;
    }

    .leave-page h2 {
        font-size: 26px;
    }
}

/* =========================
   Planning conges - rendu blocs (VALIDE vs EN DEMANDE)
   ========================= */

.planning-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
}

    .planning-table th,
    .planning-table td {
        border: 1px solid rgba(0,0,0,.15);
        padding: 2px;
        text-align: center;
    }

        .planning-table th.name-col,
        .planning-table td.name-col {
            text-align: left;
            min-width: 170px;
            padding-left: 8px;
        }

/* Le bloc qui represente une absence dans une cellule */
.leave-block {
    display: block;
    width: 100%;
    height: 18px;
    line-height: 18px;
    border-radius: 4px;
    text-align: center;
    font-size: 11px;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid rgba(0,0,0,.18);
}

/* Valide = plein */
.leave-approved {
    background: rgba(0,0,0,0.18);
    color: #111;
}

/* En demande = hachure */
.leave-pending {
    background: repeating-linear-gradient( 45deg, rgba(0,0,0,0.00), rgba(0,0,0,0.00) 6px, rgba(0,0,0,0.12) 6px, rgba(0,0,0,0.12) 12px );
    color: #111;
}

/* Annulation demandee = hachure rouge */
.leave-cancel-pending {
    background: repeating-linear-gradient( 45deg, rgba(211,47,47,0.08), rgba(211,47,47,0.08) 6px, rgba(211,47,47,0.22) 6px, rgba(211,47,47,0.22) 12px );
    color: #d32f2f;
}
.leave-block.half-am {
    display: inline-block;
    width: 100%;
    height: 18px;
    line-height: 18px;
    clip-path: inset(0 0 50% 0);
}

.leave-block.half-pm {
    display: inline-block;
    width: 100%;
    height: 18px;
    line-height: 18px;
    clip-path: inset(50% 0 0 0);
}
/* =========================
   Bon de commande (BdC)
   ========================= */

.bdc-page {
    max-width: 1100px;
    margin: 28px auto;
    padding: 0 12px;
}

.bdc-back a {
    color: var(--isi-blue);
    font-weight: 700;
    text-decoration: none;
}

    .bdc-back a:hover {
        text-decoration: underline;
    }

.bdc-title {
    text-align: center;
    margin: 8px 0 14px;
    font-size: 30px;
    font-weight: 800;
    color: var(--isi-night);
}

/* Montants partiels: une "ligne" propre */
.mp-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

    .mp-row select,
    .mp-row input[type="number"],
    .mp-row input[type="date"],
    .mp-row input[type="text"] {
        width: auto;
        min-width: 140px;
    }

.mp-sum {
    min-width: 140px;
    text-align: right;
}

.bdc-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
