/* ==========================================================================
    1. ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ И СБРОС
    ========================================================================== */
:root {
    --sidebar-width: 260px;
    --primary-color: #0d6efd;
    --bg-color: #f4f6f9;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #fd7e14;
    --transition-speed: 0.3s;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #333;
    margin: 0;
    transition: all var(--transition-speed) ease;
}

/* ВАШ STYLE.CSS */
.logo {
    font-family: 'Inter', sans-serif !important;
    font-weight: 900 !important;
    letter-spacing: -0.7px !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
}

/* ==========================================================================
    2. УТИЛИТЫ И ГЛОБАЛЬНЫЕ ОТСТУПЫ (ИСПРАВЛЕНО ДЛЯ МОБИЛЬНЫХ)
    ========================================================================== */
.xsmall { font-size: 0.72rem; letter-spacing: 0.02em; font-weight: 800; text-transform: uppercase; }
.uppercase { text-transform: uppercase; letter-spacing: 0.8px; }
.italic { font-style: italic; }
.fw-bold { font-weight: 700 !important; }

.shadow-xs { box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important; }
.rounded-4 { border-radius: 1rem !important; }

.transition-all { transition: all var(--transition-speed) ease; }
.hover-shadow:hover { box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important; transform: translateY(-2px); }
.hover-scale { transition: transform 0.2s; }
.hover-scale:active { transform: scale(0.96); }

/* Мягкие фоновые цвета */
.bg-soft-primary { background-color: rgba(13, 110, 253, 0.08) !important; }
.bg-soft-danger { background-color: rgba(220, 53, 69, 0.05) !important; }
.bg-soft-success { background-color: rgba(25, 135, 84, 0.08) !important; }
.bg-soft-secondary { background-color: rgba(108, 117, 125, 0.08) !important; }

