/* =========================================================================
   Signage — console d'administration
   ========================================================================= */

:root {
  --brand: #2d6fff;
  --brand-dark: #1f56d6;
  --brand-soft: #eaf1ff;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e2e5ea;
  --border-strong: #cbd1da;
  --text: #1b1f27;
  --text-muted: #6b7280;

  --ok: #12805c;
  --ok-soft: #e6f6f0;
  --warn: #9a6200;
  --warn-soft: #fdf3e2;
  --danger: #c22a3a;
  --danger-soft: #fdecee;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f25;
    --surface-2: #22262d;
    --border: #2e333c;
    --border-strong: #414854;
    --text: #e8eaee;
    --text-muted: #9aa3b2;
    --brand-soft: #1b2740;
    --ok-soft: #10291f;
    --warn-soft: #2c2213;
    --danger-soft: #2d1619;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; font-weight: 650; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.muted { color: var(--text-muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.inline { display: inline; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff;
  padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* --- Barre supérieure ---------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  height: var(--topbar-h); padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto;
  background: var(--brand);
  box-shadow: inset 0 0 0 3px var(--brand), inset 0 -7px 0 -3px rgba(255,255,255,.85);
}
.brand-mark.big { width: 38px; height: 38px; border-radius: 10px; }
.brand-name { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; gap: .15rem; margin-left: .5rem; flex: 1; }
.nav a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .7rem; border-radius: var(--radius);
  color: var(--text-muted); font-weight: 550; font-size: .93rem;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.topbar-right { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.user { color: var(--text-muted); font-size: .9rem; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.burger { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.burger span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

@media (max-width: 900px) {
  .burger { display: block; order: 3; margin-left: auto; }
  .topbar { flex-wrap: wrap; height: auto; padding: .6rem 1rem; }
  .nav {
    order: 5; flex-basis: 100%; flex-direction: column; margin: .5rem 0 0;
    display: none;
  }
  .nav.open { display: flex; }
  .topbar-right { order: 4; }
  .user { display: none; }
}

/* --- Page ---------------------------------------------------------------- */
.page { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1rem 4rem; }
.page.wide { max-width: 1500px; }

.page-head {
  display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.page-head h1 { margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0 0; }

.breadcrumb { font-size: .86rem; color: var(--text-muted); margin-bottom: .35rem; }
.breadcrumb a { color: var(--text-muted); }

/* --- Boutons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .5rem .9rem; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; font-size: .92rem; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .3rem .6rem; font-size: .84rem; }
.btn-lg { padding: .7rem 1.3rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .4rem; width: 32px; height: 32px; }

/* --- Cartes -------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 1.3rem;
}
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.1rem; }
.card-head h1, .card-head h2 { margin: 0; }
.card-title { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.card-title h2 { margin: 0; }
.card-title .actions { margin-left: auto; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --- Statistiques -------------------------------------------------------- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.1rem; }
.stat .v { font-size: 1.7rem; font-weight: 680; line-height: 1.1; }
.stat .l { color: var(--text-muted); font-size: .87rem; }

/* --- Alertes ------------------------------------------------------------- */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  border: 1px solid transparent; font-size: .93rem;
}
.alert-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.alert-info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); color: var(--brand); }

/* --- Formulaires --------------------------------------------------------- */
.field { margin-bottom: 1.05rem; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-weight: 550; font-size: .9rem; margin-bottom: .3rem; }
.hint { display: block; color: var(--text-muted); font-size: .84rem; margin-top: .3rem; }

input[type=text], input[type=password], input[type=number], input[type=url],
input[type=email], input[type=date], input[type=time], input[type=search],
select, textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; font-size: .93rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--brand); }

.field-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.field-row > * { flex: 1 1 180px; }

.check { display: flex; align-items: flex-start; gap: .55rem; font-weight: 450; margin-bottom: .55rem; cursor: pointer; }
.check input { margin-top: .2rem; width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; }
.check span { font-size: .92rem; }

.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 450; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong);
  position: relative; transition: background .15s; flex: 0 0 auto;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }

fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; }
legend { font-weight: 650; font-size: 1.02rem; padding: 0; margin-bottom: .2rem; }

