/* Style de base pour les onglets myTab */
myTab{
    width:100%
}
myTabHeader {
    display: flex;
    border-bottom: 2px solid var(--zen-theme-border, #cfd8dc);
    margin-bottom: 0.5rem;
    width: 100%;
    flex-wrap: wrap;
}

    myTabHeader button {
        background: transparent;
        border: none;
        padding: 8px 16px;
        cursor: pointer;
        font: 14px/1.4 Segoe UI, Arial, sans-serif;
        color: var(--zen-theme-text, #455a64);
        border-bottom: 2px solid transparent;
        transition: all 0.2s ease;
        border-radius: 0;
        justify-content: space-between;
    }

        myTabHeader button:hover {
            color: var(--zen-theme-action, #0d47a1);
        }

        myTabHeader button.active {
            color: var(--zen-theme-selection-accent, #0d47a1);
            font-weight: 600;
            border-bottom-color: var(--zen-theme-selection-accent, #1976d2);
        }

myTabItem {
    /*display: none;
    padding: 8px;
    width: 100%;
    height: calc(100% - 35px);*/ /* tabHeader en moins*/
    display: flex; /* toujours flex */
    flex-direction: column;
    flex: 1 1 auto; /* prend la place dispo */
    min-height: 0; /* 🔑 autorise le scroll */
    overflow: hidden;
}

tabItem {
    display: flex;
    width: -webkit-fill-available;
    flex-direction: column;
    gap: 0.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* 🔑 encore */
    overflow-y: auto;
    inset: 0;
    contain: size
}


    myTabItem[style*="display: block"] {
        animation: fadeIn 0.25s ease-in;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

tabitem.inactive {
    height: 0;
    overflow: hidden;
    display: none;
}

tabitem.active {
    height: auto;
    overflow: auto;
    position: relative;
}

mytabitem.inactive {
    height: 0;
    overflow: hidden;
    display: none;
}

mytabitem.active {
    height: auto;
    overflow: auto;
    position: relative;
}



.app-mobile tabsmodule tabstrip {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    flex-wrap: wrap;
}

    .app-mobile tabsmodule tabstrip::-webkit-scrollbar {
        display: none;
    }

.app-mobile tabheader {
    flex: 0 0 auto;
    white-space: nowrap;
}
.app-desktop tabsmodule tabstrip {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.app-desktop tabheader {
    white-space: normal;
}

/* ZEN_MYTAB_UNIFIED_R1
   Canonical Zen tab visual contract.
   Reference: the Settings navigation validated in Solvea.
*/
:root {
    --zen-tab-surface: var(--zen-theme-surface-muted, #f8fafc);
    --zen-tab-border: var(--zen-theme-border, #e5e7eb);
    --zen-tab-text: var(--zen-theme-text, #374151);
    --zen-tab-hover-bg: var(--zen-theme-hover-bg, #e9f4ff);
    --zen-tab-active-bg: var(--zen-theme-selection-bg, #e8f1fb);
    --zen-tab-active-text: var(--zen-theme-selection-text, #0f5f9d);
    --zen-tab-indicator: var(--zen-theme-selection-accent, #0f6cbd);
    --zen-tab-radius: 0px;
    --zen-tab-font-size: 14px;
}

mytab > mytabheader {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--zen-tab-border);
    background: var(--zen-tab-surface);
    box-sizing: border-box;
    flex-wrap: nowrap;
}

mytab > mytabheader > tabactions {
    display: flex;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

mytab > mytabheader > tabactions::-webkit-scrollbar {
    display: none;
}

mytab > mytabheader > tabactions > button {
    box-sizing: border-box;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex: 0 0 auto;
    margin: 2px 0;
    padding: 9px 11px;
    border: 0;
    border-radius: var(--zen-tab-radius);
    background: transparent;
    color: var(--zen-tab-text);
    font-family: var(--zen-ctrl-font-family, "Segoe UI", Arial, sans-serif);
    font-size: var(--zen-tab-font-size);
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

mytab > mytabheader > tabactions > button:hover {
    background: var(--zen-tab-hover-bg);
}

mytab > mytabheader > tabactions > button.active {
    background: var(--zen-tab-active-bg);
    color: var(--zen-tab-active-text);
    font-weight: 600;
    box-shadow: inset 0 -3px 0 var(--zen-tab-indicator);
}

/* Neutralize historical app-level underline pseudo-element. */
mytab > mytabheader > tabactions > button::after {
    content: none;
    display: none;
}

mytab > mytabheader > tabactions > button i {
    width: 18px;
    text-align: center;
}

/* Ribbon keeps the same visual language in a compact layout variant. */
mytab.ribbon > mytabheader {
    border-bottom: 0;
    background: transparent;
}

mytab.ribbon > mytabheader > tabactions > button {
    min-height: 30px;
    margin: 0;
    padding: 6px 10px;
    font-size: var(--zen-ctrl-font-size, 13px);
}

mytab.ribbon > mytabheader > tabactions > button.active {
    box-shadow: inset 0 -2px 0 var(--zen-tab-indicator);
}

/* Sidebar is a layout variant, not a different visual style. */
mytab.zen-tabs-sidebar {
    display: flex;
    flex-direction: row;
    min-width: 0;
    min-height: 0;
}

mytab.zen-tabs-sidebar > mytabheader {
    width: 210px;
    flex: 0 0 210px;
    align-items: stretch;
    flex-direction: column;
    padding: 18px 12px;
    border-right: 1px solid var(--zen-tab-border);
    border-bottom: 0;
}

mytab.zen-tabs-sidebar > mytabheader > tabactions {
    width: 100%;
    flex-direction: column;
    overflow: visible;
}

mytab.zen-tabs-sidebar > mytabheader > tabactions > button {
    width: 100%;
}

mytab.zen-tabs-sidebar > mytabheader > tabactions > button.active {
    box-shadow: inset 3px 0 0 var(--zen-tab-indicator);
}

mytab.zen-tabs-sidebar > mytabitem {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

/* Module-tab host layout.
   tabsmodule is part of the Zen tab control contract, not application CSS. */
tabsmodule {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--zen-theme-border, #dcdcdc);
    border-radius: 6px;
    background: var(--zen-theme-surface, white);
    margin-right: 8px;
    width: 140px;
    padding: 4px 0;
}

.app-desktop tabsmodule {
    padding: 8px 0 8px 8px;
    background: var(--zen-theme-surface-muted, #F7F9FD);
}

tabsmodule.mobile {
    border: none;
    box-shadow: none;
    border-radius: 0px;
    flex-direction: row;
    margin-bottom: 0px;
    display: flex;
    background: transparent;
    width: 100%;
    border-bottom: 2px solid var(--zen-theme-border, #cfd8dc);
}
/* Module tab-header structure.
   Visual states remain in the historical stylesheet until R2F9B. */
tabheader {
    margin: 2px 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--zen-theme-text-muted, #666);
    font-weight: 500;
    transition: background 0.15s ease;
}

.app-desktop tabheader {
    margin: 0 8px 6px 0;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.app-desktop tabheader > div {
    min-height: 38px;
    display: flex;
    align-items: center;
}

tabheader > div {
    display: flex;
    align-items: center;
    gap: 6px;
}
/* Module tab-header visual states and labels.
   Values migrated from the historical application stylesheet unchanged.
   Hover intensity is intentionally NOT changed in this ownership lot. */
tabheader:hover {
    background: var(--zen-tab-hover-bg);
}

tabheader.selected {
    background: var(--zen-theme-selection-bg, #e9f4ff);
    box-shadow: inset 4px 0 0 var(--zen-theme-selection-accent, #0F6CB7);
}

.app-desktop tabheader.selected {
    border-radius: 0;
}

.app-mobile tabheader.selected {
    background: var(--zen-theme-selection-bg, #e9f4ff);
    box-shadow: none;
}

tabsmodule.mobile tabheader {
    color: var(--zen-theme-text, #455a64);
    background: transparent;
    align-content: center;
    border-radius: 0px;
}

tabsmodule.mobile tabheader.selected {
    color: var(--zen-theme-selection-accent, #0d47a1);
    font-weight: 600;
    background: transparent;
    border-bottom: 2px solid var(--zen-theme-selection-accent, #1976d2);
    border-radius: 0px;
    align-content: center;
}

.app-mobile tabsmodule .lbTab {
    margin-right: 4px;
    white-space: nowrap;
}

.app-desktop tabsmodule .lbTab {
    margin-right: 4px;
    white-space: wrap;
}
/* Legacy module tabs: same visual contract while runtime stays untouched in R1. */
.app-desktop tabsmodule > tabstrip > tabheader {
    box-sizing: border-box;
    min-height: 42px;
    display: flex;
    align-items: center;
    margin: 2px 8px 2px 0;
    padding: 9px 11px;
    border-radius: var(--zen-tab-radius);
    background: transparent;
    color: var(--zen-tab-text);
    font-family: var(--zen-ctrl-font-family, "Segoe UI", Arial, sans-serif);
    font-size: var(--zen-tab-font-size);
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-desktop tabsmodule > tabstrip > tabheader:hover {
    background: var(--zen-tab-hover-bg);
}

.app-desktop tabsmodule > tabstrip > tabheader.selected {
    border-radius: var(--zen-tab-radius);
    background: var(--zen-tab-active-bg);
    color: var(--zen-tab-active-text);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--zen-tab-indicator);
}

.app-mobile tabsmodule > tabstrip > tabheader {
    box-sizing: border-box;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0 2px;
    padding: 8px 10px;
    border-radius: var(--zen-tab-radius);
    background: transparent;
    color: var(--zen-tab-text);
    font-family: var(--zen-ctrl-font-family, "Segoe UI", Arial, sans-serif);
    font-size: var(--zen-tab-font-size);
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
}

.app-mobile tabsmodule > tabstrip > tabheader:hover {
    background: var(--zen-tab-hover-bg);
}

.app-mobile tabsmodule > tabstrip > tabheader.selected {
    border-radius: var(--zen-tab-radius);
    background: var(--zen-tab-active-bg);
    color: var(--zen-tab-active-text);
    font-weight: 600;
    box-shadow: inset 0 -3px 0 var(--zen-tab-indicator);
}

@media (max-width: 760px) {
    mytab.zen-tabs-sidebar {
        flex-direction: column;
    }

    mytab.zen-tabs-sidebar > mytabheader {
        width: 100%;
        flex: 0 0 auto;
        padding: 10px 8px 8px;
        border-right: 0;
        border-bottom: 1px solid var(--zen-tab-border);
    }

    mytab.zen-tabs-sidebar > mytabheader > tabactions {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    mytab.zen-tabs-sidebar > mytabheader > tabactions > button {
        width: auto;
        min-height: 38px;
        margin: 0;
        padding: 8px 10px;
    }

    mytab.zen-tabs-sidebar > mytabheader > tabactions > button.active {
        box-shadow: inset 0 -3px 0 var(--zen-tab-indicator);
    }
}
/* ZEN_MYTAB_UNIFIED_R1_END */

/* ZEN_MYTAB_MODULE_STRUCTURE_R2B
   Module tabs now use mytabheader/tabactions instead of tabstrip.
   Keep the previous module-tab layout exactly while the old tabstrip
   selectors remain temporarily as backward-compatible CSS.
*/
tabsmodule > mytabheader.module-tabs-header {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    flex-wrap: nowrap;
}

tabsmodule > mytabheader.module-tabs-header > tabactions.module-tabs-actions {
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
}

.app-mobile tabsmodule > mytabheader.module-tabs-header > tabactions.module-tabs-actions {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    flex-wrap: wrap;
}

.app-mobile tabsmodule > mytabheader.module-tabs-header > tabactions.module-tabs-actions::-webkit-scrollbar {
    display: none;
}

.app-desktop tabsmodule > mytabheader.module-tabs-header > tabactions.module-tabs-actions {
    display: flex;
    flex-direction: column;
    overflow: visible;
    flex-wrap: nowrap;
}

/* ZEN_MYTAB_DESKTOP_HORIZONTAL_DENSITY_R1
   Ordinary horizontal tabs on desktop are a compact layout variant.
   Visual language remains shared with the canonical myTab.
   Sidebar Settings keeps its roomy navigation height.
   Ribbon keeps its own compact 30px variant.
   Mobile keeps its touch-friendly sizing.
*/
@media (min-width: 761px) {
    mytab:not(.ribbon):not(.zen-tabs-sidebar)
        > mytabheader
        > tabactions
        > button {
        min-height: 30px;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 5px;
        padding-bottom: 5px;
    }
}
