﻿/* =========================================
   VARIABLES & RESET
   ========================================= */

:root {
    --CouleurBackgroundTIS: AliceBlue;
    --CouleurFondPage: #F5F5F5;
    --CouleurTIS: #2C778B;
    --CouleurFondComposant1: #5F5F5F;
    --CouleurFondComposant2: #2C778B;
    --CouleurFondUserControlGestionProduit: #F0FFFF;
    --CouleurTextLabel: #3F3F3F;
    --CouleurBordure: #888888;
    --CouleurHighlight: #4F4F4F;
    --FondColonneJour: #C2E0E3;
    --FondColonneMois: #526779;
    --FondColonneMoisProchain: #9A9FAD;
    --FondColonneSemaineProchaine: #DBDBDB;
    --FondRowDeleted: #FF8080;
    --FondRowModify: #A2DEFC;
    --FondRowFerie: #FFF694;
    --inner-shadow: 0 0 0 transparent;
    --TabItemColorNonSelectionner: #CEF1F9;
    --TabItemColorSelectionner: #B0DEDF;
    --CouleurBlanche: white;
    --FontTIS: 'Poppins', sans-serif;
    --PoliceDefautPage: 14px;
    --offset-base-zone-calendrier: 170px;
    --col-mois-w: 70px;
    --col-sem-w: 30px;
    --col-jour-w: 70px;
    --offset-base-zone-calendrier: 170px;
}

.mobile-only {
    display: none;
}

input:disabled {
    cursor: not-allowed;
}

label {
    cursor: pointer;
}

.dark-mode {
    --CouleurTIS: #3F3F3F;
    --CouleurFondComposant2: #3F3F3F;
    --CouleurFondPage: #121212;
    --CouleurBlanche: #F5F5F5;
    --TabItemColorNonSelectionner: #F0F0F0;
    --TabItemColorSelectionner: #CACACA;
}

.menu-v-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 998;
    background: transparent;
}

.btn-tis-menu {
    padding: 0;
    margin: 0;
    display: flex;
    font-size: 10px;
    background: var(--CouleurBackgroundTIS);
    border: none;
    align-items: center;
    width: max-content;
    white-space: nowrap;
    padding: 5px;
}

.btn-tis-menu:hover {
    background-color: lightblue;
}

.btn-tis-menu img {
    max-height: 15px;
    max-width: 15px;
}

.textarea-form-control {
    width: 100%;
    height: 100%;
    resize: none;
    background: inherit;
    border: none;
    padding: 2px 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    box-sizing: border-box;
}

.input-text {
    background-color: transparent;
    border: none;
    outline: none;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 100%;
    color: inherit;
    text-align: center;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
}

.mobile-only {
    display: none !important;
}

.bg-blanc {
    background-color: var(--CouleurBlanche);
}

.bg-jour-ferie {
    background-color: var(--FondRowFerie);
}

.bg-mois {
    background-color: var(--FondColonneMois);
    color: white;
}

body {
    background-color: var(--CouleurBackgroundTIS);
    font-family: var(--FontTIS);
    font-size: var(--PoliceDefautPage);
    margin: 0;
}

p {
    padding: 0;
    margin: 0;
}

.msg-dans-menu {
    color: red;
    font-size: 1rem;
    font-weight: bold;
}

.btn-burger-toolbar {
    display: none;
}

.tab-icon-img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    object-fit: contain;
}

/* =========================================
   LAYOUT GLOBAL (Structure)
   ========================================= */

.is-loading, .is-loading * {
    cursor: wait !important;
}

    .is-loading .tis-toolbar {
        pointer-events: none;
        opacity: 0.6;
    }

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.content-tis, .page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.content-tis {
    background-color: var(--CouleurBackgroundTIS);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.page-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.empty-layout {
    width: 100vw;
    height: 100vh;
    overflow: auto;
}

footer {
    display: flex;
    gap: 5px;
    background-color: #F1EDED;
    width: 100%;
    height: 20px;
    font-size: 10px;
    align-items: center;
    padding-left: 5px;
}

.separator-vertical {
    width: 1px;
    background-color: black;
    align-self: stretch;
    margin: 1px 0;
}

.evenement-wpf {
    position: relative;
    height: 100%
}

.info-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: solid 1px black;
    font-style: normal;
    cursor: default;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    line-height: normal;
    padding-top: 1px;
}

/* Context Menu */