/* --- Tableaux ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td .actions { display: flex; gap: .35rem; justify-content: flex-end; }

/* --- Badges -------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .13rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --- État vide ----------------------------------------------------------- */
.empty {
  text-align: center; padding: 3rem 1.5rem; color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface);
}
.empty h2 { color: var(--text); }
.empty svg { width: 46px; height: 46px; stroke: var(--border-strong); fill: none; stroke-width: 1.4; margin-bottom: .6rem; }

/* --- Bibliothèque de médias ---------------------------------------------- */
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.1rem; }
.toolbar .grow { flex: 1 1 200px; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip {
  padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-muted); font-size: .85rem; font-weight: 550; cursor: pointer;
}
.chip:hover { background: var(--surface-2); text-decoration: none; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .9rem; }
.tile {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: border-color .12s, box-shadow .12s;
}
.tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.tile.selected { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.tile-thumb {
  aspect-ratio: 16 / 10; background: #0f1115 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-thumb .ph { color: #7b8598; font-size: .8rem; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.tile-thumb .ph svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.tile-body { padding: .55rem .65rem; min-width: 0; }
.tile-name { font-size: .87rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { font-size: .76rem; color: var(--text-muted); }
.tile-kind {
  position: absolute; top: .4rem; left: .4rem;
  background: rgba(9, 12, 18, .78); color: #fff; border-radius: 5px;
  padding: .08rem .38rem; font-size: .7rem; font-weight: 600; letter-spacing: .02em;
}
.tile-pick { position: absolute; top: .4rem; right: .4rem; width: 22px; height: 22px; accent-color: var(--brand); }
.tile-add {
  position: absolute; inset: auto 0 0 0; padding: .45rem;
  background: linear-gradient(transparent, rgba(9,12,18,.85)); color: #fff;
  font-size: .82rem; font-weight: 600; text-align: center; opacity: 0; transition: opacity .12s;
}
.tile:hover .tile-add { opacity: 1; }

/* --- Zone de dépôt ------------------------------------------------------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 1.8rem 1rem; text-align: center; background: var(--surface);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone h3 { margin: .3rem 0 .2rem; }
.dropzone svg { width: 34px; height: 34px; stroke: var(--brand); fill: none; stroke-width: 1.5; }

.uploads { margin-top: 1rem; display: grid; gap: .5rem; }
.upload-row {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: .88rem;
}
.upload-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row .st { color: var(--text-muted); font-size: .82rem; white-space: nowrap; }
.bar { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; width: 130px; flex: 0 0 auto; }
.bar > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.upload-row.err { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.upload-row.err .st { color: var(--danger); }
.upload-row.ok .st { color: var(--ok); }

/* --- Éditeur de playlist ------------------------------------------------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.1rem; align-items: start; }
@media (max-width: 1080px) { .editor { grid-template-columns: 1fr; } }

.editor-main { min-width: 0; }
.editor-side { position: sticky; top: calc(var(--topbar-h) + 1rem); }
@media (max-width: 1080px) { .editor-side { position: static; } }

.timeline { display: flex; flex-direction: column; gap: .5rem; min-height: 90px; }
.pitem {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pitem.dragging { opacity: .4; }
.pitem.drop-before { box-shadow: 0 -3px 0 -1px var(--brand), var(--shadow); }
.pitem.drop-after  { box-shadow: 0  3px 0 -1px var(--brand), var(--shadow); }
.pitem.disabled { opacity: .55; }
.pitem-handle {
  cursor: grab; color: var(--text-muted); padding: .2rem; flex: 0 0 auto;
  display: flex; align-items: center; touch-action: none;
}
.pitem-handle:active { cursor: grabbing; }
.pitem-handle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.pitem-num { width: 1.6rem; text-align: center; font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.pitem-thumb {
  width: 78px; height: 48px; border-radius: 6px; background: #0f1115 center/cover no-repeat;
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  color: #8592a6; font-size: .68rem; overflow: hidden;
}
.pitem-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pitem-info { flex: 1; min-width: 0; }
.pitem-name { font-weight: 550; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem-sub { font-size: .79rem; color: var(--text-muted); display: flex; gap: .5rem; flex-wrap: wrap; }
.pitem-dur { display: flex; align-items: center; gap: .3rem; flex: 0 0 auto; }
.pitem-dur input { width: 68px; text-align: right; padding: .32rem .45rem; font-size: .88rem; }
.pitem-dur .u { color: var(--text-muted); font-size: .82rem; }
.pitem-actions { display: flex; gap: .2rem; flex: 0 0 auto; }

.pitem-detail {
  display: none; padding: .9rem .7rem .3rem; margin-top: .1rem;
  border-top: 1px dashed var(--border); font-size: .88rem;
}
.pitem.open .pitem-detail { display: block; }
.pitem { flex-wrap: wrap; }
.pitem-detail { flex-basis: 100%; }

.daypicker { display: flex; gap: .3rem; flex-wrap: wrap; }
.daypicker label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 30px; border-radius: 7px; border: 1px solid var(--border-strong);
  font-size: .8rem; cursor: pointer; margin: 0; background: var(--surface); user-select: none;
}
.daypicker input { position: absolute; opacity: 0; pointer-events: none; }
.daypicker input:checked + span { color: #fff; }
.daypicker label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }

.editor-empty {
  padding: 2.2rem 1rem; text-align: center; color: var(--text-muted);
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.editor-empty.over { border-color: var(--brand); background: var(--brand-soft); }

.savebar {
  position: sticky; bottom: 0; z-index: 20; margin-top: 1rem;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .7rem .9rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.savebar .state { color: var(--text-muted); font-size: .87rem; margin-left: auto; }
.savebar .state.dirty { color: var(--warn); font-weight: 550; }
.savebar .state.saved { color: var(--ok); }

/* --- Modale -------------------------------------------------------------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 13, 18, .6); padding: 1rem; backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(760px, 100%); max-height: 92vh; overflow: auto; padding: 1.4rem;
}
.modal-box.lg { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.modal-head h2 { margin: 0; }
.modal-head .close { margin-left: auto; }

/* --- Éditeur de diapositive ---------------------------------------------- */
.slide-editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.2rem; }
@media (max-width: 780px) { .slide-editor { grid-template-columns: 1fr; } }
.slide-preview-wrap { position: sticky; top: 0; }
.slide-preview {
  aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); background: #000;
}

/* --- Aperçu / lien ------------------------------------------------------- */
.linkbox {
  display: flex; gap: .5rem; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .4rem .4rem .4rem .7rem;
}
.linkbox code {
  flex: 1; font-size: .85rem; overflow-x: auto; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text);
}

