/**
 * Couleur primaire REGIDESO #09459C — variables Bootstrap + surcharges (après style.css).
 */
:root,
[data-bs-theme=light] {
    --regideso-primary: #09459c;
    --regideso-primary-rgb: 9, 69, 156;
    --regideso-primary-dark: #073a83;
    --regideso-primary-deep: #052e5c;
    --bs-primary: #09459c;
    --bs-primary-rgb: 9, 69, 156;
    --bs-blue: #09459c;
    --bs-link-color: #09459c;
    --bs-link-hover-color: #073a83;
}

.text-primary {
    color: #09459c !important;
}

.border-primary {
    border-color: #09459c !important;
}

.bg-primary {
    background-color: #09459c !important;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn.btn-primary,
.btn.btn-primary:focus-visible {
    --bs-btn-color: #fff;
    --bs-btn-bg: #09459c;
    --bs-btn-border-color: #09459c;
    --bs-btn-hover-bg: #073a83;
    --bs-btn-hover-border-color: #073a83;
    --bs-btn-focus-shadow-rgb: 9, 69, 156;
    --bs-btn-active-bg: #052e5c;
    --bs-btn-active-border-color: #052e5c;
    --bs-btn-disabled-bg: #09459c;
    --bs-btn-disabled-border-color: #09459c;
}

/* Contre Bootstrap #0d6efd et anciennes règles du template */
.btn-primary:not(:disabled):not(.disabled),
.btn.btn-primary:not(:disabled):not(.disabled),
button.btn-primary:not(:disabled):not(.disabled),
a.btn-primary:not(:disabled):not(.disabled),
input[type="submit"].btn-primary:not(:disabled):not(.disabled) {
    background-color: #09459c !important;
    border-color: #09459c !important;
    color: #fff !important;
}

.btn-primary:hover:not(:disabled):not(.disabled),
.btn-primary:active:not(:disabled):not(.disabled),
.btn-primary.active:not(:disabled):not(.disabled),
.btn.btn-primary:hover:not(:disabled):not(.disabled),
.btn.btn-primary:active:not(:disabled):not(.disabled) {
    background-color: #073a83 !important;
    border-color: #073a83 !important;
    color: #fff !important;
}

.btn-outline-primary {
    --bs-btn-color: #09459c;
    --bs-btn-border-color: #09459c;
    --bs-btn-hover-bg: #09459c;
    --bs-btn-hover-border-color: #09459c;
    --bs-btn-focus-shadow-rgb: 9, 69, 156;
    --bs-btn-active-bg: #073a83;
    --bs-btn-active-border-color: #073a83;
}

.btn-soft-primary {
    --bs-btn-color: #09459c;
    --bs-btn-bg: rgba(9, 69, 156, 0.12);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: rgba(9, 69, 156, 0.22);
    --bs-btn-hover-color: #052e5c;
}

.btn-soft-primary,
.btn-soft-primary:focus {
    background-color: rgba(9, 69, 156, 0.12) !important;
    color: #09459c !important;
}

.btn-soft-primary:hover,
.btn-soft-primary:focus-visible,
.btn-soft-primary:active,
.btn-soft-primary.active {
    background-color: rgba(9, 69, 156, 0.22) !important;
    color: #052e5c !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Alias « orange » Dreamguy = même primaire */
.btn.btn-orange:not(:disabled):not(.disabled) {
    background-color: #09459c !important;
    border-color: #09459c !important;
    color: #fff !important;
}

.btn.btn-orange:hover:not(:disabled):not(.disabled),
.btn.btn-orange:focus:not(:disabled):not(.disabled),
.btn.btn-orange:active:not(:disabled):not(.disabled) {
    background-color: #073a83 !important;
    border-color: #073a83 !important;
    color: #fff !important;
}

.btn-submit,
.btn-save,
.btn-send {
    background-color: #09459c !important;
    border-color: #09459c !important;
    color: #fff !important;
}

.btn-submit:hover,
.btn-save:hover,
.btn-send:hover {
    background-color: #073a83 !important;
    border-color: #073a83 !important;
    color: #fff !important;
}

.page-header .btn-added:not(.downloader):not(.printer) {
    background: #09459c !important;
    color: #fff !important;
}

.page-header .btn-added:not(.downloader):not(.printer):hover {
    background: #073a83 !important;
    color: #fff !important;
}

/**
 * Filigrane REGIDESO sur tout le corps de page (image décalée à droite, effet discret).
 * Fichier : public/regideso/body-watermark.png
 */
body {
    isolation: isolate;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("../../regideso/body-watermark.png");
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: min(60vw, 780px) auto;
    opacity: 0.99;
}

/**
 * Zone page limitée aux 10 premières colonnes d’une grille 12 (desktop).
 * Mobile : pleine largeur. Carte pleine page : exception. Dashboard : pleine largeur.
 */
@media (min-width: 992px) {
    .main-wrapper .page-wrapper > .content,
    .main-wrapper .page-wrapper > .copyright-footer {
        max-width: calc(100% * 10 / 12);
        margin-right: auto;
        margin-left: 0;
        box-sizing: border-box;
    }

    .page-wrapper:has(.regi-dash-shell) > .content,
    .page-wrapper:has(.regi-dash-shell) > .copyright-footer {
        max-width: none;
        width: 100%;
        margin-right: 0;
    }

    .page-wrapper:has(.regi-carte-fullpage) > .content {
        max-width: none;
        width: 100%;
    }

    .page-wrapper:has(.regi-reporting-fullpage) > .content,
    .page-wrapper:has(.regi-reporting-fullpage) > .copyright-footer {
        max-width: none;
        width: 100%;
        margin-right: 0;
    }

    /* Listes admin (structure agences, demandes, catalogue services…) : pleine largeur utile */
    .page-wrapper:has(.regi-structure-like-page) > .content,
    .page-wrapper:has(.regi-structure-like-page) > .copyright-footer,
    /* Détail ticket /request/ticket/{id} */
    .page-wrapper:has(.regi-leak-detail-page) > .content,
    .page-wrapper:has(.regi-leak-detail-page) > .copyright-footer {
        max-width: none;
        width: 100%;
        margin-right: 0;
    }
}

/* Bandeau menu rapide / encart dashboard : photo plein panneau (texte en overlay bas) */
#regiQuickMenuModal .regi-quick-menu-accent,
.regi-dash-sidebar-photo .regi-quick-menu-accent {
    position: relative;
    isolation: isolate;
    background: linear-gradient(165deg, #09459c 0%, #073a83 42%, #052e5c 100%);
    color: #fff;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    min-height: 220px;
    display: block;
}

.regi-dash-sidebar-photo .regi-quick-menu-accent.regi-dash-sidebar-accent-fill {
    flex: 1 1 auto;
    min-height: 220px;
    height: 100%;
}

#regiQuickMenuModal .regi-quick-menu-accent__photo,
.regi-dash-sidebar-photo .regi-quick-menu-accent__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    z-index: 0;
}

#regiQuickMenuModal .regi-quick-menu-accent__footer,
.regi-dash-sidebar-photo .regi-quick-menu-accent__footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    padding: 2.75rem 1rem 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(
        180deg,
        rgba(9, 69, 156, 0) 0%,
        rgba(9, 69, 156, 0.45) 28%,
        rgba(7, 58, 131, 0.88) 70%,
        rgba(9, 69, 156, 0.95) 100%
    );
}

.regi-dash-sidebar-photo .regi-quick-menu-accent__footer {
    padding: 2.35rem 0.85rem 1.15rem;
}

#regiQuickMenuModal .regi-quick-menu-accent__title,
.regi-dash-sidebar-photo .regi-quick-menu-accent__title {
    font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: #fff;
    line-height: 1.28;
}

#regiQuickMenuModal .regi-quick-menu-accent__sub,
.regi-dash-sidebar-photo .regi-quick-menu-accent__sub {
    font-size: clamp(0.9rem, 0.825rem + 0.35vw, 1.0625rem);
    font-weight: 500;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.5;
    max-width: 18rem;
}

.regi-dash-sidebar-photo .regi-quick-menu-accent__sub {
    max-width: none;
}

.regi-quick-menu-accent__promo-text {
    transition: opacity 0.36s ease;
    max-width: 100%;
}

.regi-quick-menu-accent .regi-quick-menu-accent__title,
.regi-quick-menu-accent .regi-quick-menu-accent__sub {
    transition: inherit;
}

@media (max-width: 1199.98px) {
    .regi-dash-sidebar-photo .regi-quick-menu-accent.regi-dash-sidebar-accent-fill {
        height: auto;
        flex: 0 1 auto;
    }

    .regi-dash-sidebar-photo .regi-quick-menu-accent {
        min-height: 220px;
        height: auto;
    }

    .regi-dash-sidebar-photo .regi-quick-menu-accent__footer {
        padding: 2.75rem 1rem 1.25rem;
    }

    .regi-dash-sidebar-photo .regi-quick-menu-accent__sub {
        max-width: 18rem;
    }
}

@media (min-width: 1200px) {
    .regi-dash-sidebar-photo .regi-quick-menu-accent__title {
        font-size: clamp(1.2rem, 0.92rem + 0.95vw, 1.48rem);
    }

    .regi-dash-sidebar-photo .regi-quick-menu-accent__sub {
        font-size: clamp(0.9975rem, 0.86rem + 0.52vw, 1.1125rem);
    }
}

/* Encart tableau de bord : liste « requêtes du jour » */
#regiQuickMenuModal .regi-quick-menu-accent__footer--dashtoday,
.regi-dash-sidebar-photo .regi-quick-menu-accent__footer--dashtoday {
    text-align: left;
    align-items: stretch;
}

.regi-quick-menu-accent__dashtoday {
    width: 100%;
    max-width: 100%;
}

#regiQuickMenuModal .regi-quick-menu-accent__footer--dashtoday .regi-quick-menu-accent__title,
.regi-dash-sidebar-photo .regi-quick-menu-accent__footer--dashtoday .regi-quick-menu-accent__title {
    text-align: center;
}

#regiQuickMenuModal .regi-quick-menu-accent__footer--dashtoday .regi-quick-menu-accent__sub--dashtoday-lead,
.regi-dash-sidebar-photo .regi-quick-menu-accent__footer--dashtoday .regi-quick-menu-accent__sub--dashtoday-lead {
    text-align: center;
    max-width: none;
}

.regi-dash-today-list {
    max-height: min(42vh, 300px);
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.regi-dash-today-item {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding-top: 0.65rem;
    margin-top: 0.65rem;
}

.regi-dash-today-item:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.regi-dash-today-cat {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.62);
}

.regi-dash-today-service {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.regi-dash-today-snippet {
    font-size: clamp(0.8125rem, 0.75rem + 0.35vw, 0.9375rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.42;
}

.regi-dash-today-empty {
    font-size: 0.8875rem;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
}

.regi-dash-today-trunc {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
}

.regi-dash-today-all {
    display: block;
    text-align: center;
    width: 100%;
}

/**
 * Sidebar + header : fond blanc (surcharge du customiser Dreamguy / valeurs persistées dans localStorage).
 */
.main-wrapper .header {
    background: #ffffff !important;
    border-bottom: 1px solid #e6eaed !important;
}

.main-wrapper .header .header-left {
    background: #ffffff !important;
}

.main-wrapper .header .header-left .logo.logo-normal {
    display: inline-block !important;
}

/* Logo officiel header (PNG) : dimensions cohérentes desktop + mobile (évite le logo vectoriel du thème). */
.main-wrapper .header .header-left .logo img {
    width: auto !important;
    max-width: min(168px, 46vw);
    max-height: 44px;
    height: auto;
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .main-wrapper .header .header-left .logo img {
        max-width: min(150px, 42vw);
        max-height: 40px;
    }
    .main-wrapper .header .header-left .logo-small img {
        max-width: 40px;
        max-height: 40px;
    }
}

.main-wrapper .header .header-left .logo.logo-white {
    display: none !important;
}

.main-wrapper .header .responsive-search {
    color: #09459c !important;
}

.main-wrapper .header .mobile-user-menu {
    color: #092c4c !important;
}

/**
 * Icônes Tabler (ti) dans le header : le thème peut forcer texte blanc (ex. data-topbar=all)
 * alors que le fond est blanc — rendu « icônes disparues ».
 */
.main-wrapper .header .user-menu .nav-item-box > a,
.main-wrapper .header .user-menu .nav-item-box > .nav-link.dropdown-toggle {
    background: #f7f7f7 !important;
    color: #646b72 !important;
}

.main-wrapper .header .user-menu .nav-item-box > a:hover,
.main-wrapper .header .user-menu .nav-item-box > .nav-link.dropdown-toggle:hover,
.main-wrapper .header .user-menu .nav-item-box > .nav-link.dropdown-toggle.show {
    background: #f2f2f2 !important;
    color: #09459c !important;
}

.main-wrapper .header .user-menu .nav-item-box .ti,
.main-wrapper .header .user-menu .nav-item-box .ti::before {
    color: inherit !important;
}

.main-wrapper .header .profile-nav .nav-link.userset,
.main-wrapper .header .profile-nav .nav-link.userset .ti,
.main-wrapper .header .profile-nav .user-email {
    color: #092c4c !important;
}

.main-wrapper .header .profile-nav .nav-link.userset:hover .ti,
.main-wrapper .header .profile-nav .nav-link.userset:hover .user-email {
    color: #09459c !important;
}

.main-wrapper .header .dropdown-menu .input-group-text.bg-white,
.main-wrapper .header .dropdown-menu .input-group-text {
    background-color: #ffffff !important;
    border-color: #e6eaed !important;
    color: #09459c !important;
}

.main-wrapper .header .dropdown-menu .input-group-text .ti {
    color: inherit !important;
}

.main-wrapper .header .top-nav-search form .form-control {
    background-color: #f7f7f7 !important;
    border: 1px solid #e6eaed !important;
}

.main-wrapper .header .top-nav-search form .form-control::-webkit-input-placeholder {
    color: rgba(33, 43, 54, 0.45) !important;
}

.main-wrapper .header .top-nav-search form .form-control::placeholder {
    color: rgba(33, 43, 54, 0.45) !important;
}

.main-wrapper .header .top-nav-search form .btn {
    color: #646b72 !important;
}

@media (min-width: 992px) {
    .main-wrapper .header .main-header {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }

    .main-wrapper .header .header-left {
        float: none;
        flex-shrink: 0;
    }

    .main-wrapper .header .regi-header-global-search {
        flex: 0 1 auto;
        min-width: 0;
        max-width: min(320px, 34vw);
        padding-left: 0.35rem;
        padding-right: 0.65rem;
        align-self: center;
    }

    .main-wrapper .header .regi-header-global-search .regi-header-global-search__form {
        margin-bottom: 0;
    }

    .main-wrapper .header .regi-header-global-search .regi-header-global-search__group {
        flex-wrap: nowrap;
    }

    .main-wrapper .header .regi-header-global-search .regi-header-global-search__group .form-control {
        min-width: 0;
    }

    .main-wrapper .header .user-menu {
        float: none;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
    }
}
@media (min-width: 991.98px) {
    .main-wrapper .header #toggle_btn .bar-icon span {
        background-color: #092c4c !important;
    }
}

.main-wrapper .sidebar {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-right-color: #e6eaed !important;
}

[data-sidebar=all] .main-wrapper .sidebar {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #e6eaed !important;
}

.main-wrapper .sidebar .sidebar-logo a.logo.logo-normal {
    display: flex !important;
}

.main-wrapper .sidebar .logo.logo-white {
    display: none !important;
}

/**
 * Lisibilité : texte principal en noir, corps un peu plus grand (le thème d’origine est en 14px / gris).
 */
:root,
[data-bs-theme=light] {
    --bs-body-font-size: 1rem;
    --bs-body-color: #000000;
    --bs-body-line-height: 1.55;
    --bs-body-bg: #FAFAFB;
}

body {
    font-size: 1rem;
    color: #000000;
    line-height: 1.55;
    background-color: #FAFAFB;
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
    color: #000000;
}

.page-wrapper .content {
    font-size: 1rem;
    color: #000000;
}

.card,
.card-body,
.list-group-item {
    color: #000000;
}

.card-title {
    font-size: 1.125rem;
    color: #000000;
}

.table {
    --bs-table-color: #000000 !important;
    color: #000000 !important;
    font-size: 1rem;
}

/*
 * Template style.css : .table { color: #646B72 } puis .table tbody tr td { color: #646B72 }
 * (plus spécifique que .table tbody td). Forcer le noir sur les tableaux clairs.
 */
.table:not(.table-dark) thead.table-light tr th {
    color: #000000 !important;
}

.table:not(.table-dark) tbody tr td,
.table:not(.table-dark) tbody tr th {
    color: #000000 !important;
}

.table.table-hover:not(.table-dark) > tbody > tr:hover > * {
    color: #000000 !important;
}

.table:not(.table-dark) .table-active,
.table:not(.table-dark) .table-active > * {
    color: #000000 !important;
}

.table:not(.table-dark) .text-muted,
.table:not(.table-dark) tbody .text-muted {
    color: #000000 !important;
}

.table:not(.table-dark) tbody tr td a:not(.btn):not(.badge) {
    color: #000000 !important;
}

.table:not(.table-dark) tbody tr td a:not(.btn):not(.badge):hover {
    color: #09459c !important;
}

.form-control,
.form-select {
    color: #000000;
    font-size: 1rem;
}

.form-label,
.col-form-label {
    color: #000000;
    font-size: 1rem;
}

.input-group-text {
    color: #000000;
    font-size: 1rem;
}

small,
.small {
    font-size: 0.9375rem !important;
    color: #0d0d0d;
}

.text-muted {
    color: #2d2d2d !important;
}

.breadcrumb,
.breadcrumb-item,
.breadcrumb-item a {
    font-size: 0.9375rem;
}

.breadcrumb-item.active {
    color: #000000;
}

.dropdown-item {
    font-size: 1rem;
    color: #000000;
}

.modal-title {
    color: #000000;
}

.offcanvas-title {
    color: #000000;
}

/* Menu latéral : titres, liens, icônes (taille légèrement sous le corps de page) */
.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open .submenu-hdr {
    font-size: 0.75rem !important;
    color: #000000 !important;
    letter-spacing: 0.04em;
    margin-bottom: 0.45rem !important;
}

.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li > a {
    font-size: 0.875rem !important;
    line-height: 1.35;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    color: #000000 !important;
}

.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li > a span {
    color: inherit !important;
    font-size: inherit !important;
}

.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li > a i.ti {
    font-size: 1rem !important;
    width: 1.2rem;
    text-align: center;
    color: #333333 !important;
}

.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li .badge {
    font-size: 0.64rem !important;
    padding: 0.2em 0.4em !important;
}

.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li.active > a,
.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li > a.active {
    background: rgba(22, 102, 194, 0.08) !important;
    color: #09459c !important;
}

.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li.active > a span,
.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li > a.active span {
    color: inherit !important;
}

.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li.active > a i,
.main-wrapper .sidebar .sidebar-menu > ul > li.submenu-open ul li > a.active i {
    color: #09459c !important;
}
