/* Pulse CRM / ОДК — Премиальная Глассморф Дизайн-система (by papenkov.studio) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root, [data-theme="dark"] {
    color-scheme: dark !important;
    --bg-main: #0F111A;
    --bg-surface: #1A1D27;
    --bg-base-gradient: radial-gradient(circle at 50% -20%, rgba(123, 97, 255, 0.18), transparent 60%), #0F111A;
    --bg-card: #1A1D27;
    --bg-card-sub: #141721;
    --bg-hover: rgba(123, 97, 255, 0.15);
    --border-color: #2D313E;
    --border-glow: rgba(123, 97, 255, 0.4);
    
    --accent: #7B61FF;
    --accent-violet: #7B61FF;
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981;

    --text-primary: #FFFFFF;
    --text-secondary: #8B92A5;
    --text-main: #FFFFFF;
    --text-sub: #8B92A5;
    --text-muted: #64748b;

    --gradient-btn: linear-gradient(135deg, #7B61FF, #6366f1);
    --glow-btn: 0 0 25px rgba(123, 97, 255, 0.4);

    /* Статусы сделок */
    --status-new: #f59e0b;
    --status-in_progress: #3b82f6;
    --status-measurement: #a855f7;
    --status-contract: #06b6d4;
    --status-closed: #10b981;
    --status-rejected: #71717a;
    --status-spam: #ef4444;

    /* Роли */
    --role-admin: #f43f5e;
    --role-director: #a855f7;
    --role-manager: #3b82f6;

    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-deep: 0 20px 45px -10px rgba(0, 0, 0, 0.8);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Spacing Scale (кратно 4px) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typography Scale */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.8125rem;  /* 13px */
    --text-base: 0.875rem; /* 14px */
    --text-lg: 1rem;       /* 16px */
    --text-xl: 1.125rem;   /* 18px */
    --text-2xl: 1.25rem;   /* 20px */
    --text-3xl: 1.5rem;    /* 24px */

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-Index Слойность */
    --z-dropdown: 100;
    --z-bottom-nav: 500;
    --z-modal: 1000;
    --z-toast: 9999;
}

[data-theme="light"] {
    --bg-main: #F9FAFB;
    --bg-surface: #FFFFFF;
    --bg-base-gradient: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-card-sub: #F3F4F6;
    --bg-hover: rgba(123, 97, 255, 0.08);
    --border-color: #E5E7EB;
    --border-glow: rgba(123, 97, 255, 0.35);
    
    --accent: #7B61FF;
    --accent-violet: #7B61FF;
    --accent-indigo: #4f46e5;
    --accent-emerald: #059669;

    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-main: #111827;
    --text-sub: #6B7280;
    --text-muted: #9ca3af;

    --gradient-btn: linear-gradient(135deg, #7B61FF, #4f46e5);
    --glow-btn: 0 8px 25px rgba(123, 97, 255, 0.25);

    --shadow-card: 0 4px 15px -3px rgba(0, 0, 0, 0.06);
    --shadow-deep: 0 15px 35px -5px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

/* КАСТОМНЫЕ ЭЛЕГАНТНЫЕ СКРОЛЛБАРЫ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-violet);
}

/* Векторные Иконки и CSS Маски */
.svg-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.svg-icon-sm {
    width: 14px;
    height: 14px;
}

/* ИНПУТЫ, СЕЛЕКТЫ И FOCUS RING */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    outline: none !important;
    font-family: inherit;
    background: var(--bg-card-sub);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    font-size: 0.88rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.25) !important;
    outline: none !important;
}

/* МИКРОАНИМАЦИИ КНОПОК */
button, .btn-primary, .btn-sim, .btn-success, .filter-chip {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

button:active, .btn-primary:active, .btn-sim:active, .btn-success:active, .filter-chip:active {
    transform: scale(0.97) !important;
}
    height: 14px;
}

.channel-icon-tg {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    background-color: #0088cc;
    -webkit-mask: url('../assets/tg.webp') no-repeat center / contain;
    mask: url('../assets/tg.webp') no-repeat center / contain;
}

.channel-icon-max {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    background-color: var(--accent-violet);
    -webkit-mask: url('../assets/max.webp') no-repeat center / contain;
    mask: url('../assets/max.webp') no-repeat center / contain;
}

