/* VetRad Pro — palette médicale : bleu acier / bleu pétrole, teintes bleu pâle, accent vert pastel */
:root {
    --brand-900: #0b3a5b;
    --brand-700: #0f5c8a;
    --brand-600: #1572a6;
    --brand-500: #2a91c4;
    --tint-300: #a9d6e6;
    --tint-200: #cde8f1;
    --tint-100: #e5f3f8;
    --tint-50: #f3f9fb;
    --ink: #12283a;
    --muted: #5d7385;
    --white: #ffffff;
    --danger: #e5675c;
    --danger-bg: #fde3e0;
    --info-bg: #cfe8fb;
    --warning-bg: #fbe0a6;
    --success: #2f9e5b;
    --success-bg: #c9efd6;
    --mint-200: #cdeee0;
    --mint-500: #3aa57a;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 18px rgba(15, 92, 138, 0.10);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--tint-50);
}

h1, h2, h3 { margin: 0 0 .5em; }

.muted { color: var(--muted); }

/* Marque */
.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--ink);
}
.brand--center { justify-content: center; margin-bottom: 1.5rem; }

/* Pages publiques (connexion, choix d'établissement) */
body.public {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, var(--tint-200), var(--tint-50));
}
.public-card {
    width: min(420px, 92vw);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.public-title { font-size: 1.3rem; text-align: center; }

/* Formulaires */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; font-weight: 500; }
.field input {
    font: inherit;
    padding: .7rem .9rem;
    border: 1.5px solid var(--tint-300);
    border-radius: var(--radius-sm);
    background: var(--white);
}
.field input:focus { outline: 3px solid var(--tint-200); border-color: var(--brand-500); }
.form-inline { margin-top: 1rem; text-align: center; }

/* Boutons */
.btn {
    font: inherit;
    font-weight: 600;
    border: 0;
    border-radius: var(--radius-sm);
    padding: .65rem 1.1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}
.btn--primary { background: var(--brand-600); color: var(--white); }
.btn--primary:hover { background: var(--brand-700); }
.btn--soft { background: var(--tint-100); color: var(--brand-900); }
.btn--soft:hover { background: var(--tint-200); }
.btn--link { background: none; color: var(--brand-600); text-decoration: underline; }
.btn--block { width: 100%; }

.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); }
.alert--error { background: var(--danger-bg); color: #8a2018; }

.choice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }

/* Application */
body.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar {
    background: linear-gradient(180deg, var(--tint-100), var(--tint-200));
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.nav { display: grid; gap: .35rem; }
.nav__item {
    padding: .65rem .9rem;
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}
.nav__item:hover { background: var(--tint-200); }
.nav__item.is-active { background: var(--tint-300); color: var(--brand-900); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: var(--tint-300);
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.topbar__site { font-weight: 600; }
.topbar__user { display: flex; align-items: center; gap: .6rem; }
.chip {
    background: var(--tint-50);
    border-radius: var(--radius-sm);
    padding: .45rem .8rem;
    font-weight: 500;
}
.content { padding: 1.5rem; display: grid; gap: 1.25rem; align-content: start; }

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
}
.card--hero { background: var(--tint-200); }

/* ---------- Coquille applicative (maquettes 01/02) ---------- */
.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .85rem; }
.right { text-align: right; }
a { color: var(--brand-600); }

body.app { grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; }
.brand { text-decoration: none; padding: 0 .4rem; }
.nav__item { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; }
.nav__item.is-active { background: var(--tint-300); box-shadow: inset 0 0 0 1px rgba(21, 114, 166, .08); }
.sidebar__bottom { margin-top: auto; }

.topbar { gap: 1.25rem; min-height: 76px; }
.topbar__left, .topbar__right { display: flex; align-items: center; gap: .6rem; }
.topbar__right { margin-left: auto; }
.mode-toggle { display: flex; align-items: center; gap: .6rem; margin: 0; }
.mode-toggle__label { font-weight: 500; font-size: 1.05rem; }
.mode-toggle__pill { display: inline-flex; padding: 4px; background: var(--tint-50); border-radius: 999px; border: 2px solid var(--tint-100); gap: 2px; }
.mode-toggle__opt {
    font: inherit; border: 0; background: transparent; color: var(--ink); padding: .4rem 1rem;
    border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font-weight: 500;
}
.mode-toggle__opt.is-active { background: var(--brand-700); color: var(--white); }
.mode-toggle__opt.is-static { cursor: default; }
.quick-search {
    display: flex; align-items: center; gap: .5rem; background: var(--white); border-radius: var(--radius-sm);
    padding: .55rem .9rem; flex: 0 1 320px; color: var(--muted);
}
.quick-search input { border: 0; outline: 0; font: inherit; flex: 1; min-width: 0; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; }
.chip--link:hover { background: var(--white); }
.icon-btn { border: 0; background: var(--tint-50); color: var(--ink); border-radius: var(--radius-sm); width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--white); }

