/* Tableau de bord RRF-NG — mêmes jetons de couleur que svxlink-hotspot-gui (sombre par défaut, clair en option). */
:root, [data-theme="dark"] {
  --bg: #0d1420; --bg2: #121b2a; --card: #172234; --card2: #1d2a3f;
  --line: #273650; --text: #e6edf6; --muted: #a9b6c8; --dim: #8796ad;
  --accent: #2fb7a8; --accent-ink: #04201d; --accent-soft: rgba(47,183,168,.14);
  --tx: #ff5a4e; --tx-soft: rgba(255,90,78,.15);
  --ok: #3fcf7f; --warn: #f2b33d; --err: #ff5a4e; --off: #59667a;
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
[data-theme="light"] {
  --bg: #f3f6fa; --bg2: #fff; --card: #fff; --card2: #f6f8fb;
  --line: #dde4ee; --text: #142033; --muted: #4a586c; --dim: #66758a;
  --accent: #128a7e; --accent-ink: #fff; --accent-soft: rgba(18,138,126,.1);
  --tx: #e03b30; --tx-soft: rgba(224,59,48,.1);
  --ok: #1c9d58; --warn: #c58a12; --err: #e03b30; --off: #a3adbb;
  --shadow: 0 6px 18px rgba(20,32,51,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
[x-cloak] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.mono { font-family: var(--mono); } .muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .grow { flex: 1; }

/* ----- En-tête + navigation ----- */
.top { position: sticky; top: 0; z-index: 2000; background: var(--bg2); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; padding: 10px 20px; max-width: 1400px; margin: auto; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.brand b { display: block; } .brand small { color: var(--muted); font-size: 11px; }
nav.menu { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
nav.menu a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; }
nav.menu a:hover { background: var(--card); color: var(--text); }
nav.menu a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.icon-btn { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }

/* ----- Bandeau « en direct », commun à toutes les pages ----- */
.live { border-top: 1px solid var(--line); background: var(--card2); }
.live-in { display: flex; gap: 8px; align-items: center; padding: 8px 20px; max-width: 1400px; margin: auto; overflow-x: auto; }
.live-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.tx { background: var(--tx); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.live-in { flex-wrap: wrap; overflow: visible; }
.talk { display: grid; grid-template-columns: auto 26px; column-gap: 8px; align-items: center; padding: 3px 5px 3px 10px; border-radius: 10px; background: var(--tx-soft); border: 1px solid var(--tx); white-space: nowrap; line-height: 1.25; }
.talk .l2 { font-size: 11px; display: flex; gap: 6px; align-items: center; }
.talk .play { grid-row: 1 / 3; grid-column: 2; }
.talk .tgchip { font-size: 11px; padding: 0 6px; display: inline-block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.live-label { flex-basis: 100%; line-height: 1; padding-top: 2px; }
.talk b { font-family: var(--mono); }
.talk .tgchip { margin: 0; }
.play { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; font-size: 11px; }
.play.on { background: var(--tx); color: #fff; }
.more { border: 1px solid var(--tx); background: transparent; color: var(--tx); border-radius: 10px; padding: 6px 12px; cursor: pointer; font-weight: 700; }
.live-quiet { color: var(--dim); font-size: 12px; white-space: nowrap; }

/* ----- Lecteur audio (barre fixe en bas) ----- */
.player { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 2100; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 14px; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 24px); }
.vu { display: flex; gap: 2px; align-items: flex-end; height: 22px; }
.vu i { width: 4px; background: var(--ok); border-radius: 2px; animation: vu .5s infinite alternate; }
.vu i:nth-child(2n) { animation-delay: .15s; } .vu i:nth-child(3n) { animation-delay: .3s; background: var(--warn); }
@keyframes vu { from { height: 4px; } to { height: 22px; } }

/* ----- Composants ----- */
.content { max-width: 1400px; margin: auto; padding: 20px 20px 100px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h h2 { margin: 0; font-size: 15px; }
.card-b { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 12px 16px; } .kpi .v { font-size: 24px; font-weight: 700; } .kpi .l { color: var(--muted); font-size: 12px; }
.tgchip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: var(--ok); } .badge.warn { color: var(--warn); border-color: var(--warn); } .badge.err { color: var(--err); border-color: var(--err); }
input.search, select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input.search { min-width: 200px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--err); color: #fff; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--card); }
tr:hover td { background: var(--card2); }
.scroll { overflow: auto; }
.note { border-left: 3px solid var(--warn); background: var(--card2); padding: 8px 12px; border-radius: 6px; font-size: 12px; color: var(--muted); margin-bottom: 16px; }

@media (max-width: 800px) {
  .top-in { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  nav.menu { order: 3; flex-basis: 100%; }
  .brand small { display: none; }
  .live-in { padding: 6px 12px; }
  .content { padding: 12px 12px 100px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  input.search { min-width: 0; flex: 1; }
}
.talk-np { grid-template-columns: auto; padding-right: 10px; }
.empty { color: var(--dim); padding: 20px; text-align: center; }
