/* ==========================================================================
   ==========================================================================
   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;
    --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;
}

/* --------------------------------------------------------------------------
   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) 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;
    }

    .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
   -------------------------------------------------------------------------- */
.mini-num {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 4px 2px;
    text-align: center;
    min-height: 34px;
}

.mini-select {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    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.1) date-range
   -------------------------------------------------------------------------- */
.date-range input[type="date"] {
    width: 160px;
}

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

/* --------------------------------------------------------------------------
   12.3) Patch mini champs : hauteur cohérente
   -------------------------------------------------------------------------- */
.date-range.align-row .mini-num,
.date-range.align-row .mini-select {
    border: 1px solid var(--gris3);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.2;
    height: auto;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   12.4) Largeur mini-num
   -------------------------------------------------------------------------- */
.date-range.align-row .mini-num {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

/* --------------------------------------------------------------------------
   12.5) Largeur mini-select
   -------------------------------------------------------------------------- */
.date-range.align-row .mini-select {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    flex: 0 0 130px;
    padding-left: 8px;
    padding-right: 8px;
}

/* --------------------------------------------------------------------------
   12.6) select.mini-select
   -------------------------------------------------------------------------- */
select.mini-select {
    height: var(--field-h) !important;
    min-height: var(--field-h) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box;
    line-height: 1;
}



/* ==========================================================================
   ==========================================================================
   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
   ==========================================================================
   ========================================================================== */

.inami-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  flex-wrap: nowrap;
}

.inami-search-wrap {
  flex: 0 0 120px;
  max-width: 120px;
}

.inami-search-input {
  width: 120px;
}

.inami-combi-input {
  flex: 0 0 120px;
  width: 120px;
}

.inami-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size:13px;
}

.inami-results {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  max-height: 300px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--gris3);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
  z-index: 9999;
  padding: 2px;

}

.inami-result-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  color: var(--gris5);
}

.inami-result-item:hover,
.inami-result-item.is-active {
  background: var(--gris2);
}

.inami-result-combi {
  font-weight: 500;
  white-space: nowrap;
}

.inami-result-suffixe {
  font-weight: 400;
  white-space: nowrap;
}

.inami-result-desc {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}



.inami-result-empty {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--gris4);
}

.inami-result-combi {
  font-weight: 500;
}

.inami-result-suffixe {
  margin-left: 2px;
}

.inami-result-sep {
  margin: 0 4px;
}


/* ==========================================================================
   ==========================================================================
   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;
}

.effacer:hover {
    color: var(--danger);
}



/* ==========================================================================
   ==========================================================================
   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;
    justify-content: flex-end;
    align-items: center;
    padding: 4px 8px 4px 8px;
    background: var(--gris1);
    border-bottom: 1px solid var(--gris3);
}

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

/* --------------------------------------------------------------------------
   17.7) Close
   -------------------------------------------------------------------------- */
.modal__close {
    appearance: none;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--gris4);
    display: flex;
    border-radius: 10px;
    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: 6px;
    border-top: 1px solid var(--gris3);
    background: transparent;
}

/* --------------------------------------------------------------------------
   17.10) Colonnes internes
   -------------------------------------------------------------------------- */
.modal__cols {
    display: grid;
    gap: 12px;
}



/* ==========================================================================
   ==========================================================================
   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.1) bouton1
   -------------------------------------------------------------------------- */
.bouton1 {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    text-decoration: none;
    color: var(--gris5);
    font-size: 13px;
    cursor: pointer;
}

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

.bouton1.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.2) bouton2
   -------------------------------------------------------------------------- */
.bouton2 {
    display: inline-flex;
    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;
}

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

.bouton2.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.3) bouton2bis
   -------------------------------------------------------------------------- */
.bouton2bis {
    display: inline-flex;
    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;
}

.bouton2bis:hover {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

.bouton2bis.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.4) bouton3
   -------------------------------------------------------------------------- */
.bouton3 {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    text-decoration: none;
    color: var(--gris5);
    font-size: 13px;
    cursor: pointer;
}

