/* ==========================================================================
   ==========================================================================
   Mediscribe — stylesheet.css (global)
   Nouveau modèle : .grid > .section > .section-body > .champ
   ==========================================================================
   ========================================================================== */



/* ==========================================================================
   ==========================================================================
   01) PALETTE + TOKENS
   ==========================================================================
   ========================================================================== */
:root {
    /* ----------------------------------------------------------------------
       01.1) Gris
       ---------------------------------------------------------------------- */
    --gris1: #f8fafc;
    --gris2: #f1f5f9;
    --gris3: #e2e8f0;
    --gris4: #94a3b8;
    --gris5: #334155;

    /* ----------------------------------------------------------------------
       01.2) Vert
       ---------------------------------------------------------------------- */
    --vert0: #f9fdfb;
    --vert1: #e6f4ef;
    --vert2: #bfe9db;
    --vert3: #5fd0b2;
    --vert4: #10b981;
    --vert5: #0f766e;

    /* ----------------------------------------------------------------------
       01.3) Rouge
       ---------------------------------------------------------------------- */
    --rouge1: #fee2e2;
    --rouge3: #fca5a5;
--rouge4: #991b1b;
    --rouge5: #dc2626;

    /* ----------------------------------------------------------------------
       01.4) Alias fonctionnels
       ---------------------------------------------------------------------- */
    --bg: var(--gris1);
    --panel: #fff;
    --text: var(--gris5);
    --muted: #475569;
    --border: rgba(15, 23, 42, .10);
    --shadow: 0 1px 2px rgba(15, 23, 42, .06);

    --radius: 16px;
    --radius-sm: 12px;

    --primary: var(--vert5);
    --accent: var(--vert4);
    --danger: var(--rouge5);

    --topbar-h: 56px;

    --field-h: 34px;
    --textarea-hdef: 2;
}



/* ==========================================================================
   ==========================================================================
   02) BASE GLOBALE
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   02.1) Reset / box-sizing
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   02.2) HTML / body
   -------------------------------------------------------------------------- */
html,
body {
    height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg);
}

/* --------------------------------------------------------------------------
   02.3) Police des contrôles
   -------------------------------------------------------------------------- */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: var(--text);
}



/* ==========================================================================
   ==========================================================================
   03) LIENS ET TEXTE
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   03.1) Liens globaux
   -------------------------------------------------------------------------- */
a.lien {
    color: var(--primary);
    text-decoration: none;
    padding: 0px 4px 2px 4px;
    border-radius: 4px;
}

a.lien:hover {
    background: var(--vert1);
}

a.lien:focus-visible {
    outline: none;
    border-radius: 6px;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
}

/* --------------------------------------------------------------------------
   03.2) Lien externe (target=_blank)
   -------------------------------------------------------------------------- */
a[target="_blank"]::after {
    content: "↗";
    font-size: .85em;
    margin-left: 4px;
    opacity: .6;
}

a[target="_blank"]:hover::after {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   03.3) Texte classique
   -------------------------------------------------------------------------- */
.text-classic {
    font-size: 13px;
    line-height: 2.3;
    color: var(--text);
}



/* ==========================================================================
   ==========================================================================
   04) UTILITAIRES
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   04.1) Visibilité / display
   -------------------------------------------------------------------------- */
.is-hidden {
    display: none !important;
}

/* --------------------------------------------------------------------------
   04.2) Marges utilitaires
   -------------------------------------------------------------------------- */
.mt-12 {
    margin-top: 12px !important;
}

/* --------------------------------------------------------------------------
   04.3) Texte secondaire
   -------------------------------------------------------------------------- */
.muted {
    color: var(--muted);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   04.4) Tooltip global
   -------------------------------------------------------------------------- */
#msGlobalHover {
    position: fixed;
    z-index: 60;
    display: none;
    pointer-events: none;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--gris5);
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    box-shadow: 0 10px 30px var(--gris3);
}


/* ==========================================================================
   ==========================================================================
   05) LAYOUT GLOBAL
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   05.1) Body applicatif
   -------------------------------------------------------------------------- */
.ms-body {
    overflow: hidden;
    padding-top: var(--topbar-h);
}

/* --------------------------------------------------------------------------
   05.2) Shell principal
   -------------------------------------------------------------------------- */
.app-shell {
    height: calc(100vh - var(--topbar-h));
    display: flex;
    min-height: 0;
    width: 100%;
}

.app-shell>* {
    min-width: 0;
}