/* УДАЛЕНИЕ ВНУТРЕННИХ ОТСТУПОВ НА МОБИЛЬНЫХ */
@media (max-width: 576px) {
    .container-fluid, 
    .main-content,
    .container-fluid.px-4,
    .container-fluid.px-3 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .card-body {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }
    .row > * {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}

/* ==========================================================================
    3. НАЗВАНИЕ САЙТА (ЛОГОТИП ALMUSLIMU)
    ========================================================================== */
/* Исправлено: принудительное применение стилей логотипа */
.logo, .sidebar .logo, .mobile-header-bar .logo {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
    color: #1a1a1a !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
}

.logo::first-letter, .sidebar .logo::first-letter {
    color: var(--primary-color) !important;
}

/* ==========================================================================
    4. ВЫПАДАЮЩИЕ МЕНЮ И ФИКС СЛОЕВ (ПРОТИВ ПЕРЕКРЫТИЯ)
    ========================================================================== */
/* Позволяем меню выходить за пределы контейнеров */
.card, .card-body, .table-responsive, .modern-card-link, .client-mobile-card, .main-content {
    overflow: visible !important;
}

/* ИСПРАВЛЕНИЕ: Понижаем z-index меню, чтобы модальные окна были сверху */
.dropdown-menu {
    z-index: 1000 !important; 
    position: absolute !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
    border: 1px solid var(--border-color) !important;
    background: #ffffff !important;
    border-radius: 12px;
    padding: 8px;
}

/* Гарантируем, что модальные окна ВСЕГДА выше любых меню */
.modal { z-index: 1070 !important; }
.modal-backdrop { z-index: 1060 !important; }

.dropdown-item { border-radius: 8px; padding: 10px 15px; font-size: 0.85rem; font-weight: 500; }

/* ==========================================================================
    5. ЛЕЙАУТ И НАВИГАЦИЯ
    ========================================================================== */
.sidebar {
    width: var(--sidebar-width); height: 100vh; position: fixed;
    top: 0; left: 0; background: white; border-right: 1px solid var(--border-color);
    padding: 20px; display: flex; flex-direction: column; z-index: 1030; overflow-y: auto;
}

.sidebar .logo { margin-bottom: 30px; }
.brand-logo-img { max-height: 40px; width: auto; object-fit: contain; }

.sidebar .nav-link {
    color: var(--text-muted); padding: 12px 15px; border-radius: 10px;
    margin-bottom: 5px; font-weight: 500; display: flex; align-items: center; text-decoration: none;
}
.sidebar .nav-link:hover { background-color: #f8f9fa; color: var(--primary-color); }
.sidebar .nav-link.active { background-color: #e7f1ff; color: var(--primary-color); font-weight: 600; }
.sidebar .nav-link i { width: 24px; text-align: center; margin-right: 10px; }

.main-content { margin-left: var(--sidebar-width); padding: 30px; min-height: 100vh; }

/* ==========================================================================
    6. ФОРМЫ И ВАЛИДАЦИЯ
    ========================================================================== */
.form-control, .form-select { padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid #e0e0e0; }
.form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(13,110,253,0.1); outline: none; }

.field-error {
    display: none; color: var(--danger-color); font-size: 11px; font-weight: 700;
    text-transform: uppercase; margin-top: 4px; letter-spacing: 0.5px;
}
.form-control.is-invalid { border-color: var(--danger-color) !important; background-color: rgba(220, 53, 69, 0.05) !important; }
.is-valid { border-color: var(--success-color) !important; }

/* ==========================================================================
    7. МОДУЛЬ: КЛИЕНТЫ (СПИСОК И КАРТОЧКИ)
    ========================================================================== */
.avatar-circle, .avatar-client {
    width: 70px; height: 70px; color: white; display: flex; align-items: center; 
    justify-content: center; font-size: 2.5rem; font-weight: 800; border-radius: 50%;
}
.avatar-circle { background: linear-gradient(135deg, #4e73df, #224abe); }

/* Мобильная карточка клиента (image_ec7f06.png) */
.client-mobile-card {
    background: #ffffff; border-radius: 20px; padding: 15px 20px;
    border: 1px solid #f0f2f5; position: relative;
}

.card-info-box { background: #f8f9fa; border-radius: 14px; margin-top: 10px; padding: 12px; }

.client-info-row label {
    display: block; font-size: 0.65rem; text-transform: uppercase;
    font-weight: 800; color: #adb5bd; margin-bottom: 1px; letter-spacing: 0.03em;
}

.action-menu { position: absolute; right: 12px; top: 15px; z-index: 100; }

/* ==========================================================================
    8. МОДУЛЬ: НАСТРОЙКИ
    ========================================================================== */
.settings-section { background: #fff; border-radius: 8px; margin-bottom: 15px; border: 1px solid #e1e4e8; overflow: hidden; }
.section-header { padding: 15px 20px; background: #f8f9fa; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }

.img-company-stamp, .img-company-sig {
    max-height: 100px; max-width: 160px; border: 1px solid #dee2e6;
    border-radius: 12px; padding: 10px; background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.img-company-sig { filter: grayscale(1) contrast(1.1); }

.sticky-bottom-custom {
    position: sticky; bottom: 0; z-index: 1040; margin-top: 30px;
    border-radius: 0 0 16px 16px !important; background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px); border-top: 1px solid var(--border-color); padding: 15px;
}

/* Блокировка настроек по тарифу */
.tariff-locked {
    background-color: #f8f9fa !important;
    opacity: 0.7;
    position: relative;
    pointer-events: none;
}

.tariff-locked .form-switch {
    pointer-events: auto;
}

.tariff-locked input, 
.tariff-locked textarea, 
.tariff-locked select {
    background-color: #e9ecef !important;
    cursor: not-allowed;
    border-color: #dee2e6 !important;
}

/* Цветные иконки в табах */
.color-whatsapp { color: #25D366; }
.color-telegram { color: #0088cc; }

/* Кастомные тени и размеры */
.shadow-xs { box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.icon-size-42 { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; }
.fw-black { font-weight: 900 !important; }
.uppercase { text-transform: uppercase; }
.xsmall { font-size: 0.72rem !important; }

/* Вкладки SMTP внутри настроек */
#smtpTabs .nav-link {
    border: 1px solid #dee2e6;
    margin: 0 2px;
    border-radius: 10px 10px 0 0;
    background: #f8f9fa;
    color: #6c757d;
    font-weight: bold;
}

#smtpTabs .nav-link.active {
    background: #fff;
    color: #0d6efd;
    border-bottom-color: transparent;
}

/* Эффект блокировки тарифа */
.tariff-locked {
    position: relative;
    overflow: hidden;
}

.tariff-locked::after {
    content: "RESTRICTED BY PLAN";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.6rem;
    font-weight: 900;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    padding: 2px 8px;
    border-radius: 50px;
}

/* Иконки и общие стили */
.color-whatsapp { color: #25D366; }
.color-telegram { color: #0088cc; }
.icon-size-42 { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; }
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.fw-black { font-weight: 900 !important; }
.xsmall { font-size: 0.75rem !important; }

/* ==========================================================================
    9. МОДУЛЬ: КЛИЕНТЫ - ПРОФИЛЬ И ГРАФИК (VIEW.PHP)
    ========================================================================== */
#personalDataChevron { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

.card-header[data-bs-toggle="collapse"]:hover { background-color: #f8f9fa !important; }
.card-header[data-bs-toggle="collapse"] { outline: none; box-shadow: none; }

/* Документы */
.pointer-zoom { cursor: zoom-in; transition: 0.2s ease-in-out; }
.pointer-zoom:hover { transform: scale(1.02); filter: brightness(0.9); }

/* Вкладки (Строго в одну строку) */
#clientTabs { flex-wrap: nowrap !important; }
#clientTabs .nav-link {
    white-space: nowrap !important;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 0.85rem;
}

/* Кнопки связи (Симметрия 50/50) */
.btn-communication-fixed {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Компактный аватар профиля */
.avatar-client-compact {
    width: 75px; height: 75px; color: #fff;
    font-size: 1.8rem; font-weight: 800; display: flex;
    align-items: center; justify-content: center;
    border-radius: 50%; text-transform: uppercase;
}

/* График платежей: стиль карточек (image_183b0f.jpg) */
.payment-card-item .h5 { font-size: 1.15rem; letter-spacing: -0.5px; }
.payment-card-item:last-child { border-bottom: none !important; }

/* ==========================================================================
    10. МОБИЛЬНАЯ АДАПТАЦИЯ (BOTTOM NAV И HEADER)
    ========================================================================== */
@media (max-width: 768px) {
    body { padding-bottom: 80px; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 15px; }

    .mobile-header-bar {
        background: #fff; padding: 15px 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1020;
        display: flex; justify-content: space-between; align-items: center;
        margin: -15px -10px 25px -10px;
    }

    .bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
        background: white; border-top: 1px solid #dee2e6; z-index: 1050;
    }

    .nav-item-mobile { 
        flex: 1; display: flex; flex-direction: column; 
        align-items: center; justify-content: center; 
        color: #adb5bd; font-size: 11px; text-decoration: none; 
    }
    .nav-item-mobile.active { color: var(--primary-color); }
    .nav-item-mobile i { font-size: 22px; }

    .btn-communication-fixed { font-size: 0.82rem; padding: 0 5px; }
    .avatar-client-compact { width: 70px; height: 70px; font-size: 1.8rem; }
}

/* ==========================================================================
    11. ПЕЧАТЬ
    ========================================================================== */
@media print {
    aside, header, footer, .sidebar, .bottom-nav, .mobile-header-bar, .no-print, .btn-print { display: none !important; }
    .main-content, body { width: 100% !important; margin: 0 !important; padding: 0 !important; background: white !important; }
    .print-container { max-width: 800px; margin: 0 auto; color: #000; font-family: "PT Serif", serif; font-size: 14px; }
    .schedule-table { width: 100%; border-collapse: collapse; }
    .schedule-table th, .schedule-table td { border: 1px solid #000; padding: 8px; text-align: center; }
}


/* ==========================================================================
   СТИЛИ ДЛЯ СТРАНИЦЫ ВХОДА (LOGIN PAGE)
   ========================================================================== */
.login-page {
    background-color: #f4f6f9; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; 
}

.login-card { 
    width: 100%; 
    max-width: 420px; 
    padding: 2.5rem; 
    border-radius: 20px; 
    background: white; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.05); 
}

.login-card .brand-logo { 
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.5px !important;
    color: #1a1a1a !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-card .brand-logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.login-card .form-control { 
    padding: 0.75rem 1rem; 
    border-radius: 10px; 
    border: 1px solid #e0e0e0;
}

.login-card #togglePass {
    right: 15px; 
    top: 12px; 
    cursor: pointer;
    z-index: 5;
}

.login-card .alert {
    border-radius: 12px;
}

/* Кнопка повторной отправки */
.btn-link.text-danger:hover {
    color: #a71d2a !important;
    text-decoration: underline !important;
}

/* ФИКС ВЕРХНЕГО МЕНЮ */
.navbar {
    min-height: 70px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.navbar-brand {
    padding: 0;
}

/* Название сайта (Логотип) */
.logo {
    font-family: 'Inter', sans-serif !important;
    font-weight: 900 !important;
    font-size: 1.4rem !important;
    letter-spacing: -0.8px !important;
    color: #1a1a1a !important;
    text-transform: none;
}

.brand-logo-img {
    width: auto;
    max-width: 150px;
}

/* Коррекция мобильного вида */
@media (max-width: 991px) {
    .navbar .container {
        justify-content: space-between;
    }
    
    .logo {
        font-size: 1.2rem !important;
    }
}

/* Убираем лишние отступы контейнера на лендинге */
.landing-hero {
    margin-top: 0;
}


/* КАРТОЧКИ ФУНКЦИЙ */
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
}

/* СЕКЦИЯ ТАРИФОВ */
#tariffs .card {
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

#tariffs .card:hover {
    border-color: var(--primary-color);
}

#tariffs .badge {
    font-size: 0.65rem;
    padding: 8px 15px;
    letter-spacing: 1px;
}

/* МОБИЛЬНОЕ МЕНЮ (NAVBAR) */
@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.1);
        margin-top: 10px;
    }
}

/* КАРТОЧКИ ТАРИФОВ (MASTER PANEL STYLE) */
#tariffs .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    border: 1px solid #f0f0f0;
}

#tariffs .card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.1) !important;
}

#tariffs .badge.bg-success.bg-opacity-10 {
    font-size: 0.75rem;
    padding: 6px 12px;
}

/* Сетка иконок лимитов */
#tariffs .border.rounded.py-2 {
    background: #fcfcfc;
    border-color: #eee !important;
}

#tariffs .xsmall {
    font-size: 0.65rem;
    font-weight: 600;
}

#tariffs .h2.fw-bold {
    letter-spacing: -1px;
}

