/* Solartech CRM — Custom CSS Components */

/* ============ TILES MODULES ============ */
.st-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    width: 100%;
}
.st-tile {
    display: block;
    padding: 1.25rem;
    border-radius: 0.75rem;
    color: white;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    transition: transform .15s, box-shadow .15s;
    font-family: "Public Sans", sans-serif;
}
.st-tile:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.st-tile__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.st-tile__icon {
    font-size: 2rem;
    line-height: 1;
}
.st-tile__badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: rgba(255,255,255,.18);
    padding: .2rem .55rem;
    border-radius: 9999px;
    color: white;
}
.st-tile__title {
    font-family: "Exo", sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 .25rem 0;
    line-height: 1.2;
    color: white;
}
.st-tile__desc {
    font-size: 0.875rem;
    opacity: .92;
    line-height: 1.25;
    margin: 0;
    color: white;
}

/* ============ NEWS BOARD ============ */
.st-news-board {
    width: 100%;
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border: 1px solid #E4E4E4;
    font-family: "Public Sans", sans-serif;
}
.st-news-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #AFCA0B;
}
.st-news-title {
    font-family: "Exo", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0E121D;
    margin: 0;
}
.st-news-link {
    font-size: 0.85rem;
    color: #AFCA0B;
    font-weight: 600;
    text-decoration: none;
}
.st-news-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scroll-snap-type: x mandatory;
}
.st-news-card {
    flex: 0 0 320px;
    scroll-snap-align: start;
    display: block;
    padding: 1.25rem;
    border-radius: 0.75rem;
    background: #F8F8F8;
    border: 1px solid #E4E4E4;
    text-decoration: none;
    color: inherit;
    transition: all .2s;
}
.st-news-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.st-news-card__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.st-news-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.25rem;
    color: white;
}
.st-news-date {
    font-size: 0.75rem;
    color: #72849B;
    font-weight: 500;
}
.st-news-card h3 {
    font-family: "Exo", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0E121D;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}
.st-news-card p {
    font-size: 0.875rem;
    color: #4D5765;
    line-height: 1.5;
    margin: 0;
}

/* ============ MODULES SECTION TITLE ============ */
.st-section-title {
    font-family: "Exo", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0E121D;
    margin: 0 0 1rem 0;
}