.tis-context-menu {
    position: fixed;
    z-index: 1000;
    left: var(--click-x, 0px);
    top: var(--click-y, 0px);
    transform: translate( min(0px, calc(100dvw - var(--click-x) - 100% - 10px)), min(0px, calc(100dvh - var(--click-y) - 100% - 10px)) );
    background: var(--CouleurTIS);
    border: 1px solid #ccc;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    padding: 5px 0;
    border-radius: 4px;
}

.context-item {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--CouleurBlanche);
}

    .context-item .tis-submenu-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .context-item:hover {
        background-color: var(--CouleurBlanche);
        color: var(--CouleurTIS);
    }

.context-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    background: transparent;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar-tis {
    width: 40px;
    min-width: 40px;
    background-color: var(--CouleurTIS);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    z-index: 20;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.sidebar-btn {
    width: 40px;
    height: 38px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

    .sidebar-btn:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .sidebar-btn img {
        width: 28px;
        height: 28px;
        object-fit: contain;
    }

/* =========================================
   BOUTONS & ELEMENTS UI
   ========================================= */

.btn-tis {
    height: 35px;
    font-family: var(--FontTIS);
    cursor: pointer;
    padding: 7px 20px;
    font-size: var(--PoliceDefautPage);
    border: 2px solid var(--CouleurFondComposant2);
    border-radius: 7px;
    background: transparent;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-block;
}

    .btn-tis:hover:not(:disabled) {
        background-color: var(--CouleurFondComposant2);
        color: white;
        opacity: 0.8;
    }

    .btn-tis:disabled {
        border-color: gray;
        background-color: lightgray;
        color: gray;
        cursor: not-allowed;
    }

.btn-tis-img {
    border: none;
    background: transparent;
}

    .btn-tis-img:active {
        transform: translateY(1px);
    }

    .btn-tis-img img {
        min-width: 31px;
        min-height: 31px;
        width: 31px;
        height: 31px;
    }

.nav-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

    .nav-btn img {
        min-width: 25px;
        min-height: 25px;
        width: 25px;
        height: 25px;
    }

    .nav-btn:hover {
        background-color: rgba(0, 0, 0, 0.1);
        border-radius: 4px;
    }

.list-view {
    border: 1px solid #ccc;
    background-color: whitesmoke;
    border-radius: 4px;
    user-select: none;
    max-height: 50vh;
    padding-bottom: 5px;
    overflow: auto;
}

    .list-view.disabled {
        background-color: #f5f5f5;
        color: #a0a0a0;
        border-color: #d9d9d9;
        cursor: not-allowed;
        pointer-events: none;
        opacity: 0.6;
    }

.list-item {
    padding: 2px 8px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 2px;
    width: 100%;
}

    .list-item:hover {
        background-color: #f0f0f0;
    }

    .list-item.selected {
        background-color: #0078d7;
        color: white;
    }

/* =========================================
   FORMULAIRES & INPUTS
   ========================================= */
.tis-combobox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 20px;
    min-height: 25px;
    height: 25px;
    width: 100%;
    font-family: var(--FontTIS);
    font-size: 0.9rem;
    color: white;
    background-color: var(--CouleurHighlight);
    border: 1px solid var(--CouleurBordure);
    border-radius: 5px;
    padding-left: 5px;
    padding-right: 30px;
    outline: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

    .tis-combobox option {
        background-color: var(--CouleurTIS);
        color: white;
    }

    .tis-combobox:disabled {
        color: var(--CouleurTextLabel);
        border-color: #555;
        background-image: none;
        cursor: not-allowed;
    }

    .tis-combobox::-webkit-scrollbar {
        width: 8px;
    }

    .tis-combobox::-webkit-scrollbar-track {
        background: var(--CouleurFondComposant2);
    }

    .tis-combobox::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

.slider-toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 100%;
    padding: 5px 0;
}

.slider-label {
    display: none;
}

.slider-switch {
    width: 34px;
    height: 18px;
    background-color: #D3D3D3;
    border-radius: 20px;
    position: relative;
    border: 1px solid #A9A9A9;
    transition: background-color 0.3s;
}

    .slider-switch.on {
        background-color: var(--CouleurTIS);
        border-color: #222;
    }

.slider-thumb {
    width: 14px;
    height: 14px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 2px;
    transition: left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.slider-switch.on .slider-thumb {
    left: 17px;
    background-color: #EEE;
}

.date-label {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
}

.date-label-input {
    font-weight: bold;
    text-align: center;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    width: auto;
    font-family: inherit;
    color: #333;
}

    .date-label-input:hover {
        border-color: #ccc;
        background-color: white;
    }

/* =========================================
   ARBORESCENCE (TreeView)
   ========================================= */

.tis-treeview {
    font-family: Arial, sans-serif;
    font-size: 14px;
    user-select: none;
}

.tree-node {
    margin-bottom: 5px;
}

.tree-item-header, .tree-item-leaf {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 4px;
}

    .tree-item-header:hover, .tree-item-leaf:hover {
        background-color: #f0f0f0;
    }

.tree-children {
    margin-left: 24px;
    border-left: 1px dotted #ccc;
    padding-left: 8px;
    margin-top: 2px;
}

.tree-expander {
    cursor: pointer;
    font-size: 10px;
    color: #666;
    display: inline-block;
    transition: transform 0.2s;
    width: 12px;
    text-align: center;
}

    .tree-expander.expanded {
        transform: rotate(90deg);
    }

.tree-icon {
    width: 16px;
    height: 16px;
}

.tree-label {
    cursor: pointer;
}

/* =========================================
   MENU PRINCIPAL (Header)
   ========================================= */

.tis-menu-container {
    margin-left: 20px;
    height: 100%;
    display: flex;
    align-items: center;
}

.tis-menu-bar {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100%;
}

.tis-menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
}

    .tis-menu-item:hover > .menu-link {
        background-color: var(--CouleurFondPage);
        color: var(--CouleurTIS);
        border-color: var(--CouleurTIS);
    }

    .tis-menu-item:hover > .tis-submenu {
        display: block;
    }

.menu-link {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    color: white;
    font-family: var(--FontTIS);
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
    border-radius: 3px;
    margin: 0 2px;
    white-space: nowrap;
}

    .menu-link span {
        line-height: 1;
        padding-top: 2px;
    }

.menu-icon {
    width: 25px;
    height: 25px;
    min-width: 25px;
    min-height: 25px;
    margin-right: 12px;
    object-fit: contain;
    display: block;
}

.arrow-right {
    font-size: 0.7rem;
    margin-left: auto;
    padding-left: 20px;
    opacity: 0.8;
}

.menu-separator {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 5px 0;
}

.tis-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--CouleurTIS);
    border: 1px solid var(--CouleurTIS);
    list-style: none;
    padding: 2px;
    min-width: 200px;
    width: max-content;
    max-width: 400px;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

    .tis-submenu .menu-link {
        height: 35px;
        width: 100%;
        box-sizing: border-box;
    }

