/**
 * Styles consolidés pour Praxely
 * Tous les styles inline des templates ont été déplacés ici
 * pour respecter la Content Security Policy stricte
 */

/* ===== HTMX — équivalent des styles injectés par défaut (includeIndicatorStyles) =====
   Sans ce bloc, désactiver l’injection via meta htmx-config laisserait les indicateurs toujours visibles. */
.htmx-indicator {
    opacity: 0;
    visibility: hidden;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
    visibility: visible;
    transition: opacity 200ms ease-in;
}

/* ===== STYLES DE BASE ===== */

/* Améliorations d'accessibilité */
:focus {
    outline: 3px solid #000080 !important;
    outline-offset: 2px !important;
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 128, 0.25) !important;
}

/* Amélioration des contrastes */
.text-muted {
    color: #6c757d !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

/* Navbar sticky (au-dessus du contenu défilant) */
.praxely-navbar-sticky {
    z-index: 1030;
}

/* ===== NAVBAR – liens sur une seule ligne ===== */
.navbar-brand {
    gap: 0.25rem;
}

.brand-logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}

.brand-text {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.navbar-nav .nav-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* ===== NAVBAR DROPDOWNS – plus aérés ===== */
.navbar .dropdown-menu {
    padding: 0.5rem 0;
    min-width: 12rem;
}
.navbar .dropdown-menu .dropdown-item {
    padding: 0.5rem 1rem;
}
.navbar .dropdown-menu .dropdown-divider {
    margin: 0.35rem 0;
}

/* ===== LAYOUT RESPONSIVE ===== */

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.position-sticky {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

/* main : avec navbar sticky (dans le flux), pas de décalage vertical fixe supplémentaire */
main {
    padding-top: 0;
}

/* Footer : fond clair, tous les liens lisibles (comme Gestion des cookies) */
footer {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    padding: 1rem 0;
    text-align: center;
    font-size: 1rem;
    margin-top: 2rem;
    border-top: 1px solid #dee2e6;
}

footer p {
    color: #212529 !important;
}

footer a,
footer a:visited {
    color: #6c757d !important;
    text-decoration: none;
}

footer a:hover {
    color: #495057 !important;
    text-decoration: underline;
}

/* ===== PAGE /bases/ — cartes bases de données (padding et hiérarchie alignés) ===== */
.data-browser-index .data-browser-card {
    overflow: hidden;
    border: none !important;
    box-shadow: var(--box-shadow);
}
.data-browser-index .data-browser-card .card-header {
    font-size: 0.95rem;
    border-bottom: none !important;
}
.data-browser-index .data-browser-card-body .card-title {
    font-size: 1.1rem;
    font-weight: 600;
}
/* Sélection au clic : contour neutre (plus de vert), aligné avec les autres encarts */
.data-browser-index .data-browser-card.is-selected {
    filter: grayscale(0.45);
    box-shadow:
        var(--box-shadow),
        inset 0 0 0 2px rgba(0, 0, 0, 0.12);
}
/* Recherche rapide : même largeur utile que les encarts (carte pleine colonne) */
.data-browser-index .data-browser-quick-search .form-label {
    display: block;
}

/* Fiche Gouv — bandeaux : même dégradé vert que navbar / tableaux Bases */
.gouv-detail-page .card .card-header.bg-success {
    background: linear-gradient(
        135deg,
        var(--nav-gradient-start, #005000) 0%,
        var(--nav-gradient-end, #0d7a28) 100%
    ) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0.375rem 0.375rem 0 0;
}
.gouv-detail-page .card .card-header.bg-success h2,
.gouv-detail-page .card .card-header.bg-success h3,
.gouv-detail-page .card .card-header.bg-success .h5,
.gouv-detail-page .card .card-header.bg-success .h6 {
    color: #fff !important;
}

.data-grid-detail-icon {
    min-width: 2rem;
    line-height: 1.25;
    transition: box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}
.data-grid-detail-icon.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 3px 10px rgba(13, 110, 253, 0.45);
}
.data-grid-detail-icon.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.35);
}
/* ===== LISTE UNIFIÉE MODIFICATIONS – filtration et en-tête épinglés ===== */
/* Hauteur naturelle du contenu : pas de « trou » blanc sous un tableau court.
   Les longues listes restent scrollables via max-height sur le wrapper tableau. */
.unified-modifications-list-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
}
.unified-modifications-list-header {
    flex-shrink: 0;
}
/* Filtres : ne rétrécit pas */
.unified-modifications-filters {
    flex-shrink: 0;
    z-index: 11;
    background-color: #fff;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.08);
}