/* Иконка WL (White Label) */
.fa-crown {
    font-size: 0.9rem;
}

/* Ползунки калькулятора */
.form-range::-webkit-slider-thumb { background: #0d6efd; }
.form-range::-moz-range-thumb { background: #0d6efd; }

/* Стиль для кнопки переключения пароля в input-group */
.toggle-password-btn {
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
}

.toggle-password-btn:hover {
    opacity: 0.7;
}

.toggle-password-btn i {
    width: 20px;
    text-align: center;
}

/* Состояния для SMS модулей */
.sms-provider-fields {
    transition: all 0.3s ease-in-out;
}

#smsProviderSelector {
    border-color: #dee2e6;
}

#smsProviderSelector:focus {
    border-color: #dc3545; /* Цвет Danger для соответствия иконке SMS */
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.1);
}

.bg-light-subtle {
    background-color: #fcfcfc !important;
}

/* Стилизация badge внутри аккордеона */
.badge.xsmall {
    font-size: 0.65rem;
    padding: 0.35em 0.8em;


}

/* Дизайн динамических инструкций SMS */
.sms-instruction-fields {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.shadow-xs {
    box-shadow: 0 2px 5px rgba(0,0,0,0.03) !important;
}

.italic {
    font-style: italic;
}

/* Компактная кнопка проверки */
#api-sms .fw-black {
    font-weight: 900 !important;
}


