/* ==========================================================================
   Sonos × Spotify — supervision musicale AXION
   Feuille de styles unique, sans étape de compilation.
   ========================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --night: #0f1b33;
  --night-2: #172644;
  --night-3: #22345a;
  --mist: #edf1f6;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #dfe5ee;
  --line-strong: #c9d2df;
  --ink: #13213a;
  --ink-2: #44546e;
  --muted: #6b7a92;
  --accent: #2f5bea;
  --accent-ink: #2149cc;
  --accent-soft: #e8eeff;

  --ok: #14a672;
  --ok-soft: #e3f6ee;
  --warn: #d9890b;
  --warn-soft: #fdf3e1;
  --bad: #d63c3c;
  --bad-soft: #fde9e9;
  --idle: #8d9bb0;
  --idle-soft: #eef1f6;

  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 27, 51, .06), 0 8px 24px -12px rgba(15, 27, 51, .18);
  --shadow-pop: 0 24px 60px -20px rgba(15, 27, 51, .45);
  --side: 252px;
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.tally b, output, time, .facts dd, table.data td, .overview-sub, .cc-meta { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; stroke: none; }

/* ---------- Structure ---------- */

.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--night);
  color: #c9d4e8;
  padding: 26px 18px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #3b6bff, #2246c7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-mark .bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.brand-mark .bars i { width: 3px; border-radius: 2px; background: #fff; }
