:root {
  --bg: #0e1013;
  --panel: #16191e;
  --panel-2: #1d2128;
  --panel-3: #262b34;
  --line: #2b3039;
  --text: #e8ebf0;
  --muted: #8d95a3;
  --accent: #e8b44a;
  --accent-ink: #1b1406;
  --danger: #ef6b5f;
  --ok: #52c78d;
  --r: 10px;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { background: var(--panel-3); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.muted { color: var(--muted); }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-3); color: var(--text); white-space: nowrap;
}
.btn:hover { background: #2f3540; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.btn.primary:hover { background: #f0c161; }
.btn.danger { color: var(--danger); background: transparent; border-color: rgba(239, 107, 95, .4); }
.btn.danger:hover { background: rgba(239, 107, 95, .12); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg, .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

input[type=text], input[type=password], select {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
}
input[type=text]:focus, input[type=password]:focus, select:focus { border-color: var(--accent); outline: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }
label.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }

/* ---------- Écran de connexion ---------- */
body.is-gate { display: grid; place-items: center; }
.gate { width: min(380px, calc(100% - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.gate h1 { margin: 0 0 6px; font-size: 22px; }
.gate form { display: grid; gap: 14px; margin-top: 18px; }
.gate label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.form-error { margin: 0; color: var(--danger); }

/* ---------- Dashboard ---------- */
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-weight: 700; letter-spacing: .01em; font-size: 16px; }
.spacer { flex: 1; }
.dash { padding: 28px 24px 60px; max-width: 1180px; margin: 0 auto; }
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.dash-head h1 { margin: 0; font-size: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; display: flex; flex-direction: column; }
.card:hover { border-color: #3a414d; }
.card-thumb { display: block; aspect-ratio: 2 / 1; background: var(--panel-3) center / cover no-repeat; border: 0; width: 100%; position: relative; }
.card-thumb .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.card-body { padding: 12px 14px 8px; }
.card-title { margin: 0 0 6px; font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.badge { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-3); color: var(--muted); }
.badge.live { background: rgba(82, 199, 141, .16); color: var(--ok); }
.badge.priv { background: rgba(232, 180, 74, .14); color: var(--accent); }
.badge { display: inline-flex; align-items: center; gap: 4px; }
.badge svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.card-actions { display: flex; gap: 4px; padding: 6px 10px 10px; margin-top: auto; }
.empty-state { border: 1px dashed var(--line); border-radius: 14px; padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--text); margin: 0 0 8px; font-size: 18px; }

/* ---------- Éditeur ---------- */
body.is-studio { overflow: hidden; }
.editor { height: 100vh; display: grid; grid-template-rows: 52px 1fr; grid-template-columns: 272px minmax(0, 1fr) 328px; grid-template-areas: "top top top" "left stage right"; }
.ed-top { grid-area: top; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.title-input { width: 260px; background: transparent; border: 1px solid transparent; font-weight: 650; font-size: 15px; padding: 6px 8px; border-radius: 8px; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { border-color: var(--accent); background: var(--bg); outline: none; }
.save-state { font-size: 12.5px; color: var(--muted); min-width: 110px; }
.save-state.err { color: var(--danger); }
.switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.switch button { border: 0; border-radius: 999px; padding: 5px 12px; font-weight: 650; background: var(--panel-3); color: var(--muted); }
.switch button.on { background: var(--ok); color: #06210f; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; color: var(--muted); }
.seg button.on { background: var(--panel-3); color: var(--text); }

.ed-left, .ed-right { background: var(--panel); overflow-y: auto; min-height: 0; }
.ed-left { grid-area: left; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.ed-right { grid-area: right; border-left: 1px solid var(--line); }
.ed-stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; background: #000; }
#stage-viewer { position: absolute; inset: 0; }

.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; font-weight: 650; }
.dropzone { margin: 4px 12px 10px; padding: 14px; border: 1.5px dashed #3a414d; border-radius: 10px; text-align: center; color: var(--muted); font-size: 13px; }
.dropzone.over { border-color: var(--accent); color: var(--text); background: rgba(232, 180, 74, .07); }
.dropzone b { color: var(--text); font-weight: 600; }
.scene-list { list-style: none; margin: 0; padding: 0 8px 20px; display: grid; gap: 4px; }
.scene {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center;
  padding: 6px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; background: transparent;
}
.scene:hover { background: var(--panel-2); }
.scene.active { background: var(--panel-3); border-color: #3a414d; }
.scene.dragover { border-color: var(--accent); }
.scene img, .scene .ph { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--panel-3); display: block; }
.scene .nm { min-width: 0; }
.scene .nm b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene .nm span { font-size: 12px; color: var(--muted); }
.scene .star { color: var(--accent); width: 16px; height: 16px; fill: currentColor; }
.scene .prog { height: 3px; background: var(--panel-3); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.scene .prog i { display: block; height: 100%; background: var(--accent); width: 0; }
.scene.uploading { cursor: default; }

.tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px; gap: 4px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.tabs button { border: 0; border-radius: 8px; padding: 8px; background: transparent; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--panel-3); color: var(--text); }
.pane { padding: 14px; }
.pane h3 { margin: 18px 0 10px; font-size: 13px; font-weight: 650; color: var(--muted); }
.pane h3:first-child { margin-top: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 12px; }
.row2 { display: grid; grid-template-columns: 1fr 44px; gap: 12px; align-items: center; }
.row2 output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.stack { display: grid; gap: 8px; }
.hs-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.hs-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.hs-item:hover { background: var(--panel-2); }
.hs-item.active { background: var(--panel-3); border-color: #3a414d; }
.hs-item svg { width: 16px; height: 16px; fill: var(--accent); flex: none; }
.hs-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-box { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--bg); font-size: 13px; margin-bottom: 8px; }
.view-box b { display: block; margin-bottom: 2px; }
.view-box small { color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.empty-pane { color: var(--muted); padding: 24px 14px; text-align: center; }

/* ---------- Scène : bandeaux et réticule ---------- */
.banner {
  position: absolute; left: 14px; right: 14px; top: 14px; margin: 0 auto; width: fit-content; z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; max-width: 640px;
  background: rgba(22, 25, 30, .92); backdrop-filter: blur(8px); border: 1px solid var(--accent); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.banner p { margin: 0; flex: 1 1 auto; min-width: 0; }
.banner .btn { flex: none; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 15; pointer-events: none; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.crosshair::before { left: 16px; top: 0; width: 2px; height: 34px; }
.crosshair::after { top: 16px; left: 0; height: 2px; width: 34px; }
.stage-add { cursor: crosshair; }
.stage-add .psv-container { cursor: crosshair !important; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.stage-empty h2 { margin: 0 0 8px; color: var(--text); font-size: 18px; }
.psv-container { --psv-caption-bg: transparent; }

/* ---------- Divers ---------- */
.toast-zone { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 10px; background: #232832; border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, .5); max-width: 520px; }
.toast.err { border-color: var(--danger); }
.modal-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0, 0, 0, .6); }
.modal { width: min(440px, calc(100% - 32px)); padding: 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.modal h2 { margin: 0 0 12px; font-size: 18px; }
.modal p { margin: 0 0 14px; color: var(--muted); }
.modal p.warn { color: var(--accent); }
.modal.wide { width: min(600px, calc(100% - 32px)); }
.share-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; }
.copy-row .btn { flex: none; }
.modal textarea { width: 100%; min-height: 88px; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--text); resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.too-small { display: none; }
@media (max-width: 980px) {
  .editor { display: none; }
  .too-small { display: grid; place-items: center; height: 100vh; padding: 30px; text-align: center; color: var(--muted); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Navigation principale ---------- */
.mainnav { display: flex; gap: 2px; margin-left: 18px; }
.mainnav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
.mainnav a:hover { color: var(--text); background: var(--panel-2); }
.mainnav a.on { color: var(--text); background: var(--panel-3); }
a { color: var(--accent); }
a.btn { text-decoration: none; }

/* ---------- Visibilité (barre de l'éditeur) ---------- */
.vis-seg button { display: inline-flex; align-items: center; gap: 5px; }
.vis-seg button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.vis-seg button.on[data-v="draft"] { background: var(--panel-3); color: var(--text); }
.vis-seg button.on[data-v="private"] { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.vis-seg button.on[data-v="public"] { background: var(--ok); color: #06210f; font-weight: 650; }
.vis-list { display: grid; gap: 6px; margin-bottom: 10px; }
.vis-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.vis-opt.on { border-color: var(--accent); background: rgba(232, 180, 74, .06); }
.vis-opt input { margin-top: 3px; accent-color: var(--accent); }
.vis-opt b { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.vis-opt b svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.vis-opt small { color: var(--muted); font-size: 12px; }

/* ---------- Réglages (globaux et par visite) ---------- */
.settings { display: grid; gap: 16px; max-width: 640px; }
.set-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 18px 18px 8px; }
.set-card h2 { margin: 0 0 4px; font-size: 16px; }
.set-actions { display: flex; justify-content: flex-end; gap: 8px; }
.fov-row { display: grid; grid-template-columns: 96px 1fr 46px auto; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.ed-right .fov-row { grid-template-columns: 82px 1fr 40px auto; }
.fov-row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.fov-row input[disabled] { opacity: .4; }
.fov-dev { color: var(--muted); white-space: nowrap; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--accent); margin: 0; }

/* ---------- Médias ---------- */
.media-tools { display: flex; gap: 8px; }
.media-tools input[type=search] { width: 240px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.media-tools select { width: 220px; }
.media-group { margin-bottom: 30px; }
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.media-head h2 { margin: 0 0 4px; font-size: 16px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media-item { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.media-thumb { display: block; position: relative; aspect-ratio: 2 / 1; background: var(--panel-3); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb:hover img { opacity: .85; }
.media-flag { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: var(--accent); font-size: 11.5px; }
.media-flag svg { width: 11px; height: 11px; fill: currentColor; }
.media-item figcaption { padding: 8px 10px 8px; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.media-item figcaption b { color: var(--text); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: flex; gap: 4px; margin-top: 6px; }

/* ---------- Vue d'arrivée : vignette + liste des arrivées ---------- */
.mini-slot { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--panel-3); margin-bottom: 6px; cursor: grab; border: 1px solid var(--line); }
.mini-slot:active { cursor: grabbing; }
.mini-viewer { position: absolute; inset: 0; }
.mini-tag { position: absolute; left: 6px; bottom: 6px; z-index: 5; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; pointer-events: none; }
.mini-state { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.mini-state.changed { color: var(--accent); }
.mini-actions { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.mini-actions .spacer { flex: 1; }
.in-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.in-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.in-list li div { min-width: 0; }
.in-list b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-list small { color: var(--muted); font-size: 12px; }

/* ---------- Aperçu par appareil ---------- */
.block-seg { display: flex; width: 100%; margin-bottom: 10px; }
.block-seg button { flex: 1; }
.ed-stage.frame-mobile, .ed-stage.frame-tablet { background: #07080a; }
.ed-stage.frame-mobile #stage-viewer, .ed-stage.frame-tablet #stage-viewer {
  top: 14px; bottom: 14px; left: 50%; right: auto; transform: translateX(-50%);
  max-width: calc(100% - 28px); border-radius: 18px; overflow: hidden; outline: 2px solid #3a414d;
}
.ed-stage.frame-mobile #stage-viewer { aspect-ratio: 9 / 19.5; }
.ed-stage.frame-tablet #stage-viewer { aspect-ratio: 4 / 3; }

/* Barre de l'éditeur : le titre ne prend pas toute la largeur (input[type=text] impose 100 %) */
.ed-top .title-input { width: auto; flex: 0 1 240px; min-width: 110px; }
.ed-top .save-state { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-top > .btn, .ed-top > .seg { flex: none; }

/* ---------- Glisser une scène sur le panorama ---------- */
.ed-stage.stage-drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.drop-ghost { position: absolute; z-index: 30; pointer-events: none; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; }
.drop-ghost .hs { cursor: default; }
.drop-ghost .hs-disc { border-color: var(--accent); }
.drop-ghost .dg-label { position: absolute; top: calc(100% + 6px); white-space: nowrap; padding: 4px 9px; border-radius: 7px; background: rgba(22, 25, 30, .92); border: 1px solid var(--accent); font-size: 12.5px; }
.drop-ghost.no { opacity: .7; }
.drop-ghost.no .hs-disc { border-color: var(--danger); }
.drop-ghost.no .dg-label { border-color: var(--danger); color: var(--danger); }

/* ---------- Clients ---------- */
.dash-filter { margin: -8px 0 14px; }
.dash-filter select { width: 240px; }
.card-client { font-size: 12.5px; color: var(--muted); margin: -2px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.client-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; }
.client-card .client-logo { margin: 14px 14px 0; }
.client-body { padding: 10px 14px 4px; display: grid; gap: 3px; font-size: 13px; }
.client-body h2 { margin: 0 0 2px; font-size: 15.5px; }
.client-body a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-logo { height: 64px; border-radius: 9px; background: #f4f5f7; display: grid; place-items: center; padding: 8px 14px; }
.client-logo img { max-height: 48px; max-width: 100%; object-fit: contain; }
.client-logo span { color: #5b6270; font-weight: 700; font-size: 18px; }
.client-logo.big { width: 180px; height: 80px; flex: none; }
.logo-pick { display: flex; align-items: center; gap: 12px; }
.logo-pick .client-logo { width: 160px; }
.client-head { display: flex; align-items: center; gap: 18px; margin: 10px 0 20px; }
.client-head h1 { margin: 0 0 4px; font-size: 22px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--text); }
.cl-prop { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cl-prop img, .cl-prop .ph { width: 64px; height: 32px; object-fit: cover; border-radius: 5px; background: var(--panel-3); flex: none; }
.cl-prop b { display: block; }
.cl-prop small { color: var(--muted); font-size: 12px; }
.row-actions { white-space: nowrap; text-align: right; }
.link-row { display: flex; gap: 8px; margin: 14px 0; }
.link-row select { width: 320px; }
textarea[data-field] { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
input[type=date] { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }

/* ---------- Tarifs ---------- */
.price-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 13px; }
.price-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.price-table td { padding: 4px 6px; }
.price-table input { width: 90px; padding: 7px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.price-table input[disabled] { opacity: .5; }
.set-actions.left { justify-content: flex-start; align-items: center; margin-bottom: 4px; }
.cur-input { width: 70px !important; padding: 5px 7px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }

/* ---------- Statistiques ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px 16px; display: grid; gap: 2px; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 14px; }
.st-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.st-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.st-table tr:last-child td { border-bottom: 0; }
.st-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.st-table tbody tr[data-id] { cursor: pointer; }
.st-table tbody tr:hover { background: var(--panel-2); }
.st-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.st-report .set-card { padding-bottom: 14px; }
.chart { position: relative; margin-top: 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .yl { fill: var(--muted); font-size: 11px; text-anchor: end; }
.chart .xl { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.chart .bar path { fill: var(--accent); }
.chart .bar .hit { fill: transparent; }
.chart .bar.on .hit { fill: rgba(255, 255, 255, .04); }
.chart .bar.on path { fill: #f0c161; }
.chart-tip { position: absolute; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: #232832; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0, 0, 0, .4); font-size: 12.5px; white-space: nowrap; display: grid; }
.chart-tip span { color: var(--muted); }
.bar-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.bar-list li { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 44px 40px; gap: 10px; align-items: center; font-size: 13px; }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bl-track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.bar-list b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-list small { text-align: right; color: var(--muted); }

/* Rapport imprimable (statistiques d'une visite) */
@media print {
  :root { --bg: #fff; --panel: #fff; --panel-2: #fff; --panel-3: #e8eaee; --line: #d5d8de; --text: #111; --muted: #555; color-scheme: light; }
  body.is-studio { overflow: visible; }
  .topbar, .no-print, .toast-zone { display: none !important; }
  .dash { padding: 0; max-width: none; }
  .kpi, .set-card, .table-wrap { break-inside: avoid; }
}
.chart-tip[hidden] { display: none; }
/* Navigation principale sur petit écran : défile horizontalement au lieu de déborder */
.topbar { min-width: 0; }
.mainnav { overflow-x: auto; scrollbar-width: none; min-width: 0; }
@media (max-width: 720px) { .topbar .brand { display: none; } .mainnav { margin-left: 0; } }
