:root {
  --ink: #121212;
  --ink-2: #181818;
  --ink-3: #242424;
  --cream: #f5f5f5;
  --muted: rgba(255,255,255,.55);
  --line: rgba(255,255,255,.08);
  --green: #1db954;
  --green-2: #1ed760;
  --amber: #e6a23c;
  --red: #e85d4c;
  --blue: #6cb6ff;
  --sans: "Inter", system-ui, sans-serif;
  --r: 14px;
  --side: 232px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--cream);
  line-height: 1.45;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.auth-bg { position: fixed; inset: 0; pointer-events: none; }
.auth-bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, #000 20%, transparent 70%);
}
.glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(90px); opacity: .18; }
.glow-a { background: #1db954; top: -180px; right: 8%; }
.glow-b { background: #0b3d22; bottom: -160px; left: 20%; }
.auth-main { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 18px; padding: 32px 16px 24px; position: relative; }
.legal { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 28px; }
.auth-legal { text-align: center; max-width: 420px; }
.side .legal { padding: 8px 8px 0; }
.room-block { padding: 14px 0; border-top: 1px solid var(--line); }
.room-block:first-child { border-top: 0; padding-top: 0; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.room-box { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; }
.room-title { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.room-title h2 { font-size: 22px; letter-spacing: -.04em; margin: 0; }
.room-title .help { margin-top: 2px; }
.room-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.room-section { padding: 14px 16px; border-top: 1px solid var(--line); }
.room-section:first-of-type { border-top: 0; }
.room-section h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.room-section h3 .ph { width: 16px; height: 16px; }
.person { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.person + .person { border-top: 1px solid var(--line); }
.person-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #101010; color: var(--cream); flex: none; }
.person-ico.admin { color: #9ec1ff; }
.person-ico .ph { width: 18px; height: 18px; }
.pill.role-admin { color: #c9dcff; background: rgba(108,182,255,.18); }
.pill.role-agent { color: #d7ffe6; background: rgba(29,185,84,.16); }
.linkish { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0 0 0 6px; }
.who-line { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.task-check { flex: none; display: grid; place-items: center; }
.task-check input { width: 18px; height: 18px; accent-color: #1db954; padding: 0; }
.meter-row { display: flex; align-items: center; gap: 8px; }
.meter { width: 92px; height: 8px; border-radius: 99px; background: #2a2a2a; overflow: hidden; flex: none; }
.meter > span { display: block; height: 100%; background: #1db954; }
.pct { font-size: 13px; min-width: 36px; }
.act:disabled, .btn:disabled { opacity: .38; cursor: default; filter: none; }
.wallet-qr { display: block; margin-top: 12px; width: 220px; height: 220px; border-radius: 12px; background: #fff; padding: 8px; }
.pill.wait { color: #ffe1a8; background: rgba(230,162,60,.16); }
.duty { margin-bottom: 14px; }
.task-bar { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.task-bar:first-of-type { border-top: 0; padding-top: 0; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; }
.task-main strong { font-size: 15px; }
.task-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.act-row { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.act { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 72px; min-height: 72px; border-radius: 16px; border: 1px solid var(--line); background: #101010; color: var(--cream); font-size: 12px; font-weight: 650; cursor: pointer; }
.act .ph { width: 28px; height: 28px; }
.act.start { color: #b6f5cb; background: rgba(29,185,84,.16); border-color: rgba(29,185,84,.4); }
.act.stop, .act.trash { color: #ffc7c0; background: rgba(232,93,76,.14); border-color: rgba(232,93,76,.45); }
.act.pause { color: #ffe1a8; background: rgba(230,162,60,.12); border-color: rgba(230,162,60,.4); }
.act:hover { filter: brightness(1.12); }
.phone-live {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 10px; font-size: 12px; color: var(--cream);
}
.phone-camp { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.phone-camp strong { display: block; color: var(--cream); font-size: 13px; margin-bottom: 2px; }
.preview-qr {
  width: 96px; height: 96px; margin-top: 12px; border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, #111 0 6px, transparent 6px 12px),
    repeating-linear-gradient(#111 0 6px, #fff 6px 12px);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px 32px 28px;
}
.mark {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--green); color: #06210f;
  margin-bottom: 18px;
}
.auth-card h1 { font-size: 28px; letter-spacing: -.04em; font-weight: 600; }
.lead { color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; background: #101010; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none;
}
.pick { position: relative; }
.pick-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #101010; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; text-align: left; color: var(--cream);
}
.pick.open .pick-btn, .pick-btn:focus { border-color: rgba(29,185,84,.7); }
.pick-chev {
  width: 8px; height: 8px; flex: none; margin-top: -4px;
  border-right: 2px solid rgba(255,255,255,.55); border-bottom: 2px solid rgba(255,255,255,.55);
  transform: rotate(45deg);
}
.pick-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #1c1c1c; border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.45);
  max-height: 240px; overflow: auto;
}
.pick-opt {
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: 10px;
  padding: 10px 12px; color: var(--cream); font-size: 14px; font-weight: 500;
}
.pick-opt:hover, .pick-opt.on { background: rgba(29,185,84,.16); }
.pick-opt[hidden] { display: none; }
.phone[hidden] { display: none !important; }
.phone {
  position: fixed; z-index: 65; bottom: 18px; right: 18px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  touch-action: none;
}
.phone.left { right: auto; left: 18px; align-items: flex-start; }
.phone-panel {
  display: none; width: min(320px, calc(100vw - 36px));
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 20px;
  padding: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.phone.open .phone-panel { display: block; }
.phone-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
#phone-grip { flex: 1; min-width: 0; cursor: grab; }
.phone-fold {
  flex: none; background: transparent; color: var(--cream);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 10px; font-size: 12px; font-weight: 600;
}
.phone-top strong { font-size: 15px; letter-spacing: -.03em; }
.phone-top span, .phone-num { color: var(--muted); font-size: 13px; }
.phone-num { min-height: 22px; margin: 10px 0 4px; color: var(--cream); font-size: 18px; letter-spacing: -.03em; }
.phone .pad { grid-template-columns: repeat(3, 1fr); }
.phone .pad button { height: 46px; font-size: 16px; }
.phone-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.phone-actions .btn { flex: 1 1 40%; }
.call-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; flex: 1 1 46%; min-height: 88px; border: 0; border-radius: 16px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.call-btn .ph { width: 30px; height: 30px; }
.call-btn.go { background: #1db954; color: #06210f; }
.call-btn.drop { background: #e85d4c; color: #fff; }
.call-btn:hover { filter: brightness(1.08); }
.phone.ring .phone-actions { display: grid; grid-template-columns: 1fr 1fr; }
.phone.ring .call-btn { min-height: 108px; font-size: 16px; }
.phone-bubble {
  width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0;
  background: var(--green); color: #06210f; display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.phone-bubble .ph { width: 26px; height: 26px; }
.phone.ring .phone-bubble { box-shadow: 0 0 0 8px rgba(29,185,84,.2); }
.coin {
  display: flex; width: 100%; text-align: left; margin-top: 8px;
  background: #101010; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; color: var(--cream); font-size: 14px; font-weight: 500;
}
.coin:hover { border-color: rgba(29,185,84,.7); }
.qr { width: 168px; height: 168px; border-radius: 12px; background: #fff; margin-top: 12px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(29,185,84,.7); }
.file-label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: #101010; border: 1px solid var(--line); color: var(--cream); font-weight: 600;
}
.file-box { border: 0; outline: 0; }
.clip-lib { margin: 4px 0 16px; }
.card > .clip-lib { margin-top: 0; }
.clip-preview { margin-top: 8px; }
.clip-preview[hidden] { display: none; }
.clip-preview audio { display: block; width: 100%; height: 32px; }
.peer-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.peer-list button { text-align: left; background: #101010; color: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
input[type="file"] { color: var(--muted); cursor: pointer; }
input[type="file"]::file-selector-button {
  font: inherit; cursor: pointer; margin-right: 12px;
  background: var(--ink-3); color: var(--cream);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #06210f; border: 0; border-radius: 999px;
  padding: 11px 16px; font-weight: 600; font-size: 14px;
}
.btn:hover { background: var(--green-2); }
.btn.full { width: 100%; margin-top: 18px; padding: 13px; }
.btn.ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(232,93,76,.4); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 12px; }

.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100%; }
.side {
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  background: #101010;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.logo-20cx {
  display: inline-flex; align-items: center; line-height: .85;
  background: #3a3a3a; border-radius: 16px;
  padding: 8px 12px 9px 10px; letter-spacing: -.08em;
}
.logo-20cx b, .logo-20cx i {
  font-size: 28px; font-weight: 700; font-style: normal; letter-spacing: -.08em;
}
.logo-20cx b { color: #00a4e4; }
.logo-20cx i { color: #ffffff; }
.auth-card .logo-20cx { margin-bottom: 16px; }
.nav-btn {
  text-align: left; background: transparent; border: 0; color: var(--muted);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 500;
}
.nav-btn.on, .nav-btn:hover { background: var(--ink-3); color: var(--cream); }
.side .spacer { flex: 1; }
.who { padding: 10px 12px; font-size: 12px; color: var(--muted); }
.who strong { display: block; color: var(--cream); font-size: 14px; }
.main { padding: 28px 32px 64px; max-width: 1180px; }
.head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 22px; }
h1 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.045em; font-weight: 600; }
.sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--red); }
.dot.on { background: var(--green); }
.ami { font-size: 13px; color: var(--muted); display: flex; align-items: center; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat, .card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
}
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat strong { font-size: 26px; letter-spacing: -.04em; font-weight: 600; }
.card + .card, .stack { display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 16px; letter-spacing: -.03em; margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.coin-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.coin-row .btn { flex: 1 1 140px; }
.grow { flex: 1; min-width: 180px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 8px; }
td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.pill {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px;
  font-size: 12px; background: var(--ink-3); color: var(--muted);
}
.pill.run, .pill.bridged, .pill.available, .pill.ended { color: #b6f5cb; background: rgba(29,185,84,.15); }
.pill.paused, .pill.ringing, .pill.answered { color: #ffe1a8; background: rgba(230,162,60,.15); }
.pill.failed, .pill.stopped, .pill.abandoned { color: #ffc7c0; background: rgba(232,93,76,.15); }
.pill.voicemail { color: #c9dcff; background: rgba(108,182,255,.15); }
.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.help { color: var(--muted); font-size: 13px; }
.pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; margin-top: 8px; }
.pad button {
  height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-3); font-size: 18px;
}
.sip-box { font-family: ui-monospace, monospace; font-size: 13px; background: #101010; border-radius: 10px; padding: 12px; line-height: 1.7; }
.status-dock {
  position: fixed; z-index: 80; top: 16px; left: 16px; width: 200px;
}
.status-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.status-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; cursor: default;
  padding: 12px 14px;
  background: transparent; border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--cream);
}
.status-row:last-child { border-bottom: 0; }
.status-row .ph { width: 18px; height: 18px; flex: none; color: rgba(255,255,255,.72); }
.status-row .kicker {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 500; letter-spacing: -.02em;
}
.status-row .lamp {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(232,93,76,.16);
}
.status-row.on .lamp {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(29,185,84,.18);
}
.side { padding-top: 124px; }
.nav-btn { display: flex; align-items: center; gap: 10px; }
.nav-btn .ph, .brand .ph { width: 18px; height: 18px; flex: none; }
.mark .ph { width: 22px; height: 22px; color: #06210f; }
.toast {
  position: fixed; bottom: 18px; right: 18px; background: #222; border: 1px solid var(--line);
  padding: 12px 14px; border-radius: 12px; max-width: 320px; display: none; z-index: 5;
}
.toast.show { display: block; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .status-dock { width: calc(100% - 32px); max-width: 420px; }
  .side { position: sticky; top: 0; height: auto; z-index: 2; flex-direction: row; overflow: auto; padding: 108px 10px 10px; }
  .brand, .who, .side .spacer { display: none; }
  .main { padding: 18px 14px 48px; }
  .grid, .split { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid, .split { grid-template-columns: 1fr; }
}