/* Дизайн модуля Messenger Max */
#api-messenger-max .badge.bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
    letter-spacing: 0.5px;
}

#api-messenger-max .border-dashed {
    border-style: dashed !important;
    border-color: #dee2e6 !important;
}

#test_max_target {
    font-size: 0.85rem;
    height: 38px;
}

#api-messenger-max .fw-black {
    font-weight: 900 !important;
}

#api-messenger-max .italic {
    font-style: italic;
}

/* Компактная кнопка проверки */
#api-messenger-max .btn-sm {
    font-size: 0.75rem;
    padding: 0.5rem 1.5rem;
}

/* Исправление отступа: тумблер слева */
.form-check.form-switch.d-flex {
    gap: 1.25rem; /* Физический разрыв между тумблером и текстовым блоком */
}

.form-check-input.int-toggle {
    flex-shrink: 0; /* Чтобы тумблер не сплющивало при длинном описании */
}

/* Компактный блок теста */
.border-dashed {
    border-style: dashed !important;
    border-color: #dee2e6 !important;
}

.bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

/* Стили для инструкций */
.italic {
    font-style: italic;
     font-size: 0.8rem;
     background-color: #dddddd;
     border-radius: 0.3rem;
     padding: 0.7rem;
}


/* Улучшенные внутренние вкладки Email модуля */
#pills-email-tab .nav-link {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: transparent;
    border: none;
}