/* --------------------------------------------------------------------------
   05.3) Zone main
   -------------------------------------------------------------------------- */
.app-main {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overflow-x: hidden;
    padding: 16px;
}



/* ==========================================================================
   ==========================================================================
   06) GRILLE PAGE
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   06.1) Grid 2 colonnes
   -------------------------------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   06.2) Éléments pleine largeur
   -------------------------------------------------------------------------- */
.full-width {
    grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   06.3) Responsive < 1200px
   -------------------------------------------------------------------------- */
@media (max-width:1200px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: 1 / -1;
    }
}



/* ==========================================================================
   ==========================================================================
   07) SECTIONS ET CHAMPS
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   07.1) Section
   -------------------------------------------------------------------------- */
.section {
    background: var(--panel);
    border: 1px solid var(--gris3);
    border-radius: 14px;
    box-shadow: var(--shadow);
    min-width: 0;
}

/* --------------------------------------------------------------------------
   07.2) Header de section
   -------------------------------------------------------------------------- */
.section>header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    background: var(--vert0);
    padding: 6px 10px;
    min-height: 42px;
    border-radius: 14px 14px 0 0;
    border-bottom: 1px solid var(--gris3);
}

/* --------------------------------------------------------------------------
   07.3) Titres h2 / h3
   -------------------------------------------------------------------------- */
.section h2 {
    margin: 0;
    line-height: 1.2;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    min-width: 0;
}

.section h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vert5);
    min-width: 0;
}

.titre2{
    display: block;
    grid-column: 1 / -1;
    width: 100%;

    background: var(--vert0);
    padding: 5px 10px;
    border-radius: 10px;
    border:1px solid var(--gris3);
}

/* --------------------------------------------------------------------------
   07.4) Body de section
   -------------------------------------------------------------------------- */
.section-body {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    padding: 16px;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   07.5) Champ / titre / contenu
   -------------------------------------------------------------------------- */
.champ {
    display: contents;
}

.champ-titre {
    grid-column: 1;
    font-weight: 600;
    font-size: 13px;
    color: var(--gris5);
    padding-top: 6px;
    white-space: nowrap;
    min-width: 0;
}

.champ-contenu {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    min-height: 34px;
}

/* --------------------------------------------------------------------------
   07.6) Variante section--top
   -------------------------------------------------------------------------- */
.section--top .champ {
    gap: 4px;
}

.section--top .champ-titre {
    padding: 0 0 0 0;
    min-height: auto;
}

.section--top .champ-contenu {
    min-height: 34px;
}

/* --------------------------------------------------------------------------
   07.7) Champ-top
   -------------------------------------------------------------------------- */
.champ-top {
    display: block;
    grid-column: 1 / -1;
    min-width: 0;
}