/* --- Toasts -------------------------------------------------------------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 80; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .65rem .9rem;
  font-size: .9rem; max-width: 360px; animation: toast-in .18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* --- Installation / connexion -------------------------------------------- */
body.bare { background: var(--bg); }
.centered { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.card-wide { width: min(620px, 100%); }
.card-wide.narrow { width: min(430px, 100%); }
.footnote { color: var(--text-muted); font-size: .8rem; margin-top: 1.2rem; }

.steps { display: flex; gap: .35rem; list-style: none; padding: 0; margin: 0 0 1.4rem; flex-wrap: wrap; }
.steps li {
  display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text-muted);
  padding: .25rem .6rem .25rem .25rem; border-radius: 999px; background: var(--surface-2);
}
.steps li span {
  width: 20px; height: 20px; border-radius: 50%; background: var(--border-strong); color: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700;
}
.steps li.current { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.steps li.current span { background: var(--brand); color: #fff; }
.steps li.done span { background: var(--ok); color: #fff; }

.checklist { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.checklist li { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.checklist li:last-child { border-bottom: 0; }
.checklist .mark { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: #fff; margin-top: .12rem; }
.checklist .ok .mark { background: var(--ok); }
.checklist .ko .mark { background: var(--danger); }
.checklist .warn .mark { background: var(--warn); }
.checklist .txt { flex: 1; font-size: .92rem; }
.checklist .hint { margin-top: .1rem; }

dl.info { display: grid; grid-template-columns: minmax(160px, auto) 1fr; gap: .35rem 1rem; margin: 0; font-size: .9rem; }
dl.info dt { color: var(--text-muted); }
dl.info dd { margin: 0; word-break: break-word; }

@media print { .topbar, .btn, .savebar { display: none !important; } }
