/* Interface de gestion VitrineExpress */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1d2330;
    --muted: #667085;
    --border: #d9dde5;
    --accent: #0a56c2;
    --accent-dark: #083f8f;
    --accent-soft: #e8f0fc;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --success: #067647;
    --success-soft: #e7f6ee;
    --warning: #b54708;
    --warning-soft: #fef4e6;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
    font-size: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}

a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
.muted { color: var(--muted); font-weight: normal; }
.hidden, [hidden] { display: none !important; }
/* Caché à l'écran mais accessible (lecteurs d'écran, clavier). Prioritaire sur les styles de formulaire :
   sinon « width: 100% » d'un champ, mesuré sur toute la fenêtre, crée un défilement horizontal. */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.link-button { background: none; border: 0; padding: .4rem 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.icon-button:hover { background: #eef0f3; color: var(--text); }
.icon-button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Barre du haut */
.topbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 1.5rem;
    min-height: 56px;
    background: #10202b;
    color: #fff;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; padding: .25rem 0; }
.brand img { display: block; height: 32px; width: auto; }
.brand-large { margin: 0 0 1.5rem; text-align: center; line-height: 0; }
.brand-large img { height: 56px; width: auto; max-width: 100%; }
.mainnav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.mainnav a {
    color: #cbd5e1;
    text-decoration: none;
    padding: .45rem .75rem;
    border-radius: 6px;
}
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.mainnav a[aria-current="page"] { color: #fff; background: rgba(0, 224, 240, .16); }
.usermenu { display: flex; align-items: center; gap: 1rem; }
.usermenu a { color: #e2e8f0; text-decoration: none; }
.usermenu form { margin: 0; }
button.link { background: none; border: 0; color: #cbd5e1; cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: #fff; text-decoration: underline; }

/* Menu repliable (admin.js) : quand la barre ne tient plus sur une ligne, elle reçoit « is-compact » ;
   le bouton Menu ouvre alors la navigation en panneau vertical sous la barre (« is-open »).
   Sans JavaScript, la barre passe simplement sur plusieurs lignes. */
.topnav { display: flex; flex: 1; }
.topnav-inner { display: flex; align-items: center; gap: 2rem; flex: 1; }
.mainnav a, .usermenu { white-space: nowrap; }
.topbar.has-menu-js,
.topbar.has-menu-js .mainnav { flex-wrap: nowrap; }
.menu-toggle {
    display: none;
    align-items: center;
    gap: .45rem;
    margin-left: auto;
    padding: .4rem .75rem;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px;
    background: none;
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.menu-toggle:hover { background: rgba(255, 255, 255, .08); }
.menu-toggle svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.topbar.is-compact { flex-wrap: wrap; row-gap: 0; }
.topbar.is-compact .menu-toggle { display: inline-flex; }
/* Panneau replié : hauteur animée de 0 à son contenu (grid-template-rows 0fr → 1fr), avec un fondu. */
.topbar.is-compact .topnav {
    display: grid;
    grid-template-rows: 0fr;
    flex-basis: 100%;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows .28s ease, opacity .2s ease, visibility 0s linear .28s;
}
.topbar.is-compact.is-open .topnav {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows .28s ease, opacity .2s ease .05s, visibility 0s;
}
.topbar.is-compact .topnav-inner {
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
}
.topbar.is-compact .mainnav { flex-direction: column; gap: .15rem; padding-top: .25rem; }
.topbar.is-compact .mainnav a { padding: .6rem .75rem; }
.topbar.is-compact .usermenu {
    justify-content: space-between;
    padding: .75rem .75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
}
/* Pendant la mesure de la place disponible (admin.js), aucune animation. */
.topbar.is-measuring, .topbar.is-measuring * { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    .topbar.is-compact .topnav { transition: none; }
}

/* Page */
.page { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* Messages flash */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: #abefc6; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #fecdca; }
.flash-info { background: var(--accent-soft); color: var(--accent-dark); border-color: #b9d3f6; }

/* Boutons */
.button {
    display: inline-block;
    padding: .5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.4;
    white-space: nowrap;
}
.button:hover { border-color: #b8bfcc; background: #f9fafb; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.danger { color: var(--danger); border-color: #fecdca; }
.button.danger:hover { background: var(--danger-soft); }
.button.small { padding: .25rem .6rem; font-size: .875rem; }

/* Cartes et formulaires */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}
.form { display: flex; flex-direction: column; gap: 1rem; }
.form.narrow { max-width: 520px; }
.form label, .form fieldset { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; }
.form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0; min-width: 0; }
.form legend { padding: 0 .35rem; }
.form input[type="text"],
.form input[type="password"],
.form input[type="number"],
.form input[type="datetime-local"],
.form input[type="date"],
.form input[type="time"],
.form input[type="file"],
.form select,
.form textarea {
    font: inherit;
    font-weight: normal;
    padding: .5rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: 2px solid rgba(10, 86, 194, .35);
    border-color: var(--accent);
}
.form .hint { font-weight: normal; color: var(--muted); font-size: .875rem; margin: 0; }
.form .hint-warning { color: var(--warning); }
.field-error { color: var(--danger); font-weight: normal; font-size: .875rem; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.form-actions > .danger { margin-left: auto; } /* « Supprimer » à l'écart, à droite */
/* Formulaire long : la rangée d'actions reste collée au bas de l'écran (bord à bord dans la carte). */
.form .sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: .25rem -1.25rem -1.25rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--surface);
    box-shadow: 0 -4px 12px rgba(16, 24, 40, .05);
}
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.checks label { flex-direction: row; align-items: center; gap: .4rem; font-weight: normal; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }

/* Tableaux : le cadre défile horizontalement si le tableau est plus large que l'écran (pas toute la page). */
.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: #f9fafb; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table .empty { text-align: center; color: var(--muted); padding: 2rem; }
/* Ligne cliquable (data-href, admin.js) : toute la ligne ouvre la fiche ; le nom reste un vrai lien (clavier, Ctrl+clic). */
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: #f6f9fe; }
.row-link { color: inherit; text-decoration: none; }
.table tr[data-href]:hover .row-link { color: var(--accent); }

/* Pastilles */
.badge {
    display: inline-block;
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    background: #eef0f3;
    color: #475467;
    white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); }
.badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }

/* Téléviseurs */
.code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .12em;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .1rem .45rem;
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.device-code { text-align: center; }
.device-code-label { margin: 0; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.device-code-value {
    margin: .25rem 0 .75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: .15em;
    color: var(--accent-dark);
}
.device-code .hint { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; text-align: left; margin: 1rem 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.stack { display: flex; flex-direction: column; gap: .5rem; }
.stack form { margin: 0; }
.stack .button { width: 100%; }

/* Messages : liste */
.filters {
    display: flex;
    gap: .75rem 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.filters label { display: flex; flex-direction: column; gap: .25rem; max-width: 100%; font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters input[type="search"] { min-width: 15rem; }
/* Suppression en lot (liste des messages expirés) */
.bulk-actions { display: flex; justify-content: flex-end; margin: -.25rem 0 1rem; }
.filters select,
.filters input[type="search"] {
    font: inherit;
    font-size: .95rem;
    color: var(--text);
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    min-width: min(200px, 100%);
}
.hint-box {
    background: var(--accent-soft);
    border: 1px solid #b9d3f6;
    color: var(--accent-dark);
    border-radius: var(--radius);
    padding: .6rem .9rem;
    margin: 0 0 1rem;
}
.thumb-col { width: 112px; }
.thumb {
    display: block;
    width: 96px;
    height: 54px;
    object-fit: contain;
    background: #000;
    border-radius: 4px;
}
.thumb-slide { position: relative; overflow: hidden; }
.is-dim td { opacity: .6; }
.nowrap { white-space: nowrap; }

/* Messages : formulaire */
/* Formulaire de message : l'aperçu a une colonne étroite dans la page, mais déborde dans la marge de droite
   quand l'écran est large (en gardant 1,5 rem du bord) ; le formulaire profite de la largeur gagnée. */
.split-wide {
    --bleed: max(0px, calc((100vw - 1200px) / 2 - 1.5rem));
    grid-template-columns: minmax(0, 1fr) clamp(300px, 30%, 360px);
}
.split-wide .preview-panel { width: calc(100% + var(--bleed)); }
/* Choix du type à la création : contrôle segmenté « Image | Texte » (vrais boutons radio, cachés ;
   l'état coché est porté par le span qui suit, sans dépendre de :has()). */
.type-switch { display: inline-flex; align-self: flex-start; gap: 3px; padding: 3px; border-radius: 10px; background: #eef0f3; }
.form .type-switch label { display: block; position: relative; cursor: pointer; }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch span {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem 1.1rem;
    border-radius: 8px;
    color: var(--muted);
    transition: background-color .15s, color .15s;
}
.type-switch label:hover span { color: var(--text); }
.type-switch input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .14); }
.type-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.type-switch svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.label-hint { font-weight: normal; font-size: .875rem; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-label { font-weight: 600; }
#editor { min-height: 180px; font-size: 1.05rem; background: #fff; }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--border); }
.ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; background: #f9fafb; }
.ql-container.ql-snow { border-radius: 0 0 6px 6px; }
/* Liste « Taille » : « Taille » dans la barre tant que rien n'est choisi, « Normal » dans la liste. */
.form .ql-snow .ql-picker.ql-size .ql-picker-label::before { content: 'Taille'; }
.form .ql-snow .ql-picker.ql-size .ql-picker-item::before { content: 'Normal'; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 96px)); gap: .6rem; }
.swatch { position: relative; flex-direction: column; align-items: center; gap: .25rem !important; font-weight: normal !important; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-color {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    font-weight: 700;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.swatch input:checked + .swatch-color { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 86, 194, .25); }
.swatch input:focus-visible + .swatch-color { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Grille compacte : étiquette à gauche, champs sur la même ligne (début, fin, durée) */
.compact-grid {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .5rem .9rem;
    align-items: center;
}
.compact-grid > label { font-weight: 600; }
/* Écran étroit : étiquette au-dessus des champs, pour garder la date et l'heure sur une ligne. */
@media (max-width: 480px) {
    .compact-grid { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
    .compact-grid > label:not(:first-child) { margin-top: .6rem; }
}
.end-add { margin-left: .35rem; }
.reveal-cancel { align-self: flex-start; font-size: .9rem; }

/* Champ image (message-form.js) */
.image-field { display: flex; flex-direction: column; gap: .5rem; }
.form .dropzone {
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 1.5rem 1rem;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: #fafbfc;
    color: var(--muted);
    font-weight: normal;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.dropzone strong { color: var(--accent); }
.dropzone:hover,
.image-field.is-dragover .dropzone { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.image-field input:focus-visible ~ .dropzone,
.image-field input:focus-visible ~ .image-card { outline: 2px solid rgba(10, 86, 194, .4); outline-offset: 2px; }
.image-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}
.image-field.is-dragover .image-card { border-color: var(--accent); background: var(--accent-soft); }
.image-card-thumb { flex: none; width: 96px; height: 54px; object-fit: contain; background: #000; border-radius: 6px; }
.image-card-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.image-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-card-meta { font-size: .85rem; }
.image-card-actions { display: flex; gap: .4rem; flex: none; }
.form label.button { display: inline-block; font-weight: normal; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.form .inline-fields input[type="date"],
.form .inline-fields input[type="time"] { width: auto; }
.form .inline-fields input[type="number"] { width: 6rem; }
.form .inline-fields input:disabled { color: var(--muted); background: #f6f7f9; }
.inline-fields .field-error { flex-basis: 100%; }
.check-strong { flex-direction: row !important; align-items: center; gap: .45rem !important; margin-bottom: .5rem; }
.preview-panel { position: sticky; top: 1rem; }
.preview-label { margin: 0 0 .5rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.preview-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.preview-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    color: #94a3b8;
    text-align: center;
}

/* Sélecteur à choix multiples (partials/picker.php) */
.picker { display: flex; flex-direction: column; gap: .5rem; font-weight: normal; }
.picker-tools { display: flex; align-items: center; gap: .35rem .75rem; flex-wrap: wrap; }
.picker-tools .picker-search {
    flex: 1 1 100%;
    font: inherit;
    padding: .45rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.picker-count { margin-right: auto; font-size: .875rem; }
.picker-all, .picker-none {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: .875rem;
    color: var(--accent);
    cursor: pointer;
}
.picker-all:hover, .picker-none:hover { text-decoration: underline; }
.picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}
.picker-list li + li { border-top: 1px solid #eef0f3; }
.picker-list li[hidden] { display: none; }
.form .picker-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    font-weight: normal;
    cursor: pointer;
}
.picker-item:hover { background: #f9fafb; }
.picker-item.is-checked { background: var(--accent-soft); }
.picker-item.is-included { cursor: default; }
.picker-item.is-included .picker-label { font-weight: normal; color: var(--muted); }
.picker-item.is-included .picker-meta { color: var(--accent-dark); }
.picker-list .picker-section {
    padding: .35rem .75rem;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    background: #f6f7f9;
}
.picker-list .picker-section[hidden] { display: none; }
.picker-item input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; margin: 0; }
.picker-label { font-weight: 600; }
.picker-meta { margin-left: auto; color: var(--muted); font-size: .85rem; text-align: right; }
.picker-nomatch { margin: 0; font-size: .875rem; }
.picker-summary { margin: 0; padding: .55rem .75rem; border-radius: 6px; font-size: .9rem; }
.picker-summary.is-ok { background: var(--success-soft); color: var(--success); }
.picker-summary.is-warning { background: var(--warning-soft); color: var(--warning); }

.target-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: .5rem; margin-bottom: .25rem; }
.form .target-mode {
    flex-direction: row;
    align-items: flex-start;
    gap: .6rem;
    padding: .65rem .8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: normal;
    cursor: pointer;
}
.target-mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.target-mode input { margin-top: .25rem; accent-color: var(--accent); }
.target-mode span { display: flex; flex-direction: column; }
.target-mode small { color: var(--muted); }
.target-fixed { margin: 0; font-weight: normal; }

/* Page « Diffusion » (message d'un autre) : rappel du message, en lecture seule */
.message-heading { display: flex; flex-direction: column; gap: .2rem; }
.message-heading strong { font-size: 1.15rem; overflow-wrap: anywhere; }

/* Tableau de bord */
.small { font-size: .85rem; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1.25rem; align-items: start; }
.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem;
}
.dash-label { margin: 0 0 .35rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dash-big { margin: 0; font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.dash-ok { color: var(--success); margin-right: .25rem; }
.dash-sub { margin: .2rem 0 .9rem; color: var(--muted); }
.dash-sub a { color: inherit; }
.dash-gap { height: .9rem; }
.dash-line {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .7rem .5rem;
    margin: 0 -.5rem;
    border-top: 1px solid #eef0f3;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
}
.dash-line:hover { background: #f6f7f9; }
.dash-dot { flex: none; width: .55rem; height: .55rem; margin-top: .5rem; border-radius: 50%; background: #c2c8d1; }
.dot-danger { background: var(--danger); }
.dot-warning { background: #f79009; }
.dot-accent { background: var(--accent); }
.dash-text { flex: 1; font-weight: 600; }
.dash-text small { display: block; font-weight: normal; font-size: .85rem; color: var(--muted); }
.dash-chevron { color: #b8bfcc; font-size: 1.3rem; line-height: 1; }
.dash-thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.dash-line + .dash-details { margin-top: .9rem; }
/* Vignette de message de taille fixe (miniature cliquable, ou case grise) : « Affiche en ce moment »
   des périphériques (le tableau ne bouge pas) et messages en diffusion du tableau de bord. */
.live-current { width: 112px; }
.current-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 54px;
    border-radius: 4px;
}
.current-thumb .thumb { width: 96px; height: 54px; }
a.current-thumb { transition: box-shadow .15s, transform .15s; }
a.current-thumb:hover, a.current-thumb:focus-visible { box-shadow: 0 0 0 2px var(--accent); transform: translateY(-1px); }
.current-placeholder { background: #f1f3f5; color: var(--muted); font-size: 1.1rem; }
.current-placeholder svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Bascule en fondu quand la diapositive affichée change (devices-live.js). */
.live-slot { transition: opacity .25s ease; }
.live-slot.is-fading { opacity: 0; }

/* Paramètres */

/* Connexion */
.no-nav .page { max-width: 420px; padding-top: 10vh; }
.login-box .card { padding: 1.5rem; }
.login-device { text-align: center; margin-top: 1.5rem; }

/* Installation */
.no-nav .page:has(.install-box) { max-width: 620px; padding-top: 5vh; }
.install-box { display: flex; flex-direction: column; gap: 1.25rem; padding-bottom: 3rem; }
.install-box .brand-large { margin-bottom: 0; }
.install-intro { text-align: center; margin: -.5rem 0 0; color: var(--muted); }
.install-step { margin: 0 0 .75rem; font-size: 1.05rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.checklist li { display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; }
.check-icon {
    flex: none;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
}
.checklist .is-ok .check-icon { background: var(--success-soft); color: var(--success); }
.checklist .is-error .check-icon { background: var(--danger-soft); color: var(--danger); }
.checklist .is-warning .check-icon { background: var(--warning-soft); color: var(--warning); }
.checklist .muted { overflow-wrap: anywhere; }
.button[disabled] { opacity: .5; cursor: not-allowed; }

/* Fenêtre de confirmation (admin.js) */
.confirm-dialog {
    width: min(440px, calc(100vw - 2rem));
    padding: 1.4rem 1.5rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
    color: var(--text);
}
.confirm-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.confirm-message { margin: 0 0 1.25rem; font-size: 1.02rem; line-height: 1.5; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.button.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger-solid:hover { background: #912018; }

/* Erreurs */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-code { font-size: 4rem; font-weight: 700; color: var(--border); margin: 0; }

@media (max-width: 700px) {
    .topbar { gap: .5rem 1rem; padding: .5rem 1rem; }
    .page { padding: 1rem; }
    .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
    .preview-panel { position: static; order: -1; }
}

@media (max-width: 420px) {
    .brand img { height: 26px; }
}

@media (max-width: 340px) {
    .brand img { height: 22px; }
}
