/* ── تماس‌ها (/calls) — تماس دونفرهٔ داخلی محفل ── */

/* hero + شماره‌گیر */
.call-hero {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, #0d9463 0%, #12b76a 55%, #2bd48f 100%);
    color: #fff;
    box-shadow: 0 18px 45px rgba(16, 160, 105, .22);
}
.call-hero::before {
    content: "";
    position: absolute;
    width: 300px; height: 300px;
    inset-inline-end: -70px; top: -140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}
.call-hero::after {
    content: "";
    position: absolute;
    width: 180px; height: 180px;
    inset-inline-end: 120px; bottom: -120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}
.call-hero .card-body { position: relative; z-index: 1; padding: 1.7rem; }
.call-hero h3, .call-hero p { color: #fff; }
.call-hero p { opacity: .88; max-width: 460px; }
.call-hero-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .4rem .75rem; margin-bottom: .8rem;
    border-radius: 30px; background: rgba(255, 255, 255, .14);
    font-size: .72rem; font-weight: 600;
}
.call-hero-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #a7f3c9; box-shadow: 0 0 0 4px rgba(167, 243, 201, .2);
}

.call-dial { width: min(100%, 430px); flex: 0 0 auto; }
.call-dial-input {
    position: relative;
    display: flex; align-items: center;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 15px;
    transition: background .18s ease;
}
.call-dial-input:focus-within { background: rgba(255, 255, 255, .2); }
.call-dial-input > i { position: absolute; inset-inline-start: 15px; font-size: 1.05rem; color: rgba(255, 255, 255, .75); }
.call-dial-input input {
    border: 0; background: transparent; color: #fff;
    padding: .95rem 2.8rem .95rem 2.4rem;
    font-size: .92rem;
}
.call-dial-input input::placeholder { color: rgba(255, 255, 255, .68); }
.call-dial-input input:focus { box-shadow: none; color: #fff; }
.call-dial-clear {
    position: absolute; inset-inline-end: 10px;
    display: grid; place-items: center; width: 28px; height: 28px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .16); color: #fff;
}
.call-dial-results {
    margin-top: .6rem;
    display: flex; flex-direction: column; gap: .4rem;
}
.call-dial-item {
    display: flex; align-items: center; gap: .7rem;
    width: 100%; padding: .55rem .75rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    color: #fff; font: inherit; text-align: start;
    transition: background .15s ease, transform .15s ease;
}
.call-dial-item:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.call-dial-item .call-avatar { width: 36px; height: 36px; font-size: .85rem; background: rgba(255,255,255,.18) !important; color: #fff !important; border-color: rgba(255,255,255,.3) !important; }
.call-dial-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.call-dial-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-dial-sub { font-size: .7rem; opacity: .75; }
.call-dial-go {
    display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: 50%; background: #fff; color: #0d9463; font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.call-dial-none { padding: .9rem; text-align: center; font-size: .8rem; color: rgba(255, 255, 255, .8); background: rgba(255,255,255,.08); border-radius: 12px; }
.call-online-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #a7f3c9; box-shadow: 0 0 0 3px rgba(167, 243, 201, .25); }

/* آمار */
.call-stat { border: 0; border-radius: 16px; transition: transform .18s ease, box-shadow .18s ease; }
.call-stat:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15, 23, 42, .08); }
.call-stat-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 14px; font-size: 1.25rem; }

/* آواتار */
.call-avatar {
    position: relative;
    display: grid; place-items: center;
    width: 42px; height: 42px; flex: 0 0 auto;
    border-radius: 50%; font-weight: 700; font-size: .95rem;
}
.call-avatar-dot {
    position: absolute; inset-inline-end: 0; bottom: 1px;
    width: 11px; height: 11px; border-radius: 50%;
    background: #12b76a; border: 2px solid var(--custom-white);
}

