/* ============================================================
   TS Manager — "Signal Desk"
   Bespoke dark audio-console aesthetic. Cyan-mint signal + amber live.
   Display: Bricolage Grotesque · UI: Hanken Grotesk · Data: JetBrains Mono
   ============================================================ */

:root {
  --void: #090A0C;
  --bg: #090A0C;
  --bg-2: #0B0D11;          /* inset wells */
  --surface: #121419;        /* faceplate */
  --surface-2: #161A20;
  --surface-3: #1d222b;
  --line: #171B22;           /* hairline */
  --line-2: #202530;         /* seam */

  --text: #EBEFF4;
  --muted: #8B94A3;
  --faint: #6c778d;

  --signal: #5EE6C4;         /* cyan-mint — primary / connected */
  --signal-deep: #2bbfa0;
  --signal-dim: rgba(94, 230, 196, 0.10);
  --signal-glow: rgba(94, 230, 196, 0.20);
  --amber: #F5A623;          /* live / on-air / warn */
  --amber-glow: rgba(245, 166, 35, 0.18);
  --violet: #9B8CFF;
  --blue: #6AA6FF;
  --red: #FF6060;
  --red-glow: rgba(255, 96, 96, 0.14);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;

  --shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 40px -28px rgba(0,0,0,0.9);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--void);
  background-image:
    radial-gradient(1100px 480px at 84% -8%, var(--signal-glow), transparent 60%),
    radial-gradient(820px 480px at -6% 110%, var(--amber-glow), transparent 55%);
  background-attachment: fixed;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}
/* faceplate grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
::selection { background: var(--signal); color: #06231d; }

*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }

/* ============================================================
   App shell
   ============================================================ */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  background: linear-gradient(180deg, #141821, #0e1116);
  border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; }
.brand-mark {
  width: 34px; height: 28px; border-radius: 7px; flex: none;
  display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 5px 4px;
  background: var(--bg-2); border: 1px solid var(--line-2);
}
.brand-mark i { flex: 1; background: var(--signal); border-radius: 2px; box-shadow: 0 0 8px var(--signal-glow); animation: wm 1.1s ease-in-out infinite; }
.brand-mark i:nth-child(2) { animation-delay: .18s; }
.brand-mark i:nth-child(3) { animation-delay: .36s; }
.brand-mark i:nth-child(4) { animation-delay: .1s; }
@keyframes wm { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: 0.02em; }
.brand-name b { color: var(--signal); font-weight: 800; }
.brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.32em; color: var(--signal); text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; overflow-y: auto; }
.nav-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; color: var(--faint); text-transform: uppercase; padding: 14px 11px 7px; display: flex; align-items: center; gap: 8px; }
.nav-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  position: relative; transition: background .15s, color .15s; text-decoration: none;
}
.nav a i { font-size: 18px; width: 18px; text-align: center; color: var(--faint); transition: color .15s; }
.nav a:hover { background: rgba(255,255,255,0.035); color: var(--text); }
.nav a:hover i { color: var(--muted); }
.nav a.on { color: var(--text); background: linear-gradient(90deg, var(--signal-dim), transparent); box-shadow: inset 0 0 0 1px rgba(94,230,196,0.16); }
.nav a.on i { color: var(--signal); }
.nav a.on::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0;
  background: var(--signal); box-shadow: 0 0 11px var(--signal);
}

.sidebar-foot { margin-top: auto; padding-top: 14px; }
.who { display: flex; align-items: center; gap: 10px; padding: 11px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 0 2px 6px rgba(0,0,0,.5); }
.who-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 14px;
  background: linear-gradient(180deg, var(--surface-2), #13171d); color: var(--signal); border: 1px solid var(--line-2);
}
.who-name { font-size: 14px; font-weight: 600; }
.who-role { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
.who-out-form { margin-left: auto; display: flex; }
.who-out { margin-left: auto; color: var(--faint); display: grid; place-items: center; padding: 7px; border-radius: 8px; }
button.who-out { background: none; border: 0; cursor: pointer; font: inherit; line-height: 0; }
.who-out:hover { color: var(--red); background: var(--surface); text-decoration: none; }

/* ============================================================
   Mobile bottom tab bar
   ============================================================ */
.botbar { display: none; }
.botbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: linear-gradient(180deg, #13161d, #0c0e12);
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -12px 30px -20px #000;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
}
.botbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 54px; min-height: 52px; border-radius: 12px; flex: 1; max-width: 96px;
  color: var(--muted); text-decoration: none; font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
}
.botbar a i { font-size: 21px; }
.botbar a.on { color: var(--signal); }
.botbar a.on i { color: var(--signal); }
.botbar a.on::before { content: ""; position: absolute; top: -6px; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--signal); box-shadow: 0 0 10px var(--signal); }

