﻿/* EVO web - habillage proche de la version WPF (MahApps.Metro, thème clair) */
:root {
    --accent: #119eda;
    --accent4: #e3f1fa;
    --pane: #f2f2f2;
    --text: #212121;
    --compact: 48px;
    --open: 280px;
    --titlebar: 30px;
}

@supports (color: color-mix(in srgb, red 20%, white)) {
    .evo-window { --accent4: color-mix(in srgb, var(--accent) 18%, white); }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: 16px;
    color: var(--text);
    background: #fff;
}

.evo-window {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Barre de titre */
.evo-titlebar {
    display: flex;
    align-items: center;
    height: var(--titlebar);
    flex: none;
    background: var(--accent);
    color: #fff;
}
.evo-titlebar-left { width: var(--compact); height: 100%; flex: none; }
.evo-back {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.evo-back:hover { background: rgba(255, 255, 255, .25); }
.evo-title {
    flex: 1;
    min-width: 0;
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evo-engine { flex: none; margin-right: 12px; font-size: 13px; opacity: .95; }
.evo-engine i { font-size: 9px; vertical-align: middle; margin-right: 4px; }
.evo-engine.ok i { color: #b7f5c0; }
.evo-engine.ko i { color: #ffb4ab; }

/* Corps : menu hamburger + contenu */
.evo-body { display: flex; flex: 1; min-height: 0; position: relative; }

.evo-pane {
    display: flex;
    flex-direction: column;
    flex: none;
    width: var(--compact);
    overflow: hidden;
    background: var(--pane);
    transition: width .2s ease;
}
.evo-pane.open { width: var(--open); }

.evo-hamburger {
    width: var(--compact);
    height: var(--compact);
    flex: none;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}
.evo-hamburger:hover { background: rgba(0, 0, 0, .08); }

.evo-menu { display: flex; flex-direction: column; }
.evo-menu-options { margin-top: auto; }

.evo-item {
    display: flex;
    align-items: center;
    height: 44px;
    flex: none;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.evo-item:hover { background: rgba(0, 0, 0, .06); }
.evo-item.active {
    background: rgba(0, 0, 0, .09);
    box-shadow: inset 6px 0 0 var(--accent);
}
.evo-item-icon { width: var(--compact); flex: none; text-align: center; font-size: 18px; }
.evo-item-label { padding-right: 12px; }

.evo-content {
    flex: 1;
    min-width: 0;
    overflow: auto;
    background: var(--accent4);
}

/* Page d'accueil (MainPage) */
.home { position: relative; display: flex; flex-direction: column; height: 100%; padding: 2px; }
.home-events {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: #fff;
    border: 1px solid #ccc;
    padding: 4px 6px;
}
.home-event { white-space: pre-wrap; line-height: 1.45; }
/* Barre du bas : mêmes colonnes que MainPage.xaml de WPF (* / 240 / 120, hauteur 56) ; interrupteur marges 16,0, bouton Effacer marges 16,2, mode marges 16,2. */
.home-bar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 240px 120px;
    align-items: center;
    flex: none;
    height: 56px;
    padding: 0;
}
.home-bar .evo-toggle { grid-column: 1; justify-self: start; margin: 0 16px; }
.home-bar .evo-btn { grid-column: 2; align-self: stretch; margin: 2px 16px; padding: 0 8px; }
.home-bar .home-mode { grid-column: 3; justify-self: center; margin: 2px 16px; }
.home-spacer { display: none; }
.home-mode { color: #0000ff; font-weight: bold; }
.home-countdown { position: absolute; top: 2px; right: 0; z-index: 1; pointer-events: none; padding: 0 32px; text-align: center; color: #8b0000; font-weight: 800; font-size: 20px; opacity: .5; }
@media (max-width: 560px) {
    .home-bar { grid-template-columns: 1fr 140px 80px; }
    .home-bar .evo-btn, .home-bar .home-mode { margin-left: 4px; margin-right: 4px; }
}

/* Boutons */
.evo-btn {
    border: 0;
    padding: 8px 18px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.evo-btn:hover:not(:disabled) { filter: brightness(.9); }
.evo-btn:disabled { background: #ccc; color: #888; cursor: default; }
.evo-btn-danger { background: #c62828; }
.evo-btn-light { background: #ddd; color: var(--text); }

/* Interrupteur (ToggleSwitch) */
.evo-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.evo-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.evo-toggle-track {
    position: relative;
    width: 44px;
    height: 20px;
    border: 2px solid #555;
    border-radius: 11px;
    transition: background .15s, border-color .15s;
}
.evo-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #555;
    transition: left .15s, background .15s;
}
.evo-toggle input:checked + .evo-toggle-track { background: var(--accent); border-color: var(--accent); }
.evo-toggle input:checked + .evo-toggle-track .evo-toggle-thumb { left: 27px; background: #fff; }
.evo-toggle input:focus-visible + .evo-toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Confirmation */
.evo-confirm {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    min-width: 320px;
    max-width: 90vw;
    padding: 20px 24px;
    background: #fff;
    box-shadow: 0 6px 30px rgba(0, 0, 0, .35);
}
.evo-confirm-title { font-size: 20px; font-weight: bold; margin-bottom: 8px; }
.evo-confirm-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Pages pas encore migrées */
.coming-soon { text-align: center; padding: 15vh 24px 0; }
.coming-soon h1 { font-weight: normal; margin: 12px 0 6px; }
.coming-soon p { margin: 0; opacity: .7; }
.coming-soon-icon { font-size: 64px; color: var(--accent); }

/* Pages de formulaire (connexion, déconnexion) */
.page-wrap { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.page-icon { position: absolute; top: 10px; right: 10px; font-size: 48px; color: var(--accent); }
.form-panel { width: min(480px, 92%); }
.form-panel label { display: block; margin-top: 4px; }
.form-panel .form-gap { margin-top: 16px; }
.evo-input {
    width: 100%;
    height: 32px;
    padding: 2px 8px;
    border: 1px solid #999;
    background: #fff;
    font: inherit;
    color: var(--text);
}
.evo-input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.evo-input:disabled { background: #eee; color: #777; }
.evo-check { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; cursor: pointer; }
.evo-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.password-box { position: relative; }
.password-box .evo-input { padding-right: 40px; }
.password-reveal {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #555;
    cursor: pointer;
}
.form-error { margin-top: 12px; color: #c62828; font-weight: bold; }
.evo-btn-large { width: 100%; height: 56px; margin-top: 16px; font-size: 18px; }
.evo-user { flex: none; margin-right: 14px; font-size: 14px; }
.evo-user i { margin-right: 4px; }

/* Écrans étroits (tablettes en portrait, téléphones) : le menu ouvert recouvre le contenu */
@media (max-width: 700px) {
    .evo-pane { position: absolute; top: 0; bottom: 0; left: 0; z-index: 10; }
    .evo-pane.open { box-shadow: 4px 0 18px rgba(0, 0, 0, .3); }
    .evo-content { margin-left: var(--compact); }
    .evo-item-label { overflow: hidden; text-overflow: ellipsis; }
    .evo-engine, .evo-user { display: none; }
}

/* Page À propos */
.about { position: relative; min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 32px 8px; box-sizing: border-box; }
.about .page-icon { z-index: 1; }
.about-top { display: flex; flex-direction: column; align-items: flex-start; }
.about-helixcom { width: 256px; max-width: 70%; height: auto; margin: 0 0 8px; }
.about-author { font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-weight: bold; font-size: 16px; color: #000; }
.about-author a { color: inherit; text-decoration: none; }
.about-author a:hover { text-decoration: underline; }
.about-address { white-space: pre-line; margin-bottom: 8px; }
.about-product { align-self: center; display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.about-evo { width: 280px; max-width: 80vw; height: auto; }
.about-version { margin-top: 32px; font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-weight: 800; font-size: 24px; color: #000; }
.about-bottom { align-self: center; text-align: center; padding: 8px; margin-top: 16px; }
.about-license { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; min-height: 56px; margin-bottom: 8px; font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-weight: bold; font-size: 24px; color: darkred; }
.about-license-gap { display: inline-block; width: 64px; }
.about-disclaimer { font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: 12px; color: #000; }

/* Page Événements en cours */
.events-page { position: relative; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.events-page .page-icon { z-index: 1; }
.evo-tabs { display: flex; flex: none; height: 46px; padding-right: 68px; overflow-x: auto; }
.evo-tab {
    position: relative;
    flex: none;
    padding: 0 16px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    color: inherit;
}
.evo-tab:hover { background: rgba(0, 0, 0, .05); }
.evo-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--accent); }
.evo-filter { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 12px 2px 4px; }
.evo-filter .evo-input { min-width: 0; }
.evo-list-wrap { flex: 1; min-height: 0; overflow: auto; margin: 0 2px; }
.evo-list { border-collapse: collapse; width: 100%; font-weight: bold; font-size: 20px; }
.evo-list td { padding: 2px 8px; white-space: nowrap; text-align: left; }
.evo-list td.r { text-align: right; }
.evo-list td.stretch { width: 100%; }
.evo-list tr.stored { opacity: .5; }
.evo-list-empty { padding: 8px; opacity: .7; }
@media (max-width: 700px) {
    .evo-filter { grid-template-columns: 1fr; }
    .evo-list { font-size: 16px; }
}

/* Page Connexions */
.port-wrap { padding: 8px 2px; }
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.port-card { background: #fff; border: 1px solid #b9c7d0; border-left: 6px solid #999; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.port-card.on { border-left-color: #1a7f37; }
.port-card.off { border-left-color: #b3261e; }
.port-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.port-name { font-weight: bold; font-size: 16px; }
.port-state { font-size: 13px; white-space: nowrap; }
.port-card.on .port-state { color: #1a7f37; }
.port-card.off .port-state { color: #b3261e; }
.port-state .fa-circle { font-size: 9px; vertical-align: 1px; }
.port-friendly { font-size: 15px; min-height: 20px; overflow-wrap: anywhere; }
.port-line { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; opacity: .85; }
.port-link { font-family: Consolas, "Courier New", monospace; }
.port-card footer { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .85; margin-top: 2px; }
.port-waiting.busy { color: #b3261e; font-weight: bold; opacity: 1; }
.port-debug.on { color: #b36b00; font-weight: bold; }

/* Page Connexions : modification des ports */
.port-notice { margin: 0 0 8px; padding: 6px 10px; background: var(--accent4); font-size: 14px; }
/* Comme en WPF : les ports sont empilés les uns sous les autres (largeur de la page WPF : 960). */
.port-grid.edit { grid-template-columns: minmax(0, 960px); align-items: start; }
.port-card.edit { gap: 6px; }
.port-card.edit .evo-input { height: 28px; font-size: 15px; padding: 1px 6px; }
.port-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.port-wide { width: 100%; }
.port-protocol-select { width: 160px; }
.port-narrow { width: auto; min-width: 64px; }
.port-ip { width: 150px; }
.port-num { width: 70px; }
.port-tiny { width: 52px; text-align: center; }
.port-id { width: 120px; }
.port-label { font-size: 14px; }
.port-field { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.port-field.inline { flex-direction: row; align-items: center; gap: 6px; }
.port-check { margin: 0; font-size: 14px; }
.port-dialog { padding: 2px 14px; }
.port-card.edit .evo-btn { height: 28px; padding: 2px 12px; font-size: 14px; }
.port-refused h2 { font-weight: normal; margin: 0 0 12px; }
.port-refused h2 .fa-solid { color: var(--accent); margin-right: 6px; }
.port-refused-text { margin: 0 0 16px; }

/* Fenêtres de paramètres d'un port (bouton « … ») */
.param-backdrop { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .4); padding: 12px; }
.param-dialog { display: flex; flex-direction: column; max-width: 100%; max-height: 100%; background: var(--accent4); box-shadow: 0 6px 30px rgba(0, 0, 0, .45); font-size: 13px; }
.param-dialog h2 { margin: 0; padding: 8px 16px; background: var(--accent); color: #fff; font-size: 18px; font-weight: normal; }
.param-port { opacity: .8; font-size: 14px; margin-left: 12px; }
.param-body { flex: 1; min-height: 0; overflow: auto; display: grid; }
.param-body > .pn-grid { align-content: start; }
/* Bas des fenêtres de paramétrage (comme WPF : une ligne de 56 px, bouton OK sur toute la largeur, marges de 2 px ; avec un bouton de test, test 1/3 et OK 2/3). */
.param-actions { flex: none; display: flex; height: 56px; padding: 0; box-sizing: border-box; background: var(--accent4); border-top: 1px solid #9fb6c3; }
.param-actions .evo-btn { flex: 2 1 0; min-width: 0; margin: 2px; padding: 0 8px; }
/* Fenêtres de paramètres : reproduction de la présentation WPF (piles, grilles, groupes). */
.pn { box-sizing: border-box; min-width: 0; }
.pn-stack { display: flex; flex-direction: column; }
.pn-stack.h { flex-direction: row; }
.pn-stack.h > .pn { flex: none; }
.pn-grid { display: grid; }
.pn-split { display: flex; align-items: center; justify-content: space-between; }
.pn-split > .pn-field { min-width: 140px; }
.pn-group { border: 1px solid #9fb6c3; padding: 0; margin-inline: 0; }
.pn-group > legend { padding: 0 6px; margin-left: 6px; }
.pn-text { white-space: pre-line; overflow-wrap: anywhere; }
.pn-field .evo-input { width: 100%; height: 100%; min-height: 26px; box-sizing: border-box; font-size: inherit; padding: 1px 4px; }
.pn-field .pn-secret { display: flex; gap: 4px; height: 100%; }
.pn-field .pn-secret .evo-input { flex: 1; min-width: 0; }
.pn-field label.pn-bool { display: flex; flex-direction: row; align-items: center; gap: 8px; }

/* Choix d'un fichier du serveur (certificats, TIFIP) : liste, envoi, suppression. */
.fp-root { width: 100%; min-width: 0; }
.fp { display: flex; gap: 4px; align-items: stretch; }
.fp-select { flex: 1; min-width: 0; }
.fp-upload { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.fp-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.fp-msg { font-size: 12px; margin-top: 2px; opacity: .85; }
.fp-msg.error { color: #a40000; opacity: 1; }
.fp-confirm { z-index: 60; }

/* Onglets et fenêtres secondaires (fenêtre des interfaces de contacts). */
.pn-tabs { display: flex; flex-direction: column; }
.pn-tabbar { display: flex; gap: 2px; padding: 2px 2px 0; border-bottom: 2px solid var(--accent); }
.pn-tab { border: 0; background: transparent; padding: 6px 18px; font: inherit; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.pn-tab:hover { background: rgba(0, 0, 0, .06); }
.pn-tab.active { border-bottom-color: var(--accent); font-weight: bold; }
.pn-tabpage { flex: 1; min-width: 0; padding: 2px 0; }
.pn-dialog-button { width: 100%; height: 100%; min-height: 28px; }
.pn-popup-backdrop { position: fixed; inset: 0; z-index: 50; }
.pn-popup { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); max-height: 95vh; overflow: auto; background: var(--accent4); box-shadow: 0 6px 30px rgba(0, 0, 0, .45); border: 1px solid #9fb6c3; }
.pn-grid > .pn-grid { min-width: 0; }
.pn-text.mono { font-family: "Courier New", Courier, monospace; white-space: pre; }

/* Fenêtre des services d'une entrée NC XML / NC IPGW (stations et groupes, numéros d'appel). */
.sv-dialog { width: min(784px, 100%); }
.sv-body { min-height: 630px; padding: 2px; }
.sv-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px; min-height: 0; }
.sv-grid > .pn-group { margin: 0; padding: 0 2px 2px; min-width: 0; min-height: 0; }
.sv-list-box { display: flex; flex-direction: column; }
.sv-list { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid #9fb6c3; max-height: calc(100vh - 190px); }
.sv-item { display: flex; gap: 0; padding: 2px 4px; cursor: default; white-space: nowrap; line-height: 20px; user-select: none; }
.sv-item:hover { background: rgba(0, 0, 0, .06); }
.sv-item.selected { background: var(--accent); color: #fff; }
.sv-short { flex: none; width: 56px; }
.sv-name { flex: none; width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sv-detail { display: flex; flex-direction: column; padding: 2px; }
.sv-detail.disabled { opacity: .55; }
.sv-name-row { display: grid; grid-template-columns: auto 1fr; align-items: center; height: 28px; }
.sv-name-row .evo-input { height: 26px; min-height: 26px; box-sizing: border-box; font-size: inherit; padding: 1px 4px; min-width: 220px; }
.sv-table { display: grid; grid-template-columns: auto 320px; align-items: center; }
.sv-label { text-align: right; padding: 0 8px; height: 26px; line-height: 26px; white-space: nowrap; }
.sv-modes { display: grid; grid-template-columns: repeat(4, 1fr); height: 26px; text-align: center; line-height: 26px; }
.sv-label.gap, .sv-modes.gap { margin-top: 8px; }
.sv-number { height: 24px; min-height: 24px; box-sizing: border-box; margin: 1px 2px; min-width: 0; width: calc(100% - 4px); font-size: inherit; padding: 0 3px; font-family: "Courier New", Courier, monospace; }
.sv-menu-backdrop { z-index: 70; }
.sv-menu { position: fixed; z-index: 71; min-width: 190px; background: #fff; border: 1px solid #9fb6c3; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); display: flex; flex-direction: column; padding: 2px 0; }
.sv-menu button { border: 0; background: transparent; text-align: left; padding: 6px 14px; font: inherit; cursor: pointer; }
.sv-menu button:hover { background: var(--accent); color: #fff; }
.sv-menu hr { border: 0; border-top: 1px solid #c3d2db; margin: 2px 0; width: 100%; }
.sv-menu button:disabled { opacity: .45; cursor: default; }
.sv-menu button:disabled:hover { background: transparent; color: inherit; }
.evo-btn-yellow { background: #f2c200; color: #000; }
.param-actions .evo-btn-yellow { flex: 1 1 0; }

/* Fenêtres des sorties de radiomessagerie : groupes, numéros autorisés/interdits, convertisseurs de numéros. */
.gp-dialog { width: min(992px, 100%); }
.gp-body { min-height: 590px; padding: 2px; }
.gp-box, .cv-box { margin: 0; padding: 0 2px 2px; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.gp-list { flex: 1; min-height: 0; overflow: auto; background: #f1f8fc; max-height: calc(100vh - 240px); }
.gp-row { position: relative; display: flex; align-items: center; width: max-content; padding: 2px; }
.gp-row::before { content: ""; position: absolute; left: 24px; right: 24px; top: 50%; height: 8px; transform: translateY(-50%); background: #a0a0a0; }
.gp-num { position: relative; flex: none; width: 56px; height: 24px; min-height: 24px; box-sizing: border-box; margin: 0; padding: 0 1px; font-size: 11px; }
.gp-source { margin-right: 8px; }
.bn-dialog { width: min(624px, 100%); }
.bn-body { display: block; min-height: 550px; max-height: calc(100vh - 150px); padding: 6px; background: #f1f8fc; }
.bn-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 2px 4px; }
.bn-num { height: 24px; min-height: 24px; box-sizing: border-box; margin: 0 2px; min-width: 0; width: calc(100% - 4px); padding: 0 3px; font-size: 12px; }
.param-actions.bn-foot { display: grid; grid-template-columns: 6px 0.15fr 0.5fr 1fr; align-items: stretch; height: 56px; padding: 0; box-sizing: border-box; }
.bn-light { width: 100%; height: 100%; padding: 2px; box-sizing: border-box; object-fit: contain; }
.bn-toggle { margin: 2px; border: 1px solid #999; font: inherit; cursor: pointer; color: #000; }
.bn-toggle.banned { background: orange; }
.bn-toggle.allowed { background: lightgreen; }
.bn-foot .evo-btn { margin: 2px; }
.cv-dialog { width: min(584px, 100%); }
.cv-body { min-height: 510px; padding: 2px; }
.cv-list { flex: 1; min-height: 0; overflow: auto; padding: 6px; max-height: calc(100vh - 230px); }
.cv-row { display: grid; grid-template-columns: 0.15fr 0.3fr 1.7fr; align-items: center; height: 26px; }
.cv-row .evo-input { height: 24px; min-height: 24px; box-sizing: border-box; margin: 0 2px; min-width: 0; width: calc(100% - 4px); padding: 0 4px; font-size: inherit; }
.cv-index, .cv-source { text-align: right; }
/* Journal (page Log) : LogFilter.xaml - une seule ligne de 240 px, quatre colonnes (dates, événements, NC XML, filtre) ; le filtre occupe
   la moitié haute de la dernière colonne, les boutons d'export la moitié basse. */
.log-page { position: relative; height: 100%; display: flex; flex-direction: column; min-height: 0; padding: 2px; font-size: 13px; }
.lg-filter { flex: none; display: grid; grid-template-columns: auto auto auto minmax(170px, 360px); grid-template-rows: 120px 1fr; justify-content: start; height: 240px; }
.lg-box { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 0; margin: 2px; padding: 4px 6px; overflow: hidden; }
.lg-box > legend { font-size: 13px; }
.lg-box:disabled { opacity: .55; }
.lg-dates { grid-column: 1; grid-row: 1 / 3; width: 215px; }
.lg-events { grid-column: 2; grid-row: 1 / 3; }
.lg-ezcare { grid-column: 3; grid-row: 1 / 3; }
.lg-text { grid-column: 4; grid-row: 1; }
.lg-export { grid-column: 4; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
.lg-export .evo-btn { height: 28px; padding: 0 6px; margin: 0 2px 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.lg-box .evo-input { height: 28px; font-size: 13px; padding: 2px 4px; }
.lg-box select.evo-input { padding: 0 2px; }
.lg-checks { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.lg-check { display: flex; align-items: center; gap: 6px; cursor: pointer; height: 19px; white-space: nowrap; }
.lg-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.lg-cats { display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, 19px); grid-auto-columns: max-content; column-gap: 14px; align-content: center; }
.lg-combos { flex: none; display: grid; grid-template-columns: repeat(3, minmax(88px, 1fr)); gap: 4px; height: 28px; }
.lg-combos .evo-input { min-width: 0; }
.lg-tools { flex: none; display: flex; height: 24px; }
.lg-icon { width: 30px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: #ddd; color: var(--accent); cursor: pointer; }
.lg-icon:hover { filter: brightness(.92); }
.lg-dates .evo-btn { flex: none; height: 40px; padding: 0 8px; }
.lg-text .evo-btn { flex: none; height: 26px; margin-top: 2px; padding: 0 8px; }
.lg-text .evo-input + .evo-btn { margin-top: auto; }
.lg-apply.flash { animation: lg-flash 1s steps(1) infinite; }
@keyframes lg-flash { 0% { background: var(--accent); color: #fff; } 50% { background: #f2c200; color: #000; } }
@media (max-width: 1000px) {
    .lg-filter { display: flex; flex-wrap: wrap; height: auto; }
    .lg-box { min-height: 220px; }
    .lg-dates, .lg-text { flex: 1 1 200px; }
    .lg-export { flex: 1 1 200px; }
}
.lg-notice { flex: none; margin: 2px 4px; padding: 3px 8px; background: #fff3cd; border: 1px solid #e0c36a; font-size: 13px; }
.lg-results { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 4px 2px 0; background: #fff; border: 1px solid #ccc; }
/* Une ligne fait 24 px quand le texte tient sur une ligne, et grandit si l'événement est plus long (le texte passe à la ligne). */
.lg-row { display: flex; align-items: flex-start; line-height: 20px; padding: 2px 6px; font-size: 14px; }
.lg-row.odd { background: rgba(17, 158, 218, .08); }
.lg-row:hover { background: rgba(17, 158, 218, .22); }
.lg-row span { flex: none; padding-right: 14px; overflow: hidden; white-space: nowrap; }
.lg-row .lg-d { width: 6.5em; text-align: right; }
.lg-row .lg-t { width: 7em; text-align: right; }
.lg-row .lg-l { width: 8.5em; text-align: right; }
.lg-row .lg-e { flex: 1; min-width: 0; padding-right: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-results { color: #000; padding: 2px 0; }
.st-head { display: flex; align-items: center; gap: 4px; padding: 3px 6px; user-select: none; }
.st-toggle { flex: none; width: 22px; height: 22px; margin-right: 4px; padding: 0; border: 1px solid #aaa; border-radius: 3px; background: #eee; color: #000; font-weight: 700; line-height: 1; cursor: pointer; }
.st-toggle:hover { background: #ddd; }
.st-head:hover { background: rgba(17, 158, 218, .22); }
.st-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-count { flex: none; min-width: 100px; padding: 1px 6px; border-radius: 3px; text-align: right; white-space: nowrap; font-size: 14px; }
/* Nuances de rouge par palier (> 5, > 10, > 15, > 30 min, > 1 h) : à garder identiques à LogStatisticsColors (EVO.Core). */
.st-count.lv1 { background: #6b1a1a; color: #fff; }
.st-count.lv2 { background: #8f2020; color: #fff; }
.st-count.lv3 { background: #b52525; color: #fff; }
.st-count.lv4 { background: #dc2d2d; color: #fff; }
.st-count.lv5 { background: #ff1f1f; color: #fff; }
.st-rows { margin-left: 32px; padding-bottom: 6px; }
.lg-row.st-row.lv1 { background: #6b1a1a; color: #fff; }
.lg-row.st-row.lv2 { background: #8f2020; color: #fff; }
.lg-row.st-row.lv3 { background: #b52525; color: #fff; }
.lg-row.st-row.lv4 { background: #dc2d2d; color: #fff; }
.lg-row.st-row.lv5 { background: #ff1f1f; color: #fff; }
.lg-row.st-row.lv1:hover { background: #561515; }
.lg-row.st-row.lv2:hover { background: #721919; }
.lg-row.st-row.lv3:hover { background: #921e1e; }
.lg-row.st-row.lv4:hover { background: #b02424; }
.lg-row.st-row.lv5:hover { background: #cc1919; }
/* Onglets « Par lieu » / « Synthèse » et synthèse (cartes, puces par palier, graphiques SVG). */
.st-kinds { display: flex; flex: none; gap: 6px; padding: 8px 10px 0; }
.st-kind { padding: 3px 12px; border: 1px solid #b5b5b5; border-radius: 4px; background: #f3f3f3; color: #222; font: inherit; cursor: pointer; }
.st-kind:hover:not(:disabled) { background: #e6eef2; }
.st-kind.active { background: #4f8fb0; border-color: #4f8fb0; color: #fff; font-weight: 700; }
.st-kind:disabled { cursor: default; opacity: .6; }
.st-tabs { display: flex; flex: none; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid #ddd; }
.st-tab { padding: 6px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.st-tab.active { font-weight: 700; border-bottom-color: #4f8fb0; }
.sm-results { padding: 12px 16px 16px; overflow: auto; }
.sm-cards, .sm-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.sm-card { box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; min-width: 140px; min-height: 74px; padding: 8px 14px; border-radius: 6px; background: #f0f5f7; color: #000; }
.sm-card b { display: block; font-size: 22px; line-height: 26px; height: 26px; white-space: nowrap; }
.sm-card span { display: block; max-width: 180px; font-size: 12px; line-height: 15px; opacity: .75; }
.sm-chip { box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; min-width: 110px; min-height: 70px; padding: 8px 14px; border-radius: 6px; color: #fff; }
.sm-chip b { display: block; font-size: 20px; line-height: 24px; height: 24px; white-space: nowrap; }
.sm-chip span { display: block; max-width: 150px; font-size: 12px; line-height: 15px; }
.sm-chip.dim { opacity: .45; }
.sm-title { margin: 14px 0 6px; font-size: 14px; }
.sm-svg { display: block; width: 100%; max-width: 760px; height: auto; }
@media (max-width: 760px) { .st-head { flex-wrap: wrap; } .st-name { flex-basis: 60%; } .st-count { min-width: 0; } }
.lg-loading { width: min(600px, 100%); }
.lg-loading-text { padding: 22px 16px; text-align: center; font-size: 18px; }

/* Page Équipements (DevicesPage / DevicesDisplay) */
.dv-page { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.dv-page .evo-tabs { padding-right: 0; }
.dv-filter { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 2px 4px; }
.dv-filter .evo-input { min-width: 0; }
.dv-list { flex: 1; min-height: 0; overflow: auto; margin: 0 2px; }
.dv-list { --dv-c1: 8em; --dv-c2: 8em; --dv-c3: 8em; --dv-c4: 8em; }
.dv-row { display: grid; grid-template-columns: calc(var(--dv-c1) + 20px) calc(var(--dv-c2) + 20px) calc(var(--dv-c3) + 20px) calc(var(--dv-c4) + 20px) 160px 160px; justify-content: start; align-items: center; height: 36px; width: 100%; min-width: max-content; font-size: 14px; }
.dv-row:hover { background: var(--accent4); }
.dv-row > span { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-row .dv-cell { padding: 0 8px 0 0; }
.dv-row .evo-btn { width: 100%; height: 28px; padding: 0 6px; color: #000; }
.dv-green { background: #0c0; }
.dv-lightgreen { background: #0f0; }
.dv-yellow { background: #ff0; }
.dv-lightyellow { background: #ff8; }

/* Page « État des chambres » : mêmes colonnes ajustées au contenu que les équipements, la dernière prend le reste de la largeur ; texte gras de 20 px */
.rs-list { --rs-c1: 8em; --rs-c2: 8em; --rs-c3: 8em; }
.rs-row { grid-template-columns: calc(var(--rs-c1) + 20px) calc(var(--rs-c2) + 20px) calc(var(--rs-c3) + 20px) minmax(8em, 1fr); font-size: 20px; font-weight: bold; }
.rs-row > span { padding: 0 8px; }

/* Page « Badges RFID » : liste à gauche (640 px comme WPF), détail du badge à droite (480 px au plus) */
.rf-page { height: 100%; display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 0; min-height: 0; }
.rf-left, .rf-right { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 2px; }
.rf-page .pn-group { margin: 2px; padding: 4px 4px 6px; min-width: 0; }
.rf-filter { flex: none; display: grid; grid-template-columns: 1fr 160px; align-items: stretch; }
.rf-filter > .evo-btn { margin: 2px; }
.rf-list-box { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.rf-list { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid #9fb6c3; user-select: none; outline: none; }
.rf-row { display: grid; grid-template-columns: 280px 190px 90px minmax(72px, 1fr); height: 28px; align-items: center; cursor: default; min-width: 632px; font-size: 14px; }
.rf-row > span { padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-row:hover { background: rgba(0, 0, 0, .06); }
.rf-row.selected { background: var(--accent); color: #fff; }
.rf-big { flex: none; height: 56px; margin: 2px; }
.rf-right { max-width: 480px; }
.rf-detail { flex: 1; min-height: 0; overflow: auto; }
.rf-detail.disabled .pn-group { opacity: .6; }
.rf-center { text-align: center; min-height: 32px; line-height: 32px; overflow-wrap: anywhere; }
.rf-orange { background: orange; color: #000; }
.rf-bottom { flex: none; display: grid; grid-template-columns: 1fr 1fr; }
.rf-help { flex: none; max-height: 55%; overflow: auto; margin: 2px; padding: 4px 10px 8px; border: 1px solid #9fb6c3; background: rgba(255, 255, 255, .5); font-size: 14px; }
.rf-help > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.rf-help p { margin: 4px 0 6px; }
.rf-help ol { margin: 0 0 6px; padding-left: 22px; }
.rf-help li { margin: 2px 0; }
.rf-conn { margin: 4px 0 0 !important; }
.rf-conn-row { display: flex; gap: 12px; align-items: baseline; padding: 2px 4px; }
.rf-conn-row > span { min-width: 140px; }
.rf-conn-row > strong { overflow-wrap: anywhere; }
@media (max-width: 900px) {
    .rf-page { grid-template-columns: minmax(0, 1fr); grid-auto-rows: min-content; overflow: auto; }
    .rf-list-box { min-height: 320px; }
    .rf-right { max-width: none; }
}

/* Page Cartes (boutons interactifs) : carte de 1280 x 1024 mise à l'échelle, boutons de 64 pixels, liste des cartes de 196 pixels à droite (MapsPage.xaml) */
.mp-page { position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 196px; min-height: 0; }
.mp-denied { grid-column: 1 / -1; }
.mp-stage { container-type: size; margin: 64px 0 4px 4px; min-width: 0; min-height: 0; display: flex; justify-content: center; align-items: flex-start; }
.mp-canvas { --u: calc(100cqw / 1280); container-type: inline-size; position: relative; flex: none; width: min(100cqw, 100cqh * 1.25); aspect-ratio: 1280 / 1024; border: 1px solid #000; background: #fff; user-select: none; }
.mp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.mp-btn { position: absolute; cursor: pointer; font-family: "Trebuchet MS", "Segoe UI", sans-serif; filter: drop-shadow(calc(var(--u) * 4) calc(var(--u) * 4) calc(var(--u) * 3) rgba(0, 0, 0, .4)); }
.mp-ring { height: 100%; padding: calc(var(--u) * 2); background: linear-gradient(#888, #444); border-radius: calc(var(--u) * 8); }
.mp-ring > .mp-ring { border-radius: calc(var(--u) * 4); }
.mp-face { position: relative; height: 100%; border-radius: calc(var(--u) * 2); }
.mp-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: calc(var(--u) * 12); font-weight: bold; font-size: calc(var(--u) * 24); white-space: nowrap; }
.mp-chrono { position: absolute; top: 0; right: calc(var(--u) * 2); font-size: calc(var(--u) * 18); line-height: 1.3; }
.mp-led { position: absolute; left: calc(var(--u) * 2); top: calc(var(--u) * 2); display: grid; z-index: 1; }
.mp-led > img { grid-area: 1 / 1; height: calc(var(--u) * 20); width: auto; }
.mp-list { margin: 64px 4px 4px 4px; min-height: 0; overflow: auto; }
.mp-map { height: 38.6px; border: 2px solid transparent; }
.mp-map.selected { border-color: darkred; }
.mp-map > button { display: block; width: 100%; height: 100%; padding: 0 2px; border: 2px solid #8a8a8a; border-radius: 0; background: lightgray; color: #000; font: inherit; font-size: 15px; text-align: center; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-map > button:hover { background: #ddd; border-color: var(--accent); }
.mp-map > button:active { background: #eee; }
.mp-disclaimer { white-space: pre-wrap; max-width: 520px; }
.mp-delay { display: flex; align-items: center; justify-content: center; gap: 8px; }
.mp-delay .evo-input { width: 76px; }
@media (max-width: 700px) {
    .mp-page { grid-template-columns: minmax(0, 1fr) 120px; }
    .mp-map > button { font-size: 13px; }
}

/* Cartes : mode édition, barre d'outils, menu contextuel, fenêtres de choix du plan et de réglage du bouton */
.mp-bar { position: absolute; top: 0; left: 8px; right: 80px; height: 64px; display: flex; align-items: center; gap: 8px; z-index: 2; }
.mp-bar-left { display: flex; flex-direction: column; justify-content: center; min-width: 0; margin-right: 8px; }
.mp-coords { height: 16px; line-height: 16px; font-size: 13px; }
.mp-tool { flex: none; width: 48px; height: 40px; padding: 0; }
.mp-bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mp-notice { color: #c62828; font-size: 13px; text-align: right; }
.mp-upload { position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 14px; overflow: hidden; background: #f2c200; color: #000; white-space: nowrap; }
.mp-upload.disabled { background: #ccc; color: #888; cursor: default; }
.mp-upload input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mp-upload.disabled input[type=file] { cursor: default; }
.mp-btn.editable { cursor: move; touch-action: none; }
.mp-btn.faded { opacity: .25; }
.mp-btn.picked > .mp-ring > .mp-ring { background: linear-gradient(#ff5, #ee2); }
.mp-stage:focus { outline: none; }
.mp-title { display: block; width: 100%; height: 100%; padding: 0 8px; border: 2px solid #8a8a8a; background: #fff; color: #000; font: inherit; font-size: 15px; text-align: center; }
.mp-menu-backdrop { position: fixed; inset: 0; z-index: 44; }
.mp-menu { position: fixed; z-index: 45; display: flex; flex-direction: column; min-width: 200px; padding: 4px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.mp-menu > button { margin: 4px; padding: 14px 24px; border: 2px solid #8a8a8a; background: lightgray; color: #000; font: inherit; font-size: 16px; cursor: pointer; }
.mp-menu > button:hover { background: #ddd; border-color: var(--accent); }
.mp-move { width: min(420px, 100%); }
.mp-move-list { display: block; padding: 8px 24px; overflow: auto; max-height: calc(100vh - 220px); background: #f1f8fc; }
.mp-move-list .mp-map { width: 100%; }
.mb-dialog { width: min(856px, 100%); }
.mb-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 4px 12px 8px; background: #f1f8fc; align-content: start; }
.mb-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mb-field { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.mb-label { font-size: 13px; }
.mb-field .evo-input, .mb-row .evo-input { height: 26px; min-height: 26px; box-sizing: border-box; padding: 0 4px; font-size: 13px; min-width: 0; }
.mb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.mb-row .evo-input { width: 55%; }
.mb-row .mb-short { width: 88px; }
.mb-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mb-inline .evo-input.mb-num { width: 64px; }
.mb-sizes .evo-input { width: 64px; }
.mb-sizes { margin-top: 10px; }
.mb-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.mb-color { width: 64px; height: 26px; padding: 0; border: 1px solid #9fb6c3; background: #fff; }
.mb-alpha { width: 110px; accent-color: var(--accent); }
.mb-pct { width: 3.2em; text-align: right; }
@media (max-width: 700px) {
    .mb-body { grid-template-columns: 1fr; }
    .mp-bar { right: 8px; flex-wrap: wrap; height: auto; min-height: 64px; }
    .mp-stage { margin-top: 112px; }
    .mp-list { margin-top: 112px; }
}

/* Outils : boîte à outils, cadre des outils, groupes, boutons du bas, traceur XML et appels virtuels */
/* Fenêtre d'outil (PopupLayout) : le navigateur fournit la barre de titre, la page remplit toute la fenêtre. */
.evo-popup { display: flex; flex-direction: column; height: 100vh; overflow: auto; background: var(--accent4); }
@supports (color: color-mix(in srgb, red 20%, white)) {
    .evo-popup { --accent4: color-mix(in srgb, var(--accent) 18%, white); }
}
.tl-box { position: relative; padding: 80px clamp(12px, 14vw, 80px) 64px; }
.tl-box-list { display: flex; flex-direction: column; }
.tl-box-button { display: flex; align-items: center; justify-content: center; height: 40px; margin: 4px; text-align: center; text-decoration: none; background: var(--accent); color: #fff; border: 2px solid transparent; }
.tl-box-button:hover { filter: brightness(.9); }
.tl-box-button:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

.tl-frame { display: flex; flex-direction: column; width: 100%; background: var(--accent4); font-size: 13px; }
.tl-fixed { flex: none; }
.tl-resizable { flex: 1; min-height: 0; }
.tl-body { flex: 1; min-height: 0; padding: 4px; }
.tl-footer { flex: none; display: flex; align-items: center; gap: 4px; padding: 4px; }
.tl-footer .tl-btn { flex: 1; }
.tl-sent { color: #1b7f1b; font-weight: bold; padding: 0 8px; white-space: nowrap; }

.tl-btn { height: 48px; padding: 0 16px; border: 2px solid #8a8a8a; font: inherit; color: #000; cursor: pointer; }
.tl-btn:hover:not(:disabled) { filter: brightness(.92); border-color: var(--accent); }
.tl-btn:disabled { background: #ccc; color: #888; cursor: default; }
.tl-yellow { background: yellow; }
.tl-gray { background: lightgray; }
.tl-red { background: orangered; color: #fff; border-color: #8a8a8a; }

.tl-group { margin: 2px; padding: 6px 8px 8px; border: 1px solid #9fb6c3; min-width: 0; }
.tl-group > legend { padding: 0 6px; font-weight: bold; font-size: 14px; }
.tl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.tl-label { flex: 1 1 auto; min-width: 0; }
.tl-select { flex: none; height: 26px; min-width: 80px; max-width: 60%; font-size: inherit; padding: 0 4px; margin-left: auto; }
.tl-paging .tl-select { flex: 1; width: 100%; min-width: 0; max-width: none; }
.tl-short { flex: none; width: 88px; height: 26px; font-size: inherit; padding: 1px 4px; margin-left: auto; }
.tl-fill { flex: 1; width: 100%; min-width: 0; height: 26px; font-size: inherit; padding: 1px 4px; }
.tl-gap { height: 16px; }

.tl-paging { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .5fr) minmax(0, 1fr) minmax(0, 2fr); }
.tl-hidden-submit { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; padding: 0; border: 0; }
.tl-p-speech { grid-column: 1 / -1; }
.tl-events { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; }
.tl-col { display: flex; flex-direction: column; }
.tl-send { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; align-items: stretch; }
.tl-send .tl-btn { width: 100%; }
.tl-send .tl-sent { text-align: center; padding-bottom: 4px; }

.tl-tracer-in { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.tl-tabs { padding-right: 0; height: 40px; }
.tl-xml { flex: 1; min-height: 0; overflow: auto; margin: 2px 0; background: #fff; border: 1px solid #9fb6c3; user-select: none; }
.tl-xml-line { padding: 4px; font-weight: bold; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: default; }
.tl-xml-line.selected { background: rgba(17, 158, 218, .18); }
.tl-xml-bar { flex: none; display: grid; grid-template-columns: 1fr 320px; align-items: center; height: 56px; padding: 0 16px; gap: 16px; }
.tl-xml-bar .tl-btn { height: 40px; }
.tl-calls { background: #fff; border: 1px solid #9fb6c3; }
.tl-kill { width: 40px; height: 32px; border: 0; background: orangered; color: #fff; cursor: pointer; }
.tl-kill:hover { filter: brightness(.9); }

@media (max-width: 900px) {
    .tl-events { grid-template-columns: 1fr; }
    .tl-paging { grid-template-columns: 1fr 1fr; }
    .tl-xml-bar { grid-template-columns: 1fr auto; padding: 0 8px; }
    .tl-select { max-width: 60%; }
}

/* Page Paramètres (onglet Préférences) : colonne de 360 px centrée comme PreferencesSettings.xaml */
.st-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; padding: 8px; }
.st-pref { width: 360px; max-width: 100%; margin: auto; display: flex; flex-direction: column; gap: 4px; }
.st-pref .pn-group { margin: 2px; padding: 4px 4px 6px; min-width: 0; }
.st-pref .pn-group > legend { font-weight: 600; }
.st-cell { display: flex; align-items: center; min-height: 40px; padding: 0 16px; }
.st-cell .evo-input { width: 100%; height: 28px; box-sizing: border-box; padding: 1px 6px; font-size: 15px; }
.st-center { justify-content: center; }
.st-cell .evo-input.st-short { width: auto; min-width: 96px; text-align: right; }
.st-ports { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.st-ports .st-cell { min-height: 56px; padding: 0 8px; }
.st-column { flex-direction: column; align-items: stretch; justify-content: center; gap: 4px; padding-top: 6px; padding-bottom: 6px; }
.st-note { font-weight: 800; text-align: center; }
.st-hint { font-size: 12px; color: #555; text-align: center; }
.st-restart { align-self: center; margin-top: 4px; }

/* Onglet Modes : interrupteur, jours de la semaine, huit créneaux heure + mode (320 px comme DayModeSettings.xaml) */
.st-modes { width: 560px; max-width: 100%; margin: auto; display: flex; flex-direction: column; }
.st-modes-toggle { align-self: stretch; margin: 8px; }
.st-days { padding-right: 0; height: 40px; }
.st-days .evo-tab { flex: 1 1 0; min-width: 0; padding: 0 4px; font-size: 14px; justify-content: center; }
.st-slots { align-self: center; width: 320px; max-width: 100%; padding: 8px 0; }
.st-slot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px; }
.st-slot .evo-input { height: 30px; min-height: 30px; box-sizing: border-box; padding: 0 6px; font-size: 15px; min-width: 0; width: 100%; }
.mp-menu > hr { width: calc(100% - 8px); margin: 4px; border: 0; border-top: 1px solid #999; }

/* Onglet Utilisateurs : liste à gauche (1) et réglages à droite (1,5), comme UsersSettings.xaml */
.st-fill { flex: 1; min-height: 0; overflow: auto; padding: 4px; }
.su-root { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.5fr); grid-template-rows: minmax(0, 1fr); gap: 0; height: 100%; }
.su-root .pn-group { margin: 2px; padding: 4px 4px 6px; min-width: 0; }
.su-root .pn-group > legend { font-weight: 600; }
.su-list-box { display: flex; flex-direction: column; min-height: 240px; }
.su-list { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid #9fb6c3; user-select: none; outline: none; }
.su-row { height: 28px; line-height: 28px; padding: 0 8px; cursor: default; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.su-row:hover { background: rgba(0, 0, 0, .06); }
.su-row.default { font-weight: 800; color: var(--accent); }
.su-row.selected { background: var(--accent); color: #fff; }
.su-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.su-detail { flex: 1; min-height: 0; overflow: auto; }
.su-detail.disabled .pn-group { opacity: .6; }
.su-top { display: grid; grid-template-columns: 1fr 1fr; }
.su-cell { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 40px; padding: 0 8px; }
.su-cell .evo-input { width: 100%; height: 28px; box-sizing: border-box; padding: 1px 6px; font-size: 15px; }
.su-check { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; font-size: 14px; }
.su-check input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.su-check.inhibited { color: #8a8a8a; cursor: default; }
.su-rights { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; column-gap: 8px; padding: 0 8px; }
.su-rcell { display: flex; align-items: center; gap: 6px; min-height: 32px; min-width: 0; }
.su-rcell .su-check { flex: 1; min-width: 0; }
.su-radio { justify-content: center; padding: 0 12px; font-size: 14px; }
.su-radio input { width: 18px; height: 18px; accent-color: var(--accent); }
.su-text { padding-left: 26px; font-size: 14px; }
.su-gear { flex: none; width: 36px; height: 30px; padding: 0; }
.su-bottom { display: grid; grid-template-columns: 1fr 1fr; }
.su-tree { max-height: 340px; min-height: 120px; overflow: auto; padding: 2px 8px; }
.su-tree hr { margin: 6px 0; border: 0; border-top: 1px solid #c4d2db; }
.su-level1 { padding-left: 20px; }
.su-level2 { padding-left: 40px; }
.su-buttons { flex: none; display: grid; grid-template-columns: 1fr 1fr; }
.su-maps { padding: 8px 12px; max-height: 80vh; overflow: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); }
@media (max-width: 900px) {
    .su-root { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; height: auto; }
    .su-detail { overflow: visible; }
    .su-top, .su-bottom { grid-template-columns: minmax(0, 1fr); }
}

/* Onglet Messages EZCARE : messages sur deux colonnes, événements, états des chambres, délais, fenêtre « Format des textes » (EZCAREParametersSettings.xaml) */
.ez-page { display: flex; flex-direction: column; gap: 4px; }
.ez-page .pn-group { margin: 2px; padding: 4px 6px 8px; min-width: 0; }
.ez-page .pn-group > legend { font-weight: 600; }
.ez-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(620px, 1fr)); gap: 8px 16px; }
.ez-col { display: flex; flex-direction: column; min-width: 0; overflow-x: auto; }
.ez-row { display: grid; align-items: center; gap: 2px; margin: 1px 0; min-width: 0; }
.ez-message { grid-template-columns: minmax(130px, 1fr) 156px 44px 56px 56px 56px 28px; min-width: 590px; }
.ez-event { grid-template-columns: minmax(130px, 1fr) 160px 44px; min-width: 340px; }
.ez-status { grid-template-columns: minmax(110px, 1fr) 152px 56px 28px; min-width: 370px; }
.ez-head > span { text-align: center; font-size: 13px; }
.ez-gap { margin-top: 16px; }
.ez-name { text-align: right; padding-right: 6px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ez-row .evo-input, .ez-number { height: 28px; box-sizing: border-box; padding: 1px 4px; font-size: 14px; min-width: 0; width: 100%; }
.ez-code { text-align: left; }
.ez-color { width: 28px; height: 28px; padding: 0; border: 1px solid #8a8a8a; background: none; cursor: pointer; }
.ez-bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 4px; align-items: start; }
.ez-side { display: flex; flex-direction: column; min-width: 0; }
.ez-delay { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 8px; font-size: 14px; }
.ez-delay .ez-number { width: 48px; text-align: right; }
.ez-delay .ez-name { flex: 1; }
.ez-transfers { display: flex; flex-direction: column; padding: 2px 8px; }
.ez-dialog-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); }
.ez-dialog { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, 96vw); max-height: 94vh; display: flex; flex-direction: column; background: var(--accent4, #e3f1fa); box-shadow: 0 4px 24px rgba(0, 0, 0, .5); }
.ez-dialog-title { padding: 10px 16px; background: var(--accent); color: #fff; font-size: 18px; }
.ez-dialog-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 16px; }
.ez-format { padding: 8px 0 12px; border-bottom: 1px solid #c4d2db; }
.ez-format-name { margin-bottom: 4px; }
.ez-field { display: grid; grid-template-columns: minmax(120px, 1fr) 44px 44px 44px 28px; gap: 4px; align-items: center; margin: 1px auto; max-width: 420px; }
.ez-field-head > span { text-align: center; font-size: 13px; }
.ez-char { font-size: 14px; }
.ez-ruler { overflow-x: auto; margin-top: 6px; }
.ez-ruler pre { margin: 0; font-family: "Courier New", monospace; font-size: 14px; text-align: center; }
.ez-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 0; }
.ez-check { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 24px; font-size: 14px; }
.ez-check input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 700px) {
    .ez-cols { grid-template-columns: minmax(0, 1fr); }
    .ez-bottom { grid-template-columns: minmax(0, 1fr); }
    .ez-checks { grid-template-columns: minmax(0, 1fr); }
}

/* Paramètres > Synthèse vocale */
.sp-page { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; gap: 4px; }
.sp-page .pn-group { margin: 2px; padding: 4px 6px 6px; min-width: 0; }
.sp-page .pn-group > legend { font-weight: 600; }
.sp-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-cell { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.sp-cell select { width: 100%; }
.sp-slider input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent, #1a9bdc); }
.sp-slider output { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.sp-translations { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sp-list { flex: 1; min-height: 0; overflow-y: auto; }
.sp-row { display: grid; grid-template-columns: 28px 28px 44px minmax(0, 1fr) minmax(0, 1fr); gap: 4px; align-items: center; padding: 1px 0; }
.sp-btn { padding: 0; height: 26px; min-width: 0; }
.sp-index { text-align: right; }
.sp-confirm-text { white-space: pre-line; }
@media (max-width: 700px) { .sp-top { grid-template-columns: 1fr; } .sp-page { height: auto; } .sp-translations { overflow: visible; } .sp-list { overflow: visible; } }

/* Paramètres > Serveur HTTP */
.sh-page { height: 100%; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 12px 8px; }
.sh-col { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 4px; }
/* Port et interrupteur « sécurisé » : l'un sous l'autre, centrés, marges de 8 px (comme HttpServerSettings.xaml de WPF). */
.sh-cell { display: flex; flex-direction: column; align-items: center; padding: 0; }
.sh-port { width: 64px; margin: 8px; text-align: right; }
.sh-cell .evo-toggle { margin: 8px; }
.sh-label { margin-top: 8px; font-size: 0.9em; opacity: 0.85; }
.sh-label.disabled { opacity: 0.45; }
.sh-status { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.sh-note { padding: 8px 10px; border: 1px solid var(--evo-border, #8884); border-radius: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-pending { justify-content: space-between; }
.sh-error { border-color: #c0392b; color: #c0392b; }
.sh-hint { font-size: 0.85em; opacity: 0.8; margin-bottom: 6px; }
.sh-valrow { display: flex; gap: 6px; align-items: center; }
.sh-valrow .evo-input { flex: 1; min-width: 0; }
.sh-valtext { width: 100%; min-height: 84px; resize: vertical; font-family: Consolas, "Courier New", monospace; box-sizing: border-box; }
.sh-validation .sh-note { margin-top: 6px; word-break: break-all; }
.sh-validation .evo-toggle { margin: 6px 0; }

/* Page Fichiers : informations du site à gauche, boutons de configuration et de clé de protection à droite (deux colonnes égales, comme WPF) */
.fl-page { height: 100%; overflow: auto; padding: 12px 16px; position: relative; }
.fl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.fl-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fl-info .pn-group { padding: 4px 8px 8px; }
.fl-info .evo-input { width: 100%; box-sizing: border-box; }
.fl-notes textarea { min-height: 220px; resize: vertical; font: inherit; }
.fl-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.fl-gap { height: 18px; }
.fl-btn { position: relative; display: inline-flex; align-items: center; gap: 12px; width: 320px; max-width: 100%; min-height: 48px; box-sizing: border-box; padding: 6px 14px; border: 1px solid #0003; border-radius: 4px; color: #000; font: inherit; font-weight: bold; text-align: left; cursor: pointer; overflow: hidden; }
.fl-btn i { width: 24px; text-align: center; font-size: 20px; flex: none; }
.fl-btn span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fl-btn:hover:not(:disabled):not(.disabled) { filter: brightness(1.1); }
.fl-btn:disabled, .fl-btn.disabled { opacity: 0.5; cursor: default; }
.fl-load { background: #00dddd; }
.fl-save { background: #cc9900; }
.fl-clear { background: #ffa500; }
.fl-update { background: #aaaaff; }
.fl-virtual { background: #33cc33; }
.fl-unvirtual { background: #dd0000; color: #fff; }
.fl-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.fl-btn.disabled .fl-file, .fl-file:disabled { cursor: default; pointer-events: none; }
.fl-wide { top: 8vh; width: min(560px, 92vw); max-height: 84vh; display: flex; flex-direction: column; }
.fl-source { font-size: 0.9em; opacity: 0.75; margin-bottom: 8px; overflow-wrap: anywhere; }
.fl-items { overflow: auto; border: 1px solid #9fb6c3; padding: 4px 10px 8px; margin-bottom: 6px; }
.fl-absent { opacity: 0.45; cursor: default; }
.fl-clear-before { margin-top: 10px; }
.fl-activation { width: min(480px, 92vw); }
.fl-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; font-size: 1.15em; letter-spacing: 1px; }
.fl-code strong { overflow-wrap: anywhere; }
.fl-error .evo-confirm-title { color: #c0392b; }
@media (max-width: 760px) { .fl-page { padding-top: 60px; } .fl-cols { grid-template-columns: 1fr; } .fl-notes textarea { min-height: 120px; } }

/* Page Administration : le mot de passe de l'administrateur, au centre de la page comme WPF (cadre de 480 px) */
.ad-page { height: 100%; overflow: auto; display: flex; justify-content: center; align-items: center; padding: 12px 16px; position: relative; }
.ad-box { width: 480px; max-width: 100%; }
.ad-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; }
.ad-row { display: flex; gap: 6px; }
.ad-row .evo-input { flex: 1; min-width: 0; }
.ad-eye { flex: none; padding: 0 10px; }
.ad-change { height: 56px; margin-top: 4px; }
.ad-mismatch { background: orange; }
.ad-maint { margin-top: 12px; }
.ad-warn { font-size: 12px; opacity: .7; }
@media (max-width: 760px) { .ad-page { align-items: flex-start; padding-top: 60px; } }

.evo-error { display: flex; justify-content: center; padding: 48px; font-size: 32px; color: #c62828; }