/* مخاطبان */
.call-contacts { overflow: hidden; }
.call-contacts-body { max-height: 520px; overflow-y: auto; }
.call-contact {
    display: flex; align-items: center; gap: .8rem;
    padding: .8rem 1.1rem;
    border-bottom: 1px solid var(--default-border);
    transition: background .15s ease;
}
.call-contact:last-child { border-bottom: 0; }
.call-contact:hover { background: rgba(var(--primary-rgb), .03); }
.call-contact-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.call-contact-name { font-size: .88rem; font-weight: 600; color: var(--default-text-color); display: flex; align-items: center; gap: .4rem; }
.call-role-badge { font-size: .62rem; font-weight: 500; }
.call-contact-sub { display: flex; align-items: center; gap: .55rem; font-size: .72rem; color: var(--text-muted); }
.call-presence { display: inline-flex; align-items: center; gap: .3rem; }
.call-presence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b7bfcd; }
.call-presence.on { color: #12b76a; }
.call-presence.on::before { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .15); }
.call-presence.busy { color: #f4a40e; }
.call-presence.busy::before { background: #f4a40e; box-shadow: 0 0 0 3px rgba(244, 164, 14, .15); }

.call-btn {
    display: grid; place-items: center;
    width: 40px; height: 40px; flex: 0 0 auto;
    border: 0; border-radius: 50%;
    background: #12b76a; color: #fff; font-size: 1.05rem;
    box-shadow: 0 5px 14px rgba(18, 183, 106, .35);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.call-btn:hover:not(:disabled) { transform: scale(1.08); }
.call-btn:disabled { opacity: .4; box-shadow: none; cursor: not-allowed; }
.call-btn.ghost {
    background: rgba(18, 183, 106, .1); color: #12b76a; box-shadow: none;
}
.call-btn.ghost:hover:not(:disabled) { background: #12b76a; color: #fff; }

/* فیلتر تاریخچه */
.call-filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.call-filter {
    padding: .42rem .95rem;
    border: 1px solid var(--default-border); border-radius: 30px;
    background: transparent; color: var(--text-muted);
    font: inherit; font-size: .76rem;
    transition: .15s ease;
}
.call-filter:hover { color: rgb(var(--primary-rgb)); border-color: rgb(var(--primary-rgb)); }
.call-filter.active {
    background: rgb(var(--primary-rgb)); border-color: rgb(var(--primary-rgb));
    color: #fff; font-weight: 600;
}

/* سطر تاریخچه */
.call-history { max-height: 520px; overflow-y: auto; }
.call-row {
    display: flex; align-items: center; gap: .8rem;
    padding: .75rem 1.1rem;
    border-bottom: 1px solid var(--default-border);
    transition: background .15s ease;
}
.call-row:last-child { border-bottom: 0; }
.call-row:hover { background: rgba(var(--primary-rgb), .03); }
.call-dir {
    display: grid; place-items: center;
    width: 38px; height: 38px; flex: 0 0 auto;
    border-radius: 12px; font-size: 1rem;
}
.call-dir.out { background: rgba(18, 183, 106, .1); color: #12b76a; }
.call-dir.in { background: rgba(var(--primary-rgb), .09); color: rgb(var(--primary-rgb)); }
.call-dir.missed { background: rgba(230, 83, 60, .1); color: #e6533c; }
.call-row.missed .call-row-name { color: #e6533c; }
.call-row-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.call-row-name { font-size: .88rem; font-weight: 600; color: var(--default-text-color); }
.call-row-sub { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .72rem; color: var(--text-muted); }
.call-row-dur { display: inline-flex; align-items: center; gap: .25rem; }

/* حالت خالی */
.call-empty { padding: 3.5rem 1rem; text-align: center; }
.call-empty-icon {
    display: grid; place-items: center;
    width: 68px; height: 68px; margin: 0 auto .9rem;
    border-radius: 22px;
    background: rgba(18, 183, 106, .09); color: #12b76a; font-size: 1.9rem;
}
.call-empty h6 { color: var(--default-text-color); }

/* لایهٔ «در حال زنگ زدن» */
.call-ring-overlay {
    position: fixed; inset: 0; z-index: 1060;
    display: grid; place-items: center;
    background: rgba(8, 15, 30, .55);
    backdrop-filter: blur(6px);
}
.call-ring-card {
    display: flex; flex-direction: column; align-items: center;
    min-width: 300px; padding: 2.2rem 2.4rem;
    border-radius: 24px;
    background: var(--custom-white);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    animation: call-pop .25s ease;
}
@keyframes call-pop { from { transform: scale(.9); opacity: 0; } }
.call-ring-avatar {
    position: relative;
    display: grid; place-items: center;
    width: 88px; height: 88px; margin-bottom: 1rem;
    border-radius: 50%; font-size: 1.8rem; font-weight: 700;
}
.call-ring-pulse {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(18, 183, 106, .55);
    animation: call-pulse 1.6s ease-out infinite;
}
.call-ring-pulse.p2 { animation-delay: .8s; }
@keyframes call-pulse {
    from { transform: scale(1); opacity: .9; }
    to { transform: scale(1.7); opacity: 0; }
}
.call-ring-name { font-size: 1.15rem; font-weight: 700; color: var(--default-text-color); }
.call-ring-status {
    display: flex; align-items: center; gap: .5rem;
    margin-top: .35rem; font-size: .8rem; color: var(--text-muted);
}
.call-ring-dots { display: inline-flex; gap: 3px; }
.call-ring-dots i {
    width: 5px; height: 5px; border-radius: 50%;
    background: #12b76a; animation: call-dot 1.2s ease-in-out infinite;
}
.call-ring-dots i:nth-child(2) { animation-delay: .2s; }
.call-ring-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes call-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.call-ring-actions { margin-top: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.call-end-btn {
    display: grid; place-items: center;
    width: 58px; height: 58px;
    border: 0; border-radius: 50%;
    background: #e6533c; color: #fff; font-size: 1.35rem;
    box-shadow: 0 8px 20px rgba(230, 83, 60, .4);
    transition: transform .15s ease;
}
.call-end-btn:hover { transform: scale(1.08); }
.call-end-btn i { transform: rotate(135deg); }
.call-ring-hint { font-size: .68rem; color: var(--text-muted); }

/* اعلان تماس ورودی (شناور، همهٔ صفحات پنل) */
.call-incoming {
    position: fixed; inset-inline-start: 1.4rem; bottom: 1.4rem; z-index: 1070;
    width: min(92vw, 340px);
    border-radius: 20px;
    background: var(--custom-white);
    border: 1px solid var(--default-border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    overflow: hidden;
    animation: call-slide-in .3s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes call-slide-in { from { transform: translateY(30px); opacity: 0; } }
.call-incoming-head {
    display: flex; align-items: center; gap: .8rem;
    padding: 1rem 1.1rem;
}
.call-incoming-meta { flex: 1; min-width: 0; }
.call-incoming-title { font-size: .68rem; color: var(--text-muted); }
.call-incoming-name {
    font-size: .95rem; font-weight: 700; color: var(--default-text-color);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.call-incoming-ring {
    display: grid; place-items: center;
    width: 40px; height: 40px; flex: 0 0 auto;
    border-radius: 50%; color: #12b76a;
    background: rgba(18, 183, 106, .1);
    animation: call-shake 1s ease-in-out infinite;
}
@keyframes call-shake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); }
    45% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); }
    75% { transform: rotate(5deg); }
}
.call-incoming-actions {
    display: flex; gap: .6rem;
    padding: 0 1.1rem 1.1rem;
}
.call-answer, .call-reject {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem .5rem; border: 0; border-radius: 12px;
    font: inherit; font-size: .82rem; font-weight: 600; color: #fff;
    transition: filter .15s ease, transform .15s ease;
}
.call-answer { background: #12b76a; }
.call-reject { background: #e6533c; }
.call-answer:hover, .call-reject:hover { filter: brightness(1.08); transform: translateY(-1px); }

.call-notice { border-radius: 14px; }
