@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');

:root {
    --bg-main: #1e1e2f;
    --bg-panel: #27293d;
    --accent: #e14eca;
    --accent-alt: #1d8cf8;
    --success: #00f2c3;
    --danger: #fd5d93;
    --text-main: #ffffff;
    --text-muted: #9a9a9a;
}

body {
    background: radial-gradient(circle at center, #2b2b43 0%, #1e1e2f 100%);
    color: var(--text-main);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

/* --- ВЕРХНЯЯ ПАНЕЛЬ --- */
.top-bar {
    height: 70px;
    background: rgba(39, 41, 61, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.nav-tabs {
    display: flex;
    gap: 10px;
}

.nav-item {
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
    color: var(--text-muted);
    font-size: 14px;
}

.nav-item.active {
    background: linear-gradient(to right, var(--accent), #ba54f1);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 78, 202, 0.4);
}

/* --- СЕТКА LAYOUT --- */
.main-layout {
    display: flex;
    height: calc(100vh - 70px);
}

/* ЛЕВАЯ ПАНЕЛЬ (КОНТАКТЫ) */
.sidebar-left {
    width: 350px;
    background: var(--bg-panel);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    perspective: 1000px;
}

.sidebar-content {
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.sidebar-left.flipped .sidebar-content {
    transform: rotateY(180deg);
}

.view-front,
.view-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.view-back {
    transform: rotateY(180deg);
    background: var(--bg-panel);
}

/* ИНПУТЫ И ПОИСК */
.search-in {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
}

.search-in:focus {
    border-color: var(--accent-alt);
    background: rgba(255, 255, 255, 0.1);
}

.contact-item {
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.alpha-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 25px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
}

/* --- ПРАВАЯ ПАНЕЛЬ (ЧЕК-ЛИСТ) --- */
.sidebar-right {
    width: 400px;
    background: var(--bg-panel);
    padding: 30px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.checklist-title {
    color: var(--accent);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
}

textarea {
    width: 100%;
    height: 250px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    padding: 15px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    resize: none;
    box-sizing: border-box;
    transition: 0.3s;
}

textarea:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.3);
}

/* --- АДМИНКА И ЛОГИН --- */
.panel {
    background: var(--bg-panel);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.logout-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}

.logout-btn:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.05);
}

.hidden {
    display: none !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 13px;
}

th {
    text-align: left;
    color: var(--accent);
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Скроллбары */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.incoming-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.incoming-card {
    background: #1e1e2f;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(225, 78, 202, 0.3);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    width: 350px;
}

.caller-avatar {
    width: 80px;
    height: 80px;
    background: var(--accent);
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-ring 1.5s infinite;
}

.caller-avatar img {
    width: 40px;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(225, 78, 202, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(225, 78, 202, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(225, 78, 202, 0);
    }
}

.btn-answer {
    background: #00f2c3;
    color: #1e1e2f;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    margin-right: 10px;
}

.btn-reject {
    background: #fd5d93;
    color: white;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.status-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #00f2c3;
    /* Цвет по умолчанию (свободен) */
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    text-transform: uppercase;
    font-size: 12px;
}

.status-select option {
    background: #1e1e2f;
    color: white;
}

/* --- ПАНЕЛЬ УПРАВЛЕНИЯ ОПЕРАТОРАМИ (ОСНОВНОЙ БЛОК) --- */
.admin-panel-large {
    width: 1200px !important;
    max-width: 98vw;
    padding: 20px !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* ФОРМА ДОБАВЛЕНИЯ/РЕДАКТИРОВАНИЯ (СЕТКА 3 КОЛОНКИ) */
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* БЛОК КНОПОК УПРАВЛЕНИЯ (СОХРАНИТЬ / ОТМЕНА) */
.admin-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

/* Общий стиль для главных кнопок в админке */
.admin-actions button {
    flex: 1;
    /* Одинаковая ширина */
    height: 48px;
    /* Строго одинаковая высота */
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

/* Цвета для кнопок управления */
#saveUserBtn {
    background: var(--accent);
    color: white;
}

#cancelEditBtn {
    background: #4b4b5e;
    /* Серый графит */
    color: #e0e0e0;
}

.admin-actions button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-actions button:active {
    transform: translateY(0);
}

/* ТАБЛИЦА И ОБЕРТКА */
.table-wrap {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Заголовки (Закреплены) */
.admin-table th {
    position: sticky;
    top: 0;
    background: #27293d;
    color: var(--accent);
    padding: 15px 10px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    z-index: 2;
}

/* Ячейки таблицы */
.admin-table td {
    padding: 12px 10px;
    white-space: nowrap;
    /* ЗАПРЕТ ПЕРЕНОСА СЛОВ */
    font-size: 13px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* СПЕЦИФИЧНЫЕ КОЛОНКИ */
.col-fio {
    font-weight: 600;
    color: #fff;
}

.col-email {
    color: var(--accent-alt);
}

.col-num {
    font-family: monospace;
    color: var(--success);
    font-weight: 600;
}

.dept-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
    font-size: 11px;
}

/* КНОПКИ В СТРОКАХ ТАБЛИЦЫ (ИЗМЕНИТЬ / УДАЛИТЬ) */
.col-actions {
    text-align: right !important;
    width: 1%;
    padding-right: 15px !important;
}

.btn-action-edit,
.btn-action-del {
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    color: white;
}

.btn-action-edit {
    background: var(--accent-alt);
    margin-right: 5px;
}

.btn-action-del {
    background: var(--danger);
}

.btn-action-edit:hover,
.btn-action-del:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Кастомный скроллбар */
.table-wrap::-webkit-scrollbar {
    width: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.btn-main-call {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

/* Статус-дропдаун */
.status-dropdown {
    position: relative;
    min-width: 180px;
    user-select: none;
}

.status-current {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
    font-size: 12px;
}

.status-current:hover {
    background: rgba(255, 255, 255, 0.1);
}

.status-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: #1e1e2f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 100;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.status-menu.active {
    display: block;
}

.status-opt {
    padding: 12px 20px;
    display: block;
    cursor: pointer;
    transition: 0.2s;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
}

/* Цвета иконок */
.st-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.st-on {
    stroke: #00f2c3;
}

.st-break {
    stroke: #ff8d72;
}

.st-reserve {
    stroke: #1d8cf8;
}

.st-off {
    stroke: #fd5d93;
}

.chevron {
    margin-left: auto;
    opacity: 0.5;
    transition: 0.3s;
}

.status-dropdown.open .chevron {
    transform: rotate(180deg);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-current {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
}

.st-icon {
    width: 18px;
    height: 18px;
    display: block;
    /* Убирает лишние отступы снизу */
}

.sale-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(253, 93, 147, 0.05);
    /* Легкий красный фон */
    border: 1px solid var(--danger);
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    color: var(--danger);
    font-weight: 600;
}

.check-item input {
    display: none;
    /* Прячем дефолтный чекбокс */
}

/* Состояние "Выполнено" */
.check-item.completed {
    background: rgba(0, 242, 195, 0.05);
    border-color: var(--success);
    color: var(--success);
}

.check-item .indicator {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 6px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-item.completed .indicator::after {
    content: '✔';
    font-size: 14px;
}

/* Контейнер для доски */
.operators-horizontal-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    padding: 10px 5px;
    overflow-x: auto;
    min-height: 110px;
    scrollbar-width: none;
    /* Убираем скроллбар */
}

.operators-horizontal-list::-webkit-scrollbar {
    display: none;
}

/* Базовый стиль стикера */
.op-sticky-note {
    position: relative;
    min-width: 130px;
    max-width: 130px;
    height: 90px;
    padding: 12px;
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    user-select: none;
}

/* Эффект при наведении — стикер "приподнимается" */
.op-sticky-note:hover {
    transform: scale(1.05) rotate(0deg) !important;
    box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Имя (ФИО) */
.op-sticky-fio {
    font-size: 11px;
    font-weight: 800;
    color: #1e1e2f;
    line-height: 1.2;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Короткий номер */
.op-sticky-short {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.6);
    text-align: right;
}

/* Канцелярская кнопка (пин) */
.op-sticky-pin {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #ff4d4d;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Цвета стикеров */
.note-yellow {
    background: #ffe66d;
}

.note-blue {
    background: #4ecdc4;
}

.note-pink {
    background: #ff6b6b;
}

.note-green {
    background: #a2d149;
}

/* Статус (точка в углу) */
.op-sticky-status {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00f2c3;
    /* Online */
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulse-dot.online {
    background: #00f2c3;
    box-shadow: 0 0 0 0 rgba(0, 242, 195, 0.7);
    animation: pulse-green 2s infinite;
}

.pulse-dot.offline {
    background: #fd5d93;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 242, 195, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 242, 195, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 242, 195, 0);
    }
}

.hidden {
    display: none !important;
}

.email-tools .btn-channel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 5px 10px;
}