/* =========================================
   7. TOOLBAR & SECOND MENU SYSTEM
   ========================================= */

.tis-toolbar {
    position: relative;
    padding: 0;
}

.tis-toolbar-content {
    display: flex;
    flex-direction: row; 
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding-bottom: 5px;
}

.tis-menubar {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.tis-menu-root {
    position: relative;
    padding: 8px 12px;
    cursor: pointer;
    font-family: var(--FontTIS);
    user-select: none;
}

    .tis-menu-root:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }

.tis-menu-root-combobox {
    position: relative;
    padding: 0;
    font-family: var(--FontTIS);
    user-select: none;
}

.tis-menu-root-label {
    position: relative;
    padding: 0 6px 0 12px;
    font-family: var(--FontTIS);
    user-select: none;
}

.tis-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--CouleurTIS);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    z-index: 1000;
    padding: 5px 0;
    border: 1px solid #ccc;
}

.tis-menu-root:hover > .tis-dropdown {
    display: block;
}

.tis-dropdown .tis-dropdown {
    display: none;
}

.tis-menu-item-toolbar {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    cursor: pointer;
    white-space: nowrap;
}

    .tis-menu-item-toolbar:hover {
        background-color: white;
        color: var(--CouleurTIS);
    }

.tis-menu-separator {
    height: 1px;
    background-color: #ddd;
    margin: 4px 0;
}

.menu-icon-img {
    width: 16px;
    height: 16px;
}

.tis-submenu-container {
    position: relative;
    display: flex;
    justify-content: space-between;
}

.tis-submenu-side {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: -1px;
    background-color: var(--CouleurTIS);
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    transform: translate( min(0px, calc(100dvw - var(--click-x) - 220px - 100% - 10px)), min(0px, calc(100dvh - var(--click-y) - 100% - 10px)) );
}

.tis-submenu-container:hover .tis-submenu-side {
    display: block;
}