.champ-top .champ {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.champ-top .champ-titre {
    padding-top: 0;
    white-space: normal;
}

.champ-top .champ-contenu {
    width: 100%;
}

/* --------------------------------------------------------------------------
   07.8) Section entière en mode top
   -------------------------------------------------------------------------- */
.section--top .section-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section--top .champ {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section--top .champ-titre {
    padding-top: 0;
    white-space: normal;
}

.section--top .champ-contenu {
    width: 100%;
}

/* --------------------------------------------------------------------------
   07.9) Variante split — section-body en colonnes
   -----------------------------------------------------------------------
   Structure de base :
     <div class="section-body split">
       <div class="split-col">         <!-- taille = contenu (défaut)  -->
       <div class="split-col--fill">   <!-- prend l'espace restant     -->
       <div class="split-col--half">   <!-- exactement 50 %            -->
       <div class="split-col--preview"> <!-- zone aperçu, fond blanc   -->
     </div>

   Chaque classe est autonome (grille max-content/1fr incluse).
   split-col--preview est la seule sans grille (contenu libre centré).

   À l'intérieur de chaque colonne, .champ / .champ-titre / .champ-contenu
   fonctionnent exactement comme dans un .section-body normal.
   -------------------------------------------------------------------------- */

/* Conteneur split — reset la grille de .section-body */
.section-body.split {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 0;
    grid-template-columns: none; /* neutralise la grille héritée */
}

/* Colonne de base : taille dictée par son contenu */
.split-col {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    padding: 16px;
    min-width: 0;
    flex: 0 0 auto;       /* ne grandit pas, ne rétrécit pas */
    align-content: start;
}

/* Modificateur : prend tout l'espace disponible */
.split-col--fill {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    padding: 16px;
    min-width: 0;
    flex: 1 1 0;
    align-content: start;
}

/* Modificateur : exactement 50 % */
.split-col--half {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 10px;
    padding: 16px;
    min-width: 0;
    flex: 0 0 50%;
    max-width: 50%;
    align-content: start;
}

/* Modificateur : colonne d'aperçu (50 %, fond blanc, contenu libre centré) */
.split-col--preview {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-width: 0;
    /* pas de grille — contenu libre */
    grid-template-columns: none;
}

/* Séparateur vertical entre colonnes */
.split-col + .split-col,
.split-col + .split-col--fill,
.split-col + .split-col--preview,
.split-col + .split-col--half,
.split-col--fill + .split-col,
.split-col--fill + .split-col--preview,
.split-col--fill + .split-col--half,
.split-col--half + .split-col--half,
.split-col--half + .split-col--preview,
.split-col--preview + .split-col,
.split-col--preview + .split-col--fill,
.split-col--preview + .split-col--half {
    border-left: 1px solid var(--gris3);
}

/* --------------------------------------------------------------------------
   07.10) Responsive étroit < 700px
   -------------------------------------------------------------------------- */
@media (max-width:700px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: 1 / -1;
    }

    .section-body {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* split : empiler les colonnes sur mobile */
    .section-body.split {
        flex-direction: column;
    }

    .split-col,
    .split-col--fill,
    .split-col--half,
    .split-col--preview {
        flex: 1 1 auto;
        max-width: 100%;
        border-left: none !important;
        border-top: 1px solid var(--gris3);
    }

    .split-col:first-child,
    .split-col--fill:first-child,
    .split-col--half:first-child,
    .split-col--preview:first-child {
        border-top: none;
    }

    /* split-col redevient flex colonne sur mobile */
    .split-col,
    .split-col--fill,
    .split-col--half {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .champ {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .champ-titre {
        padding-top: 0;
        white-space: normal;
    }

    .champ-contenu {
        width: 100%;
    }
}



/* ==========================================================================
   ==========================================================================
   08) INPUTS ET TEXTAREAS
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   08.1) Inputs / select
   -------------------------------------------------------------------------- */
input:not([type="radio"]):not([type="checkbox"]),
select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;

    height: var(--field-h);
    min-height: var(--field-h);

    padding: 0 10px;

    border: 1px solid var(--gris3);
    border-radius: 10px;

    font-size: 13px;
    line-height: 1;
    outline: none;
    background: #fff;
    color: var(--text);

    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   08.2) Focus inputs / select / textarea
   -------------------------------------------------------------------------- */
input:not([type="radio"]):not([type="checkbox"]):focus,
select:focus,
textarea:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .25);
}

/* --------------------------------------------------------------------------
   08.3) Textarea
   -------------------------------------------------------------------------- */
textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;

    padding: 8px 10px;

    border: 1px solid var(--gris3);
    border-radius: 10px;

    font-size: 13px;
    line-height: 1.3;

    outline: none;
    background: #fff;
    color: var(--text);

    box-sizing: border-box;

    resize: none;
    overflow: auto;
}

/* --------------------------------------------------------------------------
   08.4) Textarea auto-grow
   -------------------------------------------------------------------------- */
textarea.auto-grow {
    overflow: hidden;
}



/* ==========================================================================
   ==========================================================================
   09) ALIGNEMENTS ET LISTES
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   09.1) align-row
   -------------------------------------------------------------------------- */
.align-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 0;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   09.2) align-col
   -------------------------------------------------------------------------- */
.align-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 0;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   09.3) liste-item
   -------------------------------------------------------------------------- */
.liste-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text);
    min-width: 0;
}

.liste-item span {
    min-width: 0;
}

/* --------------------------------------------------------------------------
   09.4) Radios custom
   -------------------------------------------------------------------------- */
.liste-item input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
    appearance: none;
    border: 1px solid var(--gris4);
    border-radius: 999px;
    background: #fff;
    position: relative;
}

.liste-item input[type="radio"]::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    background: var(--primary);
    transform: scale(0);
    transition: .12s ease-in-out;
}

.liste-item input[type="radio"]:checked {
    border-color: var(--vert5);
}

.liste-item input[type="radio"]:checked::after {
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   09.5) Checkboxes custom
   -------------------------------------------------------------------------- */
.liste-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;

    appearance: none;
    border: 1px solid var(--gris4);
    border-radius: 3px;
    background: #fff;
    position: relative;
    cursor: pointer;
    transition: .12s ease-in-out;
}