.brand-mark .bars i:nth-child(1) { height: 8px; }
.brand-mark .bars i:nth-child(2) { height: 18px; }
.brand-mark .bars i:nth-child(3) { height: 12px; }
.brand-mark .bars i:nth-child(4) { height: 15px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { display: block; white-space: nowrap; font-weight: 450; font-size: 12.5px; color: #8fa0c0; letter-spacing: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #b9c6de; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--night-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--night-3); color: #fff; }
.nav a.active .icon { color: #7fa0ff; }
.nav .count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 12px; font-weight: 650; text-align: center;
}
.nav-sep { height: 1px; background: rgba(255,255,255,.07); margin: 14px 8px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.demo-flag {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border-radius: 12px;
  background: rgba(229, 154, 18, .12); color: #f3c470; font-size: 13px; line-height: 1.4;
}
.demo-flag .icon { width: 16px; height: 16px; margin-top: 1px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.07); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--night-3); color: #fff; font-size: 13px; font-weight: 650;
}
.me-name { color: #fff; font-weight: 550; font-size: 14px; line-height: 1.2; }
.me-role { color: #8fa0c0; font-size: 12.5px; }
.me form { margin-left: auto; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: inherit;
}
.icon-btn:hover { background: rgba(255,255,255,.08); }

.page-main { min-width: 0; padding: 34px 40px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head h1 { font-size: 28px; font-weight: 700; }
.page-head .lede { color: var(--muted); margin-top: 6px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.back .icon { width: 16px; height: 16px; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: 14.5px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: #f2b8b8; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: #bd3030; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--idle-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Panneaux ---------- */

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.panel-head h2 { font-size: 16.5px; font-weight: 650; }
.panel-head .hint { color: var(--muted); font-size: 13.5px; }
.panel-body { padding: 18px 22px 22px; }
.stack { display: flex; flex-direction: column; gap: 22px; }

/* ---------- États ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px 0 9px; border-radius: 99px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--idle-soft); color: var(--ink-2);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--idle); }
.st-playing .pill, .pill.st-playing { background: var(--ok-soft); color: #0b7a53; }
.st-playing .pill::before, .pill.st-playing::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(20,166,114,.18); }
.st-recovering .pill, .st-stopped .pill, .pill.st-recovering, .pill.st-stopped { background: var(--warn-soft); color: #9a5f00; }
.st-recovering .pill::before, .st-stopped .pill::before, .pill.st-recovering::before, .pill.st-stopped::before { background: var(--warn); }
.st-down .pill, .pill.st-down { background: var(--bad-soft); color: #b02a2a; }
.st-down .pill::before, .pill.st-down::before { background: var(--bad); }
.st-paused .pill, .pill.st-paused { background: var(--accent-soft); color: var(--accent-ink); }
.st-paused .pill::before, .pill.st-paused::before { background: var(--accent); }

/* Vu-mètre : la signature visuelle du logiciel */
.meter { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.meter i { width: 4px; height: 3px; border-radius: 2px; background: var(--idle); opacity: .45; transition: height .3s; }
.st-playing .meter i { background: var(--ok); opacity: 1; animation: level 1.1s ease-in-out infinite alternate; }
.st-playing .meter i:nth-child(1) { animation-duration: .9s; }
.st-playing .meter i:nth-child(2) { animation-duration: 1.3s; animation-delay: -.4s; }
.st-playing .meter i:nth-child(3) { animation-duration: .8s; animation-delay: -.2s; }
.st-playing .meter i:nth-child(4) { animation-duration: 1.15s; animation-delay: -.7s; }
.st-playing .meter i:nth-child(5) { animation-duration: .95s; animation-delay: -.5s; }
.st-playing .meter i:nth-child(6) { animation-duration: 1.25s; animation-delay: -.1s; }
.st-playing .meter i:nth-child(7) { animation-duration: .85s; animation-delay: -.6s; }
.st-down .meter i { background: var(--bad); opacity: .8; }
.st-recovering .meter i, .st-stopped .meter i { background: var(--warn); opacity: .8; }
@keyframes level { 0% { height: 4px; } 50% { height: 14px; } 100% { height: 22px; } }

/* ---------- Tableau de bord ---------- */

.overview {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 26px 30px; margin-bottom: 26px;
  background: var(--night); color: #fff; border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
}
.overview::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(59,107,255,.35), transparent);
  pointer-events: none;
}
.overview-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.overview-title .of { color: #8fa0c0; font-weight: 500; }
.overview-sub { color: #aebbd4; margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(20,166,114,.6); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(20,166,114,.55); } 70% { box-shadow: 0 0 0 10px rgba(20,166,114,0); } 100% { box-shadow: 0 0 0 0 rgba(20,166,114,0); } }
.tally { display: flex; gap: 10px; position: relative; z-index: 1; }
.tally div {
  min-width: 112px; padding: 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
}
.tally b { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; }
.tally span { color: #aebbd4; font-size: 13px; }
.tally .t-ok b { color: #4fd6a2; }
.tally .t-warn b { color: #ffbe55; }
.tally .t-off b { color: #c6d1e4; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: #e1e7f0; }
.segmented button, .segmented a {
  border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 9px;
  font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.segmented a:hover { text-decoration: none; }
.segmented .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15,27,51,.12); }
.segmented .n { font-size: 12px; color: var(--muted); font-weight: 600; }
.search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; width: 260px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--muted);
}
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--ink); }

.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.club-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.club-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--idle); }
.club-card.st-playing::before { background: var(--ok); }
.club-card.st-recovering::before, .club-card.st-stopped::before { background: var(--warn); }
.club-card.st-down::before { background: var(--bad); }
.club-card.st-paused::before { background: var(--accent); }
.club-card.st-down { border-color: #f1c4c4; }
.cc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0 22px; }
.cc-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.cc-name:hover { color: var(--accent-ink); text-decoration: none; }
.cc-meta { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.cc-meta span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cc-meta .icon { width: 14px; height: 14px; }
.cc-meta .warn { color: var(--warn); font-weight: 600; }
.cc-now { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px 0 22px; }
.art { width: 58px; height: 58px; border-radius: 10px; background: var(--idle-soft); object-fit: cover; }
.art-empty { display: grid; place-items: center; color: var(--idle); }
.track { min-width: 0; }
.track-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-src { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cc-detail { padding: 12px 20px 0 22px; font-size: 13.5px; color: var(--muted); }
.st-paused .cc-detail { color: var(--accent-ink); font-weight: 550; }
.st-down .cc-detail { color: var(--bad); font-weight: 550; }
.st-recovering .cc-detail { color: #9a5f00; font-weight: 550; }
.cc-controls { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 22px 14px 24px; border-top: 1px solid var(--line); margin-top: 16px; }
.club-card .cc-detail + .cc-controls, .club-card .cc-now + .cc-controls { margin-top: auto; }
.club-card .cc-now { margin-bottom: 16px; }
.club-card .cc-detail { margin: -4px 0 14px; }
.transport { display: flex; align-items: center; justify-content: center; gap: 6px; }
.t-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--ink-2);
}
.t-btn:hover { background: var(--idle-soft); color: var(--ink); }
.t-btn.main { width: 46px; height: 46px; background: var(--ink); color: #fff; }
.t-btn.main:hover { background: var(--accent); }
.t-btn .icon { width: 18px; height: 18px; }
.t-btn.main .icon { width: 19px; height: 19px; }
.t-btn[disabled] { opacity: .35; pointer-events: none; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.vol .icon { width: 16px; height: 16px; }
.vol output { min-width: 24px; text-align: right; font-weight: 600; color: var(--ink-2); }
.cc-controls .speakers { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.cc-controls .speakers .icon { width: 15px; height: 15px; }
.cc-off { padding: 16px 22px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; margin-top: auto; }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer;
  --p: 50%;
}
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(to right, var(--ink) var(--p), #dbe2ec var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 99px; background: #dbe2ec; }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--ink); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.cc-controls .vol input[type=range] { flex: 1; width: auto; min-width: 0; }

.empty {
  text-align: center; padding: 56px 24px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.empty h3 { color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.empty .actions { margin-top: 18px; }

/* ---------- Fiche club ---------- */

.club-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.club-head h1 { font-size: 30px; font-weight: 700; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.club-head .lede { color: var(--muted); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.club-head .lede span { display: inline-flex; align-items: center; gap: 6px; }
.club-head .lede .icon { width: 15px; height: 15px; }
.club-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 22px; align-items: start; }

.player { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 28px; padding: 26px; }
.player .art { width: 188px; height: 188px; border-radius: 16px; box-shadow: 0 18px 40px -18px rgba(15,27,51,.5); }
.player-info { display: flex; flex-direction: column; min-width: 0; }
.player-src { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.player-title { font-size: 26px; font-weight: 700; margin-top: 10px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 17px; color: var(--ink-2); margin-top: 4px; }
.player-meta { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.tag .icon { width: 13px; height: 13px; }
.tag.on { background: var(--ok-soft); border-color: #bfe8d6; color: #0b7a53; }
.player-bottom { margin-top: auto; padding-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.player .transport .t-btn { width: 44px; height: 44px; }
.player .transport .t-btn.main { width: 58px; height: 58px; }
.player .transport .t-btn.main .icon { width: 22px; height: 22px; }
.player-vol { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.player-vol input { flex: 1; min-width: 0; }
.player-vol .cell-sub { white-space: nowrap; }
.player .meter { height: 26px; }

.notice {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 0 26px 22px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 550;
}
.notice .grow { flex: 1; }
.notice.warn { background: var(--warn-soft); color: #8a5500; }
.notice.bad { background: var(--bad-soft); color: #a32626; }
.notice .icon { width: 20px; height: 20px; }

.favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.fav {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px;
  padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.fav:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.fav img { width: 100%; aspect-ratio: 1; border-radius: 9px; object-fit: cover; background: var(--idle-soft); }
.fav b { font-weight: 650; font-size: 14px; line-height: 1.25; display: block; }
.fav small { color: var(--muted); font-size: 12.5px; }
.fav .badge { color: var(--ok); font-weight: 650; }
.fav.current { border-color: #9fdcc3; box-shadow: 0 0 0 3px var(--ok-soft); }

.rooms { display: flex; flex-direction: column; }
.room { display: grid; grid-template-columns: minmax(0, 1fr) 140px 30px; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.room:first-child { border-top: 0; padding-top: 2px; }
.room-name { display: flex; align-items: center; gap: 10px; font-weight: 550; min-width: 0; }
.room-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-name small { display: block; color: var(--muted); font-weight: 450; font-size: 12.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.out { background: var(--warn); }
.dot.off { background: var(--bad); }
.room output { text-align: right; font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.room.is-off { color: var(--muted); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 550; text-align: right; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 74px 12px 1fr; gap: 10px; font-size: 13.5px; padding: 7px 0; }
.timeline time { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.timeline .tl-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--idle); }
.timeline .lv-success .tl-dot { background: var(--ok); }
.timeline .lv-warning .tl-dot { background: var(--warn); }
.timeline .lv-danger .tl-dot { background: var(--bad); }
.timeline .src { color: var(--muted); }

.connect-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 0; overflow: hidden; }
.connect-hero .side-art { background: var(--night); color: #fff; padding: 34px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.connect-hero .side-art h2 { font-size: 24px; }
.connect-hero .side-art p { color: #aebbd4; }
.connect-hero .steps { padding: 30px 34px; }
.steps ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 16px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13.5px; }
.steps li b { display: block; }
.steps li span { color: var(--muted); font-size: 14px; }

.sim { display: grid; grid-template-columns: 1fr; gap: 8px; }
.sim .btn { justify-content: flex-start; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data .num { text-align: right; }
table.data .center { text-align: center; }
.cell-main { font-weight: 650; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.status-ok { color: var(--ok); font-weight: 600; }
.status-off { color: var(--muted); }
.pager { display: flex; justify-content: center; gap: 6px; padding: 18px; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.pager .on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager a:hover { text-decoration: none; background: var(--surface-2); }

/* ---------- Formulaires ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
.field .help { color: var(--muted); font-size: 13px; }
.input, select.input, textarea.input {
  height: 42px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 13px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,91,234,.15); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.field-error { color: var(--bad); font-size: 13px; font-weight: 550; }
.errors { padding: 12px 16px; border-radius: 12px; background: var(--bad-soft); color: #a32626; font-size: 14px; margin-bottom: 18px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }

.switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; padding-top: 0; }
.switch b { display: block; font-weight: 600; }
.switch span { color: var(--muted); font-size: 13.5px; }
.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: #cdd5e1; cursor: pointer; transition: background .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.toggle input:checked + i { background: var(--ok); }
.toggle input:checked + i::after { transform: translateX(18px); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.tabs-v { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.tabs-v a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; color: var(--ink-2); font-weight: 550; }
.tabs-v a:hover { background: #e3e9f2; text-decoration: none; }
.tabs-v a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tabs-v a.on .icon { color: var(--accent); }
.form-foot { display: flex; justify-content: center; gap: 10px; padding: 18px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.copy-line { display: flex; gap: 8px; }
.copy-line .input { font-size: 13.5px; }
.callout { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.callout b { color: var(--ink); }
.callout.warn { background: var(--warn-soft); border-color: #f4d9a6; color: #7a4c00; }

/* ---------- Connexion ---------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-art {
  background: var(--night); color: #fff; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art .brand { padding: 0; }
.auth-art h1 { font-size: 40px; font-weight: 700; letter-spacing: -.025em; max-width: 13ch; line-height: 1.1; }
.auth-art p { color: #aebbd4; max-width: 40ch; margin-top: 14px; font-size: 16px; }
.wave { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 40px; }
.wave i { flex: 1; max-width: 10px; border-radius: 3px; background: linear-gradient(to top, #2f5bea, #7ea0ff); opacity: .9; animation: wave 1.6s ease-in-out infinite alternate; }
@keyframes wave { from { height: 12%; } to { height: 100%; } }
.auth-art small { color: #6f82a6; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h2 { font-size: 26px; font-weight: 700; }
.auth-form .lede { color: var(--muted); margin-top: -8px; }
.auth-form .btn { height: 46px; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; }
.remember input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Modales et toasts maison ---------- */

.modal-root { position: fixed; inset: 0; z-index: 50; display: none; }
.modal-root.open { display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 27, 51, .55); backdrop-filter: blur(2px); animation: fade .15s ease-out; }
.modal {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop);
  animation: pop .18s ease-out;
}
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 0; }
.modal-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.modal-icon.danger { background: var(--bad-soft); color: var(--bad); }
.modal-icon.warn { background: var(--warn-soft); color: var(--warn); }
.modal-icon .icon { width: 21px; height: 21px; }
.modal-head h3 { font-size: 18px; font-weight: 700; margin-top: 2px; }
.modal-head p { color: var(--ink-2); margin-top: 6px; font-size: 14.5px; }
.modal-close { margin-left: auto; color: var(--muted); }
.modal-close:hover { background: var(--idle-soft); color: var(--ink); }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: center; gap: 10px; padding: 16px 24px 22px; }
.modal-foot .btn { min-width: 130px; }
.choice-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; cursor: pointer; }
.choice:hover { border-color: var(--accent); color: var(--accent-ink); }
.choice.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; max-width: 420px;
  padding: 14px 16px; border-radius: 14px; background: var(--night); color: #fff;
  box-shadow: var(--shadow-pop); font-size: 14.5px; animation: slide .2s ease-out;
}
.toast .icon { width: 19px; height: 19px; margin-top: 1px; }
.toast.success .icon { color: #4fd6a2; }
.toast.error .icon { color: #ff8a8a; }
.toast.info .icon { color: #8fb0ff; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f6, #f6f8fb, #eef1f6); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.mobile-bar { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .st-playing .meter i { height: 14px; }
}

/* ==========================================================================
   Version mobile (n'affecte pas l'affichage ordinateur)
   ========================================================================== */
@media (max-width: 1180px) and (min-width: 861px) {
  .club-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding-bottom: 72px; }
  .side { display: none; }
  .mobile-bar {
    display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--night); color: #fff;
  }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .mobile-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
  .mobile-nav a.active { color: var(--accent); }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .page-main { padding: 20px 16px 32px; }
  .page-head, .club-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-head h1, .club-head h1 { font-size: 24px; }
  .head-actions { justify-content: center; }
  .overview { grid-template-columns: 1fr; padding: 22px; gap: 18px; }
  .overview-title { font-size: 24px; }
  .tally { display: grid; grid-template-columns: repeat(3, 1fr); }
  .tally div { min-width: 0; padding: 10px 12px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .segmented { overflow-x: auto; max-width: 100%; }
  .segmented button, .segmented a { white-space: nowrap; flex: none; }
  .favs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .overview-sub { align-items: flex-start; }
  .overview-sub .live-dot { margin-top: 8px; }
  .search { width: 100%; }
  .club-grid { grid-template-columns: 1fr; }
  .club-layout { grid-template-columns: 1fr; }
  .player { grid-template-columns: 1fr; gap: 18px; padding: 20px; justify-items: center; text-align: center; }
  .player .art { width: 200px; height: 200px; }
  .player-src, .player-meta { justify-content: center; }
  .player-bottom { grid-template-columns: 1fr; width: 100%; }
  .player-vol { width: 100%; }
  .player .meter { justify-content: center; }
  .notice { margin: 0 16px 18px; }
  .connect-hero { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .tabs-v { position: static; flex-direction: row; overflow-x: auto; }
  .tabs-v a { white-space: nowrap; }
  .form-grid, .checks { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; }
  .auth-art h1 { font-size: 30px; }
  .wave { height: 60px; margin-top: 24px; }
  .room { grid-template-columns: minmax(0, 1fr) 110px 28px; }
  .choice-list { grid-template-columns: repeat(2, 1fr); }
  .toasts { left: 16px; right: 16px; bottom: 84px; align-items: stretch; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 861px) { .mobile-nav { display: none; } }

/* Pastille de niveau dans le journal */
.lvl { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; background: var(--idle); vertical-align: 1px; }
.lvl-success { background: var(--ok); }
.lvl-warning { background: var(--warn); }
.lvl-danger { background: var(--bad); }

/* Accès multi-clubs */
.access-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.access-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.access-chip.control { background: var(--accent-soft); color: var(--accent-ink); }
.access-chip.view { background: var(--idle-soft); color: var(--ink-2); }
.club-head h1 .access-chip { font-size: 13px; height: 26px; }
.access-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; max-height: 300px; overflow-y: auto; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 12px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); cursor: default; }
.access-row:first-child { border-top: 0; }
.access-row b { font-weight: 600; font-size: 14px; }
.access-row small { display: block; color: var(--muted); font-size: 12.5px; }
.access-row .input { height: 36px; }
.access-quick { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.t-btn[disabled], input[type=range][disabled] { opacity: .35; cursor: not-allowed; }
@media (max-width: 860px) { .access-row { grid-template-columns: minmax(0, 1fr) 140px; } }

/* Compte d'envoi des alertes */
.sender { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.sender-badge { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; flex: none; }
.sender-badge.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
.sender-badge.ms { background: linear-gradient(150deg, #2b88d8, #0f5fa8); }
.sender-badge.gg { background: conic-gradient(from 210deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.sender-badge.other { background: linear-gradient(150deg, #8b5cf6, #6d28d9); }
.sender-id { display: flex; flex-direction: column; min-width: 0; }
.sender-id b { font-size: 17px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.sender-id span { color: var(--ink-2); font-size: 14px; }
.sender-id small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sender-state { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.chooser { margin-top: 4px; }
.sender + .callout + .actions + .chooser, .actions + .chooser { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.chooser-lede { font-weight: 600; margin-bottom: 12px; }
.choice-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; transition: border-color .15s, box-shadow .15s; }
.choice-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.choice-row .sender-badge { width: 44px; height: 44px; font-size: 19px; border-radius: 12px; }
.choice-text b { display: block; font-weight: 650; }
.choice-text span { color: var(--muted); font-size: 13.5px; }
.choice-row .btn { min-width: 130px; }
.chooser-notes { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13.5px; }
.chooser-notes li { display: flex; gap: 10px; align-items: flex-start; }
.chooser-notes .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
details.keys > summary { list-style: none; cursor: pointer; padding-bottom: 18px; }
details.keys > summary::-webkit-details-marker { display: none; }
details.keys > summary h2::before { content: "›"; display: inline-block; margin-right: 10px; color: var(--muted); transition: transform .15s; }
details.keys[open] > summary h2::before { transform: rotate(90deg); }
details.keys[open] > summary { padding-bottom: 0; }
.keys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.keys-col { display: flex; flex-direction: column; gap: 12px; }
.keys-col h3 { font-size: 15px; display: flex; align-items: center; gap: 10px; }
.keys-steps { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.preset { height: 42px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; cursor: pointer; }
.preset:hover { border-color: var(--accent); color: var(--accent-ink); }
.preset.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 860px) {
  .sender { grid-template-columns: auto minmax(0, 1fr); }
  .sender-state { grid-column: 1 / -1; white-space: normal; }
  .choice-row { grid-template-columns: auto minmax(0, 1fr); }
  .choice-row .btn { grid-column: 1 / -1; }
  .keys-grid { grid-template-columns: 1fr; }
}
.switch b { color: var(--ink); }

/* Mot de passe oublié */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-link { font-size: 13.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-back { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; }
.auth-back:hover { color: var(--ink); }
.auth-back .icon { width: 16px; height: 16px; }
.auth-note { padding: 12px 16px; border-radius: 12px; background: var(--surface-2, #f3f6fa); color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.auth-form .lede b { color: var(--ink); font-weight: 600; }
.auth-form a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