/* Deux lignes : dates puis critères (recherche, listes, actions) */
.unified-modifications-filters-inner {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow: visible;
}

.unified-modifications-filters-row--dates {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.unified-modifications-filters-row--criteria {
    flex-wrap: wrap;
}

.jorf-date-filters-row {
    justify-content: flex-start;
}

@media (min-width: 992px) {
    .jorf-date-filters-row {
        justify-content: center;
    }
}

.jorf-date-filter-group__title {
    font-weight: 600;
}

.unified-modifications-filters .jorf-date-input {
    width: auto;
    min-width: 9.5rem;
    max-width: 100%;
}

/* Listes déroulantes : largeur mini pour libellés longs */
.unified-modifications-filters .unified-filter-select {
    min-width: 11.5rem;
    max-width: min(18rem, 85vw);
    padding-right: 2.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Champ recherche : largeur bornée pour tenir sur une ligne avec les autres filtres */
.unified-modifications-filters .unified-search-field-wrap {
    width: 20rem;
    max-width: min(20rem, 55vw);
    flex: 0 0 auto;
}

.unified-modifications-filters .unified-search-input {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    font-family: var(--font-body, 'Segoe UI', system-ui, sans-serif);
}
.unified-modifications-body-table tbody td {
    font-size: 1rem;
    font-family: var(--font-body, 'Segoe UI', system-ui, sans-serif);
}
/* Conteneur du tableau + pagination : ne s’étire plus sur toute la hauteur viewport */
.unified-modifications-grid-container {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    overflow: visible;
    border-radius: 0;
}
/* Bloc tableau : hauteur = contenu jusqu’à un plafond ; scroll interne si dépassement */
.unified-modifications-table-wrapper {
    flex: 0 1 auto;
    width: 100%;
    max-height: min(78vh, calc(100vh - 12rem));
    min-height: 0;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 0;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.unified-modifications-table-wrapper .unified-modifications-table {
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border-radius: 0;
    /* .table { overflow: hidden } casse position:sticky sur les th */
    overflow: visible;
    border-collapse: separate;
    border-spacing: 0;
}

.unified-modifications-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
    border-radius: 0 !important;
    background-color: var(--table-header-bg, #008000) !important;
    background-clip: padding-box;
    box-shadow: 0 1px 0 0 #dee2e6;
}

.unified-modifications-table thead th .th-sort-link {
    background-color: var(--table-header-bg, #008000);
}

.unified-modifications-table thead th.th-sort-active .th-sort-link,
.unified-modifications-table thead th .th-sort-link:hover,
.unified-modifications-table thead th .th-sort-link:focus-visible {
    background-color: var(--table-header-bg-hover, #005a00);
}

.unified-modifications-table thead th .unified-th-abbr {
    text-decoration: none;
    cursor: inherit;
    color: inherit;
    border: 0;
}

.unified-modifications-table thead th.unified-col-statut,
.unified-modifications-table thead th.unified-col-date,
.unified-modifications-table thead th.unified-col-pfht,
.unified-modifications-table thead th.unified-col-ppttc,
.unified-modifications-table thead th.unified-col-variation {
    text-align: center;
}

.unified-modifications-table thead th.unified-col-pfht .th-sort-link,
.unified-modifications-table thead th.unified-col-ppttc .th-sort-link,
.unified-modifications-table thead th.unified-col-variation .th-sort-link {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.unified-modifications-table thead th.unified-col-detail {
    text-align: center;
    white-space: nowrap;
    font-size: 0.8125rem;
    letter-spacing: 0;
    padding: 0;
}
/* Cellules : padding modéré ; colonnes texte vs compactes */
.unified-modifications-body-table td {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    box-sizing: border-box;
    vertical-align: middle;
}

.unified-modifications-body-table td.unified-col-cip {
    padding-left: 0.5rem;
    padding-right: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.015em;
}

.unified-modifications-body-table td.unified-col-cip a {
    display: inline-block;
    max-width: 100%;
}

.unified-modifications-body-table td:nth-child(4),
.unified-modifications-body-table td:nth-child(5),
.unified-modifications-body-table td:nth-child(6),
.unified-modifications-body-table td:nth-child(7),
.unified-modifications-body-table td:nth-child(8),
.unified-modifications-body-table td:nth-child(9) {
    text-align: center;
}

.unified-modifications-body-table td.unified-col-nom,
.unified-modifications-body-table td.unified-col-presentation {
    text-align: start;
    white-space: normal;
    overflow: hidden;
    line-height: 1.35;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.unified-modifications-body-table td.unified-col-nom {
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

.unified-modifications-body-table td.unified-col-presentation {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.unified-modifications-body-table td.unified-col-statut {
    padding-left: 0.4rem;
    padding-right: 0.35rem;
    overflow: hidden;
}

.unified-modifications-body-table td.unified-col-variation {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    overflow: hidden;
}

.unified-modifications-body-table td.unified-col-statut .badge.unified-statut-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    font-size: 0.74rem;
    padding: 0.36rem 0.62rem;
    letter-spacing: 0.02em;
    cursor: help;
}

.unified-modifications-body-table td.unified-col-variation .unified-comparison-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    font-size: 0.72rem;
    padding: 0.38rem 0.64rem;
    letter-spacing: 0.01em;
}

.unified-modifications-body-table td.unified-col-date {
    padding-left: 0.5rem;
    padding-right: 0.35rem;
    white-space: nowrap;
}

.unified-modifications-body-table td.unified-col-pfht,
.unified-modifications-body-table td.unified-col-ppttc {
    white-space: nowrap;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.unified-modifications-body-table td.unified-col-detail {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.unified-modifications-pagination {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.unified-modification-presentation[title] {
    cursor: help;
}

/* ===== LISTES 3 BASES (Gouv, Medic'AM Ville, Hôpital) – même sticky ===== */
.data-grid-list-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 360px;
    overflow: hidden;
}
.data-grid-list-header {
    flex-shrink: 0;
}
.data-grid-filters {
    flex-shrink: 0;
}

.data-grid-filters-dates-row {
    padding-bottom: 0.35rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
/* Lien officiel + date : deux lignes alignées à droite */
.data-grid-source-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}
/* Libellé et champ sur la même ligne, centrés verticalement */
.data-grid-filters .data-grid-filter-inline {
    min-width: 0;
}
.data-grid-filters .data-grid-filter-inline .col-form-label {
    white-space: nowrap;
}
.data-grid-grid-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.data-grid-table-wrapper {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    -webkit-overflow-scrolling: touch;
}
/* Conteneur interne : sur mobile, min-width appliqué ici (scroll horizontal stable) */
.data-grid-table-inner {
    min-width: 0;
}
.data-grid-thead-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #fff;
    box-shadow: 0 2px 0 0 #dee2e6;
}
.data-grid-thead-sticky .data-grid-header-table {
    margin-bottom: 0;
    border-bottom: 0;
}
/* En-têtes grilles Bases : charte globale pharmacy_theme */
.data-grid-thead-sticky th {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
    padding: 0.5rem 0.5rem;
    vertical-align: bottom;
    box-sizing: border-box;
    hyphens: auto;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
/* Cellules : padding et pas de débordement */
.data-grid-body-table td {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    box-sizing: border-box;
}
.data-grid-body-table .data-grid-cell-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0; /* avec table-layout:fixed, permet au ellipsis de respecter la col */
}
.data-grid-body-table .data-grid-cell-content .data-grid-cell-ellipsis,
.data-grid-body-table .data-grid-cell-content .data-grid-cip-link {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.data-grid-body-table .data-grid-cell-content .data-grid-cip-link {
    cursor: pointer;
}
.data-grid-body-table .data-grid-cell-wrap {
    overflow: hidden;
}
.data-grid-presentation[title] {
    cursor: help;
}
.data-grid-thead-visually-hidden {
    height: 0;
    overflow: hidden;
    visibility: hidden;
    border: none;
}
.data-grid-thead-visually-hidden th {
    padding: 0;
    height: 0;
    line-height: 0;
    border: none;
    visibility: hidden;
}
.data-grid-body-table {
    margin-top: 0;
    table-layout: fixed;
    width: 100%;
}
.data-grid-header-table {
    table-layout: fixed;
    width: 100%;
}

/* Fiche médicament — historique JORF : charte globale pharmacy_theme */
.medicament-detail-history-card .medicament-detail-history-table thead th {
    vertical-align: middle;
}
.medicament-detail-history-responsive {
    border-color: #dee2e6;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        width: 280px;
        background: white;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    main {
        padding-top: 0;
        margin-left: 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }

    .brand-logo-icon {
        width: 32px;
        height: 32px;
    }

    .brand-text {
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Tablette */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 100%;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* ===== COMPOSANTS ===== */

/* Stats */
.stat-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-count {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    color: #666;
}

/* Navigation */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
}

.dropdown-submenu:hover .dropdown-menu {
    display: block;
}

.navbar-nav .dropdown-menu {
    max-height: 80vh;
    overflow-y: auto;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #000080;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Écrans tactiles */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* Lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Réduction des animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== STYLES SPÉCIFIQUES AUX TEMPLATES ===== */

/* Home page */
.hero-section {
    background: linear-gradient(135deg, #2185d0 0%, #1a5f9e 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
}

.hero-brand-logo {
    width: clamp(180px, 28vw, 260px);
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.hero-brand-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: nowrap;
}

.hero-brand-title {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    white-space: normal;
    margin-top: 0.15rem;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .hero-brand-row {
        flex-wrap: wrap;
    }
    .hero-brand-logo {
        max-width: min(240px, 100%);
    }
    .hero-brand-title {
        flex: 1 1 100%;
        font-size: clamp(1.2rem, 5vw, 1.65rem);
    }
}

.page-logo-badge-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.page-logo-badge {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    opacity: 0.98;
}

.page-logo-badge--lg {
    width: 72px;
    height: 72px;
}

.page-logo-badge--xl {
    width: 104px;
    height: 104px;
}

.page-logo-overlay-anchor {
    position: relative;
}

.page-logo-overlay {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    z-index: 2;
    pointer-events: none;
}

.page-logo-overlay--topspace {
    top: -2.1rem;
}

.page-logo-overlay--api {
    top: 0.5rem;
    right: 0.75rem;
}

@media (max-width: 991.98px) {
    .page-logo-overlay {
        display: none;
    }
}

.card-stats {
    text-align: center;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-radius: 1rem;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-stats:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #1a5f9e;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.2rem;
    color: #666;
}

.auth-card {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    height: 100%;
}

.auth-card-header {
    background-color: #1a5f9e;
    color: white;
    border-radius: 1rem 1rem 0 0;
    padding: 1.5rem;
    text-align: center;
}

.auth-card-body {
    padding: 2rem;
}

.btn-auth {
    border-radius: 2rem;
    padding: 0.75rem 2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.btn-signup {
    background-color: #1a5f9e;
    border-color: #1a5f9e;
}

.btn-login {
    background-color: white;
    border-color: #1a5f9e;
    color: #1a5f9e;
}

.section-title {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 60px;
    background-color: #1a5f9e;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #f1f8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 2px solid #1a5f9e;
}

.user-profile {
    text-align: center;
}

/* Subscription info — charte vert / bleu, sans effet au survol du bloc entier */
.subscription-info {
    background-color: rgba(0, 128, 0, 0.06);
    border: 1px solid rgba(0, 90, 0, 0.25);
    transition: border-color 0.2s ease;
}

.subscription-info h6 {
    color: var(--text-heading, #005a00);
}

.subscription-info .fas.fa-crown {
    color: #ffc107;
}

/* Compact cards */
.compact-card {
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
    min-width: 200px;
}

.compact-card.compact-card--interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.compact-card h6 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.compact-card .small {
    font-size: 0.8rem;
}

/* Hero section text colors */
.hero-section .display-4 {
    color: #fff !important;
}

.auth-card-header h3 {
    color: #fff !important;
}

/* Comparaison white block */
.comparaison-white {
    background: #fff !important;
    color: #114477 !important;
    border: none;
}

.comparaison-white h3,
.comparaison-white p {
    color: #114477 !important;
}

.comparaison-white .btn-primary {
    color: #fff;
    background: #114477;
    border: none;
}

.comparaison-white .btn-primary:hover {
    background: #0d355e;
}

/* Push buttons */
.btn-push {
    background: #fff;
    color: #111;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.5rem;
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.15s;
    margin-right: 1rem;
}

.btn-push:last-child {
    margin-right: 0;
}

.btn-push:hover, .btn-push:focus {
    background: #f0f4fa;
    color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ===== STYLES SPÉCIFIQUES AUX COMPOSANTS ===== */

/* Cookie modal */
.cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    z-index: 9998;
}

.cookie-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 9999;
}

.cookie-modal-card {
    width: min(100%, 640px);
    background: #fff;
    color: #222;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.notifications-nav-link {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.notifications-badge {
    top: 0.15rem;
    right: -0.9rem;
    transform: none;
    font-size: 0.7rem;
    line-height: 1;
}

.cookie-banner-body {
    padding: 1.5rem;
}

.cookie-options {
    display: grid;
    gap: 1rem;
}

.cookie-option {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.cookie-option .form-check {
    margin-bottom: 0.5rem;
}

.cookie-option small {
    display: block;
    margin-top: 0.25rem;
}

.cookie-banner-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

/* ===== UTILITAIRES ===== */

/* Min heights */
.min-height-100 { min-height: 100px; }
.min-height-170 { min-height: 170px; }
.min-height-220 { min-height: 220px; }

/* Widths */
.width-70 { width: 70px; }
.max-width-100 { max-width: 100%; }
.max-width-200 { max-width: 200px; }
.max-width-220 { max-width: 220px; }
.max-width-250 { max-width: 250px; }
.max-width-140 { max-width: 140px; }

/* Heights */
.height-600 { height: 600px; }
.height-20 { height: 20px; }
.height-240 { height: 240px; }

/* Medic'AM détail (ville / hôpital) — graphique évolution prix : zone dédiée.
   Évite le combo .chart-container (flex) + balises json_script voisines qui
   réduisent fortement la largeur utile du canvas sur petits écrans. */
.medicam-evolution-chart-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 260px;
    min-height: 220px;
    overflow: hidden;
    box-sizing: border-box;
}
.medicam-evolution-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}
@media (max-width: 576px) {
    .medicam-evolution-chart-wrap {
        height: 240px;
        min-height: 200px;
    }
}

/* Font sizes */
.font-size-0-98 { font-size: 0.98em; }
.font-size-1-1 { font-size: 1.1rem; }

/* Colors */
.color-666 { color: #666; }
.color-007bff { color: #007bff; }

/* Backgrounds */
.bg-gradient-green {
    background: linear-gradient(90deg, #008000 60%, #00b300 100%);
    color: #fff;
}

/* Overflow */
.overflow-visible { overflow: visible; }

/* Display */
.display-none { display: none; }

/* Text alignment */
.text-center { text-align: center; }

/* Word break */
.word-break-all { word-break: break-all; }

/* Responsive modal */
.modal-lg-custom {
    max-width: 1200px;
    min-width: 900px;
    width: 98vw;
}

.modal-body-scroll {
    overflow-x: auto;
}

/* Legend colors */
.legend-color {
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-right: 8px;
    border-radius: 3px;
}

/* Progress bars */
.progress-custom {
    height: 20px;
}

/* Form elements */
.form-margin-0 {
    margin: 0;
    padding: 0;
}

/* CSRF form */
.csrf-form-hidden {
    display: none;
}

/* ===== RESPONSIVE MOBILE ===== */

@media (max-width: 768px) {
    .cookie-banner {
        padding: 0.5rem;
    }
    
    .cookie-banner-content {
        margin: 0;
    }
    
    .cookie-banner-footer .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cookie-banner-footer .d-flex .d-flex {
        flex-direction: row;
        justify-content: center;
    }
    
    .modal-lg-custom {
        max-width: 95vw;
        min-width: auto;
        width: 95vw;
    }
}

#statutChart, #evolutionChart {
    width: 100% !important;
    max-width: 600px;
    height: 300px !important;
    max-height: 400px;
    margin: 0 auto;
    display: block;
}

/* ===== PAGE ANALYSE COMPARAISONS ===== */

.analysis-header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.chart-container {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    flex: 1 1 0%;
}
.chart-container > canvas,
.chart-container canvas,
.dashboard-chart-canvas-wrap canvas,
.home-chart-doughnut canvas,
.home-chart-bars canvas {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: block;
}

.period-selector {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.period-btn {
    border-radius: 20px;
    margin: 0.25rem;
}

.insights-card {
    background: linear-gradient(135deg, #17a2b8, #20c997);
    color: white;
    border-radius: 15px;
}

.progress-enhanced {
    height: 25px;
    border-radius: 15px;
    overflow: hidden;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Progress bars personnalisées */
.progress-custom {
    height: 20px;
}

/* Application des largeurs de progress bar via JavaScript */
.progress-bar[data-width] {
    width: 0%;
    transition: width 0.6s ease;
}

/* ===== PAGE ADMIN PANEL ===== */

.stats-card {
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.workflow-card {
    border-left: 4px solid #28a745;
}

.command-card {
    border-left: 4px solid #007bff;
}

.visualization-card {
    border-left: 4px solid #6f42c1;
}

.database-card {
    border-left: 4px solid #fd7e14;
}

.action-button {
    transition: all 0.2s ease;
}

.action-button:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.command-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.command-block h5 {
    color: #495057;
    margin-bottom: 1rem;
}

/* Couleurs personnalisées pour les boutons */
.btn-success-light {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-success-lighter {
    background-color: #34ce57;
    border-color: #34ce57;
    color: white;
}

.btn-success-dark {
    background-color: #1e7e34;
    border-color: #1e7e34;
    color: white;
}

.btn-blue-light {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-blue-dark {
    background-color: #0056b3;
    border-color: #0056b3;
    color: white;
}

.btn-red-light {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-red-dark {
    background-color: #bd2130;
    border-color: #bd2130;
    color: white;
}

/* Hover effects */
.btn-success-light:hover, .btn-success-lighter:hover, .btn-success-dark:hover,
.btn-blue-light:hover, .btn-blue-dark:hover,
.btn-red-light:hover, .btn-red-dark:hover {
    filter: brightness(90%);
    color: white;
}

.action-card {
    height: 100%;
}

.action-section {
    margin-bottom: 1rem;
}

.action-section h5 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.charts-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
}

/* ===== PAGE COMPARAISONS CALENDAR ===== */

.modal .table th, .modal .table td {
    vertical-align: middle;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
}

.modal .table th {
    min-width: 110px;
    text-align: center;
}

.modal .table td {
    text-align: center;
}

.modal .table td.nom-medicament-col {
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal .table td.prix-col {
    min-width: 90px;
    white-space: nowrap;
} 
/* Classes utilitaires pour remplacer les styles inline */
.user-avatar-size {
    width: 150px;
    height: 150px;
}

.form-inline {
    margin: 0;
    padding: 0;
}

.bg-gradient-green {
    background: linear-gradient(90deg, #008000 60%, #00b300 100%);
    color: #fff;
}

/* ===== STYLES POUR LA PAGE REGISTER ===== */

.password-progress {
    height: 8px;
}

.password-criteria {
    font-size: 0.95em;
    padding-left: 18px;
}

/* ===== CLASSES UTILITAIRES ===== */

/* Classes pour remplacer les styles inline */
.min-height-100 { min-height: 100px; }
.min-height-170 { min-height: 170px; }
.min-height-220 { min-height: 220px; }

.width-70 { width: 70px; }
.max-width-100 { max-width: 100%; }
.max-width-200 { max-width: 200px; }
.max-width-220 { max-width: 220px; }
.max-width-250 { max-width: 250px; }
.max-width-140 { max-width: 140px; }

.height-600 { height: 600px; }
.height-20 { height: 20px; }

.font-size-0-98 { font-size: 0.98em; }
.font-size-1-1 { font-size: 1.1rem; }

.color-666 { color: #666; }
.color-007bff { color: #007bff; }

.bg-gradient-green {
    background: linear-gradient(90deg, #008000 60%, #00b300 100%);
    color: #fff;
}

.overflow-visible { overflow: visible; }

.display-none { display: none; }

.text-center { text-align: center; }

.word-break-all { word-break: break-all; }

/* Classes pour les couleurs de légende */
.legend-color-danger { background-color: #dc3545; }
.legend-color-success { background-color: #28a745; }
.legend-color-primary { background-color: #007bff; }
.legend-color-warning { background-color: #ffc107; }
.legend-color-secondary { background-color: #6c757d; }

/* Gestion des couleurs dynamiques pour les légendes */
.legend-color-dynamic {
    background-color: var(--legend-color, #6c757d);
}

.text-pre-wrap { white-space: pre-wrap; }

.praxely-w-12rem { width: 12rem; }
.praxely-w-14rem { width: 14rem; }
.praxely-w-18rem { width: 18rem; }
.praxely-maxw-18rem { max-width: 18rem; }
.praxely-minh-320 { min-height: 320px; }

.praxely-api-container {
    max-width: 900px;
    padding: 2rem 1rem;
}

.evolution-chart-container {
    height: 420px;
    min-height: 300px;
    max-height: 65vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}

.chart-container {
    height: 100%;
    width: 100%;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.evolution-chart-container .chart-container canvas,
.pie-chart-container .chart-container canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
}

#evolutionPlotly {
    width: 100% !important;
    height: 100% !important;
    min-height: 350px;
    max-height: 65vh;
    display: block;
}

#piePlotly {
    width: 100% !important;
    height: 100% !important;
    min-height: 350px;
    max-height: 65vh;
    display: block;
}

.pie-chart-container {
    min-height: 350px;
    height: 420px;
    max-height: 65vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}

@media (max-width: 991px) {
    .evolution-chart-container { height: 300px; max-height: 45vh; }
    #evolutionPlotly { min-height: 200px; }
    .pie-chart-container { height: 300px; max-height: 45vh; }
    #piePlotly { min-height: 200px; }
}
@media (max-width: 576px) {
    .evolution-chart-container { height: 180px; max-height: 30vh; min-height: 120px; }
    #evolutionPlotly { min-height: 120px; }
    .pie-chart-container { height: 180px; max-height: 30vh; min-height: 120px; }
    #piePlotly { min-height: 120px; }
}

@media (max-width: 767.98px) {
    .unified-modifications-list-layout,
    .data-grid-list-layout {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .unified-modifications-grid-container,
    .data-grid-grid-container {
        overflow: visible;
    }

    .unified-modifications-table-wrapper,
    .data-grid-table-wrapper {
        max-width: 100%;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    .unified-modifications-filters-inner {
        gap: 0.75rem;
    }

    .unified-modifications-filters-row--dates {
        padding-bottom: 0.65rem;
    }

    .jorf-date-filter-group {
        width: 100%;
    }

    .unified-modifications-filters-row--criteria {
        justify-content: flex-start !important;
    }

    .unified-modifications-filters {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .unified-modifications-filters .d-flex.align-items-center.gap-2.flex-shrink-0 {
        width: 100%;
        flex-wrap: wrap;
        align-items: stretch !important;
    }

    .unified-modifications-filters .d-flex.align-items-center.gap-2.flex-shrink-0 > .form-label {
        display: block;
        flex: 0 0 100% !important;
        width: 100%;
        margin-bottom: 0.15rem !important;
        color: #495057 !important;
        font-weight: 600;
        white-space: normal;
    }

    .unified-modifications-filters .d-flex.align-items-center.gap-2.flex-shrink-0 > .btn {
        width: 100%;
    }

    .unified-modifications-filters .unified-search-field-wrap,
    .unified-modifications-filters .unified-filter-select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .praxely-w-12rem,
    .praxely-w-14rem,
    .praxely-w-18rem {
        width: 100% !important;
        max-width: 100%;
    }

    .data-grid-filters .col-auto {
        width: 100%;
    }

    .data-grid-filters .col-auto .form-control,
    .data-grid-filters .col-auto .form-select,
    .data-grid-filters .col-auto .btn {
        width: 100%;
    }

    .data-grid-filters .col-auto .data-grid-filter-inline .form-control,
    .data-grid-filters .col-auto .data-grid-filter-inline .form-select {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }

    .data-grid-filters .col-auto .data-grid-filter-inline .btn {
        width: auto;
    }

    .unified-modifications-table-wrapper {
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    .data-grid-table-inner {
        display: inline-block;
        min-width: 840px;
    }

    .unified-modifications-table-wrapper .unified-modifications-table {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    .data-grid-thead-sticky {
        display: none !important;
    }

    .data-grid-thead-visually-hidden {
        height: auto !important;
        overflow: visible !important;
        visibility: visible !important;
        border: 0;
    }

    .data-grid-thead-visually-hidden th {
        padding: 0.4rem 0.35rem !important;
        height: auto !important;
        line-height: 1.2 !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        visibility: visible !important;
        background: linear-gradient(
            135deg,
            var(--nav-gradient-start, #005000) 0%,
            var(--nav-gradient-end, #0d7a28) 100%
        ) !important;
        color: #fff !important;
        white-space: nowrap !important;
        font-size: 0.76rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .unified-modifications-body-table td.unified-col-nom,
    .unified-modifications-body-table td.unified-col-presentation {
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }

    .data-grid-header-table,
    .data-grid-body-table {
        table-layout: auto !important;
        width: max-content !important;
        min-width: 0 !important;
    }

    .data-grid-header-table colgroup col,
    .data-grid-body-table colgroup col {
        width: auto !important;
    }

    .unified-modifications-body-table td.unified-col-cip,
    .unified-modifications-body-table td.unified-col-date,
    .unified-modifications-body-table td.unified-col-pfht,
    .unified-modifications-body-table td.unified-col-ppttc {
        white-space: nowrap !important;
    }

    /* Data grid : éviter l'ellipsis « 8… » sur petites largeurs — le scroll est sur le wrapper */
    .data-grid-body-table .data-grid-cell-content {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
    }

    .data-grid-body-table .data-grid-cell-content .data-grid-cell-ellipsis,
    .data-grid-body-table .data-grid-cell-content .data-grid-cip-link {
        display: inline !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .data-grid-body-table td {
        white-space: normal !important;
    }
}

.presentation-truncate {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
