/* ==== Call Bubbles (bottom-left stack, newest on top) ==== */
:root{
    --cb-bg: rgba(10,12,18,.96);
    --cb-text: #fafbfd;
    --cb-muted: #a7b0c0;
    --cb-shadow: 0 6px 20px rgba(0,0,0,.35);
}

/* Stack: bottom-right, column-reverse → earliest stays lowest */
#call-notifications.call-stack{
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 99999;
    display: flex; flex-direction: column-reverse; align-items: flex-end;
    gap: 10px; pointer-events: none; max-height: 72vh;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Bubble core (round collapsed → panel expanded) */
.call-bubble{
--c1: #ff3b30; /* default, overridden by status classes */
--c2: #ff7a70;

position: relative; width: 56px; height: 56px; border-radius: 32px; overflow: hidden;
color: var(--cb-text); box-shadow: var(--cb-shadow); cursor: pointer;
pointer-events: auto; transition: width .28s ease, border-radius .28s ease, transform .12s ease;
will-change: width, border-radius, transform;
}
.call-bubble:active { transform: translateY(1px); }

/* Animated ring (shimmer gradient) */
.call-bubble::before{
content: ""; position: absolute; inset: -2px; border-radius: inherit;
background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c1));
animation: cb-spin 4s linear infinite;
}
/* Inner shell to create a ring */
.call-bubble::after{
    content: ""; position: absolute; inset: 3px; border-radius: inherit;
    background: var(--cb-bg); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

/* Red status pulse (missed) */
.call-bubble.status-red .cb-pulse{
    position:absolute; inset:0; border-radius:inherit;
    box-shadow: 0 0 0 0 rgba(255,59,48,.55);
    animation: cb-pulse 1.4s ease-out infinite; z-index: 1;
}

/* Content grid */
.call-bubble .cb-content{
    position: relative; z-index: 2; height: 100%;
    display: grid; grid-template-columns: 56px 1fr 28px; align-items: center; gap: 8px;
}
.call-bubble .cb-phone{ display: grid; place-items: center; width:56px; height:56px; }
.call-bubble .cb-phone svg{ width: 26px; height: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }

/* Details (hidden while collapsed) */
.call-bubble .cb-details{ display:none; padding-right:6px; min-width:0; }
.call-bubble .cb-number{
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.call-bubble .cb-meta{
    margin-top: 2px; font-size:12px; color: var(--cb-muted);
    display:flex; gap:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.call-bubble .cb-meta a{ color:#9bd1ff; text-decoration:none; }
.call-bubble .cb-meta a:hover{ text-decoration:underline; }

/* Close button */
.call-bubble .cb-close{
    width:24px; height:24px; border-radius:6px; display:none; place-items:center; color:#d0d6e4;
}
.call-bubble .cb-close:hover{ background: rgba(255,255,255,.06); color:#fff; }

/* Expanded panel */
.call-bubble.expanded{ width: 420px; border-radius: 14px; }
.call-bubble.expanded .cb-details{ display:block; }
.call-bubble.expanded .cb-close{ display:grid; }

/* Status palettes */
.call-bubble.status-red { --c1:#ff3b30; --c2:#ff7a70; }
.call-bubble.status-yellow{ --c1:#ffd000; --c2:#ffe37a; }
.call-bubble.status-blue { --c1:#0abaff; --c2:#7fe4ff; }

/* Micro-animations */
@keyframes cb-spin { to { transform: rotate(1turn); } }
@keyframes cb-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,59,48,.55); }
    70% { box-shadow: 0 0 0 18px rgba(255,59,48,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}

/* Mobile tweak */
@media (max-width: 560px){
    .call-bubble.expanded{ width: calc(100vw - 28px); }
}

.call-bubble .cb-actions {

    display: none;
    gap: 4px;
}

.call-bubble.expanded .cb-actions {
    display: flex;
}

.call-bubble .cb-btn {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.call-bubble .cb-btn-end {
    background: #e55353;
    color: #fff;
}

.call-bubble .cb-btn-reassign {
    background: #f0f0f0;
    color: #333;
}

/* Общий флекс-лейаут для содержимого пузырька */
.call-bubble .cb-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Иконка трубки слева фиксированной ширины */
.call-bubble .cb-phone {
    flex: 0 0 auto;
}

/* Детали — занимают всё оставшееся пространство, но могут сжиматься */
.call-bubble .cb-details {
    flex: 1 1 auto;
    min-width: 0; /* чтобы текст мог ужиматься, а не выталкивать кнопки */
}

/* Номер: если слишком длинный — троеточие */
.call-bubble .cb-number {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Метаданные под номером тоже не дают разрастаться */
.call-bubble .cb-meta {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    font-size: 11px;
}
.call-bubble .cb-meta .cb-owner {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Блок кнопок справа — компактная колонка */
.call-bubble .cb-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Маленькие круглые кнопки только с иконками */
.call-bubble .cb-btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* чуть разный фон по типу, если хочешь */
.call-bubble .cb-btn-end {
    background: rgba(220, 53, 69, 0.18); /* "красноватый" */
}
.call-bubble .cb-btn-reassign {
    background: rgba(13, 110, 253, 0.18); /* "синеватый" */
}

.call-bubble .cb-btn-icon i {
    font-size: 12px;
}

/* крестик — справа, но не влияет на компоновку иконок */
.call-bubble .cb-close {
    flex: 0 0 auto;
    margin-left: 4px;
}


/*обноление чтобы кнопки были рядом*/

/* Общий контейнер пузырька */
/*.call-bubble .cb-content {
    display: flex;
    align-items: stretch;
    gap: 6px;
}*/

/* Иконка телефона слева */
.call-bubble .cb-phone {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Номер/сделка/ответственный — занимают всё доступное */
.call-bubble .cb-details {
    flex: 1 1 auto;
    min-width: 0;
}

/* Блок с двумя кнопками справа */
.call-bubble .cb-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;     /* слева/справа */
    align-items: stretch;    /* высота = высоте cb-content */
    gap: 4px;
}

/* Иконочные кнопки */
.call-bubble .cb-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    /* min-width: 32px; */
    /* padding: 0; */
    /* border-radius: 6px; */
    border: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.04);
}

/* Сменить ответственного (левая) */
.call-bubble .cb-btn-reassign {
    color: #555;
}

/* Положить трубку (правая, красная) */
.call-bubble .cb-btn-end {
    background: #e53935;
    color: #fff;
}

/* Иконка внутри */
.call-bubble .cb-btn-icon i {
    font-size: 14px;
}

/* Крестик — отдельно, чтобы не ломать разметку */
.call-bubble .cb-close {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-left: 4px;
    padding-right: 10px;
    padding-top: 5px;
}


/*меняем местами в пузырьке */
.call-bubble .cb-details {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.call-bubble .cb-deal-row {
    font-weight: 600;
    margin-bottom: 2px;
}

.call-bubble .cb-info {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.call-bubble .cb-info .cb-owner,
.call-bubble .cb-info .cb-number {
    max-width: 100%;
}