/* Mobile Menu Trigger & Overlay */

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
    margin-right: 10px;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
}

.secondary-menu-btn {
    width: 40px;
    height: 38px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

    .secondary-menu-btn:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }

    .secondary-menu-btn img {
        width: 28px;
        height: 28px;
        object-fit: contain;
        margin: 0;
    }

/* =========================================
   MODALES
   ========================================= */

.tis-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.tis-modal-box {
    background-color: var(--CouleurBackgroundTIS);
    min-width: 10vw;
    max-width: 90vw;
    min-height: 10vh;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: popIn 0.1s ease-out;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tis-modal-header {
    background-color: var(--CouleurTIS);
    color: white;
    text-align: center;
    padding: 5px;
    font-family: var(--FontTIS);
}

    .tis-modal-header h3 {
        margin: 0;
        font-size: 1.2rem;
    }

.tis-modal-menu {
    display: flex;
    gap: 5px;
}

.tis-modal-body {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.5;
    flex: 1;
    overflow-y: auto;
}

.tis-modal-footer {
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.empty-layout .tis-modal-box {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 90vw;
    height: auto;
    max-height: 90vh;
    overflow-x: auto;
    overflow-y: hidden;
}

.empty-layout .tis-modal-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: max-content;
}

.empty-layout .tis-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    min-width: max-content;
}

    .empty-layout .tis-modal-body .btn-tis {
        border-radius: 0;
        width: 100%;
    }

/* =========================================
   9. LOADING SCREENS
   ========================================= */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.dark-mode .loading-screen {
    background-color: #1e1e1e;
}

.loading-text {
    margin-top: 20px;
    font-family: 'Segoe UI', sans-serif;
    color: #555;
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

.dark-mode .loading-text {
    color: #ddd;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    color: var(--CouleurTIS);
}

.tis-loader-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

    .tis-loader-container .loader-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 50px;
        flex: 1;
    }

/* =========================================
   10. ANIMATIONS
   ========================================= */

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* SYSTEME DE TABS */

.tab-bar {
    display: flex;
    align-items: flex-end;
    background-color: var(--CouleurBlanche);
    border-bottom: 1px solid var(--CouleurBlanche);
    padding: 2px 0 0 2px;
    gap: 2px;
    scrollbar-width: thin;
}

.tab-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 10px;
    background-color: var(--TabItemColorNonSelectionner);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

    .tab-button span:first-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tab-button:not(.active):hover {
        background-color: #e5e7eb;
        color: #111827;
    }

    .tab-button.active {
        background-color: var(--TabItemColorSelectionner);
        font-weight: 600;
        border-color: var(--TabItemColorSelectionner);
        border-bottom: 1px solid var(--TabItemColorSelectionner);
        box-shadow: 0 -2px 4px rgba(0,0,0,0.02);
        z-index: 10;
    }

.close-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: #9ca3af;
    transition: background 0.2s, color 0.2s;
}

    .close-icon:hover {
        background-color: #fee2e2;
        color: #ef4444;
    }

.tab-content {
    background-color: var(--CouleurBackgroundTIS);
    height: calc(100% - 35px);
    display: flex;
    flex-direction: column;
    border: 1px solid #ccc;
    border-top: none;
    flex-grow: 1;
    min-height: 0;
}

    .tab-content > div {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0 5px 5px 5px;
        overflow-y: auto;
        min-height: 0;
    }

/* CALENDRIER DE SAISON */

.bg-jour-standard {
    background-color: var(--FondColonneJour);
}

.bg-jour-dimanche {
    background-color: var(--FondRowModify);
}

.bg-alternance-semaine {
    background-color: var(--FondColonneSemaineProchaine);
}

.bg-alternance-mois-1 {
    background-color: var(--FondColonneMois);
    color: white;
}

.bg-alternance-mois-2 {
    background-color: var(--FondColonneMoisProchain);
    color: white;
}

.calendrier-container {
    display: grid;
    grid-template-rows: auto;
    flex-grow: 1;
    min-height: 0;
    width: 100%;
    height: auto;
    overflow: auto;
    margin: 5px 0 0 0;
    position: relative;
    justify-content: start;
    align-items: stretch;
    align-content: start;
}

.cal-sidebar-base {
    position: sticky;
    z-index: 30;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.1;
}

.cal-col-mois {
    grid-column: 1;
    left: 0;
    font-weight: bold;
    width: var(--col-mois-w);
    min-width: var(--col-mois-w);
    max-width: var(--col-mois-w);
}