.bouton3:hover {
    background: var(--rouge1);
    border-color: var(--rouge3);
    color: var(--rouge5);
}



/* ==========================================================================
   ==========================================================================
   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) MODE ÉDITION
   ==========================================================================
   ========================================================================== */
/* ==========================================================================
   ==========================================================================
   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;
    --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;
}

/* --------------------------------------------------------------------------
   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) 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;
    }

    .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
   -------------------------------------------------------------------------- */
.mini-num {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 4px 2px;
    text-align: center;
    min-height: 34px;
}

.mini-select {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    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.1) date-range
   -------------------------------------------------------------------------- */
.date-range input[type="date"] {
    width: 160px;
}

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

/* --------------------------------------------------------------------------
   12.3) Patch mini champs : hauteur cohérente
   -------------------------------------------------------------------------- */
.date-range.align-row .mini-num,
.date-range.align-row .mini-select {
    border: 1px solid var(--gris3);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.2;
    height: auto;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   12.4) Largeur mini-num
   -------------------------------------------------------------------------- */
.date-range.align-row .mini-num {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

/* --------------------------------------------------------------------------
   12.5) Largeur mini-select
   -------------------------------------------------------------------------- */
.date-range.align-row .mini-select {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    flex: 0 0 130px;
    padding-left: 8px;
    padding-right: 8px;
}

/* --------------------------------------------------------------------------
   12.6) select.mini-select
   -------------------------------------------------------------------------- */
select.mini-select {
    height: var(--field-h) !important;
    min-height: var(--field-h) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box;
    line-height: 1;
}



/* ==========================================================================
   ==========================================================================
   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;
}

.effacer:hover {
    color: var(--danger);
}



/* ==========================================================================
   ==========================================================================
   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;
    justify-content: flex-end;
    align-items: center;
    padding: 4px 8px 4px 8px;
    background: var(--gris1);
    border-bottom: 1px solid var(--gris3);
}

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

/* --------------------------------------------------------------------------
   17.7) Close
   -------------------------------------------------------------------------- */
.modal__close {
    appearance: none;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--gris4);
    display: flex;
    border-radius: 10px;
    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: 6px;
    border-top: 1px solid var(--gris3);
    background: transparent;
}

/* --------------------------------------------------------------------------
   17.10) Colonnes internes
   -------------------------------------------------------------------------- */
.modal__cols {
    display: grid;
    gap: 12px;
}



/* ==========================================================================
   ==========================================================================
   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.1) bouton1
   -------------------------------------------------------------------------- */
.bouton1 {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    text-decoration: none;
    color: var(--gris5);
    font-size: 13px;
    cursor: pointer;
}

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

.bouton1.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.2) bouton2
   -------------------------------------------------------------------------- */
.bouton2 {
    display: inline-flex;
    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;
}

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

.bouton2.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.3) bouton2bis
   -------------------------------------------------------------------------- */
.bouton2bis {
    display: inline-flex;
    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;
}