/* ИНТЕРАКТИВНЫЙ ЦЕНТР УВЕДОМЛЕНИЙ (КОЛОКОЛЬЧИК В ШАПКЕ) */
.notif-bell-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notif-bell-btn {
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.notif-bell-btn:hover {
    border-color: var(--accent-violet);
    color: var(--accent-violet);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.notif-badge-counter {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid var(--bg-card);
    display: none;
    box-shadow: 0 0 8px #ef4444;
}

.notif-dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    width: 320px;
    max-height: 380px;
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-deep);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notif-dropdown.active {
    display: flex;
}

.notif-dropdown-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    background: var(--bg-card-sub);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-dropdown-list {
    overflow-y: auto;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.notif-dropdown-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.notif-dropdown-item:hover {
    background: var(--bg-hover);
}

/* ТОАСТЫ УВЕДОМЛЕНИЙ (PUSH TOASTS) */
.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    width: 330px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    cursor: pointer;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--accent-violet);
    margin-bottom: 4px;
}

.toast-time {
    font-size: 0.68rem;
    color: var(--text-sub);
}

.toast-body {
    font-size: 0.82rem;
    color: var(--text-main);
    line-height: 1.35;
}

/* 🌙☀️ ПРЕМИАЛЬНЫЙ МИНИМАЛИСТИЧНЫЙ ТЕМАТИЧЕСКИЙ ПЕРЕКЛЮЧАТЕЛЬ */
.theme-toggle-capsule {
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    user-select: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.theme-toggle-capsule:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.capsule-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 58px;
    height: 28px;
    position: relative;
}

.capsule-slider {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.capsule-slider.light {
    transform: translateX(0);
}

.capsule-slider.dark {
    transform: translateX(29px);
}

.capsule-slot {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    z-index: 1;
    transition: opacity 0.15s ease;
}

.capsule-slot.active {
    opacity: 0.2;
}

/* Цветовые Бэджи Тегов Лида */
.lead-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.lead-tag-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}

.tag-urgent { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.tag-cottage { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.tag-panorama { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.tag-credit { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

/* ИСПРАВЛЕНИЕ СКРИНШОТА №2 И №3: ПОЛЕВЫЕ ИНПУТЫ И ИХ ОТСТУПЫ */
.info-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-bottom: 1.1rem !important;
    width: 100% !important;
}

.info-group label {
    font-size: 0.73rem !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    display: flex !important;
    align-items: flex-end !important;
    min-height: 28px !important;
    margin-bottom: 6px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
}


input[type="datetime-local"], input[type="date"], input[type="text"], input[type="number"], input[type="password"], select, textarea {
    background-color: var(--bg-card-sub) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 0.65rem 0.9rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.88rem !important;
    font-family: inherit !important;
    outline: none !important;
    width: 100%;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ==========================================================================
   📊 ПРЕМИАЛЬНАЯ СЕТКА И ОДИНАКОВАЯ ВЫСОТА КОЛОНОК КАНБАНА (60 FPS)
   ========================================================================== */
.kanban-board {
    display: flex !important;
    gap: 16px !important;
    align-items: stretch !important;
    overflow-x: auto !important;
    padding-bottom: 16px !important;
    width: 100% !important;
}

.kanban-column {
    flex: 1 0 270px !important;
    max-width: 320px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    min-height: 680px !important;
    padding: 12px !important;
    box-shadow: var(--shadow-sm) !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.kanban-column:hover {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.cards-container {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    overflow-y: auto !important;
    min-height: 250px !important;
    padding-right: 4px !important;
}

/* 📅 100% КИПЕННО-БЕЛАЯ ВЕКТОРНАЯ ИКОНКА КАЛЕНДАРЯ ВО ВСЕХ ИНПУТАХ */
::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 18px 18px !important;
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    cursor: pointer !important;
    width: 22px !important;
    height: 22px !important;
}

input[type="datetime-local"],
input[type="date"],
#taskDueDateInput {
    color-scheme: dark !important;
    color: #ffffff !important;
}

/* 📌 ОТДЕЛЬНЫЙ МОДУЛЬ БЫСТРЫХ ДЕЙСТВИЙ В КАРТОЧКЕ */
.lead-card-actions-module {
    margin-top: 0.75rem;
    padding: 0.85rem;
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.btn-action-tile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-action-tile:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
}

.timeline-input-bar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0.85rem 1.25rem !important;
    background: var(--bg-card-sub) !important;
    border-top: 1px solid var(--border-color) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.timeline-input-bar #msgChannelSelect {
    width: 140px !important;
    flex-shrink: 0 !important;
}

.timeline-input-bar #msgInputText {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 120px !important;
}

.timeline-input-bar button {
    flex-shrink: 0 !important;
}

.task-create-row {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    width: 100% !important;
}

.task-create-row #taskTitleInput {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 120px !important;
}

.task-create-row #taskDueDateInput {
    width: 210px !important;
    min-width: 180px !important;
    flex-shrink: 0 !important;
    color-scheme: dark;
}