.cal-col-sem {
    grid-column: 2;
    left: var(--col-mois-w);
    font-size: 0.75rem;
    width: var(--col-sem-w);
    min-width: var(--col-sem-w);
}

.cal-col-jour {
    grid-column: 3;
    left: calc(var(--col-mois-w) + var(--col-sem-w));
    font-weight: bold;
    width: var(--col-jour-w);
    min-width: var(--col-jour-w);
}

.cal-coin {
    grid-column: 1 / span 3;
    grid-row: 1;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 40;
    background-color: var(--CouleurBackgroundTIS);
    border-bottom: 1px solid #ccc;
    border-right: 1px solid #ccc;
}

.cal-header-top {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--FondColonneMois);
    color: white;
    border-top: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-left: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    justify-content: start;
    text-align: center;
    overflow: hidden;
    height: auto;
    min-height: 60px;
    min-width: 150px;
    white-space: nowrap;
}

.cal-txt-categorie {
    font-size: 0.75rem;
    margin-bottom: 2px;
    color: white;
}

.cal-txt-produit {
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.cal-case {
    position: relative;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    align-items: stretch;
    height: 100%;
    box-sizing: border-box;
}

.cal-case-zone {
    border-right: 1px solid #ccc;
    margin: 0;
    padding: 0;
    width: 5px;
    height: 100%;
    z-index: 30;
    position: sticky;
    left: calc(var(--offset-base-zone-calendrier) + var(--largeur-creneau) + (var(--zone-index) * 5px));
}

.indicateur-commentaire-rouge {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 5px;
    background-color: red;
    z-index: 15;
}

    .indicateur-commentaire-rouge:hover {
        background-color: #ff0000;
        transition: width 0.2s;
    }

.cal-col-creneau {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    background-color: #D0EBEE;
    border-right: 2px solid #ccc;
    border-bottom: 1px solid #ccc;
    width: 100%;
}

.date-mobile {
    display: none;
}

.date-desktop {
    display: inline;
}

/* EVENEMENT WPF */

.evt-desc-html {
    display: grid;
    grid-template-columns: max-content 1fr;
    white-space: nowrap;
    padding: 0 5px 0 5px;
    align-items: start;
}

.evt-null-desc-html {
    width: 100%;
    height: 100%;
    min-height: 20px;
    user-select: none;
}

.evt-prefix-col {
    font-size: 0.75em; 
    white-space: nowrap;
}

/* FEUILLE D'HEURES */

.gestion-feuille-heures-desktop {
    display: flex;
    gap: 10px;
}

.gestion-feuille-heures-mobile {
    display: none;
}

.feuille-heures-container {
    display: grid;
    grid-template-columns: max-content minmax(max-content, 1fr) minmax(max-content, 1fr) minmax(max-content, 1fr);
    grid-template-rows: minmax(0, auto) minmax(0, 1fr);
    height: calc(100dvh - 23%);
    overflow-y: hidden;
    overflow-x: auto;
}

.grille-semaine-container, .grille-prevu-reel-container, .grille-individu-container, .grille-description-container {
    display: grid;
    grid-template-rows: repeat(7, minmax(0, 1fr));
    border-top: 1px solid #ccc;
    min-height: 0;
    overflow: hidden;
}

.grille-semaine-jour-row {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #ccc;
    min-height: 0;
    overflow: hidden;
}

.grille-prevu-reel-row {
    display: flex;
    flex-direction: row;
    min-height: 0;
    overflow: hidden;
}

/* COMPOSANT GRILLE SEMAINE */

.grille-semaine-wrapper {
    display: contents;
}

.grille-semaine-header {
    grid-column: 1;
    grid-row: 1;
    background-color: var(--FondColonneMois);
    color: white;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    font-size: clamp(0.8rem, 1.3dvh, 1.2rem);
    min-height: 0;
    overflow: hidden;
}

    .grille-semaine-header p {
        margin: 0;
        min-height: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

.grille-semaine-container {
    grid-column: 1;
    grid-row: 2;
}


.grille-semaine-cell-jour {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2px 5px;
    line-height: 1.2;
    width: 80px;
    flex-shrink: 0;
    font-size: clamp(0.7rem, 1.2dvh, 1rem);
}

.grille-semaine-jour-normal {
    background-color: var(--FondColonneMois);
    color: white;
}

.grille-semaine-jour-ferie {
    background-color: var(--FondRowFerie);
    color: black;
}

.grille-semaine-cell-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5px;
    flex-shrink: 0;
    font-size: clamp(0.6rem, 1.2dvh, 0.9rem);
}

.grille-semaine-cell-zone-vide {
    background-color: var(--CouleurBlanche);
}

.grille-semaine-cell-labels-wrapper {
    display: grid;
    grid-template-rows: repeat(6, minmax(0, 1fr));
    flex-grow: 1;
    border-right: 1px solid #cbd5e1;
    min-height: 0;
}

.grille-semaine-cell-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 8px;
    font-size: clamp(0.6rem, 0.675rem, 0.9rem);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* COMPOSANT GRILLE PREVU REEL */

.grille-individu-wrapper {
    display: contents;
}

.grille-prevu-reel-header {
    grid-column: 2;
    grid-row: 1;
    background-color: #F5F5F5;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    font-size: clamp(0.8rem, 1.3dvh, 1.2rem);
    min-height: 0;
    overflow: hidden;
}

.grille-prevu-reel-col {
    flex: 1;
    min-width: 40px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grille-prevu-reel-container {
    grid-column: 2;
    grid-row: 2;
}

.grille-prevu-reel-block {
    display: grid;
    grid-template-rows: repeat(6, minmax(0, 1fr));
    border-bottom: 1px solid #ccc;
    min-height: 0;
}

.grille-prevu-reel-cell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: clamp(0.6rem, 0.675rem, 0.9rem);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* COMPOSANT INDIVIDU */

.grille-individu-header {
    grid-column: 3;
    grid-row: 1;
    background-color: var(--FondColonneMois);
    color: white;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
    font-size: clamp(0.8rem, 1.3dvh, 1.2rem);
    min-height: 0;
    position: relative;
}

    .grille-individu-header p {
        margin: 0;
        padding: 0 0 0 35px;
        text-align: left;
    }

    .grille-individu-container {
        grid-column: 3;
        grid-row: 2;
    }

.grille-individu-cell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: clamp(0.6rem, 0.675rem, 0.9rem);
    min-width: 0;
    border-right: 1px solid #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .grille-individu-cell .input-text {
        text-transform: uppercase;
    }

.grille-individu-cell p {
    padding: 0;
    margin: 0;
}

    .grille-individu-cell:first-child {
        border-left: 1px solid #ccc;
        width: max-content;
    }

.menu-individu-header-horizontal .tis-menu-bar .tis-menu-root {
    box-sizing: border-box;
    padding: 2px 5px 2px 5px;
    margin: 2px 5px 2px 2px;
    border: 1px solid var(--CouleurTIS);
    border-radius: 5px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-individu-header-horizontal {
    display: flex;
}

    .menu-individu-header-horizontal button {
        background: transparent;
        border: none;
        padding: 0 5px 0 0;
    }

    .menu-individu-header-horizontal button img {
        max-height: 15px;
        max-width: 15px;
    }

.menu-individu-header-vertical {
    display: flex;
    flex-direction: column;
    align-items: start;
}

    .menu-individu-header-vertical button {
        background: transparent;
        border: none;
        padding: 0 0 2px 5px;
    }

    .menu-individu-header-vertical button:last-child {
        background: transparent;
        border: none;
        padding: 0 0 5px 5px;
    }

    .menu-individu-header-vertical button img {
        max-height: 15px;
        max-width: 15px;
    }

.btn-toggle-planning-horizontal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0 5px 0 0;
}

    .btn-toggle-planning-horizontal img {
        max-height: 15px;
        max-width: 15px;
    }

.btn-toggle-planning-vertical {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0 0 2px 5px;
}

    .btn-toggle-planning-vertical:last-child {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        padding: 0 0 5px 5px;
    }

    .btn-toggle-planning-vertical img {
        max-height: 15px;
        max-width: 15px;
    }

.btn-desactive-securise {
    cursor: not-allowed;
    opacity: 0.6;
}

.grille-individu-wrapper .context-item {
    padding: 0;
}

.grille-individu-wrapper .tis-menu-item-toolbar {
    width: 100%;
    padding: 4px 8px;
}

/* COMPOSANT DESCRIPTION */

.grille-description-wrapper {
    display: contents;
}

    .grille-description-wrapper .tis-menu-item-toolbar {
        width: 100%;
        padding: 4px 8px;
    }

.grille-description-header {
    grid-column: 4;
    grid-row: 1;
    background-color: var(--FondColonneMois);
    color: white;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
    font-size: clamp(0.8rem, 1.3dvh, 1.2rem);
    min-height: 0;
    position: relative;
    width: 200px;
    align-content: center;
}

    .grille-description-header p {
        margin: 0;
        text-align: center;
    }

.grille-description-container {
    grid-column: 4;
    grid-row: 2;
    width: 200px;
}

.menu-description-header-horizontal .tis-menu-bar .tis-menu-root {
    box-sizing: border-box;
    padding: 2px 5px 2px 5px;
    margin: 2px 5px 2px 2px;
    border: 1px solid var(--CouleurTIS);
    border-radius: 5px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-description-header-horizontal {
    display: flex;
}

    .menu-description-header-horizontal .tis-dropdown {
        min-width: 150px;
        border: none;
        box-shadow: none;
    }

.grille-description-block {
    display: grid;
    border-bottom: 1px solid #ccc;
    min-height: 0;
}

.grille-description-cell {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
}

    .grille-description-cell .evt-desc-html {
        grid-template-columns: none;
        white-space: break-spaces;
    }

    .grille-description-cell::-webkit-scrollbar {
        width: 6px;
    }

    .grille-semaine-cell-jour,
    .grille-semaine-cell-label,
    .grille-prevu-reel-cell,
    .grille-individu-cell {
        min-height: 0;
        overflow: hidden;
        padding: 0 5px;
    }

/* DATAGRID */

/* --- EXPANDER --- */

.tis-expander-container {
    margin-bottom: 15px;
}

details {
    width: 100%;
}

summary {
    display: flex;
    align-items: center;
    padding: 4px 5px;
    background-color: var(--CouleurBackgroundTIS);
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    list-style: none;
    gap: 5px;
}

    summary:hover > :first-child {
        border-color: deepskyblue;
    }

.expander-icon {
    border: 1px solid black;
    border-radius: 15px;
    background-color: white;
    transition: transform 0.2s ease-in-out;
    max-width: 20px;
    max-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .expander-icon img {
        max-width: 20px;
        max-height: 20px;
    }

.expanders-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
    gap: 2px;
}

.tis-expander {
    display: flex;
    flex-direction: column;
    margin: 0;
    z-index: 10;
}

    .tis-expander[open] {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .tis-expander summary {
        background-color: var(--CouleurTIS);
        color: white;
        font-size: 1.3rem;
    }

    .tis-expander .expander-content {
        overflow-y: auto;
        min-height: 0;
    }

.tis-expander-ressource {
    margin: 0;
}

    .tis-expander-ressource:not([open]) {
        flex: 0 0 auto;
    }

    .tis-expander-ressource[open] {
        flex: 0 1 auto;
        min-height: 0;
        display: grid;
        grid-template-rows: max-content minmax(0, 1fr);
    }

    .tis-expander-ressource:first-child[open] {
        flex: 0 0 auto;
        display: block;
    }

    .tis-expander-ressource summary {
        background-color: var(--CouleurTIS);
        color: white;
        font-size: 1.3rem;
    }

.expander-content-ressource {
    overflow-y: auto;
    min-height: 0;
    height: 100%;
}

.tis-expander-container summary {
    background-color: initial;
    color: initial;
    font-size: initial;
}

details[open] > summary .expander-icon img {
    transform: rotate(180deg);
    transition: transform 0.2s;
}

.tis-datagrid {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--FontTIS);
    font-size: 0.9rem;
}

    .tis-datagrid th {
        background-color: var(--FondColonneMois);
        color: white;
        padding: 8px;
        border: 1px solid #ccc;
        font-weight: normal;
    }

    .tis-datagrid td {
        padding: 6px 8px;
        border: 1px solid #ccc;
        color: var(--CouleurTextLabel);
    }

    .tis-datagrid tbody tr:nth-child(even) {
        background-color: var(--FondColonneSemaineProchaine);
    }

    .tis-datagrid tbody tr:nth-child(odd) {
        background-color: white;
    }

    .tis-datagrid tbody tr:hover {
        background-color: var(--FondRowModify);
    }

.tis-row-selected {
    background-color: var(--FondRowModify) !important;
    color: white !important;
}

/* PLANNING SEMAINE */
.planning-master-layout {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    min-height: 0;
}

.planning-viewport {
    width: 100%;
    min-height: 0;
}

.viewport-header {
    overflow-y: scroll;
    overflow-x: hidden;
    flex-shrink: 0;
}

    .viewport-header::-webkit-scrollbar-thumb {
        background: transparent;
    }

    .viewport-header::-webkit-scrollbar-track {
        background: transparent;
    }

.viewport-individus {
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.viewport-lieux {
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
}

.planning-semaine-container {
    display: grid;
    width: 100%;
}

.planning-splitter {
    height: 10px;
    background-color: darkgray;
    cursor: row-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid black;
    border-bottom: 1px solid black;
    z-index: 10;
    flex-shrink: 0;
}

.splitter-handle {
    width: 40px;
    height: 4px;
    background-color: #888;
    border-radius: 2px;
}

.page-container.is-dragging {
    cursor: row-resize !important;
    user-select: none;
}

    .page-container.is-dragging * {
        cursor: row-resize !important;
        user-select: none;
    }

.planning-coin {
    border: 1px solid black;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    background: var(--FondColonneMois);
}

.case-horizontal-grille-semaine {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-top: 1px solid black;
    border-right: 2px solid black;
    border-bottom: none;
    border-left: none;
    overflow: hidden;
    white-space: nowrap;
}

.planning-label-jour {
    grid-column: 2;
    text-align: center;
}

.img-grille-semaine-planning {
    grid-column: 3;
    justify-self: end;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .img-grille-semaine-planning img {
        max-height: 24px;
        max-width: 24px;
    }

.planning-case-horaires {
    border-bottom: 2px solid black;
    border-right: 1px solid black;
    border-top: none;
    border-left: none;
    text-align: center;
}

    .planning-case-horaires:has(+ .case-horizontal-grille-semaine) {
        border-right: 2px solid black;
    }

.planning-label-horaire {
    padding: 0 4px;
    font-size: 10px;
}

.planning-case-individu {
    border-left: 1px solid black;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    border-top: none;
    padding: 2px;
    align-content: center;
    min-height: 50px;
}

.planning-case-lieu {
    border-left: 1px solid black;
    border-right: 2px solid black;
    border-bottom: 1px solid black;
    border-top: 1px solid black;
    padding: 2px;
    align-content: center;
    min-height: 50px;
}


.planning-case {
    border-right: 1px solid black;
    border-bottom: 2px solid black;
}

.planning-creneau-box {
    background-color: #ffffff;
    border: 1px solid #777;
    margin: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
    padding: 2px 0;
    font-size: 10px;
    box-shadow: 2px 1px 2px black, var(--inner-shadow);
}

.creneau-lieu {
    font-weight: bold;
    line-height: 1.2;
}

.creneau-heure {
    font-size: 10px;
    color: #333;
    line-height: 1.2;
}

/* AGENDA */

.agenda-master-layout {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    min-height: 0;
}

.agenda-viewport {
    overflow: auto;
}

.agenda-container {
    display: grid;
    width: 100%;
}

.agenda-creneau-box {
    background-color: #ffffff;
    border: 1px solid #777;
    border-radius: 5px;
    margin: 1px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 10px;
    box-shadow: 2px 1px 2px black, var(--inner-shadow);
}

.agenda-case {
    border-right: 1px solid black;
    border-bottom: 2px solid black;
}

.case-agenda-grille-semaine {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border-top: 1px solid black;
    border-right: 2px solid black;
    border-bottom: none;
    border-left: none;
    overflow: hidden;
    white-space: nowrap;
}

/* SCROLLBAR */
html, body {
    scrollbar-gutter: stable;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--CouleurTIS) transparent;
}

    *::-webkit-scrollbar {
        width: 12px;
        height: 12px;
        background-color: transparent;
    }

    *::-webkit-scrollbar-track {
        background-color: transparent;
        margin: 2px;
    }

    *::-webkit-scrollbar-thumb {
        background-color: #B0B0B0;
        border-radius: 5px;
        border: 3px solid transparent;
        background-clip: content-box;
    }

        *::-webkit-scrollbar-thumb:hover {
            background-color: #7A7A7A;
            border: 2px solid transparent;
        }

    *::-webkit-scrollbar-corner {
        background-color: transparent;
    }

.dark-mode * {
    scrollbar-color: #606060 transparent;
}

    .dark-mode *::-webkit-scrollbar-thumb {
        background-color: #606060;
    }

        .dark-mode *::-webkit-scrollbar-thumb:hover {
            background-color: #909090;
        }