.liste-item input[type="checkbox"]:checked {
    background: var(--vert5);
    border-color: var(--vert5);
}

.liste-item input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   09.6) Mode bouton (mode-btn)
   -------------------------------------------------------------------------- */
.liste-item.mode-btn {
    position: relative;
    display: inline-flex;
    gap: 0;
    padding: 0;
}

.liste-item.mode-btn input[type="radio"],
.liste-item.mode-btn input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.liste-item.mode-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 400;
    background: none;
    border: 1px solid var(--gris3);
    color: var(--text);
    transition: .15s ease;
    cursor: pointer;
}

.liste-item.mode-btn:hover span {
    background: var(--gris1);
    border-color: var(--vert3);
    color: var(--vert5);
}

.liste-item.mode-btn input:checked+span {
    background: var(--gris1);
    border-color: var(--vert4);
    color: var(--vert5);
}

.liste-item.mode-btn input:checked+span:hover {
    background: var(--vert1);
}

/*  mode-btn radio : afficher un V devant l’intitulé sélectionné */
.liste-item.mode-btn input[type="radio"]+span::before {
    content: "";
    display: inline-block;
    width: 0;
    margin-right: 0;
    overflow: hidden;
    transition: .12s ease;
}

.liste-item.mode-btn input[type="radio"]:checked+span::before {
    content: "✓";
    width: auto;
    margin-right: 8px;
    font-weight: 700;
    color: var(--vert5);
}

.liste-item.mode-btn input[type="checkbox"]+span::before {
    content: "";
    display: inline-block;
    width: 0;
    margin-right: 0;
    overflow: hidden;
    transition: .12s ease;
}

.liste-item.mode-btn input[type="checkbox"]:checked+span::before {
    content: "✓";
    width: auto;
    margin-right: 8px;
    font-weight: 700;
    color: var(--vert5);
}

/* ==========================================================================
   ==========================================================================
   10) LARGEURS UTILITAIRES
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   10.1) Largeurs w-*
   -------------------------------------------------------------------------- */
.w-100 {
    width: 100% !important;
}

.w-60 {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
}

.w-130 {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
}

.w-160 {
    width: 160px !important;
}

.w-270 {
    width: 270px !important;
    max-width: 100%;
}

.w-360 {
    width: 360px !important;
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   10.2) Compat inputs
   -------------------------------------------------------------------------- */
.input-short {
    width: 160px !important;
}

.input-middle {
    width: 360px !important;
}

/* --------------------------------------------------------------------------
   10.3) mini-num / mini-select
   -------------------------------------------------------------------------- */
input.mini-num {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    flex: 0 0 60px;
    padding: 4px 2px;
    text-align: center;
    min-height: 34px;
}





/* ==========================================================================
   ==========================================================================
   11) CHAMPS COMPOSÉS
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   11.1) compose-wrap
   -------------------------------------------------------------------------- */
.compose-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.compose-wrap> :is(input, textarea, select) {
    flex: 1;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   11.2) compose-reset
   -------------------------------------------------------------------------- */
.compose-reset {
    align-items: center;
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid var(--gris3);
    background: transparent;
    text-decoration: none;
    color: var(--gris5);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    display: none;
}

.compose-reset:hover {
    background: var(--gris1);
    border-color: var(--gris3);
}

/* --------------------------------------------------------------------------
   11.3) État manuel
   -------------------------------------------------------------------------- */
.compose-wrap.is-manual .compose-reset {
    display: inline-block;
}



/* ==========================================================================
   ==========================================================================
   12) DATES ET MINI-CHAMPS
   ==========================================================================
   ========================================================================== */


/* --------------------------------------------------------------------------
   12.2) Séparateur texte
   -------------------------------------------------------------------------- */
.date-range .sep {
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   12.3) Date-range en ligne
   -------------------------------------------------------------------------- */
.date-range.align-row {
    flex-wrap: nowrap;
}

/* --------------------------------------------------------------------------
   12.4) Inputs date dans date-range
   -------------------------------------------------------------------------- */
.date-range input[type="date"] {
    width: 120px;
    flex: 0 0 120px;
}


/* ==========================================================================
   ==========================================================================
   13) SWITCH
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   13.1) Structure
   -------------------------------------------------------------------------- */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