.bouton2bis:hover {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

.bouton2bis.is-active {
    background: var(--vert1);
    border-color: var(--vert3);
    color: var(--vert5);
}

/* --------------------------------------------------------------------------
   20.4) bouton3
   -------------------------------------------------------------------------- */
.bouton3 {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    text-decoration: none;
    color: var(--gris5);
    font-size: 13px;
    cursor: pointer;
}

.bouton3:hover {
    background: var(--rouge1);
    border-color: var(--rouge3);
    color: var(--rouge5);
}



/* ==========================================================================
   ==========================================================================
   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) MODE ÉDITION
   ==========================================================================
   ========================================================================== */

/* --------------------------------------------------------------------------
   23.1) Variables mauves
   -------------------------------------------------------------------------- */
:root {
    --mauve1: #f7f3ff;
    --mauve2: #bca7f2;
    --mauve3: #7a5fd6;
    --mauve4: #5b3fc9;
    --mauve5: #3b2a87;
    --mauve-ring: rgba(188, 167, 242, .55);
}

/* --------------------------------------------------------------------------
   23.2) Champs texte / select / textarea template
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] input[data-template="1"]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.app-main.po-main[data-edition="1"] select[data-template="1"],
.app-main.po-main[data-edition="1"] textarea[data-template="1"] {
    background: var(--mauve1) !important;
    border-color: var(--mauve2) !important;
    color: var(--mauve5);
}

/* --------------------------------------------------------------------------
   23.3) Focus champs template
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] input[data-template="1"]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.app-main.po-main[data-edition="1"] select[data-template="1"]:focus,
.app-main.po-main[data-edition="1"] textarea[data-template="1"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--mauve-ring) !important;
}

/* --------------------------------------------------------------------------
   23.4) Placeholder template
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] input[data-template="1"]::placeholder,
.app-main.po-main[data-edition="1"] textarea[data-template="1"]::placeholder {
    color: color-mix(in srgb, var(--mauve5) 45%, var(--gris4));
    opacity: 1;
}

/* --------------------------------------------------------------------------
   23.5) Disabled / readonly template
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] input[data-template="1"]:disabled,
.app-main.po-main[data-edition="1"] select[data-template="1"]:disabled,
.app-main.po-main[data-edition="1"] textarea[data-template="1"]:disabled,
.app-main.po-main[data-edition="1"] input[data-template="1"][readonly],
.app-main.po-main[data-edition="1"] textarea[data-template="1"][readonly] {
    opacity: .75;
    cursor: not-allowed;
    background: color-mix(in srgb, var(--mauve1) 70%, #fff);
}

/* --------------------------------------------------------------------------
   23.6) mode-btn template
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] .liste-item.mode-btn input[data-template="1"]+span {
    background: var(--mauve1) !important;
    border-color: var(--mauve2) !important;
    color: var(--mauve5) !important;
}

.app-main.po-main[data-edition="1"] .liste-item.mode-btn:hover input[data-template="1"]+span,
.app-main.po-main[data-edition="1"] .liste-item.mode-btn input[data-template="1"]+span:hover {
    border-color: var(--mauve3) !important;
    color: var(--mauve5) !important;
}

.app-main.po-main[data-edition="1"] .liste-item.mode-btn input[data-template="1"]:checked+span {
    background: var(--mauve2) !important;
    border-color: var(--mauve4) !important;
    color: var(--mauve5) !important;
}

.app-main.po-main[data-edition="1"] .liste-item.mode-btn input[data-template="1"]:checked+span::before {
    color: var(--mauve5) !important;
}

/* --------------------------------------------------------------------------
   23.7) Radios / checkboxes custom hors mode-btn
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] .liste-item input[type="checkbox"][data-template="1"] {
    border-color: var(--mauve2) !important;
}

.app-main.po-main[data-edition="1"] .liste-item input[type="checkbox"][data-template="1"]:checked {
    background: var(--mauve3) !important;
    border-color: var(--mauve4) !important;
}

.app-main.po-main[data-edition="1"] .liste-item input[type="checkbox"][data-template="1"]:checked::after {
    color: #fff !important;
}

.app-main.po-main[data-edition="1"] .liste-item input[type="radio"][data-template="1"] {
    border-color: var(--mauve2) !important;
}

.app-main.po-main[data-edition="1"] .liste-item input[type="radio"][data-template="1"]::after {
    background: var(--mauve3) !important;
}

.app-main.po-main[data-edition="1"] .liste-item input[type="radio"][data-template="1"]:checked {
    border-color: var(--mauve4) !important;
}
/* --------------------------------------------------------------------------
   23.8) Switch template (version mauve visible)
   -------------------------------------------------------------------------- */


/* OFF */
.app-main.po-main[data-edition="1"] .switch input[data-template="1"] + .slider {
    background: var(--mauve2) !important;
}

/* ON */
.app-main.po-main[data-edition="1"] .switch input[data-template="1"]:checked + .slider {
    background: var(--mauve3) !important;
}

/* rond (reste blanc comme normal) */
.app-main.po-main[data-edition="1"] .switch input[data-template="1"] + .slider::before {
    background: #fff !important;
}

/* SUPPRIME glow */
.app-main.po-main[data-edition="1"] .switch input[data-template="1"]:focus + .slider,
.app-main.po-main[data-edition="1"] .switch input[data-template="1"]:focus-visible + .slider {
    box-shadow: none !important;
}


/* --------------------------------------------------------------------------
   23.9) Boutons J / S / M liés à un hidden data-template="1"
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="itt_jsm"],
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="itc_jsm"],
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="its_jsm"],
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="rdv1_jsm"],
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="rdv2_jsm"] {
    background: var(--mauve1) !important;
    border-color: var(--mauve2) !important;
    color: var(--mauve5) !important;
}

.app-main.po-main[data-edition="1"] .cycle-btn[data-field="itt_jsm"]:hover,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="itc_jsm"]:hover,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="its_jsm"]:hover,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="rdv1_jsm"]:hover,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="rdv2_jsm"]:hover {
    border-color: var(--mauve3) !important;
}

.app-main.po-main[data-edition="1"] .cycle-btn[data-field="itt_jsm"]:focus,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="itc_jsm"]:focus,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="its_jsm"]:focus,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="rdv1_jsm"]:focus,
.app-main.po-main[data-edition="1"] .cycle-btn[data-field="rdv2_jsm"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px var(--mauve-ring) !important;
}

/* --------------------------------------------------------------------------
   23.10) Smartlist-btn liés à un champ template
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] .smartlist-field>input[data-template="1"]+.smartlist-btn,
.app-main.po-main[data-edition="1"] .smartlist-field>textarea[data-template="1"]+.smartlist-btn {
    background: var(--mauve1) !important;
    border-color: var(--mauve2) !important;
    color: var(--mauve5) !important;
}

.app-main.po-main[data-edition="1"] .smartlist-field>input[data-template="1"]+.smartlist-btn:hover,
.app-main.po-main[data-edition="1"] .smartlist-field>textarea[data-template="1"]+.smartlist-btn:hover {
    border-color: var(--mauve3) !important;
}

/* --------------------------------------------------------------------------
   23.11) Compose reset lié à un champ template
   -------------------------------------------------------------------------- */
.app-main.po-main[data-edition="1"] .compose-wrap>input[data-template="1"]~.compose-reset,
.app-main.po-main[data-edition="1"] .compose-wrap>textarea[data-template="1"]~.compose-reset {
    background: var(--mauve1) !important;
    border-color: var(--mauve2) !important;
    color: var(--mauve5) !important;
}

.app-main.po-main[data-edition="1"] .compose-wrap>input[data-template="1"]~.compose-reset:hover,
.app-main.po-main[data-edition="1"] .compose-wrap>textarea[data-template="1"]~.compose-reset:hover {
    border-color: var(--mauve3) !important;
}

/* --------------------------------------------------------------------------
   23.12) Protocole opératoire (Quill)
   -------------------------------------------------------------------------- */

/* CONTENU (textarea visuel) → mauve */
.app-main.po-main[data-edition="1"] #protocole_indic_editor .ql-editor,
.app-main.po-main[data-edition="1"] #protocole_desc_editor .ql-editor {
    background: var(--mauve1) !important;
    color: var(--mauve5);
}

/* CONTAINER → bordure mauve */
.app-main.po-main[data-edition="1"] #protocole_indic_editor .ql-container.ql-snow,
.app-main.po-main[data-edition="1"] #protocole_desc_editor .ql-container.ql-snow {
    border: 1px solid var(--mauve2) !important;
}

/* TOOLBAR → reste NORMAL (gris) */
.app-main.po-main[data-edition="1"] #protocole_indic_editor .ql-toolbar.ql-snow,
.app-main.po-main[data-edition="1"] #protocole_desc_editor .ql-toolbar.ql-snow {
    background: var(--gris1) !important;
    border-color: var(--gris3) !important;
}