/* Оверлей аудио/видеозвонков (public/js/call.js) - один набор стилей и для
   кабинета, и для админ-панели, подключается как обычный CSS-файл. */
#itcall-root { font-family: var(--font-ui, system-ui, sans-serif); }

.itcall-incoming {
  position: fixed; top: 18px; right: 18px; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
}
.itcall-card {
  background: #1a1d22; color: #fff; border-radius: 16px; padding: 18px 20px;
  width: 280px; box-shadow: 0 18px 50px rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  animation: itcallPop .18s ease-out;
}
@keyframes itcallPop { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.itcall-ava {
  width: 56px; height: 56px; border-radius: 50%; background: #d97757; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
  margin-bottom: 10px; animation: itcallRing 1.1s ease-in-out infinite;
}
@keyframes itcallRing { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.itcall-name { font-size: 15px; font-weight: 700; }
.itcall-sub { font-size: 12.5px; opacity: .7; margin-top: 2px; }
.itcall-actions { display: flex; gap: 28px; margin-top: 18px; width: 100%; justify-content: center; }
.itcall-ia-col { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.itcall-ia-label { font-size: 11.5px; opacity: .75; font-weight: 600; }
.itcall-round.decline { background: #e03131; }
.itcall-round.decline:hover { background: #c92a2a; }
.itcall-round.accept { background: #2f9e44; }
.itcall-round.accept:hover { background: #2b8a3e; }
.itcall-round.accept, .itcall-round.decline { width: 58px; height: 58px; box-shadow: 0 6px 16px rgba(0,0,0,.3); }

.itcall-active {
  position: fixed; inset: 0; z-index: 99998; background: rgba(10,12,16,.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.itcall-stage { position: relative; width: min(900px, 94vw); height: min(560px, 68vh); }

/* ---- Сетка видео-плиток: своя плитка «Вы» + по одной на каждого участника.
   Раскладка зависит от числа плиток (n1 - один на весь экран, как раньше;
   n2 - бок о бок; n3/n4 - 2х2; nmany - плотная сетка поменьше) ---- */
.itcall-grid {
  width: 100%; height: 100%; display: grid; gap: 10px;
  grid-template-columns: 1fr; grid-template-rows: 1fr;
}
.itcall-grid.n2 { grid-template-columns: 1fr 1fr; }
.itcall-grid.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.itcall-grid.n3 .itcall-tile:first-child { grid-column: 1 / 3; }
.itcall-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.itcall-grid.nmany { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(auto-fit, 1fr); }
.itcall-tile {
  position: relative; background: #15171a; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-height: 0;
}
.itcall-tile video { width: 100%; height: 100%; object-fit: cover; }
.itcall-tile.local { position: absolute; bottom: 14px; right: 14px; width: 150px; height: 100px; z-index: 3; border: 2px solid rgba(255,255,255,.25); border-radius: 10px; }
.itcall-grid.n1 .itcall-tile.local { width: 150px; height: 100px; }
.itcall-grid:not(.n1) .itcall-tile.local { position: static; width: auto; height: auto; border: none; border-radius: 14px; }
.itcall-tile-ava {
  display: none; width: 72px; height: 72px; border-radius: 50%; background: #d97757; color: #fff;
  align-items: center; justify-content: center; font-weight: 700; font-size: 22px;
}
.itcall-tile.no-video .itcall-tile-ava { display: flex; }
.itcall-tile.no-video video { display: none; }
.itcall-tile-name {
  position: absolute; left: 10px; bottom: 8px; color: #fff; font-size: 12px; font-weight: 600;
  background: rgba(0,0,0,.45); padding: 3px 9px; border-radius: 20px;
}
.itcall-tile.lost { outline: 2px solid #e03131; }
.itcall-tile-remove {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(224,49,49,.85); color: #fff; cursor: pointer; display: none;
  align-items: center; justify-content: center;
}
.itcall-tile-remove .ic { width: 14px; height: 14px; }
.itcall-tile:hover .itcall-tile-remove { display: flex; }

.itcall-status {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6;
  color: #fff; font-size: 13px; background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 20px;
}
.itcall-qual {
  position: absolute; top: 10px; left: 10px; border: none; border-radius: 20px; z-index: 6;
  background: rgba(255,255,255,.14); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 6px 12px; cursor: pointer; letter-spacing: .3px;
}
.itcall-qual:hover { background: rgba(255,255,255,.26); }
.itcall-close-x {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 15px; cursor: pointer; z-index: 6;
}

/* ---- Панели «Чат звонка» / «Добавить участника» - выезжают поверх сетки справа ---- */
.itcall-chat-panel, .itcall-add-panel {
  position: absolute; top: 0; right: 0; width: 260px; height: 100%; background: #1a1d22;
  border-radius: 0 14px 14px 0; display: flex; flex-direction: column; z-index: 5;
  box-shadow: -8px 0 24px rgba(0,0,0,.3);
}
.itcall-chat-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  color: #fff; font-size: 13px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.08);
}
.itcall-chat-head button { background: none; border: none; color: #fff; opacity: .7; cursor: pointer; display: flex; }
.itcall-chat-head button .ic { width: 16px; height: 16px; }
.itcall-chat-msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.itcall-chat-row { display: flex; flex-direction: column; align-items: flex-start; }
.itcall-chat-row.mine { align-items: flex-end; }
.itcall-chat-from { font-size: 10.5px; color: rgba(255,255,255,.5); margin-bottom: 2px; }
.itcall-chat-bubble { background: rgba(255,255,255,.1); color: #fff; font-size: 12.5px; padding: 7px 10px; border-radius: 12px; max-width: 85%; word-break: break-word; }
.itcall-chat-row.mine .itcall-chat-bubble { background: #2f6fed; }
.itcall-chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.itcall-chat-form input {
  flex: 1; background: rgba(255,255,255,.08); border: none; border-radius: 20px; padding: 8px 12px;
  color: #fff; font-size: 12.5px; outline: none;
}
.itcall-chat-form button { background: none; border: none; color: #fff; cursor: pointer; display: flex; align-items: center; }
.itcall-chat-form button .ic { width: 18px; height: 18px; }

.itcall-add-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.itcall-add-row {
  display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.06); border: none;
  border-radius: 10px; padding: 9px 10px; color: #fff; font-size: 13px; cursor: pointer; text-align: left;
}
.itcall-add-row:hover { background: rgba(255,255,255,.12); }
.itcall-add-ava {
  width: 28px; height: 28px; border-radius: 50%; background: #495057; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.itcall-add-empty { color: rgba(255,255,255,.5); font-size: 12.5px; padding: 14px; text-align: center; }

.itcall-badge {
  position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px; border-radius: 9px;
  background: #e03131; color: #fff; font-size: 10px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; padding: 0 4px;
}
.itcall-bar { display: flex; align-items: center; gap: 20px; margin-top: 26px; }
.itcall-round {
  width: 60px; height: 60px; border-radius: 50%; border: none; background: rgba(255,255,255,.14);
  color: #fff; cursor: pointer; transition: background .15s, transform .1s;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.itcall-round .ic { width: 26px; height: 26px; }
.itcall-round .ic-off { display: none; }
.itcall-round.off .ic-on { display: none; }
.itcall-round.off .ic-off { display: block; }
.itcall-round:hover { background: rgba(255,255,255,.26); }
.itcall-round:active { transform: scale(.93); }
.itcall-round.off { background: #e03131; }
.itcall-round.off:hover { background: #c92a2a; }
.itcall-round.hangup {
  width: 68px; height: 68px; background: #e03131; box-shadow: 0 6px 18px rgba(224,49,49,.4);
}
.itcall-round.hangup .ic { width: 28px; height: 28px; }
.itcall-round.hangup:hover { background: #c92a2a; }

@media (max-width: 560px) {
  .itcall-stage { height: 60vh; }
  .itcall-tile.local { width: 96px; height: 70px; }
  .itcall-chat-panel, .itcall-add-panel { width: 100%; border-radius: 0; }
  .itcall-round { width: 52px; height: 52px; }
  .itcall-round .ic { width: 22px; height: 22px; }
  .itcall-round.hangup { width: 60px; height: 60px; }
  .itcall-bar { gap: 12px; flex-wrap: wrap; justify-content: center; }
}

/* ---- Кнопки «позвонить» в шапке чата (кабинет + админка) - вместо плоского
   эмодзи в сером кружке - залитые цветные круги, как в WhatsApp ---- */
.call-trig {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  color: #fff; transition: transform .12s, filter .15s, box-shadow .15s;
}
.call-trig svg { width: 18px; height: 18px; }
.call-trig:active { transform: scale(.92); }
.call-trig:hover { filter: brightness(1.08); }
.call-trig.audio { background: linear-gradient(145deg, #2f9e44, #37b24d); box-shadow: 0 3px 10px rgba(47,158,68,.32); }
.call-trig.video { background: linear-gradient(145deg, #1c7ed6, #339af0); box-shadow: 0 3px 10px rgba(28,126,214,.32); }

/* ---- Экран во время звонка - кнопка "поделиться экраном" ---- */
.itcall-round.sharing { background: #1c7ed6; }
.itcall-round.sharing:hover { background: #1971c2; }