/* --------------------------------------------------------------------------
   13.2) Input caché
   -------------------------------------------------------------------------- */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* --------------------------------------------------------------------------
   13.3) Slider
   -------------------------------------------------------------------------- */
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--gris3);
    border-radius: 999px;
    transition: .2s;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 999px;
    transition: .2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}

/* --------------------------------------------------------------------------
   13.4) États checked
   -------------------------------------------------------------------------- */
.switch input:checked+.slider {
    background: var(--primary);
}

.switch input:checked+.slider::before {
    transform: translateX(20px);
}






/* ==========================================================================
   ==========================================================================
   14) INAMI
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   14.1) Liste
   -------------------------------------------------------------------------- */
.inami-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   14.2) Ligne de recherche
   -------------------------------------------------------------------------- */
.inami-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    position: relative;
}

.inami-row {
    padding-bottom: 8px;
}

/* --------------------------------------------------------------------------
   14.3) Input code
   -------------------------------------------------------------------------- */
.inami-input {
    width: 160px;
    flex: 0 0 160px;
    text-align: left;
}

/* --------------------------------------------------------------------------
   14.4) Description
   -------------------------------------------------------------------------- */
.inami-desc {
    flex: 1;
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   14.5) Suggestions
   -------------------------------------------------------------------------- */
.inami-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 6px;
    background: #fff;
    border: 1px solid var(--gris3);
    border-radius: 12px;
    box-shadow: 0 10px 22px var(--gris3);
    z-index: 80;
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    display: none;
}

/* --------------------------------------------------------------------------
   14.6) Item de suggestion
   -------------------------------------------------------------------------- */
.inami-suggest__item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.25;
}

.inami-suggest__item strong {
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   14.7) États hover / actif
   -------------------------------------------------------------------------- */
.inami-suggest__item:hover {
    background: var(--gris2);
}

.inami-suggest__item.is-active {
    background: var(--gris3);
}



/* ==========================================================================
   ==========================================================================
   15) PROTOCOLE OPÉRATOIRE / QUILL
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   15.1) Conteneur éditeur
   -------------------------------------------------------------------------- */
.ms-editor {
    width: 100%;
    display: block !important;
}

/* --------------------------------------------------------------------------
   15.2) Toolbar
   -------------------------------------------------------------------------- */
.ms-editor .ql-toolbar.ql-snow {
    border: 1px solid var(--gris3);
    border-bottom: 1px solid var(--gris3);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--gris1);
}

/* --------------------------------------------------------------------------
   15.3) Container
   -------------------------------------------------------------------------- */
.ms-editor .ql-container.ql-snow {
    border: 1px solid var(--gris3);
    border-top: 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: #fff;
}

/* --------------------------------------------------------------------------
   15.4) Contenu
   -------------------------------------------------------------------------- */
.ms-editor .ql-editor {
    min-height: 160px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   15.5) Textarea backend caché
   -------------------------------------------------------------------------- */
.protocole-block textarea[hidden] {
    display: none !important;
}





/* ==========================================================================
   ==========================================================================
   16) CERTIFICATS
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   16.1) Statut générique
   -------------------------------------------------------------------------- */
.cert-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    user-select: none;

}

/* --------------------------------------------------------------------------
   16.2) Statut OK
   -------------------------------------------------------------------------- */
.cert-status.ok {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* --------------------------------------------------------------------------
   16.3) Statut KO
   -------------------------------------------------------------------------- */
.cert-status.ko {
    background: var(--rouge1);
    color: #991b1b;
    border: 1px solid var(--rouge3);
}

/* --------------------------------------------------------------------------
   16.4) Lien effacer
   -------------------------------------------------------------------------- */
.effacer {
    font-size: 12px;
    font-family: inherit;
    color: var(--text);
    text-decoration: none;
	margin-right: 10px;
}

.effacer:hover {
    color: var(--danger);
}
/* --------------------------------------------------------------------------
   16.5) Libellé certificat
   -------------------------------------------------------------------------- */
.cert-label {
    margin-left: -10px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.cert-status.ok + .cert-label {
    color: var(--vert5);
}

.cert-status.ko + .cert-label {
    color: var(--rouge4);
}




/* ==========================================================================
   ==========================================================================
   17) MODAL
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   17.1) Hidden
   -------------------------------------------------------------------------- */
.modal[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   17.2) Overlay
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

/* --------------------------------------------------------------------------
   17.3) Backdrop
   -------------------------------------------------------------------------- */
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .45);
}

/* --------------------------------------------------------------------------
   17.4) Dialog
   -------------------------------------------------------------------------- */