#pills-email-tab .nav-link.active {
    background-color: #f8f9fa !important;
    color: #0d6efd !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* Рамка для блока тестирования */
.border-dashed {
    border-style: dashed !important;
    border-width: 2px !important;
    border-color: #dee2e6 !important;
}

/* Компактный ввод */
#test_email_target {
    font-size: 0.8rem;
    border-color: #eee;
}

#test_email_target:focus {
    border-color: #0d6efd;
    box-shadow: none;
}

/* Убираем фон у тела аккордеона в настройках */
#tab-api .accordion-body {
    background-color: transparent !important;
}

/* Оставляем белый фон только для карточек с полями ввода */
#tab-api .bg-white {
    background-color: #ffffff !important;
}

/* Улучшаем вид вкладок инструкций */
#pills-email-tab .nav-link.active {
    background-color: #ffffff !important;
    color: #0d6efd !important;
    border: 1px solid #dee2e6 !important;
}
.p-4 {
    padding: 0.5rem !important;
}



.fw-black { font-weight: 900; }
.shadow-xs { box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.uppercase { text-transform: uppercase; letter-spacing: 0.05rem; }
.xsmall { font-size: 0.72rem; }

/* Стили для кнопок "+" в группах ввода */
.input-group .btn-primary, .input-group .btn-outline-primary {
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.form-range::-webkit-slider-thumb { 
    background: #0d6efd; 
    border: 2px solid #fff; 
    box-shadow: 0 0 5px rgba(0,0,0,0.1); 
    width: 18px; 
    height: 18px; 
}

/* Эффект липкого блока итогов */
@media (min-width: 992px) { 
    .sticky-lg-top { position: sticky; top: 20px; } 
}

/* Улучшение таблицы графика */
.table-hover tbody tr:hover { 
    background-color: rgba(13, 110, 253, 0.03); 
    transition: 0.2s; 
}

/* SaaS Deal Management: Client Form PC Optimization */
.modal-form-body {
    padding: 30px !important;
    background-color: #fff !important;
}

#phone {
    min-width: 250px !important; /* Чтобы номер на ПК не обрезался */
    border-color: #3b82f6;
    letter-spacing: 0.5px;
}

.field-hint {
    font-size: 0.68rem;
    color: #8898aa;
    margin-top: 3px;
    line-height: 1;
}

.field-error {
    font-size: 0.7rem;
    color: #f5365c;
    margin-top: 5px;
    font-weight: 600;
}

.modal-form-body .form-control, 
.modal-form-body .form-select {
    border-radius: 12px;
    padding: 12px 15px;
}

.modal-form-body .is-invalid { border-color: #f5365c !important; }
.modal-form-body .is-valid { border-color: #2dce89 !important; }

#submitBtn:not(:disabled) {
    background: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);
    border: none;
}

.border-dashed { border-style: dashed !important; border-width: 2px !important; }

/* ===== Deals create page: fix title overflow on small screens ===== */
.deal-create-page .deal-title-row { gap: .75rem; }
.deal-create-page .deal-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* On very small screens allow wrapping (prevents crossing border) */
@media (max-width: 420px) {
  .deal-create-page .deal-title {
    white-space: normal;
    overflow: visible;
  }
}

/* ===== Sticky summary & iframe ===== */
.deal-summary-sticky { position: sticky; top: 20px; z-index: 100; }
.deal-modal-iframe { width: 100%; height: 600px; border: 0; }

/* ===== Summary card pleasant color (instead of black) ===== */
.deal-summary-card {
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.deal-summary-card .border-secondary-subtle { border-color: rgba(15, 23, 42, 0.12) !important; }
.deal-summary-card .text-warning { color: #2563eb !important; } /* make total blue */
.deal-summary-card .bg-light { background-color: rgba(37, 99, 235, 0.06) !important; } /* monthly box */
.deal-summary-card .btn-outline-secondary { border-color: rgba(15,23,42,.25); color: rgba(15,23,42,.85); }

/* ===== Toast ===== */
.app-toast-container { position: fixed; top: 0; right: 0; padding: 1rem; z-index: 2000; }

/* Optional: prevent long option text from breaking layout */
.ts-dropdown .option { white-space: normal; }

/* SaaS Deal Card Styles */
.fw-black { font-weight: 900; }
.avatar-huge {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #5e72e4 0%, #825ee4 100%);
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 900;
}

/* Настройки для печати */
.print-layout { 
    display: none; /* Скрыто в браузере */
}

@media print {
    /* Скрываем весь интерфейс CRM */
    .no-print, aside, nav, header, .btn, .breadcrumb, .progress, .card { 
        display: none !important; 
    }
    
    /* Делаем страницу белой */
    body { 
        background: #fff !important; 
        color: #000 !important; 
        margin: 0; 
        padding: 0; 
    }

    /* Показываем только блок договора */
    .print-layout { 
        display: block !important; 
        padding: 20mm; /* Поля для принтера */
        font-family: "Times New Roman", Times, serif;
        font-size: 12pt;
        line-height: 1.5;
    }

    /* Стили таблицы внутри договора */
    .print-table { 
        width: 100%; 
        border-collapse: collapse; 
        margin: 20px 0; 
    }
    .print-table th, .print-table td { 
        border: 1px solid #000 !important; 
        padding: 8px; 
        text-align: center; 
    }
}



/* Стили для печатной версии договора */
.print-page {
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
}

.print-container {
    background-color: white;
    width: 210mm; /* Размер A4 */
    min-height: 297mm;
    padding: 20mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-family: "Times New Roman", Times, serif;
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
}

.print-toolbar {
    width: 210mm;
    background: #333;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
}

.btn-print {
    background-color: #1cc88a;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-close {
    background-color: #858796;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* Оформление текста внутри договора */
.print-container h1, .print-container h2 {
    text-align: center;
    text-transform: uppercase;
}

.print-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.print-container table td, .print-container table th {
    border: 1px solid #000;
    padding: 8px;
}



/* Адаптивность графика платежей в просмотре сделки */
@media (max-width: 767.98px) {
    .responsive-schedule-table, 
    .responsive-schedule-table tbody, 
    .responsive-schedule-table tr, 
    .responsive-schedule-table td {
        display: block;
        width: 100%;
    }

    .responsive-schedule-table tr {
        margin-bottom: 1rem;
        border-bottom: 1px solid #edf2f9;
        padding: 10px 15px;
        position: relative;
    }

    .responsive-schedule-table td {
        text-align: left;
        padding: 5px 0 !important;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Добавляем подписи к данным на мобильных */
    .responsive-schedule-table td[data-label]::before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        font-weight: 700;
        color: #8492a6;
    }

    .responsive-schedule-table td:last-child {
        margin-top: 10px;
    }
}

/* Стили для кнопок мессенджеров */
.ms-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff !important;
    font-size: 1.2rem;
    transition: all 0.2s;
}
.ms-btn:hover { transform: translateY(-3px); }
.ms-btn.wa { background: #25d366; }
.ms-btn.tg { background: #0088cc; }
.ms-btn.max { background: #6f42c1; }
.ms-btn.mail { background: #ea4335; }

.avatar-huge {
    width: 80px;
    height: 80px;
    background: #f5f8ff;
    color: #4e73df;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
}

.avatar-sm {
    width: 45px;
    height: 45px;
    background: #f8f9fc;
    color: #4e73df;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    border: 1px solid #e3e6f0;
}









/* Нумерация и статусы в реестре */
.table thead th {
    background-color: #f8f9fc;
    border-bottom: 2px solid #e3e6f0;
}

.badge {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.7rem;
}

.xsmall {
    font-size: 0.75rem;
}

.uppercase {
    text-transform: uppercase;
}

/* Эффекты при наведении */
.transition-hover {
    transition: all 0.2s ease-in-out;
}

.transition-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

/* Скроллбары для таблицы */
.table-responsive::-webkit-scrollbar {
    height: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #4e73df;
    border-radius: 10px;
}