.note-create-row {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    width: 100% !important;
}

.note-create-row #noteInputText {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 120px !important;
}

/* Кнопки-чипсы фильтров помесячного канбана и задач */
.filter-chip {
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-chip:hover {
    border-color: var(--accent-violet);
    color: var(--text-main);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: var(--accent-violet);
    border-color: var(--accent-violet);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}

.filter-chip.chip-overdue.active {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.filter-chip.chip-today.active {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.filter-chip.chip-meas.active {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

/* Бейджи задач на карточках Канбана */
.card-task-indicator {
    font-size: 0.73rem;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-sm);
    margin-top: 0.45rem;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    line-height: 1.2;
}

.card-task-overdue {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.card-task-today {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.card-task-upcoming {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #a78bfa;
}

/* Стили блоков задач в карточке лида */
.task-group-title {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-item-card {
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: background 0.15s ease;
}

.task-item-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.task-item-card.completed {
    opacity: 0.55;
    text-decoration: line-through;
}

/* Софтфон-виджет звонка */
.softphone-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 260px;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    padding: 0.9rem;
    z-index: 9999;
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    animation: slideUpSoftphone 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpSoftphone {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.softphone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.softphone-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: pulseDot 1s infinite alternate;
}

.softphone-status-dot.active {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

@keyframes pulseDot {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.softphone-close {
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
}

.softphone-body {
    text-align: center;
    padding: 0.4rem 0;
}

.softphone-end-btn {
    width: 100%;
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 0.55rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.softphone-end-btn:hover {
    background: #dc2626;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-violet) !important;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.25) !important;
}

#loginForm input {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* ШАПКА В СТИЛЕ СТЕКЛА */
.header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.brand-odk-box {
    display: flex;
    flex-direction: column;
}

.brand-odk-main {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--text-main), var(--accent-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot-accent {
    width: 9px;
    height: 9px;
    background-color: var(--accent-violet);
    border-radius: 50%;
    box-shadow: 0 0 14px var(--accent-violet);
    display: inline-block;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.8); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.brand-odk-sub {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-violet);
    margin-top: 4px;
}

.nav-links {
    display: flex;
    gap: 0.6rem;
}

.nav-link {
    color: var(--text-sub);
    text-decoration: none;
    padding: 0.6rem 1.3rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: var(--text-main);
    background-color: var(--bg-card-sub);
}

.nav-link.active {
    color: #ffffff;
    background: var(--gradient-btn);
    box-shadow: var(--glow-btn);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 30px;
}

.user-avatar-svg {
    width: 20px;
    height: 20px;
    fill: var(--text-sub);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.user-role-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-admin { color: var(--role-admin); }
.badge-director { color: var(--role-director); }
.badge-manager { color: var(--role-manager); }

.btn-logout {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* ПАНЕЛЬ СИМУЛЯЦИЙ И КНОПКИ */
.simulation-bar {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    opacity: 0;
    transition: opacity 0.3s ease !important;
    pointer-events: none !important;
}

.modal-overlay.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto !important;
}

.sim-title {
    font-size: 0.85rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.sim-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.btn-sim {
    background: var(--bg-card-sub) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 0.6rem 1.1rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.btn-sim:hover {
    border-color: var(--accent-violet) !important;
    color: var(--accent-violet) !important;
    background: var(--bg-hover) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important;
}

.btn-sim-call {
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #f59e0b !important;
}

.btn-sim-call:hover {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
}

.btn-primary {
    background: var(--gradient-btn) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.75rem 1.2rem !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s !important;
    font-size: 0.88rem !important;
    box-shadow: var(--glow-btn) !important;
    white-space: nowrap !important;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5) !important;
}

/* ==========================================================================
   КАНБАН ДОСКА — PREMIUM SaaS CARD DESIGN
   ========================================================================== */
.main-container {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.kanban-board {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    min-height: calc(100vh - 220px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.kanban-column {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-width: 340px;
    max-width: 380px;
    flex: 0 0 340px;
    max-height: calc(100vh - 220px);
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.kanban-column.drag-over {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.3), 0 8px 32px rgba(139, 92, 246, 0.25);
}

.column-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(123, 97, 255, 0.04) 0%, transparent 100%);
    flex-shrink: 0;
}

.column-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
    flex-shrink: 0;
}

.dot-new { background-color: var(--status-new); color: var(--status-new); }
.dot-in_progress { background-color: var(--status-in_progress); color: var(--status-in_progress); }
.dot-measurement { background-color: var(--status-measurement); color: var(--status-measurement); }
.dot-contract { background-color: var(--status-contract); color: var(--status-contract); }
.dot-closed { background-color: var(--status-closed); color: var(--status-closed); }
.dot-rejected { background-color: var(--status-rejected); color: var(--status-rejected); }
.dot-spam { background-color: var(--status-spam); color: var(--status-spam); }

.cards-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 80px;
}

/* ПРЕМИАЛЬНАЯ КАРТОЧКА СДЕЛКИ */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: grab;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 145px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.lead-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lead-card:active { cursor: grabbing; }

.lead-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.lead-card:hover::before {
    opacity: 1;
}

.lead-card-name-block {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.empty-state-text {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
    font-size: 0.82rem;
}

.lead-phone.empty {
    color: var(--text-muted);
}

.lead-card-budget-badge {
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--accent-violet);
    width: fit-content;
}

.lead-card-budget-pending {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 6px;
    width: fit-content;
}

.lead-phone {
    font-size: 0.82rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lead-profile {
    font-size: 0.78rem;
    background: var(--bg-card);
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--text-sub);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
}

.lead-source-tag {
    font-size: 0.72rem;
    color: #c084fc;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
}

/* ИСПРАВЛЕНИЕ СКРИНШОТА №4: ФУТЕР КАРТОЧКИ КАНБАНА */
.lead-card-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border-color) !important;
    width: 100% !important;
}

.status-select {
    background: var(--bg-card) !important;
    color: var(--text-sub) !important;
    border: 1px solid var(--border-color) !important;
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    max-width: 120px !important;
}

/* МОДАЛЬНОЕ ОКНО СДЕЛКИ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 5, 7, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 1020px;
    height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-deep);
    overflow: hidden;
}

.modal-header {
    background: var(--bg-card-sub);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header-title-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.modal-header-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.modal-close {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-sub);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-main);
    border-color: var(--accent-violet);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.modal-body {
    display: grid;
    grid-template-columns: 380px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.lead-info-col {
    padding: 1.25rem;
    border-right: 1px solid var(--border-color);
    background: var(--bg-card-sub);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.lead-card-block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.95rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: border-color 0.2s ease;
}

.lead-card-block:hover {
    border-color: rgba(139, 92, 246, 0.35);
}

.lead-card-block-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--accent-violet);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.omnichannel-col {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.modal-tabs-header {
    display: flex;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card-sub);
    border-bottom: 1px solid var(--border-color);
}

.modal-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-sub);
    padding: 0.55rem 1.3rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.modal-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.modal-tab-btn.active {
    background: var(--gradient-btn);
    color: #ffffff;
    box-shadow: var(--glow-btn);
}

.timeline-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    max-height: 100%;
    scroll-behavior: smooth;
}

.message-bubble {
    max-width: 80%;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    line-height: 1.45;
}

.message-client {
    align-self: flex-start;
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
}

.message-manager {
    align-self: flex-end;
    background: #064e3b;
    color: #ecfdf5;
    border: 1px solid #047857;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.badge-channel {
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.channel-telegram { background-color: rgba(0, 136, 204, 0.15); color: #0088cc; border: 1px solid rgba(0, 136, 204, 0.3); }
.channel-max_widget { background-color: rgba(147, 51, 234, 0.15); color: #c084fc; border: 1px solid rgba(147, 51, 234, 0.3); }
.channel-call_transcript { background-color: rgba(217, 119, 6, 0.15); color: #f59e0b; border: 1px solid rgba(217, 119, 6, 0.3); }

.timeline-input-bar {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    background: var(--bg-card-sub);
    flex-shrink: 0;
}

/* ФУТЕР PAPENKOV.STUDIO */
.footer {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-top: auto;
    transition: background 0.3s ease;
}

.footer-brand {
    font-weight: 700;
    color: var(--text-main);
}

.footer-studio {
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.footer-studio strong {
    background: linear-gradient(135deg, var(--accent-violet), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-studio:hover {
    border-color: var(--accent-violet);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

/* ЭКРАН АВТОРИЗАЦИИ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bg-base-gradient);
    padding: 2rem;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: 2.8rem;
    box-shadow: var(--shadow-deep);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.demo-account-buttons {
    margin-top: 2rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--border-color);
}

.demo-account-title {
    font-size: 0.78rem;
    color: var(--text-sub);
    margin-bottom: 1rem;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.demo-btn-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.btn-demo {
    background: var(--bg-card-sub) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 0.65rem 0.5rem !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    transition: all 0.2s !important;
}

.btn-demo:hover {
    border-color: var(--accent-violet) !important;
    color: var(--accent-violet) !important;
    background: var(--bg-hover) !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important;
}

.director-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-card);
}

.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    color: var(--text-sub);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background-color: var(--bg-hover);
}

/* 🌟 MOTION UI & PAGE TRANSITIONS (60 FPS) */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.app-container, .main-header, .page-content, .table-container, .modal-content {
    animation: pageFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* KANBAN LEAD CARD HOVER (3D LIFT EFFECT) */
.lead-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
    will-change: transform, box-shadow;
}

.lead-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px -5px rgba(123, 97, 255, 0.3);
    border-color: var(--accent) !important;
}

/* BUTTON & INTERACTIVE FEEDBACK */
button:active, .btn-primary:active, .btn-sim:active, .btn-success:active, .filter-chip:active, .mobile-tab-item:active {
    transform: scale(0.97) !important;
}

/* GLASSMORPHISM BACKDROP BLUR */
.main-header, .modal-content, .toast-item, .softphone-widget, .theme-toggle-capsule, .mobile-bottom-nav {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* SKELETON LOADERS */
.skeleton-box {
    background: linear-gradient(90deg, var(--bg-card-sub) 25%, rgba(123, 97, 255, 0.18) 50%, var(--bg-card-sub) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
    display: block;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 📱 MOBILE-FIRST UX & RESPONSIVE DESIGN (< 768px) */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    button, input, select, textarea, .filter-chip {
        min-height: 44px;
        font-size: 0.95rem;
    }

    /* BOTTOM NAVIGATION TAB BAR FOR MOBILE */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        z-index: var(--z-bottom-nav);
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.3);
    }

    .mobile-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-sub);
        font-size: 0.68rem;
        font-weight: 600;
        text-decoration: none;
        flex: 1;
        height: 100%;
        cursor: pointer;
    }

    .mobile-tab-item.active {
        color: var(--accent);
    }

    .mobile-tab-item svg, .mobile-tab-item i {
        width: 20px;
        height: 20px;
    }

    /* BOTTOM SHEET MODAL FOR MOBILE */
    .modal {
        z-index: var(--z-modal) !important;
    }

    .modal.active .modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100% !important;
        max-width: 100% !important;
        height: 90vh !important;
        max-height: 90vh !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(0) !important;
        animation: slideUpBottomSheet 0.35s cubic-bezier(0.16, 1, 0.3, 1) !forward;
        overflow-y: auto !important;
        margin: 0 !important;
    }

    @keyframes slideUpBottomSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .bottom-sheet-handle {
        width: 44px;
        height: 5px;
        background: var(--border-color);
        border-radius: 3px;
        margin: 8px auto 12px;
        display: block;
    }

    /* KANBAN ACCORDION ON MOBILE */
    .kanban-board {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        overflow-x: hidden !important;
    }

    .kanban-column {
        width: 100% !important;
        min-width: 100% !important;
    }

    .kanban-column-header {
        cursor: pointer;
        padding: 12px 16px;
        background: var(--bg-card-sub);
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .kanban-cards-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 8px;
    }

    .director-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* 📋 CRM TABLE VIEW STYLES */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th {
    padding: 0.75rem 1rem;
    background: var(--bg-card-sub);
    color: var(--text-sub);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.15s ease-in-out;
}

.data-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.04);
}

.status-select {
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.status-select:focus {
    border-color: var(--accent);
}

/* ==========================================================================
   📱 ПРЕМИАЛЬНЫЙ ВИДЖЕТ ТЕЛЕФОНИИ И МЕССЕНДЖЕР-ЗВОНКОВ (VOIP / TELEGRAM STYLE)
   ========================================================================== */
.softphone-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: 330px;
    background: rgba(15, 18, 30, 0.94);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 24px rgba(139, 92, 246, 0.25);
    backdrop-filter: blur(20px);
    padding: 1.25rem;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: voipPopup 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #ffffff;
}

@keyframes voipPopup {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.softphone-avatar-ring {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.6);
}

.softphone-avatar-ring.calling {
    animation: voipPulse 1.5s infinite;
}

@keyframes voipPulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.6); }
    70% { box-shadow: 0 0 0 18px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.softphone-equalizer {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 16px;
    margin-top: 4px;
}

.softphone-equalizer-bar {
    width: 3px;
    height: 100%;
    background: #10b981;
    border-radius: 2px;
    animation: eqBounce 1.2s infinite ease-in-out alternate;
}

.softphone-equalizer-bar:nth-child(1) { animation-delay: 0.1s; }
.softphone-equalizer-bar:nth-child(2) { animation-delay: 0.3s; }
.softphone-equalizer-bar:nth-child(3) { animation-delay: 0.5s; }
.softphone-equalizer-bar:nth-child(4) { animation-delay: 0.2s; }

@keyframes eqBounce {
    0% { height: 4px; }
    100% { height: 16px; }
}

.softphone-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}

.softphone-btn-round {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.softphone-btn-round.end {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.softphone-btn-round.end:hover {
    background: #dc2626;
    transform: scale(1.08);
}

.softphone-btn-round.opt {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.softphone-btn-round.opt:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   DISABLED & LOADING STATES ДЛЯ ВСЕХ КНОПОК
   ========================================================================== */
.btn-primary:disabled,
.btn-sim:disabled,
.btn-success:disabled,
.btn-action-tile:disabled,
button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-loading {
    position: relative !important;
    color: transparent !important;
    pointer-events: none !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* Lucide icon alignment inside buttons and inline */
[data-lucide] {
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE: MOBILE (max-width: 768px)
   ========================================================================== */
/* ==========================================================================
   RESPONSIVE: MOBILE (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* 44px touch targets */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="datetime-local"],
    select,
    textarea {
        min-height: 44px;
        font-size: 1rem;
    }

    .btn-primary,
    .btn-sim,
    .btn-success,
    .btn-action-tile,
    .filter-chip {
        min-height: 44px !important;
        font-size: 0.875rem !important;
    }

    body {
        overflow-x: hidden;
    }

    .header {
        flex-wrap: wrap;
        padding: 0.5rem 1rem !important;
        gap: 8px;
        position: relative;
    }

    .nav-links {
        display: none;
    }

    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-deep);
        z-index: var(--z-modal);
        padding: 8px;
        gap: 4px;
    }

    .nav-links.mobile-open .nav-link {
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .mobile-burger-btn {
        display: flex !important;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        background: var(--bg-card-sub);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-main);
        cursor: pointer;
        transition: all var(--transition-base);
    }

    .mobile-burger-btn:hover {
        border-color: var(--accent);
    }

    .main-container {
        padding: 12px !important;
        overflow-x: hidden !important;
    }

    /* KANBAN: горизонтальный скролл, колонки НЕ сжимаются */
    .kanban-board {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 12px !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 16px;
        min-height: calc(100vh - 260px);
        scroll-snap-type: x proximity;
    }

    .kanban-column {
        min-width: 280px !important;
        max-width: 300px !important;
        flex: 0 0 280px !important;
        max-height: calc(100vh - 280px);
        scroll-snap-align: start;
    }

    .lead-card {
        min-width: 0 !important;
        flex-shrink: 0;
    }

    .simulation-bar {
        flex-direction: column !important;
        padding: 0.75rem 1rem !important;
        gap: 8px !important;
    }

    .sim-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }

    #monthPillsContainer {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 700px;
    }

    #userMonthlyEarningsWidget {
        display: none !important;
    }

    .modal-card {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        border-radius: 0 !important;
        margin: 0;
    }

    .modal-body {
        grid-template-columns: 1fr !important;
    }

    .lead-info-col {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-bottom-nav {
        display: flex !important;
    }

    .footer {
        display: none;
    }

    .director-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-container {
        padding: 1.25rem !important;
    }

    .kanban-column {
        min-width: 260px;
        flex: 0 0 260px;
    }

    .director-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop: hide burger */
@media (min-width: 769px) {
    .mobile-burger-btn {
        display: none !important;
    }
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
    cursor: pointer;
}

/* ==========================================================================
   ✨ ЭРГОНОМИЧНЫЕ ТАБЫ И БЫСТРЫЕ ДЕЙСТВИЯ КАРТОЧКИ ЛИДА (LIGHT & DARK THEME SAFE)
   ========================================================================== */
.modal-card {
    max-width: 1360px !important;
    border-radius: 20px !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-md) !important;
    overflow: hidden;
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.modal-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.modal-header-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main) !important;
    line-height: 1.2;
}

.modal-header-phone-badge {
    font-size: 0.88rem;
    font-weight: 800;
    color: #10b981 !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 2px 8px;
    border-radius: 7px;
    transition: all 0.2s ease;
}

.modal-header-phone-badge:hover {
    background: rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.modal-body {
    display: grid !important;
    grid-template-columns: 520px 1fr !important;
    padding: 1.25rem 1.75rem !important;
    gap: 1.75rem !important;
    background: var(--bg-card) !important;
    align-items: start !important;
}

select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 14px !important;
    padding-right: 2.2rem !important;
}

.lead-info-col input[type="text"], 
.lead-info-col input[type="number"], 
.lead-info-col select, 
.lead-info-col textarea {
    height: 44px !important;
    border-radius: 9px !important;
    font-size: 0.86rem !important;
    background-color: var(--bg-card-sub) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    padding: 0 0.75rem !important;
    box-sizing: border-box !important;
    width: 100% !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}



.lead-info-col textarea {
    height: auto !important;
    padding: 0.75rem 1rem !important;
}

.lead-info-col input:focus, 
.lead-info-col select:focus, 
.lead-info-col textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

.wow-card-block {
    background: var(--bg-card-sub) !important;
    border: 1px solid var(--border-color) !important;
    padding: 1.25rem;
    border-radius: 14px;
    margin-bottom: 1rem;
}

.lead-left-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    background: var(--bg-card-sub);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.lead-left-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.lead-left-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.lead-left-tab-btn.active {
    background: linear-gradient(135deg, var(--accent), #8b5cf6) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-action-tile-sm {
    background: var(--bg-card-sub);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-action-tile-sm:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.lead-tab-pane {
    display: none;
    animation: fadeIn 0.25s ease;
}

.lead-tab-pane.active {
    display: block !important;
}

/* Светлая тема - явные контрасты */
[data-theme="light"] .modal-card {
    background: #ffffff !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .lead-info-col input[type="text"], 
[data-theme="light"] .lead-info-col input[type="number"], 
[data-theme="light"] .lead-info-col select, 
[data-theme="light"] .lead-info-col textarea {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .info-group label {
    color: #475569 !important;
}

[data-theme="light"] .wow-card-block {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ВСПЛЫВАЮЩИЙ ВИДЖЕТ ВХОДЯЩЕГО ЗВОНКА (INCOMING CALL POPUP) */
.incoming-call-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 360px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.3);
    border-radius: 18px;
    padding: 1.25rem;
    backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
    gap: 12px;
    animation: popupSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.incoming-call-popup.active {
    display: flex !important;
}

@keyframes popupSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.call-popup-body {
    display: flex;
    align-items: center;
    gap: 14px;
}

.call-popup-avatar {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pulse-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 2px solid #10b981;
    animation: pulseRing 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.35); opacity: 0.4; }
    100% { transform: scale(1.6); opacity: 0; }
}

.call-popup-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.call-popup-phone {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin: 2px 0;
}

.call-popup-lead {
    font-size: 0.82rem;
    color: var(--text-sub);
}

.call-popup-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.btn-call-accept {
    flex: 1;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-call-lead {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.65rem;
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-call-decline {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 0.65rem;
    border-radius: 10px;
    cursor: pointer;
}

/* ВЕБ-ТЕЛЕФОН NOVOFON WEBPHONE WIDGET */
.crm-webphone-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999;
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.webphone-header {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.webphone-body {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.webphone-input {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.85rem;
}

.webphone-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.webphone-keypad button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.webphone-keypad button:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-purple);
}

.btn-webphone-call {
    flex: 1;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 0.65rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-webphone-hangup {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 0.65rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}