/* ============ COULEURS PAR GROUPE ============ */
.st-tile--crm          { background: linear-gradient(135deg, #FCC207 0%, #FCC207cc 100%); }
.st-tile--production   { background: linear-gradient(135deg, #93C01F 0%, #93C01Fcc 100%); }
.st-tile--logistics    { background: linear-gradient(135deg, #8B5E3C 0%, #8B5E3Ccc 100%); }
.st-tile--hr           { background: linear-gradient(135deg, #E63946 0%, #E63946cc 100%); }
.st-tile--finance      { background: linear-gradient(135deg, #27AE60 0%, #27AE60cc 100%); }
.st-tile--integrations { background: linear-gradient(135deg, #0E8C8C 0%, #0E8C8Ccc 100%); }
.st-tile--analytics    { background: linear-gradient(135deg, #16A085 0%, #16A085cc 100%); }
.st-tile--system       { background: linear-gradient(135deg, #6C3483 0%, #6C3483cc 100%); }

/* Badges news : couleurs par badge_color via classes utilitaires */
.st-news-badge--FFB539 { background: #FFB539; }
.st-news-badge--38aae1 { background: #38aae1; }
.st-news-badge--dc3545 { background: #dc3545; }
.st-news-badge--AFCA0B { background: #AFCA0B; }

/* ============ NEWS TICKER VERTICAL ============ */
.st-ticker {
    width: 100%;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #E4E4E4;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
    font-family: 'Public Sans', sans-serif;
}
.st-ticker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #AFCA0B;
    background: linear-gradient(to right, #ffffff, #F8F8F8);
}
.st-ticker__title {
    font-family: 'Exo', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0E121D;
    margin: 0;
}
.st-ticker__controls { display: flex; gap: 0.35rem; }
.st-ticker__btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: #F8F8F8;
    border: 1px solid #E4E4E4;
    cursor: pointer;
    font-size: 1rem;
    color: #4D5765;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.st-ticker__btn:hover { background: #AFCA0B; color: white; border-color: #AFCA0B; }
.st-ticker__viewport {
    height: 360px;
    overflow: hidden;
    position: relative;
}
.st-ticker__track {
    transition: transform .25s ease-out;
    will-change: transform;
}
.st-ticker__card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    height: 130px;
    border-bottom: 1px solid #F0F0F0;
}
.st-ticker__card-content { flex: 1; }
.st-ticker__card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.st-ticker__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1rem;
    color: white;
}
.st-ticker__date { font-size: 0.75rem; color: #72849B; font-weight: 600; text-transform: uppercase; }
.st-ticker__card-title {
    font-family: 'Exo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #0E121D;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}
.st-ticker__card-excerpt {
    font-size: 0.85rem;
    color: #4D5765;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.st-ticker__card-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.st-ticker__card-image--FFB539 { background: linear-gradient(135deg, #FFB539, #FFB53988); }
.st-ticker__card-image--38aae1 { background: linear-gradient(135deg, #38aae1, #38aae188); }
.st-ticker__card-image--dc3545 { background: linear-gradient(135deg, #dc3545, #dc354588); }
.st-ticker__card-image--AFCA0B { background: linear-gradient(135deg, #AFCA0B, #AFCA0B88); }
.st-ticker__card-image--16A085 { background: linear-gradient(135deg, #16A085, #16A08588); }

/* ============ WEATHER WIDGET ============ */
.st-weather {
    width: 100%;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #E4E4E4;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
    font-family: 'Public Sans', sans-serif;
}
.st-weather__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #38aae1;
    background: linear-gradient(to right, #ffffff, #F8F8F8);
}
.st-weather__title {
    font-family: 'Exo', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0E121D;
    margin: 0;
}
.st-weather__link {
    font-size: 0.85rem;
    color: #38aae1;
    font-weight: 600;
    text-decoration: none;
}
.st-weather__widget { padding: 1rem; height: 360px; max-height: 360px; overflow: auto; }

/* ============ DASHBOARD LAYOUT ============ */
.st-dashboard { display: flex; flex-direction: column; gap: 1.5rem; }
.st-dashboard__section { width: 100%; }
.st-dashboard__title {
    font-family: 'Exo', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0E121D;
    margin: 0 0 1rem 0;
}
.st-dashboard__row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 1024px) { .st-dashboard__row { grid-template-columns: 1fr; } }


/* ============ SCROLLBAR SOLARTECH ============ */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
/* WebKit (Chrome / Edge / Safari) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background-color .2s ease;
}
/* Affichage : seulement quand on survole l'élément scrollable */
*:hover > ::-webkit-scrollbar-thumb,
*:hover::-webkit-scrollbar-thumb,
:hover::-webkit-scrollbar-thumb {
    background-color: rgba(175, 202, 11, 0.35);
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #AFCA0B !important;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:active {
    background-color: #38aae1 !important;
    background-clip: padding-box;
}
/* Firefox au survol */
*:hover {
    scrollbar-color: rgba(175, 202, 11, 0.35) transparent;
}
/* Boutons + coins invisibles */
::-webkit-scrollbar-button,
::-webkit-scrollbar-corner { display: none; }

/* ============ DASHBOARD : virer le header Filament natif ============ */
.fi-page.fi-dashboard-page > header.fi-header,
.fi-page > header.fi-header.fi-dashboard-header,
.fi-page > header.fi-header:has(h1:empty),
.fi-page > .fi-header:has(.fi-header-heading:empty) {
    display: none !important;
}
/* Picto tuile : plus gros pour mieux représenter */
.st-tile__icon {
    font-size: 2.5rem !important;
    line-height: 1;
}

/* ============ PAGE LOGIN — STYLE SOLARTECH.LU ============ */
/* Forcer pleine largeur (Filament wrappe en max-w-md par défaut) */
.fi-simple-page.fi-auth-login-page .fi-simple-main-ctn,
.fi-simple-page .fi-simple-main-ctn {
    max-width: none !important;
    width: 100vw !important;
    padding: 0 !important;
    background: transparent !important;
}
.fi-simple-page main.fi-simple-main {
    max-width: none !important;
    width: 100vw !important;
    height: 100vh !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}
.fi-simple-page .fi-simple-header,
.fi-simple-page .fi-simple-footer { display: none !important; }
.fi-simple-page body, body.fi-body.fi-panel-admin.fi-simple-page { padding: 0 !important; }
html.st-auth-page body { overflow: hidden; }

.st-login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    font-family: 'Public Sans', sans-serif;
}

/* Colonne gauche : formulaire */
.st-login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    background: #ffffff;
}
.st-login-form-inner {
    width: 100%;
    max-width: 460px;
}
.st-login-brand {
    text-align: center;
    margin-bottom: 3rem;
}
.st-login-brand img {
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
}
.st-login-tagline {
    font-family: 'Exo', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #38aae1;
    letter-spacing: .08em;
    margin: 0;
}

.st-login-form-title {
    font-family: 'Exo', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4D5765;
    margin: 0 0 1.25rem 0;
}

/* Force le bouton Filament en vert lime + arrondi */
.st-login-form .fi-btn,
.st-login-form button[type='submit'].fi-btn-color-primary {
    background-color: #AFCA0B !important;
    color: white !important;
    font-family: 'Exo', sans-serif !important;
    font-weight: 700 !important;
    border-radius: 9999px !important;
    padding: .85rem 2.5rem !important;
    font-size: 1rem !important;
    width: auto !important;
    min-width: 180px !important;
    transition: all .2s !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(175, 202, 11, .3) !important;
}
.st-login-form .fi-btn:hover {
    background-color: #9CB60A !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(175, 202, 11, .45) !important;
}

/* Inputs : rounded + bordures grises */
.st-login-form .fi-input,
.st-login-form input[type='email'],
.st-login-form input[type='password'],
.st-login-form input[type='text'] {
    border-radius: 9999px !important;
    border: 1px solid #E4E4E4 !important;
    padding: .75rem 1.25rem !important;
    font-family: inherit !important;
    background: #ffffff !important;
    transition: border-color .15s !important;
}
.st-login-form .fi-input:focus,
.st-login-form input:focus {
    border-color: #AFCA0B !important;
    box-shadow: 0 0 0 3px rgba(175, 202, 11, .15) !important;
    outline: none !important;
}

.st-login-footer {
    margin-top: 3rem;
    font-size: 0.75rem;
    color: #72849B;
    text-align: center;
}

/* Colonne droite : images PV + IRVE séparées par bandeau vert */
.st-login-visual-side {
    display: grid;
    grid-template-rows: 1fr 8px 1fr;
    height: 100vh;
}
.st-login-image-top, .st-login-image-bottom {
    background-size: cover;
    background-position: center;
}
.st-login-image-separator {
    background: #AFCA0B;
}

/* Barre fine bleue en bas de la page */
.st-login-layout::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: #38aae1;
    z-index: 100;
}

/* Responsive : mobile = 1 colonne, image en haut */
@media (max-width: 768px) {
    .st-login-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    body { overflow: auto; }
    .st-login-visual-side {
        height: 30vh;
    }
}

/* ============================================================
   THÈME 3 : DARK / GRIS REPOSANT
   Activé via class .theme-gray sur <html>
   Objectif : faible contraste, fond gris foncé non noir,
   textes gris clair non blanc, bordures tuiles à teinte originale
   ============================================================ */
html.theme-gray { color-scheme: dark; }

html.theme-gray body,
html.theme-gray .fi-body,
html.theme-gray .fi-main {
    background-color: #1f1f1f !important;
    color: #c8c8c8 !important;
}

html.theme-gray .fi-main-ctn,
html.theme-gray .fi-page {
    background-color: #1f1f1f !important;
}

/* Sidebar Filament */
html.theme-gray .fi-sidebar,
html.theme-gray .fi-sidebar-nav,
html.theme-gray .fi-topbar-ctn,
html.theme-gray .fi-topbar > nav {
    background-color: #262626 !important;
    border-color: #333 !important;
    color: #c8c8c8 !important;
}
html.theme-gray .fi-sidebar-item-button,
html.theme-gray .fi-sidebar-group-label {
    color: #b5b5b5 !important;
}
html.theme-gray .fi-sidebar-item-button:hover {
    background-color: #303030 !important;
    color: #ffffff !important;
}
html.theme-gray .fi-sidebar-item.fi-active .fi-sidebar-item-button {
    background-color: rgba(175, 202, 11, .15) !important;
    color: #AFCA0B !important;
}

/* Topbar Solartech custom — la zone logo devient noire */
html.theme-gray .st-header__logo {
    background: #0a0a0a !important;
}
html.theme-gray .st-header__green {
    background: linear-gradient(135deg, #5e7506 0%, #4a5e05 100%) !important;
}
html.theme-gray .st-header__blue {
    background: linear-gradient(135deg, #1d6a89 0%, #155670 100%) !important;
}

/* Tuiles dashboard : fond gris foncé + bordure couleur groupe */
html.theme-gray .st-tile {
    color: #d8d8d8 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35) !important;
    border-width: 2px !important;
    border-style: solid !important;
}
html.theme-gray .st-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .55) !important;
}
html.theme-gray .st-tile--crm          { background: #2a2a2a !important; border-color: #FCC207 !important; }
html.theme-gray .st-tile--production   { background: #2a2a2a !important; border-color: #93C01F !important; }
html.theme-gray .st-tile--logistics    { background: #2a2a2a !important; border-color: #B57F4F !important; }
html.theme-gray .st-tile--hr           { background: #2a2a2a !important; border-color: #E63946 !important; }
html.theme-gray .st-tile--finance      { background: #2a2a2a !important; border-color: #27AE60 !important; }
html.theme-gray .st-tile--integrations { background: #2a2a2a !important; border-color: #29B6B6 !important; }
html.theme-gray .st-tile--analytics    { background: #2a2a2a !important; border-color: #16A085 !important; }
html.theme-gray .st-tile--system       { background: #2a2a2a !important; border-color: #9B6FB8 !important; }

html.theme-gray .st-tile h3,
html.theme-gray .st-tile .st-tile__name {
    color: #ececec !important;
}
html.theme-gray .st-tile .st-tile__desc,
html.theme-gray .st-tile p {
    color: #a8a8a8 !important;
}

/* Widgets news + météo */
html.theme-gray .st-ticker,
html.theme-gray .st-weather,
html.theme-gray .st-news-board {
    background: #262626 !important;
    color: #d8d8d8 !important;
    border: 1px solid #383838 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3) !important;
}
html.theme-gray .st-ticker-item,
html.theme-gray .st-news-board__item {
    background: #2f2f2f !important;
    border-color: #404040 !important;
    color: #d8d8d8 !important;
}
html.theme-gray .st-ticker-item__title {
    color: #ececec !important;
}
html.theme-gray .st-ticker-item__date {
    color: #909090 !important;
}

/* Cards Filament génériques (resources tables, formulaires) */
html.theme-gray .fi-section,
html.theme-gray .fi-ta,
html.theme-gray .fi-fo,
html.theme-gray .fi-card,
html.theme-gray .fi-modal-window {
    background-color: #262626 !important;
    border-color: #383838 !important;
    color: #d8d8d8 !important;
}
html.theme-gray .fi-section-header,
html.theme-gray .fi-header-heading,
html.theme-gray .fi-section-heading {
    color: #ececec !important;
}

/* Tables */
html.theme-gray .fi-ta-row {
    border-color: #333 !important;
}
html.theme-gray .fi-ta-row:hover {
    background-color: #2e2e2e !important;
}
html.theme-gray .fi-ta-header-cell,
html.theme-gray .fi-ta-cell {
    color: #c8c8c8 !important;
    background-color: transparent !important;
}

/* Inputs */
html.theme-gray .fi-input,
html.theme-gray .fi-select-input,
html.theme-gray .fi-textarea,
html.theme-gray input[type="text"],
html.theme-gray input[type="email"],
html.theme-gray input[type="password"],
html.theme-gray textarea,
html.theme-gray select {
    background-color: #2a2a2a !important;
    border-color: #404040 !important;
    color: #ececec !important;
}
html.theme-gray .fi-input:focus,
html.theme-gray input:focus,
html.theme-gray textarea:focus {
    border-color: #AFCA0B !important;
    box-shadow: 0 0 0 3px rgba(175, 202, 11, .2) !important;
}
html.theme-gray ::placeholder { color: #707070 !important; }

/* Boutons Filament */
html.theme-gray .fi-btn:not(.fi-color-primary):not(.fi-color-danger) {
    background-color: #333 !important;
    color: #ececec !important;
    border-color: #444 !important;
}
html.theme-gray .fi-btn:not(.fi-color-primary):not(.fi-color-danger):hover {
    background-color: #3d3d3d !important;
}

/* Avatar dropdown (portail) */
html.theme-gray .st-avatar-dropdown {
    background: #262626 !important;
    color: #ececec !important;
    border: 1px solid #383838 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .55) !important;
}
html.theme-gray .st-avatar-dropdown__item:hover {
    background: #303030 !important;
}
html.theme-gray .st-avatar-dropdown__divider {
    border-color: #383838 !important;
}

/* Scrollbar Solartech version gris */
html.theme-gray ::-webkit-scrollbar-thumb { background: #404040 !important; }
html.theme-gray ::-webkit-scrollbar-thumb:hover { background: #AFCA0B !important; }
html.theme-gray ::-webkit-scrollbar-track { background: transparent !important; }

/* Links & primary text accents */
html.theme-gray a:not(.fi-btn) { color: #B8D62E !important; }
html.theme-gray a:not(.fi-btn):hover { color: #C8E63E !important; }

/* MeteoLux iframe rester contenu lisible */
html.theme-gray .st-weather iframe {
    filter: brightness(.95) saturate(.85);
}

/* ============================================================
   THÈME GRIS — corrections selectors réels (post-vérif DOM)
   ============================================================ */

/* News ticker — bons selectors */
html.theme-gray .st-ticker,
html.theme-gray .st-ticker__viewport,
html.theme-gray .st-ticker__track,
html.theme-gray .st-ticker__card,
html.theme-gray .st-ticker__card-content,
html.theme-gray .st-ticker__card-head {
    background-color: transparent !important;
}
html.theme-gray .st-ticker {
    background-color: #262626 !important;
    border: 1px solid #383838 !important;
    color: #d8d8d8 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3) !important;
}
html.theme-gray .st-ticker__title { color: #ececec !important; }
html.theme-gray .st-ticker__card { 
    background-color: #2d2d2d !important; 
    border: 1px solid #3a3a3a !important;
}
html.theme-gray .st-ticker__card-title { color: #ececec !important; }
html.theme-gray .st-ticker__card-excerpt { color: #b0b0b0 !important; }
html.theme-gray .st-ticker__date { color: #909090 !important; }
html.theme-gray .st-ticker__btn { 
    color: #b0b0b0 !important; 
    background: #2a2a2a !important;
    border: 1px solid #404040 !important;
}
html.theme-gray .st-ticker__btn:hover { background: #353535 !important; color: #ececec !important; }

/* Sidebar items non-actifs : forcer un gris clair lisible */
html.theme-gray .fi-sidebar-item-button,
html.theme-gray .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button,
html.theme-gray .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button span,
html.theme-gray .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button svg {
    color: #c5c5c5 !important;
}
html.theme-gray .fi-sidebar-group-label,
html.theme-gray .fi-sidebar-group-button span {
    color: #a0a0a0 !important;
}
html.theme-gray .fi-sidebar-nav-groups {
    background-color: transparent !important;
}

/* Widget Météo : fond foncé + textes clairs (mais on garde l'iframe MeteoLux intact) */
html.theme-gray .st-weather,
html.theme-gray .st-weather--card-only-placeholder {
    background-color: #262626 !important;
    color: #d8d8d8 !important;
    border: 1px solid #383838 !important;
}

/* Le dashboard de Filament page wrapper */
html.theme-gray .fi-page,
html.theme-gray .fi-page-main,
html.theme-gray main.fi-main {
    background-color: #1f1f1f !important;
}

/* Header heading "Tableau de bord" éventuel + breadcrumbs */
html.theme-gray .fi-header-heading,
html.theme-gray .fi-breadcrumbs-item a,
html.theme-gray .fi-page-header * {
    color: #ececec !important;
}

/* ============================================================
   MODE SOMBRE v2 — Inspiré WowDash navy
   Palette : body #1f2937 / sidebar #273142 / cards #374151 / borders #4b5563
   Texte : #e5e7eb (primaire) · #9ca3af (secondaire) · accents Solartech #AFCA0B
   Cible class .dark sur <html> (Filament dark mode standard)
   ============================================================ */

/* Override la palette de fond Filament */
html.dark body,
html.dark .fi-body,
html.dark .fi-main,
html.dark .fi-page,
html.dark .fi-main-ctn,
html.dark main.fi-main {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
}

/* Sidebar plus claire que le body */
html.dark .fi-sidebar,
html.dark .fi-sidebar-nav,
html.dark .fi-topbar-ctn,
html.dark .fi-topbar > nav {
    background-color: #273142 !important;
    border-color: #4b5563 !important;
    color: #e5e7eb !important;
}
html.dark .fi-sidebar-item-button,
html.dark .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button,
html.dark .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button span,
html.dark .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button svg {
    color: #d1d5db !important;
}
html.dark .fi-sidebar-item-button:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}
html.dark .fi-sidebar-item.fi-active .fi-sidebar-item-button {
    background-color: rgba(175, 202, 11, .18) !important;
    color: #AFCA0B !important;
}
html.dark .fi-sidebar-group-label,
html.dark .fi-sidebar-group-button span {
    color: #9ca3af !important;
}

/* Topbar Solartech custom : on conserve les couleurs charte */
html.dark .st-header__logo { background: #1a1f2b !important; }
/* Vert/Bleu Solartech laissé en dark, mais légèrement assombri */
html.dark .st-header__green {
    background: linear-gradient(135deg, #87B30D 0%, #6E950A 100%) !important;
}
html.dark .st-header__blue {
    background: linear-gradient(135deg, #2E8FBE 0%, #1F719B 100%) !important;
}

/* Tuiles : fond card WowDash, bordure couleur groupe, garder identification visuelle */
html.dark .st-tile {
    color: #e5e7eb !important;
    border-width: 2px !important;
    border-style: solid !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .4) !important;
}
html.dark .st-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .55) !important;
}
html.dark .st-tile--crm          { background: linear-gradient(135deg, rgba(252,194,7,.22) 0%, #374151 65%) !important; border-color: #FCC207 !important; }
html.dark .st-tile--production   { background: linear-gradient(135deg, rgba(147,192,31,.22) 0%, #374151 65%) !important; border-color: #93C01F !important; }
html.dark .st-tile--logistics    { background: linear-gradient(135deg, rgba(181,127,79,.25) 0%, #374151 65%) !important; border-color: #B57F4F !important; }
html.dark .st-tile--hr           { background: linear-gradient(135deg, rgba(230,57,70,.22) 0%, #374151 65%) !important; border-color: #E63946 !important; }
html.dark .st-tile--finance      { background: linear-gradient(135deg, rgba(39,174,96,.22) 0%, #374151 65%) !important; border-color: #27AE60 !important; }
html.dark .st-tile--integrations { background: linear-gradient(135deg, rgba(41,182,182,.25) 0%, #374151 65%) !important; border-color: #29B6B6 !important; }
html.dark .st-tile--analytics    { background: linear-gradient(135deg, rgba(22,160,133,.22) 0%, #374151 65%) !important; border-color: #16A085 !important; }
html.dark .st-tile--system       { background: linear-gradient(135deg, rgba(155,111,184,.25) 0%, #374151 65%) !important; border-color: #9B6FB8 !important; }
html.dark .st-tile h3,
html.dark .st-tile .st-tile__name { color: #f3f4f6 !important; }
html.dark .st-tile p,
html.dark .st-tile .st-tile__desc { color: #b8bcc6 !important; }

/* Widget News Ticker */
html.dark .st-ticker {
    background-color: #273142 !important;
    border: 1px solid #4b5563 !important;
    color: #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35) !important;
}
html.dark .st-ticker__title { color: #f3f4f6 !important; }
html.dark .st-ticker__card {
    background-color: #374151 !important;
    border: 1px solid #4b5563 !important;
}
html.dark .st-ticker__card-title { color: #f3f4f6 !important; }
html.dark .st-ticker__card-excerpt { color: #b8bcc6 !important; }
html.dark .st-ticker__date { color: #9ca3af !important; }
html.dark .st-ticker__btn {
    background: #1f2937 !important;
    color: #d1d5db !important;
    border: 1px solid #4b5563 !important;
}
html.dark .st-ticker__btn:hover { background: #4b5563 !important; color: #ffffff !important; }

/* Widget Météo */
html.dark .st-weather {
    background-color: #273142 !important;
    border: 1px solid #4b5563 !important;
    color: #e5e7eb !important;
}
html.dark .st-weather iframe { filter: brightness(.92) saturate(.9); }

/* Cards Filament génériques */
html.dark .fi-section,
html.dark .fi-ta,
html.dark .fi-fo,
html.dark .fi-card,
html.dark .fi-modal-window {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
    color: #e5e7eb !important;
}
html.dark .fi-section-header,
html.dark .fi-header-heading,
html.dark .fi-section-heading,
html.dark .fi-page-header *,
html.dark .fi-breadcrumbs-item a { color: #f3f4f6 !important; }

/* Tables Filament */
html.dark .fi-ta-row { border-color: #4b5563 !important; }
html.dark .fi-ta-row:hover { background-color: #404a5e !important; }
html.dark .fi-ta-header-cell,
html.dark .fi-ta-cell {
    color: #e5e7eb !important;
    background-color: transparent !important;
}

/* Inputs */
html.dark .fi-input,
html.dark .fi-select-input,
html.dark .fi-textarea,
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark textarea,
html.dark select {
    background-color: #1f2937 !important;
    border-color: #4b5563 !important;
    color: #f3f4f6 !important;
}
html.dark .fi-input:focus,
html.dark input:focus,
html.dark textarea:focus {
    border-color: #AFCA0B !important;
    box-shadow: 0 0 0 3px rgba(175, 202, 11, .25) !important;
}
html.dark ::placeholder { color: #6b7280 !important; }

/* Boutons Filament (non primaires) */
html.dark .fi-btn:not(.fi-color-primary):not(.fi-color-danger):not(.fi-color-success) {
    background-color: #4b5563 !important;
    color: #f3f4f6 !important;
    border-color: #6b7280 !important;
}
html.dark .fi-btn:not(.fi-color-primary):not(.fi-color-danger):not(.fi-color-success):hover {
    background-color: #5b6573 !important;
}

/* Avatar dropdown */
html.dark .st-avatar-dropdown {
    background: #273142 !important;
    color: #f3f4f6 !important;
    border: 1px solid #4b5563 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .55) !important;
}
html.dark .st-avatar-dropdown__item:hover { background: #374151 !important; }
html.dark .st-avatar-dropdown__divider { border-color: #4b5563 !important; }

/* Scrollbar Solartech version dark navy */
html.dark ::-webkit-scrollbar-thumb { background: #4b5563 !important; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #AFCA0B !important; }
html.dark ::-webkit-scrollbar-track { background: transparent !important; }

/* Links / accents */
html.dark a:not(.fi-btn):not(.fi-sidebar-item-button) { color: #B8D62E !important; }
html.dark a:not(.fi-btn):not(.fi-sidebar-item-button):hover { color: #CDE34A !important; }

/* ============================================================
   Cohérence headers widgets Ticker + Météo en mode dark & gray
   Léger dégradé teinté + bordure inférieure colorée + titre clair
   ============================================================ */

/* ----- MODE DARK ----- */
html.dark .st-ticker__header {
    background: linear-gradient(135deg, rgba(175,202,11,.22) 0%, #273142 60%) !important;
    border-bottom-color: rgba(175,202,11,.55) !important;
    color: #f3f4f6 !important;
}
html.dark .st-ticker__header .st-ticker__title { color: #f3f4f6 !important; }

html.dark .st-weather__header {
    background: linear-gradient(135deg, rgba(56,170,225,.22) 0%, #273142 60%) !important;
    border-bottom-color: rgba(56,170,225,.55) !important;
    color: #f3f4f6 !important;
}
html.dark .st-weather__header .st-weather__title { color: #f3f4f6 !important; }
html.dark .st-weather__header .st-weather__link { color: #66c4ec !important; }

/* ----- MODE GRAY ----- */
html.theme-gray .st-ticker__header {
    background: linear-gradient(135deg, rgba(175,202,11,.18) 0%, #262626 60%) !important;
    border-bottom-color: rgba(175,202,11,.5) !important;
    color: #ececec !important;
}
html.theme-gray .st-ticker__header .st-ticker__title { color: #ececec !important; }

html.theme-gray .st-weather__header {
    background: linear-gradient(135deg, rgba(56,170,225,.18) 0%, #262626 60%) !important;
    border-bottom-color: rgba(56,170,225,.5) !important;
    color: #ececec !important;
}
html.theme-gray .st-weather__header .st-weather__title { color: #ececec !important; }
html.theme-gray .st-weather__header .st-weather__link { color: #66c4ec !important; }

/* ============================================================
   LOGIN PAGE — neutralisation x-filament-panels::page.simple
   Active uniquement quand <html class="st-auth-page">
   ============================================================ */
html.st-auth-page,
html.st-auth-page body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

/* Filament simple-page wrappers : faire sauter card + max-width */
html.st-auth-page .fi-simple-layout,
html.st-auth-page .fi-simple-page,
html.st-auth-page .fi-simple-main-ctn,
html.st-auth-page .fi-simple-main,
html.st-auth-page main,
html.st-auth-page main.fi-simple-main,
html.st-auth-page section.fi-section {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
    display: block !important;
}
html.st-auth-page .fi-simple-page-header,
html.st-auth-page .fi-simple-page-footer,
html.st-auth-page .fi-simple-page-logo,
html.st-auth-page .fi-simple-page-heading,
html.st-auth-page .fi-simple-page-sub-heading {
    display: none !important;
}

/* Le layout 2 colonnes du form login occupe tout l'écran */
html.st-auth-page .st-login-layout {
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
}

/* Le bouton Filament Connexion : reformer en "Login" arrondi vert ~ PDF */
html.st-auth-page .st-login-form .fi-form-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}
html.st-auth-page .st-login-form .fi-btn,
html.st-auth-page .st-login-form button[type='submit'] {
    background: #AFCA0B !important;
    color: #ffffff !important;
    font-family: 'Exo', sans-serif !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    padding: .75rem 2.5rem !important;
    font-size: 1rem !important;
    width: auto !important;
    min-width: 160px !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(175, 202, 11, .25) !important;
    text-transform: none !important;
}
html.st-auth-page .st-login-form button[type='submit']:hover {
    background: #9CB60A !important;
    box-shadow: 0 6px 14px rgba(175, 202, 11, .4) !important;
}

/* Inputs : compacts arrondis bord gris (style PDF) */
html.st-auth-page .st-login-form .fi-input-wrp,
html.st-auth-page .st-login-form .fi-input {
    border-radius: 6px !important;
    border: 1px solid #C8CDD4 !important;
    background: #ffffff !important;
    box-shadow: none !important;
}
html.st-auth-page .st-login-form input[type='email'],
html.st-auth-page .st-login-form input[type='password'],
html.st-auth-page .st-login-form input[type='text'] {
    border-radius: 6px !important;
    border: none !important;
    padding: .7rem 1rem !important;
    font-family: inherit !important;
    background: transparent !important;
    color: #0E121D !important;
    box-shadow: none !important;
}
html.st-auth-page .st-login-form .fi-input-wrp:focus-within {
    border-color: #AFCA0B !important;
    box-shadow: 0 0 0 3px rgba(175, 202, 11, .15) !important;
}

/* Labels : alignés à gauche, gris, comme dans le PDF */
html.st-auth-page .st-login-form .fi-fo-field-label,
html.st-auth-page .st-login-form label {
    color: #4D5765 !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    margin-bottom: .35rem !important;
}

/* Layout final 40 / 60 — comme le PDF */
html.st-auth-page .st-login-layout {
    display: grid !important;
    grid-template-columns: 40% 60% !important;
    background: #ffffff !important;
}
html.st-auth-page .st-login-form-side {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2rem 4rem !important;
    background: #ffffff !important;
}
html.st-auth-page .st-login-form-inner {
    width: 100% !important;
    max-width: 420px !important;
}

/* Logo + tagline conformes au PDF */
html.st-auth-page .st-login-brand { text-align: center; margin-bottom: 2.5rem; }
html.st-auth-page .st-login-brand img { max-width: 280px; margin: 0 auto 0.75rem; display: block; height: auto; }
html.st-auth-page .st-login-tagline {
    font-family: 'Exo', sans-serif; font-size: 1.25rem; font-weight: 700;
    color: #38aae1; letter-spacing: .08em; margin: 0;
}
html.st-auth-page .st-login-form-title {
    font-family: 'Public Sans', sans-serif; font-size: 1rem; font-weight: 500;
    color: #0E121D; margin: 0 0 1rem 0;
}

/* Colonne droite : 2 images empilées séparées par bandeau vert 10px */
html.st-auth-page .st-login-visual-side {
    display: grid !important;
    grid-template-rows: 1fr 10px 1fr !important;
    height: 100vh !important;
    width: 100% !important;
    overflow: hidden !important;
}
html.st-auth-page .st-login-image-top,
html.st-auth-page .st-login-image-bottom {
    background-size: cover !important;
    background-position: center !important;
    width: 100% !important;
    height: 100% !important;
}
html.st-auth-page .st-login-image-separator { background: #AFCA0B !important; }

/* Barre bleue fine en bas de l'écran */
html.st-auth-page::after {
    content: '';
    position: fixed; bottom: 0; left: 0;
    width: 100vw; height: 8px;
    background: #38aae1;
    z-index: 100;
}

/* Bandeau "se souvenir de moi" + bouton actions sur même ligne possible */
html.st-auth-page .fi-fo-checkbox {
    margin: .5rem 0 1rem 0;
}
html.st-auth-page .fi-fo-checkbox label { font-size: 0.85rem !important; color: #72849B !important; }

/* Footer copyright propre */
html.st-auth-page .st-login-footer {
    margin-top: 2.5rem !important;
    font-size: 0.75rem !important;
    color: #72849B !important;
    text-align: center !important;
}

/* Force le mode clair sur tout l'arbre login (même si dark hérite) */
html.st-auth-page * {
    color-scheme: light !important;
}
html.st-auth-page .fi-input,
html.st-auth-page input { color: #0E121D !important; }

/* ============================================================
   THÈME GRIS v2 — INTERMÉDIAIRE entre Light et Dark
   Palette slate : fonds gris-bleutés doux, textes sombres lisibles.
   Mode reposant pour les yeux SANS être un mode sombre.
   Le widget MeteoLux reste en config "dark" natif (html.dark conserv.)
   --
   Définit APRÈS l'ancien bloc theme-gray → surcharge tout.
   ============================================================ */

html.theme-gray { color-scheme: light !important; }

/* ----- Body / Main / Page wrappers ----- */
html.theme-gray body,
html.theme-gray .fi-body,
html.theme-gray .fi-main,
html.theme-gray .fi-main-ctn,
html.theme-gray .fi-page,
html.theme-gray .fi-page-main,
html.theme-gray main.fi-main {
    background-color: #94a3b8 !important;   /* slate-400 — fond intermédiaire */
    color: #0f172a !important;              /* slate-900 — texte sombre lisible */
}

/* ----- Sidebar — un cran plus claire que le body ----- */
html.theme-gray .fi-sidebar,
html.theme-gray .fi-sidebar-nav,
html.theme-gray .fi-topbar-ctn,
html.theme-gray .fi-topbar > nav {
    background-color: #cbd5e1 !important;   /* slate-300 */
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}
html.theme-gray .fi-sidebar-item-button,
html.theme-gray .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button,
html.theme-gray .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button span,
html.theme-gray .fi-sidebar-item:not(.fi-active) .fi-sidebar-item-button svg {
    color: #1e293b !important;              /* slate-800 */
}
html.theme-gray .fi-sidebar-item-button:hover {
    background-color: #b8c5d3 !important;   /* slate-300 plus foncé */
    color: #0f172a !important;
}
html.theme-gray .fi-sidebar-item.fi-active .fi-sidebar-item-button {
    background-color: rgba(175, 202, 11, .22) !important;
    color: #5b6907 !important;              /* vert Solartech foncé pour lisibilité */
}
html.theme-gray .fi-sidebar-group-label,
html.theme-gray .fi-sidebar-group-button span {
    color: #475569 !important;              /* slate-600 */
}
html.theme-gray .fi-sidebar-nav-groups { background-color: transparent !important; }

/* ----- Topbar custom Solartech : conserve la charte vert/bleu vive ----- */
html.theme-gray .st-header__logo { background: #ffffff !important; }
html.theme-gray .st-header__green {
    background: linear-gradient(135deg, #AFCA0B 0%, #93B30A 100%) !important;
}
html.theme-gray .st-header__blue {
    background: linear-gradient(135deg, #38aae1 0%, #2898cc 100%) !important;
}

/* ----- Tuiles dashboard — surface plus claire que body, bordure groupe ----- */
html.theme-gray .st-tile {
    color: #0f172a !important;
    border-width: 2px !important;
    border-style: solid !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12) !important;
}
html.theme-gray .st-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .22) !important;
}
html.theme-gray .st-tile--crm          { background: linear-gradient(135deg, rgba(252,194,7,.30) 0%, #e2e8f0 65%) !important; border-color: #FCC207 !important; }
html.theme-gray .st-tile--production   { background: linear-gradient(135deg, rgba(147,192,31,.30) 0%, #e2e8f0 65%) !important; border-color: #93C01F !important; }
html.theme-gray .st-tile--logistics    { background: linear-gradient(135deg, rgba(139,94,60,.30) 0%, #e2e8f0 65%) !important; border-color: #8B5E3C !important; }
html.theme-gray .st-tile--hr           { background: linear-gradient(135deg, rgba(230,57,70,.30) 0%, #e2e8f0 65%) !important; border-color: #E63946 !important; }
html.theme-gray .st-tile--finance      { background: linear-gradient(135deg, rgba(39,174,96,.30) 0%, #e2e8f0 65%) !important; border-color: #27AE60 !important; }
html.theme-gray .st-tile--integrations { background: linear-gradient(135deg, rgba(14,140,140,.30) 0%, #e2e8f0 65%) !important; border-color: #0E8C8C !important; }
html.theme-gray .st-tile--analytics    { background: linear-gradient(135deg, rgba(22,160,133,.30) 0%, #e2e8f0 65%) !important; border-color: #16A085 !important; }
html.theme-gray .st-tile--system       { background: linear-gradient(135deg, rgba(108,52,131,.30) 0%, #e2e8f0 65%) !important; border-color: #6C3483 !important; }
html.theme-gray .st-tile h3,
html.theme-gray .st-tile .st-tile__name { color: #0f172a !important; }
html.theme-gray .st-tile p,
html.theme-gray .st-tile .st-tile__desc { color: #475569 !important; }

/* ----- Widget Ticker News ----- */
html.theme-gray .st-ticker {
    background-color: #e2e8f0 !important;   /* slate-200 */
    border: 1px solid #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 6px rgba(15,23,42,.1) !important;
}
html.theme-gray .st-ticker__header {
    background: linear-gradient(135deg, rgba(175,202,11,.30) 0%, #e2e8f0 60%) !important;
    border-bottom-color: rgba(175,202,11,.65) !important;
}
html.theme-gray .st-ticker__title { color: #0f172a !important; }
html.theme-gray .st-ticker__card {
    background-color: #f1f5f9 !important;   /* slate-100 — encore plus claire */
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.theme-gray .st-ticker__card-title { color: #0f172a !important; }
html.theme-gray .st-ticker__card-excerpt { color: #475569 !important; }
html.theme-gray .st-ticker__date { color: #64748b !important; }
html.theme-gray .st-ticker__btn {
    background: #cbd5e1 !important;
    color: #1e293b !important;
    border: 1px solid #94a3b8 !important;
}
html.theme-gray .st-ticker__btn:hover { background: #AFCA0B !important; color: #fff !important; border-color: #AFCA0B !important; }

/* ----- Widget Météo : carte gris clair, mais on NE TOUCHE PAS le widget MeteoLux interne ----- */
html.theme-gray .st-weather {
    background-color: #e2e8f0 !important;
    border: 1px solid #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 6px rgba(15,23,42,.1) !important;
}
html.theme-gray .st-weather__header {
    background: linear-gradient(135deg, rgba(56,170,225,.30) 0%, #e2e8f0 60%) !important;
    border-bottom-color: rgba(56,170,225,.65) !important;
}
html.theme-gray .st-weather__title { color: #0f172a !important; }
html.theme-gray .st-weather__link { color: #1e6a9c !important; }
/* Le widget MeteoLux interne (.st-weather__widget = .meteolux-widget) reste avec son fond bleu cyan natif */

/* ----- Cards Filament génériques ----- */
html.theme-gray .fi-section,
html.theme-gray .fi-ta,
html.theme-gray .fi-fo,
html.theme-gray .fi-card,
html.theme-gray .fi-modal-window {
    background-color: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}
html.theme-gray .fi-section-header,
html.theme-gray .fi-header-heading,
html.theme-gray .fi-section-heading,
html.theme-gray .fi-page-header *,
html.theme-gray .fi-breadcrumbs-item a { color: #0f172a !important; }

/* ----- Tables Filament ----- */
html.theme-gray .fi-ta-row { border-color: #cbd5e1 !important; }
html.theme-gray .fi-ta-row:hover { background-color: #d9e2ec !important; }
html.theme-gray .fi-ta-header-cell,
html.theme-gray .fi-ta-cell {
    color: #0f172a !important;
    background-color: transparent !important;
}

/* ----- Inputs ----- */
html.theme-gray .fi-input,
html.theme-gray .fi-select-input,
html.theme-gray .fi-textarea,
html.theme-gray input[type="text"],
html.theme-gray input[type="email"],
html.theme-gray input[type="password"],
html.theme-gray textarea,
html.theme-gray select {
    background-color: #f8fafc !important;   /* slate-50 — quasi blanc */
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}
html.theme-gray .fi-input:focus,
html.theme-gray input:focus,
html.theme-gray textarea:focus {
    border-color: #AFCA0B !important;
    box-shadow: 0 0 0 3px rgba(175,202,11,.25) !important;
}
html.theme-gray ::placeholder { color: #64748b !important; }

/* ----- Boutons Filament (non primaires) ----- */
html.theme-gray .fi-btn:not(.fi-color-primary):not(.fi-color-danger):not(.fi-color-success) {
    background-color: #cbd5e1 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}
html.theme-gray .fi-btn:not(.fi-color-primary):not(.fi-color-danger):not(.fi-color-success):hover {
    background-color: #b8c5d3 !important;
}

/* ----- Avatar dropdown ----- */
html.theme-gray .st-dropdown {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
    box-shadow: 0 10px 24px rgba(15,23,42,.25) !important;
}
html.theme-gray .st-dropdown__item,
html.theme-gray .st-dropdown__btn { color: #0f172a !important; }
html.theme-gray .st-dropdown__item:hover,
html.theme-gray .st-dropdown__btn:hover { background: #cbd5e1 !important; }
html.theme-gray .st-dropdown__divider { border-color: #94a3b8 !important; }
html.theme-gray .st-dropdown__name { color: #0f172a !important; }
html.theme-gray .st-dropdown__email { color: #475569 !important; }

/* ----- Scrollbar Solartech version gris ----- */
html.theme-gray ::-webkit-scrollbar-thumb { background: #94a3b8 !important; }
html.theme-gray ::-webkit-scrollbar-thumb:hover { background: #AFCA0B !important; }
html.theme-gray ::-webkit-scrollbar-track { background: transparent !important; }

/* ----- Links / accents ----- */
html.theme-gray a:not(.fi-btn):not(.fi-sidebar-item-button) { color: #5b6907 !important; }
html.theme-gray a:not(.fi-btn):not(.fi-sidebar-item-button):hover { color: #748b08 !important; }

/* ============================================================
   THÈME GRIS v2 — patch spécificité supérieure pour battre 
   les anciens overrides #ececec qui restent dans le fichier
   ============================================================ */
html.theme-gray .st-ticker .st-ticker__header .st-ticker__title,
html.theme-gray .st-weather .st-weather__header .st-weather__title {
    color: #0f172a !important;
}
html.theme-gray .st-ticker .st-ticker__header,
html.theme-gray .st-weather .st-weather__header {
    color: #0f172a !important;
}
html.theme-gray .st-weather .st-weather__header .st-weather__link {
    color: #1e6a9c !important;
}
/* Titre h1/h2/h3 dans le header */
html.theme-gray .st-ticker__header h2,
html.theme-gray .st-ticker__header h3,
html.theme-gray .st-weather__header h2,
html.theme-gray .st-weather__header h3 {
    color: #0f172a !important;
}

/* ============================================================
   SCROLL LAYOUT — viewport non-fullscreen
   Topbar Solartech sticky 72px en haut, scroll dans le main
   (pas sur le body) pour que la topbar reste visible.
   Exclu sur la page login (st-auth-page) qui a son propre layout.
   ============================================================ */
html:not(.st-auth-page) body {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

/* La topbar custom Solartech reste collée en haut */
html:not(.st-auth-page) .st-header {
    position: sticky;
    top: 0;
    z-index: 60;
}

/* Le main wrapper de Filament prend ce qui reste de la hauteur */
html:not(.st-auth-page) main.fi-main,
html:not(.st-auth-page) .fi-main-ctn {
    min-height: calc(100vh - 72px) !important;
}

/* La page elle-même peut scroller indépendamment */
html:not(.st-auth-page) .fi-page {
    min-height: calc(100vh - 72px) !important;
    padding-bottom: 2rem !important; /* respiration en bas */
}

/* Sidebar pleine hauteur sous la topbar */
html:not(.st-auth-page) .fi-sidebar {
    height: calc(100vh - 72px) !important;
    position: sticky !important;
    top: 72px !important;
    overflow-y: auto !important;
}

/* ============================================================
   SCROLL-TO-TOP BUTTON — rond flottant bottom-right
   ============================================================ */
.st-scrolltop {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #AFCA0B 0%, #93B30A 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2), 0 0 0 1px rgba(175, 202, 11, .3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transform: translateY(16px) scale(0.85);
    pointer-events: none;
    transition: opacity .25s ease-out, transform .25s ease-out, box-shadow .2s, background .2s;
}
.st-scrolltop.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.st-scrolltop:hover {
    background: linear-gradient(135deg, #9CB60A 0%, #82A009 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3), 0 0 0 3px rgba(175, 202, 11, .4);
    transform: translateY(-2px) scale(1.05);
}
.st-scrolltop:active {
    transform: translateY(0) scale(.98);
}
.st-scrolltop svg {
    width: 22px;
    height: 22px;
}

/* Mode dark — légère variante */
html.dark .st-scrolltop {
    background: linear-gradient(135deg, #AFCA0B 0%, #93B30A 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .5), 0 0 0 1px rgba(175, 202, 11, .4);
}
html.theme-gray .st-scrolltop {
    background: linear-gradient(135deg, #AFCA0B 0%, #93B30A 100%);
}

/* Masquer sur la page login */
html.st-auth-page .st-scrolltop { display: none !important; }


/* === AI Assist (Task 119 — 17/05/2026) === */

/* ===========================================================
   AI Assist — Bouton ✨ + Modal Solartech
   Palette IA dédiée : violet #de00ff → bleu profond #3303ff → bleu clair #00acff
   (Différenciation visuelle volontaire vs charte Solartech vert/bleu)
   =========================================================== */

/* RichEditor élargi */
.st-rich-tall .filament-forms-rich-editor-component .tiptap.ProseMirror,
.st-rich-tall .ProseMirror,
.st-rich-tall .fi-fo-rich-editor .fi-fo-rich-editor-tiptap,
.st-rich-tall [contenteditable="true"] {
    min-height: 260px !important;
    max-height: 600px;
    overflow-y: auto;
}

/* === Bouton trigger ✨ AI Assist === */
.st-ai-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem 0.45rem 0.75rem;
    background: linear-gradient(135deg, #de00ff 0%, #3303ff 50%, #00acff 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgb(179 8 156 / 35%);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    margin-bottom: 0.35rem;
    position: relative;
    overflow: hidden;
}

.st-ai-trigger::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 0.6s ease;
}

.st-ai-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px #38aae1, 0 0 24px rgba(56, 170, 225, 0.4);
}

.st-ai-trigger:hover::before { left: 100%; }

.st-ai-trigger:active { transform: translateY(0); }

.st-ai-trigger__icon {
    font-size: 1.1rem;
    animation: st-ai-twinkle 2.2s ease-in-out infinite;
    display: inline-block;
}

@keyframes st-ai-twinkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.25) rotate(15deg); opacity: 0.85; }
}

.st-ai-trigger__label { white-space: nowrap; }

.st-ai-trigger__hint {
    font-size: 0.72rem;
    opacity: 0.85;
    font-weight: 400;
    margin-left: 0.25rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .st-ai-trigger__hint { display: none; }
}

/* === Modal overlay === */
.st-ai-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: st-ai-fade-in 0.18s ease-out;
}

[x-cloak] { display: none !important; }
.st-ai-modal-overlay[style*="display:none"] { display: none !important; }
.st-ai-modal-overlay[style*="display: none"] { display: none !important; }

@keyframes st-ai-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* === Modal box === */
.st-ai-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: st-ai-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .st-ai-modal,
html.theme-gray .st-ai-modal { background: #1f2937; color: #e5e7eb; }
html.theme-gray .st-ai-modal { background: #e2e8f0; color: #0f172a; }

@keyframes st-ai-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.st-ai-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #de00ff 0%, #3303ff 50%, #00acff 100%);
    color: #fff;
}

.st-ai-modal__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.st-ai-modal__title em {
    font-style: italic;
    opacity: 0.85;
    font-weight: 400;
    font-size: 0.9rem;
    margin-left: 0.25rem;
}

.st-ai-modal__icon {
    font-size: 1.4rem;
    animation: st-ai-twinkle 2.2s ease-in-out infinite;
}

.st-ai-modal__close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.st-ai-modal__close:hover { background: rgba(255,255,255,0.35); }

/* === Body === */
.st-ai-modal__body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.st-ai-modal__row { margin-bottom: 1rem; }

.st-ai-modal__row label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: #334155;
}

html.dark .st-ai-modal__row label { color: #cbd5e1; }
html.theme-gray .st-ai-modal__row label { color: #334155; }

/* === Input wrapper avec mic === */
.st-ai-input-wrapper { position: relative; }

.st-ai-input-wrapper textarea {
    width: 100%;
    padding: 0.7rem 3.2rem 0.7rem 0.85rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.st-ai-input-wrapper textarea:focus {
    outline: none;
    border-color: #de00ff;
    box-shadow: 0 0 0 3px rgba(222, 0, 255, 0.18);
}

html.dark .st-ai-input-wrapper textarea {
    background: #111827; color: #f3f4f6; border-color: #374151;
}

.st-ai-modal__row input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    background: #fff;
    color: #0f172a;
}

.st-ai-modal__row input[type="text"]:focus {
    outline: none;
    border-color: #00acff;
    box-shadow: 0 0 0 3px rgba(0, 172, 255, 0.18);
}

html.dark .st-ai-modal__row input[type="text"] {
    background: #111827; color: #f3f4f6; border-color: #374151;
}

/* === Mic button === */
.st-ai-mic {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #de00ff 0%, #3303ff 60%, #00acff 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgb(179 8 156 / 35%);
}
.st-ai-mic:hover:not(:disabled) {
    transform: scale(1.06);
    box-shadow: 0 4px 14px #38aae1, 0 0 18px rgba(56, 170, 225, 0.5);
}
.st-ai-mic:disabled { opacity: 0.4; cursor: not-allowed; }

.st-ai-mic--recording {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    animation: st-ai-rec-pulse 1.1s ease-in-out infinite;
}

@keyframes st-ai-rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
}

.st-ai-mic__pulse {
    position: absolute;
    inset: -6px;
    border: 2px solid #ef4444;
    border-radius: 50%;
    animation: st-ai-pulse-ring 1.4s ease-out infinite;
    pointer-events: none;
}

@keyframes st-ai-pulse-ring {
    0% { transform: scale(0.85); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* === Bouton améliorer === */
.st-ai-modal__actions-mid {
    text-align: center;
    margin: 1rem 0;
}

.st-ai-btn-improve {
    background: linear-gradient(135deg, #de00ff 0%, #3303ff 50%, #00acff 100%);
    color: #fff;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 3px 12px rgb(179 8 156 / 35%);
    transition: transform 0.15s, box-shadow 0.2s;
}
.st-ai-btn-improve:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px #38aae1, 0 0 24px rgba(56, 170, 225, 0.45);
}
.st-ai-btn-improve:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Aperçu === */
.st-ai-preview {
    background: #faf5ff;
    border: 1.5px solid #de00ff;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.55;
    max-height: 240px;
    overflow-y: auto;
}
.st-ai-preview p { margin: 0 0 0.5rem 0; }
.st-ai-preview p:last-child { margin-bottom: 0; }
.st-ai-preview ul, .st-ai-preview ol { margin: 0.4rem 0 0.6rem 1.5rem; padding: 0; }
.st-ai-preview li { margin-bottom: 0.25rem; }

html.dark .st-ai-preview { background: #1a0b2e; color: #f3f4f6; border-color: #a855f7; }

/* Hints + erreurs */
.st-ai-hint {
    display: block;
    font-size: 0.78rem;
    margin-top: 0.4rem;
    color: #64748b;
}
.st-ai-hint--rec { color: #dc2626; font-weight: 600; }
.st-ai-hint--warn { color: #d97706; }

.st-ai-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* === Footer modal === */
.st-ai-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #faf5ff;
}

html.dark .st-ai-modal__footer { background: #1a0b2e; border-color: #374151; }
html.theme-gray .st-ai-modal__footer { background: #e9d5ff; border-color: #94a3b8; }

.st-ai-btn-secondary {
    background: transparent;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.st-ai-btn-secondary:hover { background: #f1f5f9; }
html.dark .st-ai-btn-secondary { color: #cbd5e1; border-color: #4b5563; }
html.dark .st-ai-btn-secondary:hover { background: #1f2937; }

.st-ai-btn-primary {
    background: linear-gradient(135deg, #de00ff 0%, #3303ff 50%, #00acff 100%);
    color: #fff;
    border: none;
    padding: 0.55rem 1.4rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgb(179 8 156 / 35%);
    transition: transform 0.15s, box-shadow 0.2s;
}
.st-ai-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px #38aae1, 0 0 18px rgba(56, 170, 225, 0.5);
}
.st-ai-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* === Toast flash insertion === */
.st-ai-flash {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #de00ff 0%, #3303ff 50%, #00acff 100%);
    color: #fff;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgb(179 8 156 / 40%);
    z-index: 99999;
    animation: st-ai-flash 2.2s ease forwards;
}

@keyframes st-ai-flash {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* === Responsive tablette === */
@media (max-width: 768px) {
    .st-ai-modal { max-width: 100%; max-height: 95vh; }
    .st-ai-modal__body { padding: 1rem; }
    .st-rich-tall .ProseMirror,
    .st-rich-tall .tiptap.ProseMirror {
        min-height: 200px !important;
    }
}

/* === AI Assist v2 : titre proposé (Task 127) === */
.st-ai-preview--title {
    font-weight: 600;
    font-size: 1rem;
    color: #3303ff;
    background: linear-gradient(135deg, rgba(222, 0, 255, 0.06), rgba(0, 172, 255, 0.06));
    border-color: #3303ff;
}
html.dark .st-ai-preview--title { color: #c4a3ff; border-color: #a855f7; }

/* ===========================================================
   Login responsive mobile (Task 132 — 17/05/2026)
   Override des règles 40/60 !important en mobile via media query
   =========================================================== */
@media (max-width: 768px) {
    html.st-auth-page,
    html.st-auth-page body {
        overflow: auto !important;
        height: auto !important;
        min-height: 100vh !important;
    }

    html.st-auth-page .st-login-layout {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        grid-template-rows: unset !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
    }

    /* Image en haut : bandeau compact de 140px (panneaux PV) */
    html.st-auth-page .st-login-visual-side {
        order: -1 !important;
        height: 140px !important;
        width: 100% !important;
        display: flex !important;
        grid-template-rows: unset !important;
    }
    html.st-auth-page .st-login-image-top {
        flex: 1 1 auto !important;
        height: 140px !important;
        background-position: center !important;
    }
    html.st-auth-page .st-login-image-separator,
    html.st-auth-page .st-login-image-bottom {
        display: none !important;
    }

    /* Form : pleine largeur, padding latéral confortable */
    html.st-auth-page .st-login-form-side {
        width: 100% !important;
        padding: 1.5rem 1.25rem !important;
        align-items: flex-start !important;
    }
    html.st-auth-page .st-login-form-inner {
        max-width: 100% !important;
        width: 100% !important;
    }

    html.st-auth-page .st-login-brand {
        margin-bottom: 1.5rem !important;
    }
    html.st-auth-page .st-login-brand img {
        max-width: 200px !important;
    }
    html.st-auth-page .st-login-tagline {
        font-size: 1rem !important;
        letter-spacing: .04em !important;
    }

    /* Inputs : pleine largeur + cible tactile 44px */
    html.st-auth-page .st-login-form .fi-input-wrp,
    html.st-auth-page .st-login-form .fi-input {
        width: 100% !important;
    }
    html.st-auth-page .st-login-form input[type='email'],
    html.st-auth-page .st-login-form input[type='password'],
    html.st-auth-page .st-login-form input[type='text'] {
        width: 100% !important;
        padding: .9rem 1rem !important;
        min-height: 44px !important;
        font-size: 16px !important;  /* évite le zoom auto iOS */
        box-sizing: border-box !important;
    }

    /* Labels : pas de wrap mot par mot */
    html.st-auth-page .st-login-form label,
    html.st-auth-page .st-login-form .fi-fo-field-label {
        white-space: normal !important;
        word-break: keep-all !important;
        font-size: 0.9rem !important;
    }

    /* Bouton submit : pleine largeur, bien visible */
    html.st-auth-page .st-login-form .fi-form-actions {
        justify-content: stretch !important;
        margin-top: 1.5rem !important;
    }
    html.st-auth-page .st-login-form .fi-btn,
    html.st-auth-page .st-login-form button[type='submit'] {
        width: 100% !important;
        min-width: 0 !important;
        padding: .95rem 1.5rem !important;
        font-size: 1rem !important;
        min-height: 48px !important;
    }

    /* Footer */
    html.st-auth-page .st-login-footer {
        margin-top: 1.5rem !important;
        padding-bottom: 2rem !important;
    }

    /* Barre bleue bas : reste mais 4px */
    .st-login-layout::after {
        height: 4px !important;
    }
}

/* Très petits écrans (< 380px) : encore plus compact */
@media (max-width: 380px) {
    html.st-auth-page .st-login-visual-side {
        height: 100px !important;
    }
    html.st-auth-page .st-login-image-top {
        height: 100px !important;
    }
    html.st-auth-page .st-login-brand img {
        max-width: 160px !important;
    }
    html.st-auth-page .st-login-form-side {
        padding: 1rem !important;
    }
}

/* === AI Assist v3 : zone d'upload média (Task 143) === */
.st-ai-media-drop {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 1rem;
    background: #faf5ff;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.st-ai-media-drop:hover { border-color: #de00ff; background: #f3e8ff; }
.st-ai-media-drop--dragging {
    border-color: #de00ff !important;
    background: #e9d5ff !important;
    transform: scale(1.02);
}
.st-ai-media-drop--has {
    cursor: default;
    border-color: #de00ff;
    background: #fff;
    padding: 0.6rem;
}
.st-ai-media-drop__hint {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    color: #64748b;
    font-size: 0.88rem;
}
.st-ai-media-drop__hint small { font-size: 0.72rem; color: #94a3b8; }

.st-ai-media-preview {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    position: relative;
}
.st-ai-media-thumb {
    max-width: 120px;
    max-height: 90px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    object-fit: cover;
    background: #000;
}
video.st-ai-media-thumb { width: 120px; height: 90px; }
.st-ai-media-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}
.st-ai-media-info strong {
    display: block;
    font-size: 0.88rem;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.st-ai-media-info small {
    font-size: 0.72rem;
    color: #64748b;
}
.st-ai-media-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.st-ai-media-remove:hover { background: #dc2626; }

html.dark .st-ai-media-drop { background: #1a0b2e; border-color: #4b5563; }
html.dark .st-ai-media-drop--has { background: #1f2937; }
html.dark .st-ai-media-info strong { color: #f3f4f6; }
html.dark .st-ai-media-info small { color: #cbd5e1; }

/* === AI Assist v4 : barre de progression (Task 144) === */
.st-ai-progress {
    height: 6px;
    width: 100%;
    background: rgba(222, 0, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0 1rem 0;
}
.st-ai-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #de00ff, #3303ff, #00acff);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.18s ease-out;
}
.st-ai-progress__bar--indeterminate {
    width: 100% !important;
    animation: st-ai-progress-pulse 1.4s ease-in-out infinite;
}
@keyframes st-ai-progress-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === AI Assist v5 : grille multi-fichiers (Task 151) === */
.st-ai-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    width: 100%;
}
.st-ai-media-card {
    position: relative;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.st-ai-media-thumb-sm {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    background: #f1f5f9;
}
.st-ai-media-thumb-doc {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.st-ai-media-card-info {
    text-align: center;
    width: 100%;
    overflow: hidden;
}
.st-ai-media-card-info span {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-ai-media-card-info small {
    font-size: 0.65rem;
    color: #64748b;
}
.st-ai-media-card .st-ai-media-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.st-ai-media-add {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.15s;
    min-height: 100px;
}
.st-ai-media-add:hover {
    border-color: #de00ff;
    color: #de00ff;
    background: rgba(222, 0, 255, 0.04);
}
.st-ai-media-add span {
    font-size: 2rem;
    line-height: 1;
}
.st-ai-media-add small {
    font-size: 0.7rem;
    margin-top: 0.25rem;
}
html.dark .st-ai-media-card { background: #1f2937; border-color: #374151; }
html.dark .st-ai-media-card-info span { color: #f3f4f6; }

/* === Boutons Zoom topbar (Task D15) === */
.st-zoom-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 28px;
    padding: 0 8px;
    margin: 0 2px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Public Sans', sans-serif;
    user-select: none;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background 0.15s, transform 0.15s;
}
.st-zoom-level:hover { background: rgba(255,255,255,0.32); transform: scale(1.05); }
.st-zoom-level:active { transform: scale(0.95); }

/* ============================================================
 * SOLARTECH Dashboard Drill-Down v3 — 2026-05-28 (Session 23)
 * Animation élastique + nouvelles tuiles SAV/Marketing
 * ============================================================ */

/* Nouvelles tuiles parent : couleurs cohérentes contrastées */
.st-tile--sav { background: linear-gradient(135deg, #0EA5E9 0%, #0284C7cc 100%); }
.st-tile--marketing { background: linear-gradient(135deg, #DB2777 0%, #BE185Dcc 100%); }
html.theme-gray .st-tile--sav { background: #2a2a2a !important; border-color: #0EA5E9 !important; }
html.theme-gray .st-tile--marketing { background: #2a2a2a !important; border-color: #DB2777 !important; }

/* Anim élastique : tout sur les st-tile */
.st-tile {
  transition: 
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease,
    padding 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    min-height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mode shrink : tuiles parent en ligne compact quand drill actif */
.st-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  transition: grid-template-columns 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), gap 0.4s ease;
}
.st-tiles-grid.st-tiles-grid--shrink {
  grid-template-columns: repeat(9, 1fr);
  gap: 0.5rem;
}
.st-tiles-grid--shrink .st-tile {
  min-height: 60px;
  padding: 0.6rem 0.5rem;
}
.st-tiles-grid--shrink .st-tile__icon { font-size: 1.2rem !important; opacity: 0.7; }
.st-tiles-grid--shrink .st-tile__title { font-size: 0.7rem !important; line-height: 1.1; margin-top: 0.2rem; }
.st-tiles-grid--shrink .st-tile__desc { display: none; }
.st-tiles-grid--shrink .st-tile__badge { display: none; }
.st-tiles-grid--shrink .st-tile__head { flex-direction: column; align-items: center; gap: 0.2rem; }

/* Tuile sélectionnée (active) : ring blanc + scale */
.st-tile--active {
  transform: scale(1.08) translateY(-2px) !important;
  box-shadow: 0 0 0 3px white, 0 8px 24px rgba(0, 0, 0, 0.3) !important;
  z-index: 5;
  position: relative;
}

/* Anim entrée des sub-tuiles drill-down (élastique) */
.st-drilldown {
  animation: stDrillEnter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes stDrillEnter {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hover sub-tuiles dans le drill */
.st-drilldown .st-tile:hover, .st-mini-tile:hover, .st-list-row:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

/* Drill items stagger (chacun arrive avec un léger décalage) */
.st-drilldown-grid--tile > div, .st-drilldown-grid--mini > a, .st-drilldown-list > a {
  animation: stItemEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.st-drilldown-grid--tile > div:nth-child(1), .st-drilldown-grid--mini > a:nth-child(1), .st-drilldown-list > a:nth-child(1) { animation-delay: 0.05s; }
.st-drilldown-grid--tile > div:nth-child(2), .st-drilldown-grid--mini > a:nth-child(2), .st-drilldown-list > a:nth-child(2) { animation-delay: 0.1s; }
.st-drilldown-grid--tile > div:nth-child(3), .st-drilldown-grid--mini > a:nth-child(3), .st-drilldown-list > a:nth-child(3) { animation-delay: 0.15s; }
.st-drilldown-grid--tile > div:nth-child(4), .st-drilldown-grid--mini > a:nth-child(4), .st-drilldown-list > a:nth-child(4) { animation-delay: 0.2s; }
.st-drilldown-grid--tile > div:nth-child(5), .st-drilldown-grid--mini > a:nth-child(5), .st-drilldown-list > a:nth-child(5) { animation-delay: 0.25s; }
.st-drilldown-grid--tile > div:nth-child(n+6), .st-drilldown-grid--mini > a:nth-child(n+6), .st-drilldown-list > a:nth-child(n+6) { animation-delay: 0.3s; }
@keyframes stItemEnter {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Section row (ticker+météo) anim d'entrée quand on revient */
.st-dashboard__row {
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
 * Themes cohérents pour SAV + Marketing (fix Session 23)
 * Suit le même pattern que crm/production/system
 * ============================================================ */

/* MODE DARK : gradient transparent + border color */
html.dark .st-tile--sav       { background: linear-gradient(135deg, rgba(14,165,233,.22) 0%, #374151 65%) !important; border-color: #0EA5E9 !important; }
html.dark .st-tile--marketing { background: linear-gradient(135deg, rgba(219,39,119,.22) 0%, #374151 65%) !important; border-color: #DB2777 !important; }

/* MODE THEME-GRAY : gradient subtle pareil que crm */
html.theme-gray .st-tile--sav       { background: linear-gradient(135deg, rgba(14,165,233,.30) 0%, #e2e8f0 65%) !important; border-color: #0EA5E9 !important; }
html.theme-gray .st-tile--marketing { background: linear-gradient(135deg, rgba(219,39,119,.30) 0%, #e2e8f0 65%) !important; border-color: #DB2777 !important; }
