/* Back office MYND Instore — thème des maquettes (docs/maquettes/README.md). */
:root {
  --bg: #0e0e10; --surface: #161618; --surface2: #1c1c1f; --nav: #141416; --border: #26262b; --border2: #33333a;
  --border3: #3a3a42; --text: #ececee; --muted: #a1a1aa; --soft: #c4c4cc; --dim: #8b8b94;
  --ok: #4ade80; --warn: #f5a524; --link: #8ab4ff; --alt: #22273a; --alt-border: #34405e; --err: #f87171;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--link); text-decoration: none; } a:hover { color: #b5d0ff; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); } .soft { color: var(--soft); } .small { font-size: 12px; } .ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.layout { min-height: 100vh; display: flex; flex-wrap: wrap; }
nav.side { flex: 1 1 220px; max-width: 260px; min-width: 200px; background: var(--nav); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.brand b { display: block; font-weight: 600; font-size: 15px; } .brand span { font-size: 12px; color: var(--muted); }
nav.side a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--soft); }
nav.side a.on { background: var(--border); color: #fff; font-weight: 500; }
nav.side .sep { height: 1px; background: var(--border); margin: 14px 4px; }
main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
header.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 32px; border-bottom: 1px solid var(--border); }
.content { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 22px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
h1 { margin: 0; font-size: 24px; font-weight: 600; } h1 + p { margin: 6px 0 0; color: var(--muted); }
h2 { margin: 0; font-size: 16px; font-weight: 600; } h3 { margin: 0; font-size: 14px; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.grid2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.flush { padding: 0; gap: 0; overflow-x: auto; }
.card .card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.flush .card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12px; } .stat .v { font-size: 28px; font-weight: 600; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
button, .btn { white-space: nowrap; background: transparent; color: var(--text); border: 1px solid var(--border3); border-radius: 8px; padding: 10px 16px; font: inherit; cursor: pointer; display: inline-block; }
button.primary, .btn.primary { background: var(--text); color: var(--bg); border: 0; font-weight: 600; }
button.small, .btn.small { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.chip { background: transparent; color: var(--soft); border: 1px solid var(--border2); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.chip.on { background: var(--border); color: #fff; border-color: var(--border3); }
input, select, textarea { background: #1a1a1d; color: var(--text); border: 1px solid var(--border2); border-radius: 8px; padding: 9px 12px; font: inherit; }
textarea { font-family: var(--mono); font-size: 12px; width: 100%; min-height: 120px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--text); }
input[type=range] { accent-color: var(--text); width: 100%; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid #222226; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
table.dense td { padding: 10px 20px; } table.dense th { padding: 10px 20px; }
.dot { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.fallback::before { background: transparent; border: 2px solid var(--soft); }
.dot.offline { color: var(--warn); } .dot.offline::before { background: var(--warn); border-radius: 0; transform: rotate(45deg); }
.dot.waiting { color: var(--muted); } .dot.waiting::before { background: transparent; border: 2px dashed var(--muted); }
.badge { display: inline-block; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #1f2a22; color: var(--ok); }
.badge.alt { background: var(--alt); color: #b9c6ea; } .badge.grey { background: var(--border); color: var(--soft); } .badge.warn { background: #2e2512; color: var(--warn); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.kv .k { font-size: 12px; color: var(--muted); } .kv .v { margin-top: 2px; }
.bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; } .bar > div { height: 100%; background: var(--text); border-radius: 3px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface2); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.item .t { font-weight: 500; } .item .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.crumbs { font-size: 13px; color: var(--muted); } .crumbs a { color: var(--muted); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--surface2); border: 1px solid var(--border3); border-radius: 10px; padding: 12px 16px; max-width: 420px; display: none; z-index: 10; }
.toast.err { border-color: #5b2a2a; }
.hidden { display: none !important; }
details.box > summary { cursor: pointer; color: var(--soft); }
/* Planning */
.week { min-width: 760px; display: flex; gap: 8px; }
.hours { width: 44px; position: relative; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.day { flex: 1 1 0; min-width: 0; }
.day .dh { height: 26px; font-size: 12px; font-weight: 600; color: var(--soft); text-align: center; }
.day .col { position: relative; }
.blk { position: absolute; left: 0; right: 0; border-radius: 6px; padding: 5px 6px; font-size: 12px; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.blk.closed { background: #1c1c1f; color: var(--dim); font-size: 11px; }
.blk.open { background: #2a2a31; border: 1px solid var(--border3); }
.blk.open.alt { background: var(--alt); border-color: var(--alt-border); }
.blk .msg { margin-top: auto; align-self: flex-start; padding: 2px 6px; border-radius: 4px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 600; }
.blk .rep { color: var(--soft); font-size: 11px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--soft); margin-top: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--border3); }
/* Mobile */
@media (max-width: 720px) {
  nav.side { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .brand { padding: 4px 10px; width: 100%; } nav.side .sep { display: none; }
  .content, header.top { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs a, .tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 14px; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.tabs a.on, .tabs button.on { color: var(--text); border-bottom-color: var(--text); }
[data-panel] { display: none; flex-direction: column; gap: 18px; } [data-panel].on { display: flex; }
/* Tableau condensé */
table.compact td { padding: 8px 9px; font-size: 13px; } table.compact th { padding: 9px 9px; font-size: 11px; }
table.compact td .sub { font-size: 11.5px; }
tr.child td.ename { padding-left: 32px; }
.access { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; margin: 2px 4px 2px 0; border: 1px solid var(--border2); border-radius: 999px; font-size: 12px; }
.access button { padding: 0 6px; border: 0; background: none; color: var(--muted); }
.tree { color: var(--dim); font-family: var(--mono); margin-right: 6px; }
.zone { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--alt); color: #b9c6ea; margin-top: 3px; }
.dot.silent::before { background: transparent; border: 2px solid var(--muted); }
.quiet { color: var(--warn); }
.logo { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--border); flex: none; }
.logo.sm { width: 28px; height: 28px; border-radius: 6px; }
.phone { width: 390px; height: 780px; border: 10px solid #2a2a31; border-radius: 40px; overflow: hidden; background: var(--bg); flex: none; }
.phone iframe { width: 100%; height: 100%; border: 0; }
.split { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.split > .left { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.nw { white-space: nowrap; }
table.compact td .sub { line-height: 1.3; }
/* Lignes cliquables, fenêtre modale, autocomplétion */
table.clickable tbody tr { cursor: pointer; } table.clickable tbody tr:hover td { background: rgba(255,255,255,.03); }
dialog.dlg { width: min(720px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: none; flex-direction: column; gap: 12px; }
dialog.dlg[open] { display: flex; } dialog.dlg::backdrop { background: rgba(0,0,0,.6); }
.sug { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.sug .opt { text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 6px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.sug .opt:hover, .sug .opt:focus { background: rgba(255,255,255,.06); }
.sug > .small { padding: 4px 9px 0; }
input:disabled, select:disabled { opacity: .6; }
.secret { font-family: var(--mono); letter-spacing: .04em; }
dialog.dlg .card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: nowrap; }
dialog.dlg .card-head h2 { margin: 0; }
/* Champs côte à côte dans une carte : jamais de débordement */
.card .grid2 > * { min-width: 0; }
.card .grid2 .field input, .card .grid2 .field select { width: 100%; box-sizing: border-box; min-width: 0; }
.card.flush { overflow-x: auto; }
/* Statistiques : barres horizontales, mini-barres, frise, courbe, infobulle */
.hbar { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; }
.hbar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar-track { height: 12px; background: transparent; }
.hbar-fill { height: 12px; border-radius: 0 4px 4px 0; }
.hbar-value { font-size: 12.5px; white-space: nowrap; }
.minibar { display: inline-block; width: 70px; height: 8px; margin-right: 8px; vertical-align: middle; }
.minibar span { display: block; height: 8px; border-radius: 0 4px 4px 0; background: #3987e5; min-width: 1px; }
.timeline { position: relative; padding: 4px 0 20px; }
.tl-track { position: relative; height: 34px; border-radius: 6px; background: var(--surface2); }
.tl-seg { position: absolute; top: 0; height: 34px; box-shadow: inset -2px 0 0 var(--surface); }
.tl-cut { position: absolute; top: 0; height: 34px; background: repeating-linear-gradient(45deg, #d03b3b 0 3px, transparent 3px 6px); }
.tl-msgs { position: relative; height: 12px; margin-top: 3px; }
.tl-msg { position: absolute; top: 0; width: 3px; height: 12px; margin-left: -1px; border-radius: 2px; background: var(--text); }
.tl-axis { position: relative; height: 14px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-axis span:first-child { transform: none; } .tl-axis span:last-child { transform: translateX(-100%); }
.cut-sw { background: repeating-linear-gradient(45deg, #d03b3b 0 3px, transparent 3px 6px) !important; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .band { fill: #3987e5; opacity: .18; }
.chart .line { fill: none; stroke: #3987e5; stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: #3987e5; stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; }
.warn-badge { background: rgba(250, 178, 25, .15); color: #fab219; }
#tip { position: fixed; z-index: 50; pointer-events: none; background: #0e0e10; border: 1px solid var(--border2); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; color: var(--text); max-width: 320px; display: none; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.state { font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.state.ok { color: #0ca30c; background: rgba(12,163,12,.12); } .state.wait { color: #fab219; background: rgba(250,178,25,.12); }
.state.err { color: #e66767; background: rgba(208,59,59,.15); } .state.off { color: var(--muted); background: var(--surface2); }