.modal__dialog {
    position: relative;
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    background: var(--panel);
    border: 1px solid var(--gris3);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(2, 6, 23, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   17.5) Head
   -------------------------------------------------------------------------- */
.modal__head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 4px 8px 4px 14px;
    background: var(--gris1);
    border-bottom: 1px solid var(--gris3);
}

/* --------------------------------------------------------------------------
   17.6) Title
   -------------------------------------------------------------------------- */
.modal__title {
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--vert5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   17.7) Close
   -------------------------------------------------------------------------- */
.modal__close {
    appearance: none;
    border: 0;
    background: transparent;
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    color: var(--gris4);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__close:hover {

    color: var(--gris5);
}

/* --------------------------------------------------------------------------
   17.8) Body
   -------------------------------------------------------------------------- */
.modal__body {
    padding: 14px;
    overflow: auto;
    flex: 1 1 auto;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   17.9) Footer
   -------------------------------------------------------------------------- */
.modal__foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-top: 1px solid var(--gris3);
    background: var(--panel);
}

/* --------------------------------------------------------------------------
   17.10) Formulaire modal générique
   -------------------------------------------------------------------------- */
.modal-form {
    display: grid;
    gap: 10px;
}

.modal-field {
    display: grid;
}

.modal-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gris5);
}

/* --------------------------------------------------------------------------
   17.11) Label au-dessus du champ
   Usage : <div class="modal__body label-supra">
   -------------------------------------------------------------------------- */
.label-supra .modal-form {
    gap: 10px;
}

.label-supra .modal-field {
    gap: 10px;
}

/* --------------------------------------------------------------------------
   17.12) Label à gauche du champ, aligné sur le label le plus long
   Usage : <div class="modal__body label-left">
   -------------------------------------------------------------------------- */
.label-left .modal-form {
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 10px;
    align-items: center;
}

.label-left .modal-field {
    display: contents;
}

.label-left .modal-label {
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   17.13) Colonnes internes
   -------------------------------------------------------------------------- */
.modal__cols {
    display: grid;
    gap: 12px;
}
.modal__form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}



/* ==========================================================================
   ==========================================================================
   18) SMARTLIST
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   18.1) Champ smartlist
   -------------------------------------------------------------------------- */
.smartlist-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.smartlist-field>input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   18.2) Colonnes modal
   -------------------------------------------------------------------------- */
.smartlist-modal__cols {
    display: grid;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   18.3) Colonne smartlist
   -------------------------------------------------------------------------- */
.smartlist-col {
    width: 235px;
    max-width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 6px 0;
    position: relative;
}

/* --------------------------------------------------------------------------
   18.4) Header de colonne
   -------------------------------------------------------------------------- */
.smartlist-col__head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 6px 10px;
    margin-bottom: 6px;

    background: var(--gris1);
    border: 1px solid var(--gris3);
    border-radius: var(--radius);

    font-size: 13px;
    font-weight: 600;
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   18.5) Meta de colonne
   -------------------------------------------------------------------------- */
.smartlist-col__meta {
    font-size: 12px;
    color: var(--gris4);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   18.6) Liste interne
   -------------------------------------------------------------------------- */
.smartlist-col__list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* --------------------------------------------------------------------------
   18.7) Ligne smartlist
   -------------------------------------------------------------------------- */
.smartlist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    transition: background .12s ease, transform .12s ease;
}

/* --------------------------------------------------------------------------
   18.8) Drag handle
   -------------------------------------------------------------------------- */
.smartlist-drag {
    cursor: grab;
    background: transparent;
    color: var(--gris4);
    padding: 1px 4px 4px 4px;
    border-radius: 8px;
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
    border: 1px solid transparent;
}

.smartlist-drag:hover {
    color: var(--gris5);
}

.smartlist-drag:active {
    cursor: grabbing;
}

/* --------------------------------------------------------------------------
   18.9) Delete button
   -------------------------------------------------------------------------- */
.smartlist-del {
    background: transparent;
    cursor: pointer;
    color: var(--gris4);
    padding: 1px 4px 4px 4px;
    border-radius: 8px;
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
    border: 1px solid transparent;
}

.smartlist-del:hover {
    background: var(--rouge1);
    color: var(--rouge5);
    border: 1px solid var(--rouge5);
}

/* --------------------------------------------------------------------------
   18.10) Bloc ajout
   -------------------------------------------------------------------------- */
.smartlist-add {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
}