.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-100); color: var(--brand-700); flex: none; font-weight: 700; }
.avatar--sm { width: 28px; height: 28px; font-size: .75rem; background: var(--brand-600); color: var(--white); }
.avatar .icon { width: 26px; height: 26px; }
.avatar--dog { background: #fbe6c8; color: #9a5b12; }
.avatar--cat { background: #e3f1ea; color: #2f7d5a; }
.avatar--rabbit { background: #fde2e7; color: #b23a5a; }
.avatar--paw { background: #d8f0e2; color: #2f7d50; }
.avatar--person { background: #dceaf8; color: #2c5d8f; }

.btn--sm { padding: .45rem .9rem; font-size: .92rem; }
.btn--dark { background: var(--brand-900); color: var(--white); }
.btn--dark:hover { background: var(--brand-700); }
.btn .icon { width: 18px; height: 18px; }

.page-title { font-size: 1.7rem; }
.card__title { font-size: 1.15rem; }
.empty { color: var(--muted); padding: 1rem 0; }

/* Badges de modalité et pastilles de statut */
.badge { display: inline-block; padding: .22rem .6rem; border-radius: 6px; font-size: .85rem; font-weight: 500; }
.badge--rx { background: #c9efd6; color: #1f6b3f; }
.badge--echo { background: #dff2f0; color: #1d6e66; }
.badge--ct { background: #cfe3fa; color: #24578f; }
.badge--irm { background: #fde2c4; color: #8a4f10; }
.badge--autre { background: var(--tint-100); color: var(--brand-900); }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; border-radius: 999px; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.pill--urgent { background: #f6857a; color: #4a0d07; }
.pill--to_dictate { background: #bfe3fa; color: #0f4a70; }
.pill--in_progress { background: #fbd27f; color: #5c3b00; }
.pill--validated { background: #8fdcaa; color: #0e4a26; }
.pill--validated .icon { fill: var(--success); }

/* Tableau de bord */
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.25rem; align-items: start; }
.dashboard__main { display: grid; gap: 1.25rem; min-width: 0; }
.dashboard__side { display: grid; gap: 1.25rem; }
.dashboard__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.hero__title { font-size: 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1rem; }
.stat { background: var(--white); border-radius: var(--radius-sm); padding: .9rem 1rem; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.stat:hover { box-shadow: var(--shadow); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.actions__icon { background: var(--tint-100); color: var(--brand-600); border-radius: var(--radius-sm); width: 48px; height: 44px; display: grid; place-items: center; }
.exam-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.exam-card { display: flex; align-items: center; gap: .9rem; border: 1.5px solid var(--tint-200); background: var(--tint-50); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.exam-card__body { flex: 1; min-width: 0; display: grid; gap: .2rem; }
.exam-card__meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.timeline { list-style: none; padding: 0 0 0 1.4rem; margin: 0; display: grid; gap: .8rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: .45rem; top: .6rem; bottom: .6rem; width: 2px; background: var(--tint-200); }
.timeline__item { position: relative; }
.timeline__item::before { content: ""; position: absolute; left: -1.3rem; top: 1rem; width: 14px; height: 14px; border-radius: 50%; background: var(--tint-300); }
.timeline__item--validated::before { background: var(--success); }
.timeline__item--in_progress::before { background: var(--brand-500); }
.timeline__card { display: flex; justify-content: space-between; gap: .6rem; align-items: center; background: var(--tint-50); border-radius: var(--radius-sm); padding: .75rem 1rem; color: var(--ink); text-decoration: none; }
.timeline__card:hover { background: var(--tint-100); }
.timeline__time { display: block; color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.bars { width: 100%; height: auto; }
.bars__value { font-size: 11px; fill: var(--ink); font-weight: 600; }
.bars__label { font-size: 11px; fill: var(--ink); }
.bars__bar { fill: var(--tint-300); }
.bars__bar--0 { fill: var(--brand-600); }
.bars__bar--1 { fill: var(--brand-500); }
.bars__bar--2 { fill: var(--tint-300); }
.bars__bar--3 { fill: var(--tint-200); }
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.links a { display: flex; gap: .5rem; align-items: center; }

/* Liste de travail */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; }
.filter { padding: .55rem 1.1rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 1.02rem; border: 2px solid transparent; }
.filter--all { background: var(--tint-200); }
.filter--urgent { background: #f6857a; }
.filter--to_dictate { background: #bfe3fa; }
.filter--in_progress { background: #fbd27f; }
.filter--validated { background: #8fdcaa; }
.filter.is-active { border-color: var(--brand-900); box-shadow: 0 0 0 2px var(--white) inset; }
.filter--all.is-active { background: var(--brand-900); color: var(--white); }
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.search-field { display: flex; align-items: center; gap: .5rem; background: var(--white); border: 1.5px solid var(--tint-300); border-radius: var(--radius-sm); padding: .55rem .9rem; flex: 1 1 360px; max-width: 660px; color: var(--brand-600); }
.search-field input { border: 0; outline: 0; font: inherit; flex: 1; background: transparent; }
.modalities { border: 0; display: flex; align-items: center; gap: .5rem; margin: 0; padding: 0; }
.modalities legend { float: left; font-weight: 500; margin-right: .3rem; }
.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-toggle span { display: inline-block; padding: .5rem .9rem; border-radius: var(--radius-sm); background: var(--tint-100); cursor: pointer; font-weight: 500; }
.chip-toggle input:checked + span { background: var(--brand-700); color: var(--white); }
.chip-toggle input:focus-visible + span { outline: 3px solid var(--tint-300); }
.card--table { padding: .75rem; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 .5rem; }
.table th { text-align: left; font-weight: 600; padding: .4rem .8rem; }
.table td { padding: .6rem .8rem; background: var(--tint-50); border-top: 1.5px solid var(--tint-200); border-bottom: 1.5px solid var(--tint-200); }
.table td:first-child { border-left: 1.5px solid var(--tint-200); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table td:last-child { border-right: 1.5px solid var(--tint-200); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.table td.empty { text-align: center; border-radius: var(--radius-sm); border: 1.5px solid var(--tint-200); }
.who { display: flex; align-items: center; gap: .7rem; }
.pagination { display: flex; justify-content: flex-end; gap: .6rem; padding: .5rem .8rem; font-size: 1.02rem; }
.pagination a { text-decoration: none; }
.pagination .is-current { font-weight: 700; }
.pagination .is-disabled { color: var(--muted); }

@media (max-width: 1100px) {
    .dashboard { grid-template-columns: 1fr; }
    .dashboard__cols, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Écran d'examen / éditeur (maquettes 03/04) ---------- */
.alert--success { background: var(--success-bg); color: #0e4a26; }
.alert--warning { background: var(--warning-bg); color: #5c3b00; }
.confirm-box { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn--white { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.btn--white:hover { background: var(--tint-50); }
.btn--success { background: var(--success); color: var(--white); }
.btn--success .icon { fill: var(--white); }
.btn--danger { background: var(--danger); color: var(--white); }
.pill--xs { padding: .1rem .5rem; font-size: .75rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.25rem; align-items: start; }
.actions-cell { display: flex; gap: .4rem; justify-content: flex-end; }
.actions-cell form { margin: 0; }
.placeholders { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .9rem; }
.placeholders code { background: var(--tint-100); padding: .1rem .35rem; border-radius: 4px; }
select { font: inherit; padding: .55rem .8rem; border: 1.5px solid var(--tint-300); border-radius: var(--radius-sm); background: var(--white); }

/* Écran d'examen pleine hauteur : la page occupe exactement la fenêtre (en-tête de hauteur variable compris),
   le volet et l'éditeur s'étirent jusqu'en bas ; seuls le volet et le fil de dictée défilent. */
body.app.is-editor { height: 100vh; height: 100dvh; overflow: hidden; }
body.is-editor .main { height: 100vh; height: 100dvh; min-height: 0; }
body.is-editor .content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: .9rem 1.25rem 1rem; gap: .8rem; }
.exam-screen { --panel-width: 560px; display: flex; flex-direction: column; gap: .8rem; flex: 1 1 auto; min-height: 0; }
.exam-toolbar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.exam-toolbar__left, .exam-toolbar__right { display: flex; gap: .6rem; align-items: center; }
.exam-toolbar__right { margin-left: auto; }
.exam-toolbar__right form { margin: 0; }
.exam-toolbar__status { display: flex; gap: .6rem; align-items: center; }

.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: min(var(--panel-width), 48%) 10px minmax(0, 1fr); grid-template-areas: "panel resizer editor"; }
.editor-left .workspace { grid-template-columns: minmax(0, 1fr) 10px min(var(--panel-width), 48%); grid-template-areas: "editor resizer panel"; }
.is-collapsed .workspace { grid-template-columns: 0 0 minmax(0, 1fr); }
.is-collapsed.editor-left .workspace { grid-template-columns: minmax(0, 1fr) 0 0; }
.is-collapsed .side-panel, .is-collapsed .resizer { display: none; }
.side-panel { grid-area: panel; display: flex; flex-direction: column; gap: .8rem; min-height: 0; overflow-y: auto; padding-right: 2px; }
.resizer { grid-area: resizer; cursor: col-resize; position: relative; }
.resizer::after { content: ""; position: absolute; left: 4px; top: 40%; height: 60px; width: 3px; border-radius: 2px; background: var(--tint-300); }
.resizer:hover::after, .resizer:focus-visible::after, .is-resizing .resizer::after { background: var(--brand-600); }
.is-resizing { user-select: none; }
.is-resizing .editor-frame { pointer-events: none; }
.editor-area { grid-area: editor; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.editor-frame { flex: 1; min-height: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--white); border: 2px solid var(--tint-300); }
#onlyoffice-editor, .editor-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.editor-status { margin: .3rem .2rem 0; min-height: 1.2em; }
.empty-editor { margin: auto; max-width: 520px; text-align: center; display: grid; gap: .8rem; justify-items: center; }

.identity { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; align-items: center; }
.identity__text { font-size: 1.05rem; line-height: 1.35; }
.avatar--lg { width: 60px; height: 60px; }
.avatar--lg .icon { width: 34px; height: 34px; }
.template-picker { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: end; }
.template-picker label { flex: 1; display: grid; gap: .2rem; font-weight: 500; }
.template-picker select { width: 100%; }

.tabs { display: flex; background: var(--tint-100); border-radius: var(--radius); padding: 4px; gap: 2px; }
.tab { flex: 1; font: inherit; border: 0; background: transparent; padding: .65rem .5rem; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; color: var(--ink); }
.tab.is-active { background: var(--brand-900); color: var(--white); }
.tab:focus-visible { outline: 3px solid var(--tint-300); }
.tab-pane { flex: 1; min-height: 240px; }
.mini-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .7rem; background: var(--tint-50); border-radius: var(--radius-sm); }
.mini-list li.is-current { outline: 2px solid var(--brand-500); }
.mini-list form { margin: 0; }

/* ---------- Galerie DICOM et visionneuse ---------- */
.gallery__selects { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.gallery__selects label { display: grid; gap: .2rem; font-weight: 500; min-width: 0; }
.gallery__selects select { width: 100%; }
.gallery__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.gallery__actions p { margin: 0; flex: 1 1 100%; }
.gallery__body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .8rem; }
.thumbs-wrap { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: #111; border: 2px solid var(--tint-200); cursor: pointer; aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb.is-active { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-500); }
.thumb:focus-visible { outline: 3px solid var(--brand-500); }
.thumb__num { position: absolute; left: 4px; bottom: 3px; color: #fff; font-size: .72rem; text-shadow: 0 0 3px #000; }
.thumb input { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; accent-color: var(--brand-600); }
.thumb.is-unavailable { border-color: var(--danger); }
.thumbs__more { height: 1px; }
.preview { display: grid; gap: .4rem; align-content: start; }
.preview__img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #111; border-radius: var(--radius-sm); }
.preview__frames { display: flex; gap: .5rem; align-items: center; }
.preview__frames input { flex: 1; accent-color: var(--brand-600); }
.gallery__footer { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .8rem; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-items: center; }
.inline-form { display: inline; }
.inline-form button.badge { border: 0; cursor: pointer; font: inherit; }
.badge--off { background: #eef2f5; color: #8a99a6; text-decoration: line-through; }
.gallery__viewers { display: contents; }
.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #05090d; color: #fff; }
.viewer::backdrop { background: rgba(0, 0, 0, .85); }
.viewer__bar { display: flex; gap: .6rem; align-items: center; padding: .6rem 1rem; background: var(--brand-900); }
.viewer__info { margin-left: .6rem; }
.viewer__note { margin-left: auto; color: var(--tint-200); font-size: .85rem; }
.viewer__stage { height: calc(100vh - 56px); display: grid; place-items: center; overflow: hidden; }
.viewer__img { max-width: 100%; max-height: 100%; transition: transform .1s; image-rendering: auto; }

/* Console de mise en page des images (planches ×1 à ×16) */
.layout-console { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #1b1530; color: #fff; display: none; }
.layout-console[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.layout-console::backdrop { background: rgba(0, 0, 0, .85); }
.layout-console select, .layout-console input[type="text"] { color: var(--ink); }
.lc-bar { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; padding: .55rem 1rem; background: var(--brand-900); }
.lc-title { margin-right: .4rem; }
.lc-layouts { display: flex; gap: .25rem; }
.lc-layout { display: grid; justify-items: center; gap: 2px; padding: .3rem .4rem; min-width: 44px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: #fff; cursor: pointer; font: inherit; font-size: .75rem; }
.lc-layout:hover { background: rgba(255, 255, 255, .1); }
.lc-layout.is-active { background: var(--brand-500); border-color: var(--tint-200); }
.lc-layout:focus-visible { outline: 2px solid var(--tint-200); outline-offset: 1px; }
.lc-layout-icon { --c: 1; --r: 1; display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--r), 1fr); gap: 1px; width: 22px; height: 22px; }
.lc-layout-icon span { background: currentColor; opacity: .85; border-radius: 1px; }
.lc-field { display: flex; gap: .35rem; align-items: center; font-size: .82rem; }
.lc-field select { padding: .2rem .3rem; border-radius: 6px; }
.lc-field input[type="range"] { width: 80px; accent-color: var(--tint-300); }
.lc-check { display: flex; gap: .3rem; align-items: center; font-size: .82rem; }
.lc-bar > .btn:last-child { margin-left: auto; }
.lc-body { display: grid; grid-template-columns: 230px minmax(0, 1fr) 270px; min-height: 0; }
.lc-source, .lc-inspector { background: #241c3f; padding: .8rem; overflow-y: auto; display: flex; flex-direction: column; gap: .55rem; }
.lc-source label { display: grid; gap: .2rem; font-size: .82rem; }
.lc-source select { width: 100%; }
.lc-source .muted, .lc-inspector .muted { color: var(--tint-200); }
.lc-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .4rem; }
.lc-thumb { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #000; aspect-ratio: 1; cursor: grab; }
.lc-thumb:hover, .lc-thumb:focus-visible { border-color: var(--tint-300); outline: none; }
.lc-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.lc-thumb span { position: absolute; left: 4px; bottom: 2px; font-size: .7rem; color: #fff; text-shadow: 0 0 3px #000; }
.lc-thumb.is-unavailable { border-color: var(--danger); }
.lc-main { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: .5rem; padding: .8rem; min-width: 0; min-height: 0; }
.lc-stage { display: grid; place-items: center; min-height: 0; overflow: auto; background: #3a3354; border-radius: 10px; }
.lc-sheet { display: grid; background: #fff; padding: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.lc-cell { display: grid; grid-template-rows: auto var(--cap-h, 0); outline: none; }
.lc-frame { position: relative; line-height: 0; }
.lc-canvas { display: block; cursor: grab; touch-action: none; }
.lc-cell.is-empty .lc-canvas { cursor: pointer; }
.lc-cell.is-selected .lc-frame::after { content: ""; position: absolute; inset: -3px; border: 3px solid var(--brand-500); border-radius: 3px; pointer-events: none; }
.lc-cell:focus-visible .lc-frame::after { border-color: #f5a623; }
.lc-cell.is-drop .lc-frame::after { content: ""; position: absolute; inset: -3px; border: 3px dashed #f5a623; pointer-events: none; }
.lc-cell.is-unavailable .lc-frame::before { content: "Rendu indisponible"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--tint-200); font-size: .75rem; line-height: 1.2; }
.lc-num { position: absolute; top: 4px; left: 5px; font-size: .7rem; line-height: 1; color: #fff; background: rgba(0, 0, 0, .55); padding: 2px 5px; border-radius: 4px; pointer-events: none; }
.lc-handle { position: absolute; top: 3px; right: 4px; font-size: 1rem; line-height: 1; color: #fff; background: rgba(0, 0, 0, .55); padding: 2px 4px; border-radius: 4px; cursor: move; }
.lc-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #9d93c4; font-size: .78rem; line-height: 1.2; text-align: center; pointer-events: none; border: 1px dashed #6b6191; }
.lc-caption { color: #333; font-size: .68rem; line-height: 1.2; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-top: 2px; }
.lc-main > input[type="text"] { padding: .4rem .6rem; border-radius: 8px; border: 1px solid var(--tint-300); }
.lc-pages { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.lc-tab { padding: .3rem .7rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #fff; cursor: pointer; font: inherit; font-size: .8rem; }
.lc-tab.is-active { background: var(--brand-500); border-color: var(--tint-200); }
.lc-inspector h3 { margin: 0; font-size: 1rem; }
.lc-meta { color: var(--tint-200); margin: 0; }
.lc-range { display: grid; grid-template-columns: 78px minmax(0, 1fr) 62px; gap: .4rem; align-items: center; font-size: .82rem; }
.lc-range input { accent-color: var(--tint-300); }
.lc-range output { text-align: right; font-variant-numeric: tabular-nums; }
.lc-tools { display: flex; flex-wrap: wrap; gap: .35rem; }
.lc-tools .btn[aria-pressed="true"] { background: var(--brand-500); color: #fff; }
.lc-caption-field { display: grid; gap: .2rem; font-size: .82rem; }
.lc-caption-field input { padding: .35rem .5rem; border-radius: 6px; border: 1px solid var(--tint-300); }
.lc-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .55rem 1rem; background: var(--brand-900); }
.lc-status { margin: 0 auto 0 0; font-size: .85rem; color: var(--tint-100); }
.lc-save { font-size: .78rem; color: var(--tint-200); }
.lc-save.is-ok::before { content: "✓ "; color: #7fd6a0; }
.lc-save.is-error { color: #ffb4ab; font-weight: 600; }
@media (max-width: 1100px) {
    .lc-body { grid-template-columns: 180px minmax(0, 1fr) 220px; }
}

/* L'attribut hidden doit primer sur les display des composants. */
[hidden] { display: none !important; }

/* ---------- Anciens CR (maquette 04) ---------- */
.is-wide .workspace { grid-template-columns: minmax(360px, 50%) 10px minmax(0, 1fr); }
.is-wide.editor-left .workspace { grid-template-columns: minmax(0, 1fr) 10px minmax(360px, 50%); }
.priors { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.priors__item { width: 100%; text-align: left; font: inherit; border: 1.5px solid var(--tint-200); background: var(--tint-50); border-radius: var(--radius-sm); padding: .6rem .8rem; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: .1rem .8rem; align-items: center; }
.priors__item:hover, .priors__item:focus-visible { border-color: var(--brand-500); }
.priors__date { font-weight: 700; color: var(--brand-700); }
.priors__title { font-weight: 600; }
.priors__meta { grid-column: 2; color: var(--muted); font-size: .85rem; }
.prior-head { display: flex; gap: .6rem; align-items: center; }
.prior-head p { margin: 0; }
.prior-doc__title { margin: .6rem 0 .3rem; font-size: 1.05rem; }
.prior-doc__toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; }
.prior-doc__pager { display: inline-flex; gap: .4rem; align-items: center; margin-left: auto; }
.prior-doc__text { white-space: pre-wrap; background: var(--white); border: 1.5px solid var(--tint-300); border-radius: var(--radius-sm); padding: .9rem 1rem; max-height: 52vh; overflow-y: auto; line-height: 1.5; user-select: text; }
.prior-doc__pdf { width: 100%; height: 52vh; border: 1.5px solid var(--tint-300); border-radius: var(--radius-sm); }
.prior-doc__actions { display: flex; gap: .6rem; margin: .8rem 0; flex-wrap: wrap; }

/* ---------- Dictée : mini-assistant ancré sous l'éditeur (maquette 03) ---------- */
/* Le panneau s'insère dans la colonne de l'éditeur (flux normal) : ONLYOFFICE se réduit, il n'est jamais recouvert. */
.editor-footer { display: flex; align-items: center; gap: .8rem; min-height: 40px; padding-top: .35rem; }
.editor-footer .editor-status { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dictation-mic-icon { width: 18px; height: 18px; fill: currentColor; flex: none; }
.dictation-launcher { margin-left: auto; display: inline-flex; align-items: center; gap: .45rem; font: inherit; font-weight: 600; border: 0; cursor: pointer;
    padding: .45rem .95rem .45rem .7rem; border-radius: 999px; color: #fff; background: linear-gradient(160deg, var(--brand-600), var(--brand-900));
    box-shadow: 0 4px 14px rgba(11, 58, 91, .35); position: relative; }
.dictation-launcher:hover { background: linear-gradient(160deg, var(--brand-500), var(--brand-700)); }
.dictation-launcher:focus-visible { outline: 3px solid var(--tint-300); outline-offset: 2px; }
.dictation-launcher.is-open { background: var(--brand-900); }
.dictation-launcher__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint-300); }
.dictation-launcher.is-recording .dictation-launcher__dot { background: #ff7a6e; box-shadow: 0 0 0 0 rgba(255, 122, 110, .7); animation: dictation-pulse 1.2s infinite; }
@keyframes dictation-pulse { 70% { box-shadow: 0 0 0 8px rgba(255, 122, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 122, 110, 0); } }

.dictation-widget { flex: none; margin-top: .6rem; display: flex; flex-direction: column; max-height: min(38%, 280px); min-height: 150px;
    background: linear-gradient(160deg, #2a1b55, #120c26); color: #fff; border-radius: 16px; border: 1px solid rgba(169, 214, 230, .35);
    box-shadow: 0 8px 24px rgba(8, 28, 44, .3); overflow: hidden; }
.dictation-widget[hidden] { display: none; }
.dictation-widget__title { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-bottom: 1px solid rgba(169, 214, 230, .2); }
.dictation-widget__avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-600); flex: none; }
.dictation-widget__heading { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.dictation-widget__status { font-size: .8rem; color: var(--tint-200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dictation-widget__collapse { border: 0; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 1.1rem; flex: none; }
.dictation-widget__collapse:hover { background: rgba(255, 255, 255, .22); }
.dictation-widget__log { flex: 1; min-height: 48px; overflow-y: auto; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .4rem; scrollbar-width: thin; }
.chat-msg { max-width: 85%; padding: .4rem .7rem; border-radius: 14px; font-size: .88rem; line-height: 1.35; overflow-wrap: anywhere; }
.chat-msg--bot { align-self: flex-start; background: rgba(255, 255, 255, .1); color: var(--tint-100); border-bottom-left-radius: 4px; }
.chat-msg--user { align-self: flex-end; background: var(--brand-600); color: #fff; border-bottom-right-radius: 4px; display: flex; flex-direction: column; gap: .1rem; }
.chat-msg--provisional { background: rgba(42, 145, 196, .45); font-style: italic; }
.chat-msg--discarded { opacity: .5; text-decoration: line-through; }
.chat-msg--claimed { background: #b5761a; }
.chat-msg__status { font-size: .7rem; opacity: .8; align-self: flex-end; }
.dictation-widget__controls { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border-top: 1px solid rgba(169, 214, 230, .2); flex-wrap: wrap; }
.dictation-widget__viz { display: flex; align-items: center; gap: .45rem; margin-right: auto; }
.dictation-widget__wave { width: 120px; height: 28px; }
.dictation-widget__mic { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #e5675c; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(229, 103, 92, .25); }
.dictation-widget__mic[hidden] { display: none; }
.dictation-widget__stop { width: 12px; height: 12px; background: #fff; border-radius: 2px; }
.dictation-widget__timer { font-variant-numeric: tabular-nums; color: var(--tint-200); font-size: .9rem; }
.dictation-widget__mode { font: inherit; font-size: .88rem; border: 0; border-radius: 999px; padding: .45rem .9rem; background: var(--brand-600); color: #fff; cursor: pointer; font-weight: 500; }
.dictation-widget__mode:hover:not(:disabled) { background: var(--brand-500); }
.dictation-widget__mode.is-active { background: #e5675c; }
.dictation-widget__mode:disabled { opacity: .55; cursor: not-allowed; }
.segments { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .35rem; }
.segment { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; background: var(--tint-50); border-radius: var(--radius-sm); padding: .4rem .6rem; }
.segment__text { flex: 1 1 60%; }
.segment__status { font-size: .78rem; color: var(--muted); }
.segment--provisional .segment__text { color: var(--muted); font-style: italic; }
.segment--inserted { background: #e6f6ec; }
.segment--claimed { background: var(--warning-bg); }
.segment--discarded .segment__text { text-decoration: line-through; color: var(--muted); }
.check { display: flex; align-items: center; gap: .3rem; font-size: .9rem; }
.full-dictation__cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.full-dictation__cols h3 { font-size: .95rem; }
.full-dictation__raw { width: 100%; font: inherit; border: 1.5px solid var(--tint-300); border-radius: var(--radius-sm); padding: .5rem; resize: vertical; }
.full-dictation__formatted { background: var(--white); border: 1.5px solid var(--tint-300); border-radius: var(--radius-sm); padding: .5rem .8rem; max-height: 40vh; overflow-y: auto; }
.full-dictation__formatted h3 { margin: .5rem 0 .2rem; color: var(--brand-700); }
.full-dictation__actions { display: flex; gap: .6rem; margin-top: .6rem; }

/* ---------- Administration (maquettes 05/06) ---------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: .6rem; }
.admin-tab { padding: .6rem 1.2rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; background: var(--tint-200); }
.admin-tab--users { background: #fbd27f; }
.admin-tab--integrations { background: #bfe3fa; }
.admin-tab.is-active { background: var(--brand-900); color: var(--white); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.card--wide { grid-column: 1 / -1; }
.subtitle { font-size: 1rem; margin: 1rem 0 .5rem; }
.panel-head { background: var(--tint-300); color: var(--brand-900); text-align: center; border-radius: var(--radius-sm); padding: .45rem; font-weight: 600; letter-spacing: .02em; margin-bottom: .8rem; }
.panel-head--dark { background: var(--brand-900); color: var(--white); }
.form-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.field--inline { display: inline-grid; }
.field--inline input { width: 9rem; }
.form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.field select, .field input { width: 100%; }
fieldset.field { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
fieldset.field legend { font-weight: 500; margin-bottom: .2rem; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.source-list { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .6rem; }
.source { display: grid; grid-template-columns: 1fr auto auto auto; gap: .6rem; align-items: center; border: 1.5px solid var(--tint-200); background: var(--tint-50); border-radius: var(--radius-sm); padding: .7rem .9rem; }
.source form { margin: 0; }
.source__edit { grid-column: 1 / -1; }
.source__edit[open] summary { margin-bottom: .6rem; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.add-block { margin-top: .6rem; }
.add-block[open] > summary { margin-bottom: .8rem; }
.connectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.connector { background: var(--brand-900); color: var(--white); border-radius: var(--radius-sm); padding: .7rem; display: grid; gap: .4rem; align-content: start; font-size: .9rem; }
.connector .field span, .connector .check { color: var(--tint-200); }
.connector input[type=number], .connector input[name=aet] { padding: .35rem .5rem; }
.connector code { color: var(--tint-200); word-break: break-all; }
.badge--worklist { background: var(--brand-900); color: var(--white); }
.toggle { width: 46px; height: 26px; border-radius: 999px; border: 0; background: var(--tint-300); position: relative; cursor: pointer; padding: 0; display: inline-block; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); transition: left .15s; }
.toggle.is-on { background: var(--success); }
.toggle.is-on span { left: 23px; }
.toggle.is-static { cursor: default; vertical-align: middle; background: var(--brand-700); }
.rule { display: flex; gap: .6rem; align-items: center; font-weight: 500; }
.switch-row { display: flex; justify-content: space-between; align-items: center; background: var(--tint-50); border-radius: var(--radius-sm); padding: .6rem .8rem; font-weight: 500; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--brand-700); }
.secret-once { display: inline-block; margin: .3rem .4rem; padding: .3rem .6rem; background: var(--white); border: 1.5px dashed var(--brand-500); border-radius: 6px; font-size: 1rem; user-select: all; }
@media (max-width: 1200px) { .admin-grid, .connectors { grid-template-columns: 1fr; } }

/* Supervision et audit (lot F) */
.admin-tab--supervision { background: #c9efd6; }
.admin-tab--supervision.is-active { background: var(--brand-900); }
.supervision-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.25rem 0; }
.supervision-overall { font-size: 1rem; padding: .45rem 1.2rem; }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.status-list__item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--tint-50); border: 1.5px solid var(--tint-200); }
.status-list__item div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.status-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--success); }
.status-list__item--warn .status-dot { background: #e0a21b; }
.status-list__item--error { border-color: var(--danger); background: var(--danger-bg); }
.status-list__item--error .status-dot { background: var(--danger); }
.audit-card { margin-top: 1.25rem; }
.audit-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.table-scroll { overflow-x: auto; }
.table--compact td, .table--compact th { padding: .35rem .6rem; font-size: .85rem; white-space: nowrap; }
/* ---------- Adaptation aux tailles d'écran (écran d'examen et coquille) ---------- */
@media (max-width: 1280px) {
    body.app { grid-template-columns: 200px 1fr; }
    .exam-screen { --panel-width: 440px; }
}
@media (max-width: 1024px) {
    /* Barre latérale réduite aux icônes. */
    body.app { grid-template-columns: 68px 1fr; }
    .sidebar { padding: 1rem .5rem; gap: 1.5rem; }
    .brand { justify-content: center; padding: 0; }
    .brand span, .nav__item span { display: none; }
    .nav__item { justify-content: center; padding: .7rem; }
    .topbar { padding: .6rem 1rem; gap: .6rem; flex-wrap: wrap; min-height: 0; }
    .exam-toolbar { gap: .5rem; }
    .exam-screen { --panel-width: 380px; }
}
@media (max-width: 820px) {
    /* Tablette portrait / mobile : l'éditeur garde toute la hauteur de la fenêtre, le volet passe dessous. */
    body.app.is-editor, body.is-editor .main { height: auto; overflow: visible; }
    body.is-editor .content { padding: .6rem; }
    .workspace, .editor-left .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "editor" "panel"; grid-template-rows: calc(100dvh - 7rem) auto; row-gap: .8rem; }
    .is-collapsed .workspace, .is-collapsed.editor-left .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: calc(100dvh - 7rem); }
    .resizer { display: none; }
    .side-panel { overflow: visible; }
    .dictation-widget__wave { width: 80px; }
}
@media (max-width: 640px) {
    /* Navigation en bandeau horizontal. */
    body.app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: .4rem; padding: .4rem .6rem; }
    .nav { display: flex; gap: .2rem; }
    .sidebar__bottom { margin: 0 0 0 auto; }
    .dictation-launcher__label { display: none; }
    .dictation-widget__mode { flex: 1 1 100%; }
}
/* ---------- Brouillon de compte rendu après dictée complète (G.1) ---------- */
.full-dictation__draft { margin-top: .8rem; padding-top: .8rem; border-top: 1px dashed var(--tint-300); display: grid; gap: .4rem; justify-items: start; }
.draft-list__box { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--tint-200); }
.draft-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.draft-list__item { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--tint-50); border-radius: var(--radius-sm); padding: .45rem .6rem; }
.draft-list__item > div { flex: 1 1 160px; min-width: 0; }
.draft-dialog { width: min(1400px, 96vw); height: min(900px, 94vh); max-width: none; max-height: none; padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(8, 28, 44, .45); }
.draft-dialog[open] { display: flex; flex-direction: column; }
.draft-dialog::backdrop { background: rgba(8, 28, 44, .55); }
.draft-dialog__head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem .6rem; border-bottom: 1px solid var(--tint-200); }
.draft-dialog__head > div { flex: 1; min-width: 0; }
.draft-dialog__head h2 { margin: 0; font-size: 1.2rem; }
.draft-dialog__head p { margin: .2rem 0 0; }
.draft-dialog__close { font-size: 1.4rem; line-height: 1; }
.draft-dialog__body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; padding: 1rem 1.25rem; }
.draft-dialog__col { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding-right: 4px; }
.draft-dialog__col h3 { margin: 0; font-size: 1rem; }
.draft-dialog__transcript { margin: 0; white-space: pre-wrap; font: inherit; line-height: 1.5; background: var(--tint-50); border: 1.5px solid var(--tint-200); border-radius: var(--radius-sm); padding: .8rem 1rem; flex: 1; }
.draft-fields__box summary { cursor: pointer; font-weight: 600; margin-bottom: .4rem; }
.draft-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem .8rem; }
.draft-fields .field span { font-size: .82rem; }
.draft-section { display: grid; gap: .25rem; }
.draft-section__title { font-weight: 700; color: var(--brand-700); }
.draft-section textarea, .draft-fields input { font: inherit; width: 100%; padding: .5rem .7rem; border: 1.5px solid var(--tint-300); border-radius: var(--radius-sm); resize: vertical; }
.draft-section textarea:focus, .draft-fields input:focus { outline: 3px solid var(--tint-200); border-color: var(--brand-500); }
.draft-markers__box { background: #fffbe0; border: 1.5px solid #f0d76a; border-radius: var(--radius-sm); padding: .6rem .8rem; }
.draft-markers__box h3 { font-size: .95rem; }
.draft-markers__box p { margin: .3rem 0 0; }
.draft-markers { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.draft-markers li { font-size: .8rem; background: #ffff00; border-radius: 6px; padding: .1rem .45rem; font-weight: 600; }
.draft-markers li.is-confirm { background: #ffd36b; }
.draft-issues, .draft-warnings { margin: 0; padding-left: 1.2rem; color: #8a2018; }
.draft-warnings { color: #5c3b00; }
.draft-dialog__foot { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .7rem 1.25rem; border-top: 1px solid var(--tint-200); background: var(--tint-50); border-radius: 0 0 var(--radius) var(--radius); }
.draft-dialog__status { margin: 0; flex: 1 1 260px; font-size: .88rem; }
.draft-dialog__actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) { .draft-dialog__body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; } .draft-dialog__col { overflow: visible; } }
/* Mini-PACS : nœud de l'établissement, liste des études, page d'étude */
.pacs-nodes { display: grid; gap: .3rem; margin-bottom: 1rem; }
.pacs-nodes__list { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pacs-nodes p { margin: 0; }
.field-inline { display: inline-flex; gap: .35rem; align-items: center; font-size: .9rem; }
.field-inline input { padding: .35rem .5rem; border-radius: var(--radius-sm); border: 1px solid var(--tint-200); }
.pacs-study { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; margin-bottom: 1rem; align-items: start; }
.pacs-study .form-inline { text-align: left; margin: .5rem 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.pacs-thumbs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-bottom: .8rem; }
.pacs-thumbs .thumb { display: block; }
@media (max-width: 1100px) { .pacs-study { grid-template-columns: 1fr; } }

/* Lot N : connexion par fournisseur d'identité, double authentification (QR code, codes de secours). */
.login-sso { margin-top: 1rem; display: grid; gap: .5rem; }
.login-sso__or { display: flex; align-items: center; gap: .75rem; color: var(--muted, #5d7385); font-size: .85rem; margin: .25rem 0; }
.login-sso__or::before, .login-sso__or::after { content: ""; flex: 1; border-top: 1px solid var(--tint-200, #cde8f1); }
.input-code { font-size: 1.35rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-steps { padding-left: 1.2rem; display: grid; gap: .6rem; }
.mfa-qr { margin: .6rem 0; }
.mfa-qr img { display: block; background: #fff; padding: 6px; border: 1px solid var(--tint-200, #cde8f1); border-radius: 8px; }
.mfa-secret { font-size: .95rem; letter-spacing: .08em; user-select: all; }
.recovery-codes { background: var(--tint-50, #f3f9fb); border: 1px dashed var(--brand-500); border-radius: 8px; padding: .75rem 1rem; margin: .75rem 0; }
.recovery-codes__list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .75rem; }
.recovery-codes__list code { font-size: 1rem; letter-spacing: .06em; }
.alert--info { background: var(--info-bg); color: var(--brand-900); }
.card code { overflow-wrap: anywhere; }

/* Protocoles de lecture : aperçu de la grille (administration). */
.proto-grid { display: grid; gap: 4px; max-width: 360px; margin: .5rem 0 1rem; }
.proto-grid--c1 { grid-template-columns: repeat(1, 1fr); }
.proto-grid--c2 { grid-template-columns: repeat(2, 1fr); }
.proto-grid--c3 { grid-template-columns: repeat(3, 1fr); }
.proto-grid--c4 { grid-template-columns: repeat(4, 1fr); }
.proto-grid__cell { border: 1px solid #b9d3e4; border-radius: 6px; background: #0f1b24; color: #dfeef7; padding: 6px 8px; min-height: 52px; font-size: 12px; line-height: 1.3; }
.proto-grid__cell b { color: #8fd3b5; }

/* Paramétrage en listes : grille d'une colonne, fiche de modification sous le tableau, ligne en cours de modification. */
.admin-grid--stack { grid-template-columns: 1fr; }
.edit-panel { margin-top: 1rem; padding: 1rem 1.25rem; border: 1px solid #b9d3e4; border-left: 4px solid #1f78b4; border-radius: 10px; background: #f5fafd; }
.edit-panel .subtitle { margin-top: 0; }
.table tr.is-selected td { background: #e6f2fa; }
.table td { vertical-align: middle; }
td.actions-cell { display: table-cell; text-align: right; white-space: nowrap; width: 1%; }
td.actions-cell > .btn, td.actions-cell > .inline-form { display: inline-flex; vertical-align: middle; margin: 2px 1px; }
td.actions-cell .btn { white-space: nowrap; }
.check-row { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: center; padding: .2rem 0; }
.check-row .check { display: inline-flex; align-items: center; gap: .35rem; }
.edit-panel fieldset { border: 0; padding: 0; margin: .5rem 0; }
.edit-panel fieldset legend { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.edit-panel .form-row { align-items: end; }
.edit-panel .form > .btn { width: auto; }
.check input[type=checkbox], .check input[type=radio] { width: auto; flex: 0 0 auto; margin: 0; }
.check-row { flex: 1 1 100%; }

/* Lecture partagée : invitation et salle d'attente */
.share-facts { margin: .5rem 0 1rem; padding-left: 1.1rem; display: grid; gap: .25rem; }
.share-wait { display: grid; justify-items: center; gap: .8rem; text-align: center; padding: 1rem 0; }
.share-wait__pulse { width: 54px; height: 54px; border-radius: 50%; background: #1f78b4; opacity: .85; animation: share-pulse 1.6s ease-in-out infinite; }
.share-wait.is-closed .share-wait__pulse { animation: none; background: #9aa9b5; }
@keyframes share-pulse { 0%, 100% { transform: scale(.75); opacity: .55; } 50% { transform: scale(1); opacity: .95; } }

/* ---- Routage DICOM (refonte lot Y) ---- */
.rt { display: grid; gap: 1rem; }
.rt svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.rt-hero { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-radius: var(--radius);
  background: linear-gradient(120deg, #0f5c8a 0%, #1572a6 55%, #2a91c4 100%); color: #fff; box-shadow: var(--shadow); }
.rt-hero h2 { margin: 0 0 .2rem; font-size: 1.35rem; }
.rt-hero p { margin: 0; opacity: .88; max-width: 46ch; font-size: .93rem; }
.rt-kpis { display: flex; flex-wrap: wrap; gap: .6rem; }
.rt-kpi { display: grid; min-width: 104px; padding: .55rem .9rem; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; transition: background .15s; }
.rt-kpi:hover { background: rgba(255, 255, 255, .24); }
.rt-kpi b { font-size: 1.45rem; line-height: 1.1; }
.rt-kpi b small { font-size: .85rem; opacity: .75; font-weight: 500; }
.rt-kpi span { font-size: .78rem; opacity: .9; }
.rt-kpi.is-alert { background: rgba(229, 103, 92, .9); }
.rt-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .35rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.rt-nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .95rem; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .93rem; }
.rt-nav a:hover { background: var(--tint-50); color: var(--brand-900); }
.rt-nav a.is-active { background: var(--tint-100); color: var(--brand-900); }
.rt-nav a span { min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--tint-200); color: var(--brand-900); font-size: .75rem; text-align: center; }
.rt-nav a span.is-alert { background: var(--danger); color: #fff; }
.rt-nav .rt-nav__new { margin-left: auto; color: #fff; }
.rt-nav .rt-nav__new:hover { color: #fff; background: var(--brand-700); }
.rt-nav .rt-nav__new svg { width: 18px; height: 18px; }
.rt-panel, .rt-empty { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.5rem; }
.rt-panel__head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.rt-title { margin: .2rem 0 .6rem; font-size: 1.15rem; color: var(--brand-900); }
.rt-back { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: .4rem; }
.rt-back:hover { color: var(--brand-700); }
.rt-back svg { width: 16px; height: 16px; }
.rt-muted { color: var(--muted); }
.rt-small { font-size: .85rem; }
.rt-pad { padding: .4rem 0 0; }
.rt-hint { color: var(--muted); font-size: .84rem; margin: .4rem 0 0; }
.rt-empty { display: grid; justify-items: center; text-align: center; gap: .4rem; padding: 2.4rem; }
.rt-empty p { color: var(--muted); max-width: 52ch; margin: 0 0 .6rem; }
/* Types */
.rt-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.rt-type-card { position: relative; display: grid; gap: .5rem; align-content: start; padding: 1.25rem; border: 1.5px solid var(--tint-200); border-radius: var(--radius); background: var(--tint-50);
  color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.rt-type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-500); background: #fff; }
.rt-type-card strong { font-size: 1.05rem; color: var(--brand-900); }
.rt-type-card span:not(.rt-type-card__icon) { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.rt-type-card em { position: absolute; top: .9rem; right: .9rem; font-style: normal; font-size: .72rem; font-weight: 600; color: #0e6b52; background: var(--mint-200); padding: .15rem .5rem; border-radius: 999px; }
.rt-type-card__icon, .rt-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; }
.rt-type-card__icon svg, .rt-card__icon svg { width: 24px; height: 24px; }
.rt-type-card--forward .rt-type-card__icon, .rt-card__icon--forward { background: #dcedf8; color: var(--brand-600); }
.rt-type-card--prefetch .rt-type-card__icon, .rt-card__icon--prefetch { background: var(--mint-200); color: #2b8a63; }
.rt-type-card--gateway .rt-type-card__icon, .rt-card__icon--gateway { background: #d5eff0; color: #0e7c86; }
.rt-type { display: inline-flex; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.rt-type--forward { background: #dcedf8; color: var(--brand-700); }
.rt-type--prefetch { background: var(--mint-200); color: #1f6e4d; }
.rt-type--gateway { background: #d5eff0; color: #0b5f67; }
.rt-tag { display: inline-flex; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--tint-100); color: var(--muted); }
.rt-tag--warn { background: var(--warning-bg); color: #6a4a00; }
/* Cartes de règles */
.rt-cards { display: grid; gap: .8rem; }
.rt-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: start; padding: 1.1rem 1.25rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid var(--tint-200); transition: box-shadow .15s; }
.rt-card:hover { box-shadow: 0 8px 26px rgba(15, 92, 138, .16); }
.rt-card.is-off { opacity: .72; border-left-color: #c5ced6; }
.rt-card:has(.rt-card__icon--forward) { border-left-color: var(--brand-500); }
.rt-card:has(.rt-card__icon--prefetch) { border-left-color: var(--mint-500); }
.rt-card:has(.rt-card__icon--gateway) { border-left-color: #14a3ad; }
.rt-card__body header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.rt-card__body h3 { margin: 0; font-size: 1.05rem; color: var(--brand-900); }
.rt-card__desc { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.rt-flow { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .35rem; font-size: .9rem; }
.rt-flow li { display: flex; gap: .5rem; align-items: flex-start; line-height: 1.45; }
.rt-flow__when { color: var(--brand-900); font-weight: 600; padding: .35rem .7rem; background: var(--tint-50); border-radius: 8px; display: block !important; }
.rt-flow__ic { display: inline-flex; color: var(--brand-600); margin-top: 1px; }
.rt-flow__ic svg { width: 17px; height: 17px; }
.rt-stats { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .75rem; padding-top: .6rem; border-top: 1px dashed var(--tint-200); font-size: .82rem; color: var(--muted); }
.rt-stats b { color: var(--ink); }
.rt-stats .is-alert, .rt-stats .is-alert b { color: #b83a2f; }
.rt-card__actions { display: grid; gap: .3rem; justify-items: stretch; min-width: 128px; }
.rt-card__actions form { margin: 0; }
.rt-action { display: flex; align-items: center; gap: .4rem; width: 100%; padding: .4rem .6rem; border: 0; border-radius: 8px; background: transparent; color: var(--brand-900); font: inherit; font-size: .88rem;
  text-decoration: none; cursor: pointer; }
.rt-action:hover { background: var(--tint-50); }
.rt-action svg { width: 17px; height: 17px; }
.rt-action--danger { color: #b83a2f; }
.rt-action--danger:hover { background: var(--danger-bg); }
.rt-toggle { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .4rem .6rem; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--muted); cursor: pointer; margin-bottom: .2rem; }
.rt-toggle span, .rt-switch span { position: relative; display: inline-block; width: 34px; height: 20px; border-radius: 999px; background: #c5ced6; transition: background .15s; flex: 0 0 auto; }
.rt-toggle span::after, .rt-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.rt-toggle[aria-checked="true"] { color: var(--success); }
.rt-toggle[aria-checked="true"] span, .rt-switch input:checked + span { background: var(--success); }
.rt-toggle[aria-checked="true"] span::after, .rt-switch input:checked + span::after { transform: translateX(14px); }
.rt-switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .93rem; }
.rt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rt-switch input:focus-visible + span { outline: 3px solid var(--tint-300); }
/* Éditeur */
.rt-editor__head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.rt-editor__head .rt-title { margin: 0 0 .2rem; }
.rt-form { display: grid; gap: .9rem; }
.rt-step { display: grid; grid-template-columns: 34px 1fr; gap: .9rem; padding: 1rem 1.1rem; border: 1px solid var(--tint-200); border-radius: 12px; background: #fbfdfe; }
.rt-step__num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-600); color: #fff; font-weight: 700; }
.rt-step h4 { margin: .15rem 0 .6rem; font-size: 1rem; color: var(--brand-900); }
.rt-step__title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rt-step__title h4 { margin-bottom: .4rem; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem 1rem; }
.rt-label { margin: .9rem 0 .4rem; font-weight: 600; font-size: .88rem; color: var(--brand-900); }
.rt-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.rt-chip { position: relative; cursor: pointer; }
.rt-chip input { position: absolute; opacity: 0; }
.rt-chip span { display: grid; padding: .45rem .8rem; border: 1.5px solid var(--tint-200); border-radius: 10px; background: #fff; font-size: .88rem; transition: all .12s; }
.rt-chip small { color: var(--muted); font-size: .74rem; }
.rt-chip input:checked + span { border-color: var(--brand-600); background: #e7f3fb; color: var(--brand-900); box-shadow: inset 0 0 0 1px var(--brand-600); }
.rt-chip input:focus-visible + span { outline: 3px solid var(--tint-300); }
.rt-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--tint-100); margin-bottom: .5rem; }
.rt-seg label { cursor: pointer; }
.rt-seg input { position: absolute; opacity: 0; }
.rt-seg span { display: inline-block; padding: .35rem .8rem; border-radius: 8px; font-size: .85rem; color: var(--muted); }
.rt-seg input:checked + span { background: #fff; color: var(--brand-900); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 92, 138, .15); }
.rt-conds, .rt-dests { display: grid; gap: .45rem; }
.rt-cond, .rt-dest { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .45rem; border-radius: 10px; background: var(--tint-50); }
.rt-cond select, .rt-cond input, .rt-dest select, .rt-dest input, .rt-test select { padding: .45rem .6rem; border: 1.5px solid var(--tint-200); border-radius: 8px; background: #fff; font: inherit; font-size: .88rem; color: var(--ink); }
.rt-cond .rt-cond__field { flex: 1 1 220px; }
.rt-cond input[name="cond_value[]"] { flex: 1 1 180px; }
.rt-cond .rt-cond__tag { width: 110px; }
.rt-dest select[name="fwd_target[]"] { flex: 1 1 280px; }
.rt-inline { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; color: var(--muted); }
.rt-inline input { width: 76px; padding: .4rem .5rem; border: 1.5px solid var(--tint-200); border-radius: 8px; font: inherit; }
.rt-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.rt-icon-btn:hover { background: var(--danger-bg); color: #b83a2f; }
.rt-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.rt-add { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.rt-add__btn { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .75rem; border: 1.5px dashed var(--tint-300); border-radius: 999px; background: #fff; color: var(--brand-700);
  font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.rt-add__btn:hover { border-style: solid; background: var(--tint-50); }
.rt-add__btn svg { width: 15px; height: 15px; }
.rt-criteria { display: grid; gap: .5rem; }
.rt-criterion { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: flex-end; padding: .65rem .8rem; border-radius: 10px; background: var(--tint-50); }
.rt-criterion .field { flex: 1 1 240px; margin: 0; }
.rt-toggle-row { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; margin-top: .6rem; }
.rt-more { border-top: 1px dashed var(--tint-200); padding-top: .6rem; margin-top: .6rem; }
.rt-more > summary { cursor: pointer; color: var(--brand-700); font-weight: 600; font-size: .9rem; margin-bottom: .6rem; }
.rt-summary { padding: .9rem 1.1rem; border-radius: 12px; background: linear-gradient(120deg, #e7f3fb, #e8f6ef); border: 1px solid var(--tint-200); font-size: .9rem; }
.rt-summary p { margin: .2rem 0; }
.rt-summary__title { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--brand-700); margin-bottom: .2rem; }
.rt-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; justify-content: flex-end; }
.rt-form__foot .rt-switch { margin-right: auto; }
/* Activité, suppressions, test */
.rt-filters { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--tint-100); }
.rt-filters a { padding: .35rem .85rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600; }
.rt-filters a.is-active { background: #fff; color: var(--brand-900); box-shadow: 0 1px 3px rgba(15, 92, 138, .15); }
.rt-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rt-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); padding: .5rem .6rem; border-bottom: 1.5px solid var(--tint-200); }
.rt-table td { padding: .6rem; border-bottom: 1px solid var(--tint-100); vertical-align: top; }
.rt-table tr:hover td { background: var(--tint-50); }
.rt-table form { margin: 0; }
.rt-status { display: inline-flex; padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--tint-100); color: var(--muted); white-space: nowrap; }
.rt-status.is-ok { background: var(--success-bg); color: #17663a; }
.rt-status.is-err { background: var(--danger-bg); color: #a3302a; }
.rt-status.is-warn { background: var(--warning-bg); color: #6a4a00; }
.rt-status.is-run, .rt-status.is-wait { background: var(--info-bg); color: #0f4a70; }
.rt-test { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0 1rem; }
.rt-test select { flex: 1 1 420px; }
.rt-explain { display: grid; gap: .6rem; }
.rt-explain__item { padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--tint-200); }
.rt-explain__item.is-ok { border-color: #8fdcaa; background: #f3fbf6; }
.rt-explain__item h4 { margin: 0 0 .4rem; display: flex; gap: .5rem; align-items: center; }
.rt-explain__item ul { margin: 0; padding-left: 1.1rem; font-size: .86rem; }
.rt-explain__item li.is-ko { color: #a3302a; }
@media (max-width: 820px) { .rt-card { grid-template-columns: 1fr; } .rt-card__actions { grid-auto-flow: column; justify-content: start; } }

/* ---------- Journaux & statistiques, cyber veille ---------- */
.sx { display: grid; gap: 1rem; }
.sx-hero__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sx-hero--cyber { background: linear-gradient(120deg, #0b2a44 0%, #0f4c73 55%, #1d7bab 100%); }
.sx-filters { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; padding: .7rem .9rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.sx-filters input[type="search"], .sx-filters input[type="text"], .sx-filters input[type="date"], .sx-filters select, .sx-filter, .sx-bulk input[type="text"] {
  padding: .45rem .7rem; border: 1.5px solid var(--tint-200); border-radius: 10px; font: inherit; font-size: .9rem; background: var(--white); color: var(--ink); }
.sx-filters input[type="search"] { min-width: 16rem; flex: 1 1 16rem; }
.sx-filters .sx-ip { width: 9.5rem; }
.sx-dates { display: inline-flex; gap: .35rem; }
.sx-seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--tint-100); gap: 2px; }
.sx-seg__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sx-seg__opt span, .sx-seg button, .sx-seg a { display: inline-block; padding: .35rem .75rem; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.sx-seg__opt input:checked + span, .sx-seg button.is-active, .sx-seg a.is-active { background: var(--white); color: var(--brand-900); box-shadow: 0 1px 4px rgba(15, 92, 138, .15); }
.sx-seg__opt input:focus-visible + span { outline: 3px solid var(--tint-300); }
.sx-seg--small span, .sx-seg--small button, .sx-seg--small a { padding: .25rem .6rem; font-size: .8rem; }
.sx-chips { display: inline-flex; flex-wrap: wrap; gap: .3rem; border: 0; margin: 0; padding: 0; }
.sx-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sx-chip span { display: inline-block; padding: .3rem .65rem; border-radius: 999px; border: 1.5px solid var(--tint-200); color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer; }
.sx-chip input:checked + span { background: var(--tint-100); border-color: var(--brand-500); color: var(--brand-900); }
.sx-chip input:focus-visible + span { outline: 3px solid var(--tint-300); }
.sx-custom__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem 1rem; }
.sx-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .7rem; }
.sx-kpi { position: relative; display: grid; gap: .15rem; padding: .8rem 1rem .5rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-top: 3px solid var(--brand-500); }
.sx-kpi span { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.sx-kpi b { font-size: 1.5rem; color: var(--brand-900); line-height: 1.15; }
.sx-kpi.is-warn { border-top-color: #f0a530; }
.sx-kpi.is-alert { border-top-color: var(--danger); }
.sx-kpi.is-alert b { color: #b83a2f; }
.sx-spark { width: 100%; height: 24px; display: block; }
.sx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1rem; }
.sx-card { min-width: 0; }
.sx-card--wide { grid-column: 1 / -1; }
.sx-card__title { margin: 0; font-size: 1rem; color: var(--brand-900); }
.sx-sub { margin: 1rem 0 .4rem; font-size: .88rem; color: var(--muted); }
.sx-chart { position: relative; min-height: 60px; }
.sx-legend { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.sx-table-wrap { overflow-x: auto; }
.sx-nowrap { white-space: nowrap; }
.sx-path code { word-break: break-all; }
.sx-row--danger td { background: #fff5f4; }
.sx-ko { color: #b83a2f; font-weight: 600; }
.sx-more { text-align: center; margin: .8rem 0 0; }
.sx-src { display: inline-block; padding: .12rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 700; background: var(--tint-100); color: var(--brand-900); }
.sx-src--auth { background: #e8e2f4; color: #4d3a78; }
.sx-src--http { background: #e2eef8; color: #0f5c8a; }
.sx-src--dicom { background: #dff3e6; color: #1d6b3e; }
.sx-src--jobs { background: #fbeedb; color: #7a4b07; }
.sx-src--alerts { background: var(--danger-bg); color: #a3302a; }
.sx-log--error td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.sx-log--warning td:first-child { box-shadow: inset 3px 0 0 #f0a530; }
.sx-nav-period { margin-left: auto; }
.sx-alert-strip { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem 1rem; border-radius: var(--radius); background: var(--danger-bg); color: #7c2620; }
.sx-alert-strip a { margin-left: auto; font-weight: 600; color: #7c2620; }
.sx-bulk { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.sx-bulk input[type="text"] { flex: 1 1 14rem; }
.sx-risk { display: inline-block; width: 64px; height: 8px; border-radius: 999px; background: var(--tint-100); overflow: hidden; vertical-align: middle; }
.sx-risk i { display: block; height: 100%; width: calc(var(--v) * 1%); min-width: 4px; background: var(--success); }
.sx-risk.is-warn i { background: #f0a530; }
.sx-risk.is-err i { background: var(--danger); }
.sx-flag { font-size: 1.05rem; }
.sx-filter { min-width: 16rem; }
.sx-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: .3rem 1.2rem; }
.sx-rule { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--tint-100); }
.sx-rule .rt-switch { flex: 1 1 14rem; }
.sx-thr { font-size: .84rem; color: var(--muted); }
.sx-thr input { width: 5.5rem; padding: .25rem .4rem; border: 1.5px solid var(--tint-200); border-radius: 8px; font: inherit; }
.sx-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem 1rem; }
.sx-span2 { grid-column: span 2; }
.sx-days { display: flex; flex-wrap: wrap; gap: .25rem; border: 0; padding: 0; margin: 0; }
.sx-days legend { font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.sx-cats { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; }
.sx-cats legend { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.sx-row--warn td { background: #fff9ec; }
.sx-row--muted td { opacity: .55; }
.sx-alert-strip--info { background: var(--tint-50); color: var(--brand-900); }
.sx-flowlist code { font-size: .78rem; }
.sx-egress-cfg { margin: 1rem 0 .4rem; padding: .8rem 1rem; border: 1.5px solid var(--tint-100); border-radius: var(--radius); display: grid; gap: .6rem; }
.sx-egress-cfg legend { font-weight: 700; color: var(--brand-900); padding: 0 .3rem; }
.sx-list { margin: .4rem 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .9rem; }
.sx-ai { margin-top: .5rem; border: 1.5px solid var(--tint-200); border-radius: 10px; background: linear-gradient(180deg, #f7fbff, #fff); font-size: .86rem; }
.sx-ai > summary { cursor: pointer; padding: .45rem .7rem; list-style: none; line-height: 1.5; }
.sx-ai > summary::-webkit-details-marker { display: none; }
.sx-ai > summary::before { content: '▸'; margin-right: .35rem; color: var(--brand-500); }
.sx-ai[open] > summary::before { content: '▾'; }
.sx-ai__badge { display: inline-block; padding: .05rem .4rem; border-radius: 6px; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .4px; }
.sx-ai__body { padding: 0 .9rem .6rem; border-top: 1px solid var(--tint-100); }
.sx-ai__body h5 { margin: .7rem 0 .25rem; font-size: .82rem; color: var(--brand-900); }
.sx-ai__body ul, .sx-ai__body ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .2rem; }
.sx-ai-btn { white-space: nowrap; }
.sx-ai-btn.is-busy { cursor: progress; opacity: .75; }
.sx-ai-btn.is-busy::before { content: ''; display: inline-block; width: .8em; height: .8em; margin-right: .4em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.1em; animation: sx-spin .8s linear infinite; }
@keyframes sx-spin { to { transform: rotate(360deg); } }
.vx-svg { display: block; overflow: visible; font-family: var(--font); }
.vx-grid { stroke: var(--tint-100); stroke-width: 1; }
.vx-axis { font-size: 11px; fill: var(--muted); }
.vx-cursor { stroke: var(--brand-500); stroke-dasharray: 3 3; }
.vx-tip { position: absolute; z-index: 5; pointer-events: none; padding: .45rem .6rem; border-radius: 8px; background: rgba(11, 42, 68, .94); color: #fff; font-size: .8rem; line-height: 1.45; white-space: nowrap; }
.vx-tip i, .vx-legend__item i, .vx-donut__legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: .35rem; vertical-align: middle; }
.vx-legend__item { display: inline-flex; align-items: center; padding: .25rem .6rem; border: 1.5px solid var(--tint-200); border-radius: 999px; background: var(--white); font: inherit; font-size: .8rem; cursor: pointer; color: var(--ink); }
.vx-legend__item.is-off { opacity: .45; text-decoration: line-through; }
.vx-empty { color: var(--muted); font-size: .9rem; margin: .5rem 0; }
.vx-donut { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; align-items: center; }
.vx-donut__svg { width: 150px; }
.vx-donut__total { font-size: 17px; font-weight: 700; fill: var(--brand-900); }
.vx-slice { cursor: default; transition: opacity .15s; }
.vx-slice:hover { opacity: .8; }
.vx-donut__legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .85rem; }
.vx-donut__legend li { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem; align-items: center; }
.vx-donut__legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-bars { display: grid; gap: .45rem; }
.vx-bars__row { display: grid; grid-template-columns: minmax(0, 13rem) 1fr auto; gap: .3rem .6rem; align-items: center; font-size: .85rem; }
.vx-bars__row small { grid-column: 2 / -1; color: var(--muted); font-size: .76rem; margin-top: -.3rem; }
.vx-bars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-bars__track { height: 10px; border-radius: 999px; background: var(--tint-50); overflow: hidden; }
.vx-bars__fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); }
.vx-flow__center { fill: var(--brand-700); }
.vx-flow__title { fill: #fff; font-size: 16px; font-weight: 700; }
.vx-flow__center + .vx-flow__title + .vx-axis { fill: rgba(255, 255, 255, .8); }
.vx-flow__label { font-size: 13px; font-weight: 700; fill: var(--ink); }
@media (max-width: 720px) {
  .sx-grid, .sx-rules { grid-template-columns: 1fr; }
  .vx-donut { grid-template-columns: 1fr; justify-items: center; }
  .sx-span2 { grid-column: auto; }
}
.sx-log-wrap { max-height: 70vh; overflow: auto; }
.sx-log-wrap thead th { position: sticky; top: 0; background: var(--white); z-index: 1; }

/* ---------- Sauvegardes ---------- */
.bk-hero { background: linear-gradient(120deg, #0b3a5b 0%, #12607e 55%, #2f9e8f 100%); }
.bk-running { display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; border-radius: var(--radius); background: var(--info-bg); color: var(--brand-900); box-shadow: var(--shadow); }
.bk-spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--tint-300); border-top-color: var(--brand-700); animation: bk-spin 1s linear infinite; flex: 0 0 auto; }
@keyframes bk-spin { to { transform: rotate(360deg); } }
.bk-rule { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.bk-rule__item { display: grid; gap: .25rem; padding: .85rem 1rem; border-radius: 12px; border: 1.5px solid var(--tint-200); background: var(--tint-50); }
.bk-rule__item.is-ok { border-color: #9fd9b4; background: #f1fbf5; }
.bk-rule__item.is-ko { border-color: #f3b9b3; background: #fff6f5; }
.bk-rule__badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; color: #fff; background: var(--success); }
.bk-rule__item.is-ko .bk-rule__badge { background: var(--danger); }
.bk-dests { display: grid; gap: .6rem; }
.bk-dests--pick { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bk-dest { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border-radius: 12px; border: 1.5px solid var(--tint-200); background: var(--white); }
.bk-dest.is-ko { border-color: #f3b9b3; }
.bk-dest--pick { cursor: pointer; }
.bk-dest--pick:has(input:checked) { border-color: var(--brand-500); background: var(--tint-50); box-shadow: 0 0 0 2px var(--tint-200); }
.bk-dest--pick input { margin-top: .35rem; }
.bk-dest__icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--tint-100); color: var(--brand-700); flex: 0 0 auto; }
.bk-dest__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bk-dest__icon--sm { width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.bk-dest__icon--sm svg { width: 15px; height: 15px; }
.bk-badges { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.bk-actions { display: flex; flex-wrap: wrap; gap: .3rem; align-items: flex-start; }
.bk-actions form, .bk-inline-form { display: inline-flex; gap: .3rem; margin: 0; }
.bk-danger { color: #a3302a; }
.bk-row--off td { opacity: .6; }
.bk-step { border: 1.5px solid var(--tint-200); border-radius: 12px; padding: .8rem 1rem 1rem; margin: 0; display: grid; gap: .7rem; }
.bk-step legend { padding: 0 .4rem; font-weight: 700; color: var(--brand-900); }
.bk-choices { display: grid; gap: .45rem; }
.bk-radios { display: grid; gap: .4rem; }
.bk-radio { display: flex; gap: .55rem; align-items: center; padding: .5rem .7rem; border-radius: 10px; border: 1.5px solid var(--tint-200); cursor: pointer; }
.bk-radio:has(input:checked) { border-color: var(--brand-500); background: var(--tint-50); }
.bk-short { max-width: 34rem; }
.bk-inline { align-self: end; padding-bottom: .55rem; }
.bk-copies { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .35rem; }
.bk-copies li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.bk-filter { display: flex; gap: .4rem; }
.bk-filter select { padding: .35rem .6rem; border: 1.5px solid var(--tint-200); border-radius: 8px; font: inherit; font-size: .86rem; }
.bk-code { white-space: pre-wrap; word-break: break-all; padding: .7rem .9rem; border-radius: 10px; background: #0b2a44; color: #e5f3f8; font-size: .82rem; }
.btn--xs { padding: .2rem .55rem; font-size: .78rem; border-radius: 8px; }
.ds-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem 1rem; align-items: end; }
.ds-fields .ds-wide { grid-column: span 2; }
.ds-fields .rt-hint, .ds-checks { grid-column: 1 / -1; }
.ds-checks { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.ds-edit summary { cursor: pointer; color: var(--brand-700); }
.ds-edit form { margin-top: .5rem; display: grid; gap: .6rem; min-width: 32rem; }
@media (max-width: 720px) { .ds-fields .ds-wide { grid-column: auto; } .ds-edit form { min-width: 0; } }
.bk { min-width: 0; }
.bk-detail { min-width: 22rem; overflow-wrap: anywhere; }
.bk .rt-kpis { flex-wrap: wrap; }

/* ---------- Passerelle intelligente (cluster) ---------- */
.gw-hero { background: linear-gradient(120deg, #0b3a5b 0%, #1d5f86 50%, #4a7fb5 100%); }
.gw-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; }
.gw-start textarea { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.gw-token { display: flex; gap: .6rem; align-items: center; margin-top: .6rem; }
.gw-token code { flex: 1; padding: .55rem .7rem; border-radius: 8px; background: #fff; color: var(--ink); word-break: break-all; font-size: .78rem; }
.gw-nav-sync { margin-left: auto; }
.gw-topo { display: grid; gap: .4rem; justify-items: center; padding: .6rem 0; }
.gw-tier { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; align-items: flex-start; }
.gw-link { position: relative; width: 100%; height: 46px; display: grid; place-items: center; }
.gw-link::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px dashed var(--brand-500); }
.gw-link span { position: relative; padding: .2rem .7rem; border-radius: 999px; background: var(--tint-100); color: var(--brand-900); font-size: .78rem; font-weight: 600; }
.gw-group { padding: .6rem; border-radius: 14px; border: 2px dashed var(--tint-300); background: var(--tint-50); }
.gw-group__head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .5rem; font-size: .9rem; color: var(--brand-900); }
.gw-group__nodes { display: flex; flex-wrap: wrap; gap: .6rem; }
.gw-node { width: 240px; padding: .7rem .8rem; border-radius: 12px; background: var(--white); box-shadow: var(--shadow); border-top: 4px solid var(--brand-500); }
.gw-node--master { border-top-color: #0b3a5b; }
.gw-node--managed { border-top-color: #7b5ea7; }
.gw-node--standby { border-top-color: #2ab3b8; }
.gw-node.is-serving { box-shadow: 0 0 0 3px rgba(47, 158, 91, .45), var(--shadow); }
.gw-node.is-down { opacity: .7; border-top-color: var(--danger); }
.gw-node__head { display: flex; align-items: center; gap: .4rem; }
.gw-node__role { font-size: .8rem; color: var(--muted); margin: .15rem 0 .35rem; }
.gw-node__meta { margin-top: .35rem; overflow-wrap: anywhere; }
.gw-badges { display: flex; flex-wrap: wrap; gap: .25rem; }
.gw-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.gw-dot.is-ok { background: var(--success); box-shadow: 0 0 0 3px rgba(47, 158, 91, .2); }
.gw-dot.is-err { background: var(--danger); }
.gw-empty { min-width: 260px; }
.gw-sla { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.gw-sla__item { display: grid; gap: .1rem; padding: .6rem .8rem; border-radius: 10px; background: var(--tint-50); border: 1.5px solid var(--tint-200); }
.gw-sla__item b { font-size: 1.2rem; color: var(--brand-900); }
.gw-sla__item span { font-size: .78rem; color: var(--muted); }
.gw-sla__item.is-ok { border-color: #9fd9b4; background: #f1fbf5; }
.gw-sla__item.is-ko { border-color: #f3b9b3; background: #fff6f5; }
.gw-dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; font-size: .9rem; }
.gw-dl dt { font-weight: 600; color: var(--brand-900); }
.gw-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .gw-dl { grid-template-columns: 1fr; } .gw-node { width: 100%; } }

/* Message bref (ouverture des images dans la fenêtre VetViewer Pro déjà lancée…) */
.vr-toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 1000; max-width: 26rem; padding: .75rem 1rem; border-radius: var(--radius); background: var(--brand-900); color: #fff; box-shadow: var(--shadow); font-size: .9rem; transition: opacity .6s, transform .6s; }
.vr-toast.is-hiding { opacity: 0; transform: translateY(.5rem); }