/* ============================================================
   Topbar (console header) + live waveform
   ============================================================ */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(9,10,12,0.94), rgba(9,10,12,0.72));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.topbar .tb-brand { display: none; }
.topbar h1 { font-size: 25px; }
.topbar .crumb { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; color: var(--faint); text-transform: uppercase; margin-bottom: 4px; }

.signal-bar {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .03em;
  padding: 7px 13px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
}
.signal-bar .addr { color: var(--text); }
.signal-bar .state { color: var(--signal); letter-spacing: .12em; font-size: 10px; }
.wave { display: none; align-items: center; gap: 2px; height: 26px; width: 150px; overflow: hidden; }
.wave span { width: 3px; background: linear-gradient(180deg, var(--signal), #1f8f78); border-radius: 2px; animation: eq 1.4s ease-in-out infinite; }
@keyframes eq { 0%,100% { height: 14%; } 50% { height: 92%; } }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--signal); }
.dot.live { box-shadow: 0 0 9px var(--signal); animation: pulse 2.3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ============================================================
   Content + cards (faceplate panels)
   ============================================================ */
.content { padding: 26px 32px 64px; max-width: 1600px; width: 100%; margin: 0 auto; }

.card {
  background: linear-gradient(180deg, var(--surface), #0f1217);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) both;
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; font-weight: 700; }
.card-head .sub { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise .5s cubic-bezier(.2,.7,.3,1) both; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .16s; }
.stagger > *:nth-child(4) { animation-delay: .22s; }

.section-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin: 24px 2px 12px; }

/* grid helpers (dashboards) */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* metric / gauge readouts */
.gauge { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: inset 0 2px 7px rgba(0,0,0,.5); }
.gauge .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.gauge .v { font-family: var(--font-display); font-size: 31px; font-weight: 800; line-height: 1; margin-top: 8px; letter-spacing: -.02em; }
.gauge .v small { font-size: 14px; color: var(--faint); font-family: var(--font-mono); font-weight: 400; }
.segs { display: flex; gap: 3px; margin-top: 11px; height: 7px; }
.segs i { flex: 1; border-radius: 1px; background: #23272f; }
.segs i.f { background: var(--signal); box-shadow: 0 0 6px var(--signal-glow); }
.segs.amber i.f { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }

/* ============================================================
   Tables
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl thead th {
  text-align: left; font-family: var(--font-mono); font-weight: 500;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
  padding: 11px 18px; border-bottom: 1px solid var(--line-2); background: var(--bg-2);
}
.tbl tbody td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; color: #cfd6e0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(94,230,196,0.03); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .id, .tbl .mono { font-family: var(--font-mono); color: var(--faint); font-size: 13px; }
.tbl .name { font-weight: 600; color: var(--text); }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.actions form { display: inline-flex; gap: 6px; align-items: center; }
.tbl-wrap { overflow-x: auto; }
/* compact inline controls inside management tables (rename / move / clone) */
.cell-form { display: inline-flex; gap: 7px; align-items: center; }
.tbl .actions input[name="name"] { max-width: 160px; }
.sel-parent { max-width: 230px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .03em;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: transform .12s, background .12s, border-color .12s, box-shadow .12s, color .12s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--signal-deep); color: var(--signal); }
.btn:active { transform: scale(.98); }
.btn i { font-size: 17px; }
.btn-sm { padding: 7px 10px; font-size: 12.5px; }
.btn-primary { background: var(--signal); color: #06231d; border-color: transparent; box-shadow: 0 0 18px -2px var(--signal-glow); }
.btn-primary:hover { filter: brightness(1.08); color: #06231d; box-shadow: 0 0 24px -2px var(--signal-glow); }
.btn-danger { color: var(--red); border-color: rgba(255,96,96,0.3); background: rgba(255,96,96,0.07); }
.btn-danger:hover { background: var(--red-glow); color: var(--red); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface); border-color: var(--line-2); }
/* icon-only square button */
.btn-icon { padding: 0; width: 36px; height: 36px; }

/* ============================================================
   Forms
   ============================================================ */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }

input[type=text], input[type=password], input[type=number], input[type=search], input:not([type]), select, textarea {
  font-family: var(--font-sans); font-size: 15px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 13px; width: 100%; transition: border-color .14s, box-shadow .14s, background .14s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.4);
}
input[type=number] { font-family: var(--font-mono); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-glow); background: var(--surface); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.inline-form input[type=text], .inline-form input:not([type]) { width: auto; min-width: 180px; }
.w-num { width: 84px !important; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 21px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background .16s, border-color .16s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--faint); transition: transform .16s, background .16s; }
.switch input:checked + .track { background: var(--signal-deep); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(17px); background: #06231d; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--signal-glow); }

/* ============================================================
   Pills, tags, badges, alerts
   ============================================================ */
.tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.tag.green { color: var(--signal); border-color: rgba(94,230,196,0.3); background: var(--signal-dim); }
.tag.amber { color: var(--amber); border-color: rgba(245,166,35,0.3); background: rgba(245,166,35,0.09); }
.tag.blue { color: var(--violet); border-color: rgba(155,140,255,0.3); background: rgba(155,140,255,0.1); }
.tag.dim { color: var(--faint); }

.yn-yes { color: var(--signal); font-family: var(--font-mono); }
.yn-no { color: var(--faint); }

.alert { display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14.5px; margin-bottom: 18px; border: 1px solid rgba(255,96,96,0.3); background: var(--red-glow); color: #ffb4b4; }
.alert i { font-size: 18px; flex: none; margin-top: 1px; }
.alert.ok { border-color: rgba(94,230,196,0.3); background: var(--signal-dim); color: #b7f3e4; }

.empty { padding: 40px 22px; text-align: center; color: var(--faint); font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .05em; }
.hint { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.hint code { color: var(--signal); background: var(--bg-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* ============================================================
   Rooms list + live event feed (dashboard / events)
   ============================================================ */
.room { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.room:last-child { border-bottom: none; }
.room .ci { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--void); }
.room .ci i { font-size: 17px; }
.room .info { min-width: 0; flex: 1; }
.room .cn { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.room .cn .talk { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1s ease-in-out infinite; flex: none; }
.room .cm { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: 2px; }
.stk { display: flex; flex: none; }
.stk .av { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--surface); background: linear-gradient(180deg, #1d222b, #161a20); margin-left: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.stk .av:first-child { margin-left: 0; }
.stk .av.spk { color: var(--amber); border-color: var(--amber); }

.feed .ev { display: grid; grid-template-columns: 13px 1fr auto; align-items: center; gap: 11px; padding: 9px 18px; }
.ev .eled { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.ev .etx { font-size: 13.5px; }
.ev .etx b { font-weight: 600; color: var(--text); }
.ev .ets { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }

/* ============================================================
   Login (pre-auth) — centered console
   ============================================================ */
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 392px;
  background: linear-gradient(180deg, var(--surface), #0f1217);
  border: 1px solid var(--line-2); border-radius: 18px;
  padding: 34px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  animation: rise .55s cubic-bezier(.2,.7,.3,1) both;
}
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--signal), transparent); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-card h1 { font-size: 25px; margin-bottom: 4px; }
.auth-card .lede { color: var(--muted); font-size: 14.5px; margin-bottom: 22px; }
.auth-card .btn-primary { width: 100%; padding: 12px; margin-top: 6px; }
.auth-foot { margin-top: 22px; text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ============================================================
   Responsive — tablet & phone
   ============================================================ */
@media (max-width: 1039px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  /* tables -> cards */
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tbody tr, .tbl tbody td { display: block; width: 100%; }
  .tbl tbody tr { background: linear-gradient(180deg, var(--surface), #0f1217); border: 1px solid var(--line-2); border-radius: 14px; margin-bottom: 11px; overflow: hidden; }
  .tbl tbody tr:hover { background: linear-gradient(180deg, var(--surface), #0f1217); }
  .tbl tbody td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 15px; border-bottom: 1px solid var(--line); text-align: right; }
  .tbl tbody td:last-child { border-bottom: none; }
  .tbl tbody td::before { content: attr(data-label); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); text-align: left; }
  .tbl tbody td[data-label=""]::before, .tbl tbody td.rowcell::before { display: none; }
  .tbl tbody td.rowcell { justify-content: flex-start; }
  .actions { justify-content: flex-end; }
}

@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .botbar { display: flex; }
  .content { padding: 18px 16px 90px; }
  .topbar { padding: 14px 16px; }
  .topbar .tb-brand { display: flex; }
}

@media (max-width: 699px) {
  .topbar h1 { font-size: 19px; }
  .signal-bar .wave { display: none; }
  .btn-icon { width: 44px; height: 44px; }
  .actions .btn-icon { width: 40px; height: 40px; }
}

@media (min-width: 900px) {
  .signal-bar .wave { display: flex; }
}

@media (max-width: 699px) {
  .signal-bar .addr, .signal-bar .state { display: none; }
  .signal-bar { padding: 9px; }
}

/* mobile nav drawer (opened by the "Więcej" bottom-bar item) */
.nav-scrim { display: none; }
@media (max-width: 899px) {
  body.nav-open .sidebar {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0; height: 100vh;
    width: 84%; max-width: 300px; z-index: 60; box-shadow: 0 0 60px rgba(0,0,0,0.65);
  }
  body.nav-open .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 59;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
  }
}

/* clickable client avatars (dashboard rooms) */
.av-btn { cursor: pointer; appearance: none; font: inherit; font-family: var(--font-display); font-weight: 700; transition: border-color .14s, color .14s, box-shadow .14s; }
.av-btn:hover { border-color: var(--signal); color: var(--signal); box-shadow: 0 0 11px var(--signal-glow); z-index: 1; }

/* client action modal */
.modal-scrim { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5,6,8,0.72); backdrop-filter: blur(3px); }
.modal-scrim[hidden] { display: none; }
.modal { width: 100%; max-width: 440px; background: linear-gradient(180deg, var(--surface), #0f1217); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 70px -30px #000; overflow: hidden; animation: rise .22s ease both; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; font-weight: 700; }
.modal-x { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.modal-x:hover { color: var(--red); border-color: var(--red); }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.cm-form { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cm-form:last-child { border-bottom: none; padding-bottom: 0; }
.cm-form .field { margin-bottom: 10px; }
.cm-row { display: flex; gap: 10px; align-items: flex-end; }
.cm-row .field { margin-bottom: 10px; }
.cm-form .btn { width: 100%; justify-content: center; }

/* ── Music console ─────────────────────────────────────────────── */
.np {
  display: flex; gap: 16px; align-items: center;
  padding: 18px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-2);
}
.np-ico {
  width: 54px; height: 54px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 26px;
  background: var(--signal-dim); color: var(--signal);
  border: 1px solid rgba(94,230,196,0.25);
}
.np-ico.idle { background: var(--surface-2); color: var(--faint); border-color: var(--line-2); }
.np-ico.down { background: var(--red-glow); color: var(--red); border-color: rgba(255,96,96,0.3); }
.np-body { flex: 1 1 auto; min-width: 0; }
.np-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  color: var(--text); line-height: 1.25; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.np-title.dim { color: var(--faint); font-weight: 600; }
.np-meta { margin-top: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
.np-meta a { color: var(--signal); text-decoration: none; }
.np-meta a:hover { text-decoration: underline; }
.np-state {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); white-space: nowrap;
}

/* progress bar */
.np-prog { margin-top: 14px; }
.np-bar {
  position: relative; height: 8px; border-radius: var(--radius-pill);
  background: var(--surface-3); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-2);
}
.np-bar-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, var(--signal-deep), var(--signal));
  box-shadow: 0 0 12px -2px var(--signal-glow);
  border-radius: var(--radius-pill); transition: width .25s linear;
}
.np-times { margin-top: 6px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }

/* transport row */
.transport { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.transport form { margin: 0; }
.transport .btn-icon { width: 44px; height: 44px; font-size: 19px; border-radius: 12px; }
.transport .play-toggle { width: 52px; height: 52px; font-size: 23px; }

/* volume */
.vol { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.vol > i { font-size: 18px; color: var(--faint); flex: none; }
.vol input[type=range] {
  -webkit-appearance: none; appearance: none; height: 6px; flex: 1 1 auto;
  border-radius: var(--radius-pill); background: var(--surface-3);
  border: 1px solid var(--line-2); cursor: pointer; outline: none;
}
.vol input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--signal); border: 2px solid var(--bg);
  box-shadow: 0 0 10px -1px var(--signal-glow); cursor: pointer;
}
.vol input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--signal);
  border: 2px solid var(--bg); box-shadow: 0 0 10px -1px var(--signal-glow); cursor: pointer;
}
.vol-val { font-family: var(--font-mono); font-size: 13px; color: var(--text); min-width: 3.2ch; text-align: right; flex: none; }

/* music queue list */
.queue-list { list-style: none; margin: 0; padding: 0; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.q-row:last-child { border-bottom: 0; }
.q-row:hover { background: var(--signal-dim); }
.q-pos { font-family: var(--font-mono); font-size: 12px; color: var(--signal); min-width: 2.2ch; text-align: right; flex: none; }
.q-query { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.q-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.q-actions .btn-icon { width: 32px; height: 32px; font-size: 15px; }
.q-actions .q-act[data-act=playnow]:hover { color: var(--signal); }
.q-actions .q-act[data-act=remove]:hover { color: var(--red); }

/* youtube search results */
.yt-status { margin-top: 12px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .05em; color: var(--faint); }
.yt-results { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.yt-result {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.4);
}
.yt-result:hover { border-color: var(--line-2); background: var(--signal-dim); }
.yt-thumb { width: 80px; height: 45px; flex: none; border-radius: 6px; object-fit: cover; background: var(--surface-3); border: 1px solid var(--line); }
.yt-info { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.yt-title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-meta { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.yt-actions .yt-act[data-act=playnow]:hover { color: var(--signal); }
@media (max-width: 640px) {
  .yt-result { flex-wrap: wrap; }
  .yt-actions { width: 100%; }
  .yt-actions .btn-sm { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