.smartlist-add input {
    flex: 1 1 auto;
    min-width: 0;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--gris3);
    border-radius: 10px;
    background: transparent;
    font-size: 13px;
}

.smartlist-add button {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--gris3);
    border-radius: 10px;
    background: transparent;
    font-weight: 600;
    font-size: 12.5px;
    cursor: pointer;
}

.smartlist-add button:hover {
    background: var(--gris1);
}

/* --------------------------------------------------------------------------
   18.11) États drag & drop
   -------------------------------------------------------------------------- */
.smartlist-row.is-swap {
    background: var(--vert1);
}

.smartlist-row.is-dragging {
    background: var(--vert1);
    transform: translateX(10px);
}

.smartlist-row.is-drop-target {
    background: var(--vert1);
    transform: translateX(10px);
}

/* --------------------------------------------------------------------------
   18.12) Séparateurs colonnes / lignes
   -------------------------------------------------------------------------- */
.smartlist-col:not(.sl-first)::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--gris3);
    opacity: .9;
    pointer-events: none;
}

.smartlist-sep {
    grid-column: 1 / -1;
    height: 1px;
    background: var(--gris2);
    opacity: .9;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   18.13) Loader
   -------------------------------------------------------------------------- */
.smartlist-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .6);
    z-index: 5;
}

.smartlist-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid var(--gris3);
    border-top-color: var(--vert4);
    border-radius: 50%;
    animation: slspin .8s linear infinite;
}

@keyframes slspin {
    to {
        transform: rotate(360deg);
    }
}

#smartlistLoading {
    display: none;
}

/* --------------------------------------------------------------------------
   18.14) Ellipsis sur labels
   -------------------------------------------------------------------------- */
.smartlist-row .liste-item {
    flex: 1 1 auto;
    min-width: 0;
}

.smartlist-row .liste-item span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



/* ==========================================================================
   ==========================================================================
   19) SMARTTABLE
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   19.1) Prise de largeur section
   -------------------------------------------------------------------------- */
#section-medicaments .section-body {
    display: block;
    width: 100%;
}

/* --------------------------------------------------------------------------
   19.2) Conteneurs généraux
   -------------------------------------------------------------------------- */
.section,
.section-body,
.smarttable-wrap {
    min-width: 0;
}

.smarttable-wrap {
    width: 100%;
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   19.3) Table
   -------------------------------------------------------------------------- */
.smarttable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   19.4) Header
   -------------------------------------------------------------------------- */
.smarttable thead th {
    font-size: 13px;
    font-weight: 600;
    color: var(--gris5);
    text-align: left;
    padding: 4px 10px;
    border-bottom: 1px solid var(--gris3);
    background: transparent;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   19.5) Cells
   -------------------------------------------------------------------------- */
.smarttable td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--gris3);
    vertical-align: middle;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   19.6) Hover rows
   -------------------------------------------------------------------------- */
.smarttable tbody tr:hover {
    background: transparent !important;
}

/* --------------------------------------------------------------------------
   19.7) Ellipsis cell
   -------------------------------------------------------------------------- */
.st-cell {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   19.8) Ligne vide
   -------------------------------------------------------------------------- */
.st-empty {
    padding: 10px 10px;
    color: var(--gris4);
    font-style: italic;
}

/* --------------------------------------------------------------------------
   19.9) Sizer row
   -------------------------------------------------------------------------- */
.smarttable .st-sizer td {
    padding: 0 !important;
    border: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

.smarttable .st-sizer {
    visibility: hidden;
}

/* --------------------------------------------------------------------------
   19.10) Checkbox / label
   -------------------------------------------------------------------------- */
.st-td-chk {
    text-align: center;
}

.st-row-label {
    justify-content: center;
}

/* --------------------------------------------------------------------------
   19.11) Boutons d’action
   -------------------------------------------------------------------------- */
.st-btn {
    appearance: none;
    border: 0;
    background: transparent !important;
    padding: 3px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 0;
    color: var(--gris4);
}

.st-btn:hover {
    color: var(--gris5);
}

.st-drag {
    font-weight: 900;
    letter-spacing: .5px;
    line-height: 1;
}

.st-td-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   19.12) États drag
   -------------------------------------------------------------------------- */
.smarttable-row.is-drag-ready,
.smarttable-row.is-drop-target,
.smarttable-row.is-swap,
.smarttable-row.is-dragging {
    transform: translateX(6px);
    opacity: 1 !important;
}

.smarttable-row.is-drag-ready>td,
.smarttable-row.is-drop-target>td,
.smarttable-row.is-swap>td,
.smarttable-row.is-dragging>td {
    background: var(--vert1) !important;
}

/* --------------------------------------------------------------------------
   19.13) Formulaire modal
   -------------------------------------------------------------------------- */
.st-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.st-form {
    display: grid;
    gap: 18px;
}

/* --------------------------------------------------------------------------
   19.14) Labels de formulaire
   -------------------------------------------------------------------------- */
.st-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gris5);
}



/* ==========================================================================
   ==========================================================================
   20) BOUTONS
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   20.01) Base commune
   -------------------------------------------------------------------------- */
.bouton_gris1,
.bouton_gris2,
.bouton_gris3,
.bouton_vert1,
.bouton_vert2,
.bouton_vert3,
.bouton_rouge1,
.bouton_rouge2,
.bouton_rouge3 {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 12px;
    background: transparent;
    text-decoration: none;
    color: var(--gris5);
    font-size: 13px;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   20.02) Boutons gris
   -------------------------------------------------------------------------- */

/* Repos */
.bouton_gris1 {
    border: 1px solid transparent;
}

.bouton_gris2,
.bouton_gris3 {
    border: 1px solid var(--gris3);
}

/* Hover */
.bouton_gris1:hover,
.bouton_gris2:hover,
.bouton_gris3:hover {
    background: var(--gris1);
    border-color: var(--gris3);
}

/* Actif */
.bouton_gris1.is-active,
.bouton_gris2.is-active,
.bouton_gris3.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.03) Boutons verts
   -------------------------------------------------------------------------- */

/* Repos */
.bouton_vert1 {
    border: 1px solid transparent;
}

.bouton_vert2 {
    border: 1px solid var(--gris3);
}

.bouton_vert3 {
    border: 1px solid var(--vert2);
	background: var(--vert1);
	    color: var(--vert5);
	
}

/* Hover */
.bouton_vert1:hover,
.bouton_vert2:hover,
.bouton_vert3:hover {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* Actif */
.bouton_vert1.is-active,
.bouton_vert2.is-active,
.bouton_vert3.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.04) Boutons rouges
   -------------------------------------------------------------------------- */

/* Repos */
.bouton_rouge1 {
    border: 1px solid transparent;
}

.bouton_rouge2 {
    border: 1px solid var(--gris3);
}

.bouton_rouge3 {
    border: 1px solid var(--rouge4);
    color: var(--rouge4);
}

/* Hover */
.bouton_rouge1:hover,
.bouton_rouge2:hover,
.bouton_rouge3:hover {
    background: var(--rouge1);
    border-color: var(--rouge3);
    color: var(--rouge5);
}

/* --------------------------------------------------------------------------
   20.05) Ajustements
   -------------------------------------------------------------------------- */
.sidebar__newtemplate button {
    width: 100%;
    justify-content: center;
}

/* ==========================================================================
   ==========================================================================
   21) INFOBULLE / TOOLTIP
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   21.1) Tooltip
   -------------------------------------------------------------------------- */
.ms-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 420px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text);
    background: var(--gris1);
    border: 1px solid var(--vert3);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
    pointer-events: none;
    white-space: normal;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .12s ease, transform .12s ease;
}

/* --------------------------------------------------------------------------
   21.2) Tooltip visible
   -------------------------------------------------------------------------- */
.ms-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}











/* ==========================================================================
   ==========================================================================
   23) BOUTON TERMINER
   ==========================================================================
   ========================================================================== */
.terminer-bar {
    margin-top: 0px;
}

.terminer-split {
    position: relative;
    display: inline-flex;
}

.terminer-main,
.terminer-arrow {
    border: none;
    background: var(--vert5);
    color: white;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 16px;
}

.terminer-main {
    border-radius: 999px 0 0 999px;
}

.terminer-arrow {
    border-left: 1px solid rgba(255,255,255,0.35);
    border-radius: 0 999px 999px 0;
    padding-left: 12px;
    padding-right: 12px;
}

.terminer-main:hover,
.terminer-arrow:hover {
    background: var(--vert4);
}

.terminer-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;

    z-index: 100;
 min-width: max-content;

    background: white;
    border: 1px solid var(--gris3);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.14);

    padding: 10px;
}

.terminer-menu .liste-item {
    display: flex;
    padding: 4px 0;
}

.terminer-menu .liste-item:last-child {
    margin-bottom: 0;
}