
/* Click-to-open help tooltip (professional behavior: click to open, click outside/Esc to close) */
.help-dot{
  width:18px;
  height:18px;
  border-radius:50%;
  border:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  line-height:1;
  cursor:pointer;
  background:#e9f0ff;
  color:#2a5bd7;
  user-select:none;
}

.help-pop{
  position:fixed;
  max-width:340px;
  z-index:99999;
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:10px;
  font-size:12px;
  box-shadow:0 10px 25px rgba(0,0,0,.25);
}

.help-pop .help-pop-arrow{
  position:absolute;
  width:10px;
  height:10px;
  background:#111827;
  transform:rotate(45deg);
  top:-5px;
  left:16px;
}
/* ==========================================================================
    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;
}



/* Prevent layout shift when modals lock body scroll (scrollbar disappears) */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}
*, *::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, .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) {
    /* Space for fixed bottom nav + safe area (iOS) */
    body { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding:  15px 15px 45px 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;
    }

    /* Лого + название в мобильной шапке (не слипаются, текст не "синий") */
    .mobile-header-bar .mobile-brand { gap: 10px; text-decoration: none; }
    .mobile-header-bar .mobile-brand-logo { display: block; flex: 0 0 auto; }
    .mobile-header-bar .brand-text {
        color: #111; font-weight: 700; letter-spacing: -0.2px;
        line-height: 1; white-space: nowrap;
    }

    .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;
}



/* =========================
   Dashboard (mobile polish)
   ========================= */
.dash-hero{
  background: linear-gradient(135deg, rgba(13,110,253,.10), rgba(32,201,151,.08));
  border: 1px solid rgba(0,0,0,.06);
}
.dash-kpi{
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-kpi:hover{
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.08)!important;
}
.dash-kpi .kpi-icon{
  width: 42px; height: 42px;
  display:flex; align-items:center; justify-content:center;
  border-radius: 14px;
  background: rgba(13,110,253,.10);
}
.dash-kpi.success .kpi-icon{ background: rgba(25,135,84,.12); }
.dash-kpi.warning .kpi-icon{ background: rgba(255,193,7,.18); }
.dash-kpi.danger  .kpi-icon{ background: rgba(220,53,69,.14); }

.dash-panel{ border: 1px solid rgba(0,0,0,.06); }
.dash-panel-title{ letter-spacing:.08em; }

.dash-actions{ display:flex; gap:.5rem; flex-wrap:wrap; }
.dash-actions .btn{ border-radius: 999px; }

@media (max-width: 576px){
  .dash-actions .btn{
    width: 100%;
    padding: .55rem .85rem;
  }
}

/* =========================
   Mobile bottom navigation "+"
   ========================= */
.bottom-nav .fab-container{
  display:flex;
  align-items:center;
  justify-content:center;
}
.bottom-nav .fab-container .floating-btn{
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  border: 4px solid #fff;
  transform: translateY(-16px);
}
.bottom-nav .fab-container .floating-btn i{
  font-size: 22px;
}


/* ===============================
   Warehouses (Склады)
   =============================== */

/* Карточки складов в стиле SaaS */
.warehouse-list .list-group-item{
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  margin-bottom: 12px;
  padding: 14px 14px;
}

.warehouse-list .list-group-item:hover{
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
}

.modern-card-link{
  display:block;
  color: inherit;
  text-decoration: none;
}
.modern-card-link:hover,
.modern-card-link:focus{
  color: inherit;
  text-decoration: none;
}

.icon-box{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 110, 253, 0.10);
}

.warehouse-title{
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}

.warehouse-subtitle{
  font-size: 12px;
  color: #6b7280;
  margin: 2px 0 0;
}

/* Мобильная кнопка добавления */
@media (max-width: 768px){
  .warehouse-actions{
    display: flex;
    width: 100%;
    gap: 10px;
  }
  .warehouse-actions .btn{
    flex: 1;
    border-radius: 12px;
    padding: 10px 12px;
  }
}

.warehouse-list .modern-card-link{
  display: block;
  color: inherit;
  text-decoration: none;
}
.warehouse-list .modern-card-link:hover,
.warehouse-list .modern-card-link:focus{
  color: inherit;
  text-decoration: none;
}

.warehouse-list .card-clickable-area{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-list .warehouse-main{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.warehouse-list .icon-box{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  flex: 0 0 auto;
}

.warehouse-list .warehouse-name{
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
  color: #0f172a;
  word-break: break-word;
}

.warehouse-list .warehouse-meta{
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.25;
  color: #64748b;
}

.warehouse-list .action-menu{
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}

.warehouse-list .action-menu .btn{
  border-radius: 12px;
}

@media (max-width: 768px){
  .warehouse-list .list-group-item{
    border-radius: 16px;
    padding: 14px 12px;
  }
  .warehouse-list .warehouse-name{
    font-size: 15px;
  }
}

/* Warehouses module cards */
.modern-card-link{
  background:#fff;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.06);
  padding:14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.modern-card-link:hover{
  border-color: rgba(37, 99, 235, 0.20);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
}

.card-clickable-area{
  flex:1;
  color: inherit;
  text-decoration:none;
}

.card-clickable-area:hover,
.card-clickable-area:focus{
  color: inherit;
  text-decoration:none;
}

.icon-box{
  width:44px;
  height:44px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(37, 99, 235, 0.08);
}

.icon-box i{
  font-size: 18px;
}

.action-menu .btn{
  border-radius: 10px;
}

@media (max-width: 768px){
  .modern-card-link{ padding: 12px; }
  .icon-box{ width:40px; height:40px; border-radius: 10px; }
}

/* =========================
   SaaS UI helpers (Deals)
   ========================= */

.saas-info-btn{
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  font-weight: 800;
  line-height: 26px;
}

.cashbox-shares-summary{
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.6);
}

.cashbox-shares-kpis{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.cashbox-shares-kpi{
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

@media (max-width: 768px){
  .cashbox-shares-kpis{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Warehouses page: compact action buttons on phones */
@media (max-width: 575.98px) {
  .warehouses-actions { gap: 8px !important; }
  .btn-add-warehouse {
    width: 44px;
    height: 44px;
    padding: 0 !important;
    border-radius: 22px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-add-warehouse i { margin-right: 0 !important; }

  .btn-toggle-archive {
    height: 44px;
    padding: 0 12px !important;
    border-radius: 22px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;
  }
}

/* Contract editor: Quill + inline PDF preview */
.contract-quill-toolbar {
  border: 1px solid #e5e7eb;
  border-radius: 12px 12px 0 0;
}
.contract-quill-editor {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  min-height: 420px;
  width: 100%;
  max-width: none;
}

.contract-quill-toolbar{
  width: 100%;
  max-width: none;
}

.contract-quill-editor .ql-container,
.contract-quill-editor .ql-editor{
  width: 100%;
  max-width: none;
}
.contract-placeholders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.contract-print-group .input-group-text {
  white-space: nowrap;
}
.contract-pdf-preview-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.contract-pdf-preview {
  width: 100%;
  height: 70vh;
  border: 0;
}
@media (max-width: 575.98px) {
  .contract-quill-editor { min-height: 320px; }
  .contract-pdf-preview { height: 60vh; }
  .contract-print-group { width: 100%; }
  .contract-print-group .btn { white-space: nowrap; }
}

/* Contract editor (Quill) */
.contract-quill-toolbar {
  border: 1px solid #dee2e6;
  border-radius: 12px 12px 0 0;
  background: #fff;
}

.contract-quill-editor {
  background: #fff;
  border: 1px solid #dee2e6;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  min-height: 420px;
}

.contract-placeholders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contract-print-group {
  min-width: 320px;
}

@media (max-width: 575.98px) {
  .contract-print-group { min-width: 100%; }
  .contract-quill-editor { min-height: 360px; }
}

/* Settings: upload thumbnails (stamp/signature/logo) */
.settings-upload-thumbwrap{
  min-height: 92px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.settings-upload-thumb{
  max-height: 80px;
  max-width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 4px;
  background: #fff;
}
@media (max-width: 575.98px){
  .settings-uploads-row{ padding: 16px !important; }
  .settings-uploads-row .col-md-4{ border-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,0.9); padding-bottom: 14px; }
  .settings-uploads-row .col-md-4:last-child{ border-bottom: 0; padding-bottom: 0; }
}


/* Contract editor: mobile/PWA print & share sheet */
.contract-actions-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.contract-actions-sheet{
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px;
  padding: 14px 14px 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.contract-pdf-preview-mobile{ display:none; }

@media (max-width: 768px){
  /* mobile browsers often don't render PDF inside iframe reliably */
  .contract-pdf-preview-wrap{ display:none; }
  .contract-pdf-preview-mobile{ display:block; }
}


/* Contract PDF actions dropdown (mobile + desktop parity) */
.contract-pdf-actions .btn {
  white-space: nowrap;
}

.contract-pdf-menu {
  min-width: 200px;
  border-radius: 14px;
  overflow: hidden;
}

.contract-pdf-menu .dropdown-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Animate dropdown */
.contract-pdf-menu.show {
  animation: contractDropIn 140ms ease-out;
  transform-origin: top right;
}

@keyframes contractDropIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hide "Share" on desktop (WebShare mainly for mobile/PWA) */
@media (min-width: 576px) {
  .contract-share-item { display: none; }
}



/* --- Стили для страницы профиля (/modules/profile) --- */

/* Всплывающее уведомление о запрете доступа */
.access-denied-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    border-radius: 12px;
    min-width: 300px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border: none;
}

/* Аватар профиля */
.profile-avatar-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 4px solid #f8f9fa;
    border-radius: 50%;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important;
}

/* Кнопка загрузки аватара */
.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--bs-primary, #0d6efd); /* Используем переменную темы или дефолт */
    color: #fff;
    border-radius: 50%;
    padding: 0.5rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.avatar-upload-btn:hover {
    background-color: #0b5ed7;
}

/* ========================================================== */
/* MODERN FORM STYLES (Clients Create / Modals) */
/* ========================================================== */

/* Типография заголовков секций */
.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    font-weight: 700;
    margin-top: 10px;
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 8px;
}

/* Современная этикетка поля */
.modern-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #8898aa;
    margin-bottom: 0.5rem;
    letter-spacing: 0.03em;
}

.modern-label .info-icon {
    color: #adb5bd;
    margin-left: 6px;
    cursor: pointer;
    transition: color 0.2s;
}
.modern-label .info-icon:hover {
    color: #0d6efd; /* Primary Color */
}

/* Современный Input */
.form-control-modern {
    border: 1px solid #e9ecef;
    border-radius: 8px; /* Скругленные углы */
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #32325d;
    background-color: #fff;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.form-control-modern:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1); /* Мягкое свечение */
    background-color: #fff;
}

.form-control-modern.is-invalid {
    border-color: #dc3545;
    background-image: none; /* Убираем стандартную иконку, она часто мешает */
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control-modern.is-valid {
    border-color: #198754;
    background-image: none;
}

/* Карточка для чекбокса */
.modern-checkbox-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    background-color: #f8f9fa;
    transition: background 0.2s;
}
.modern-checkbox-card:hover {
    background-color: #fff;
    border-color: #dee2e6;
}

/* Зона загрузки файлов (Upload Zone) */
.upload-zone {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    background-color: #f8f9fa;
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: #0d6efd;
    background-color: #f1f8ff;
}

.upload-input {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

/* Сообщения об ошибках под полями */
.field-feedback {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    color: #dc3545;
}

/* Главная кнопка */
.btn-modern {
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease;
}

.btn-modern:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-modern:disabled {
    opacity: 0.6;
    background-color: #a0a0a0;
    border-color: transparent;
    cursor: not-allowed;
}

/* Анимация тряски для ошибки (Blacklist) */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}
.animate-shake {
    animation: shake 0.4s ease-in-out;
}


/* ============================================================
   ОБЩИЕ СТИЛИ И МОДУЛИ СИСТЕМЫ (almuslimu.ru)
   ============================================================ */

/* --- 1. МОДУЛЬ КАЛЬКУЛЯТОРА --- */
.result-card-gradient {
    background: linear-gradient(135deg, #008ba3 0%, #006f82 100%);
    color: white;
}

/* --- 2. МОДУЛЬ КАССЫ --- */
.cashbox-card-item {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.cashbox-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    border-color: rgba(0, 139, 163, 0.3);
}

.cashbox-card-item .icon-wrap {
    width: 48px;
    height: 48px;
    background-color: #e0f7fa;
    color: #008ba3;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.cashbox-card-item .balance-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* --- 3. СТИЛИ ГЛАВНОГО ДАШБОРДА (index.php) --- */

/* Фон основного контейнера */
.dashboard-container {
    background-color: #fcfdfe;
    min-height: 100vh;
}

/* Сетка карточек: 3 колонки */
.mobile-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; /* Небольшой отступ для мобильных */
}

/* Стиль карточек (Teal / Тиловый) - БАЗОВЫЙ (МОБИЛЬНЫЙ) */
.stat-card-teal {
    background-color: #008ba3; 
    color: white;
    border-radius: 12px;
    padding: 12px 5px; /* Чуть меньше паддинг */
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 95px; /* Чуть компактнее */
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 139, 163, 0.15);
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-card-teal:hover {
    filter: brightness(1.1);
    color: white;
    transform: translateY(-3px);
}

/* Уменьшенные шрифты для мобильных */
.stat-card-teal i {
    font-size: 1.3rem; /* Иконка поменьше */
    margin-bottom: 6px;
    opacity: 0.95;
}

.stat-card-teal .label {
    font-size: 0.65rem; /* Текст поменьше */
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
    opacity: 0.9;
}

.stat-card-teal .value {
    font-size: 0.95rem; /* Цифра поменьше */
    font-weight: 700;
    margin-top: 3px;
}

/* Блоки "Финансовый результат" и "Остатки" */
.info-card-minimal {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    height: 100%;
}

.info-title-gray {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #adb5bd;
    display: block;
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* Стрелки навигации по датам */
.fin-nav-minimal {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
}

.nav-arrow {
    background: none;
    border: none;
    color: #008ba3;
    font-size: 1.2rem;
    padding: 0 15px;
    cursor: pointer;
}

.period-name {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 120px;
    text-align: center;
    color: #333;
}

.period-subtext {
    text-align: center;
    font-size: 0.75rem;
    color: #008ba3;
    margin-top: 2px;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Строки с цифрами */
.min-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.9rem;
    color: #555;
    border-bottom: 1px dashed #f0f0f0;
}
.min-row:last-child { border-bottom: none; }
.min-row span:last-child { font-weight: 600; color: #333; }

/* Блок "Чистые активы" */
.assets-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #eee;
    margin-top: 20px;
}

/* --- 4. СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ ПК (БОЛЬШИЕ ОТСТУПЫ) --- */

@media (min-width: 1200px) {
    
    /* Центрирование и отступы по краям */
    .dashboard-container {
        max-width: 1400px !important; 
        margin: 0 auto !important;    
        padding-left: 80px !important; 
        padding-right: 80px !important; 
        padding-top: 40px !important;   
    }

    /* ЗНАЧИТЕЛЬНО увеличенные отступы между карточками */
    .mobile-grid-3 {
        gap: 30px !important; /* Было 20, стало 30 */
        margin-bottom: 50px !important;
    }

    /* Увеличенные карточки и шрифты для ПК */
    .stat-card-teal {
        min-height: 130px !important; /* Чуть выше */
        padding: 25px 15px !important;
    }

    .stat-card-teal i {
        font-size: 2.2rem !important; /* Иконка крупнее */
        margin-bottom: 15px !important;
    }
    
    .stat-card-teal .label {
        font-size: 0.85rem !important; /* Текст крупнее */
    }
    
    .stat-card-teal .value {
        font-size: 1.5rem !important; /* Цифра крупнее */
    }

    /* Просторные блоки финансов */
    .info-card-minimal {
        padding: 35px !important;
    }
}

/* --- 5. МОБИЛЬНЫЕ НАСТРОЙКИ --- */
@media (max-width: 576px) {
    .dashboard-container { margin-top: 0 !important; padding-top: 12px !important; }
    .mobile-grid-3 { gap: 8px !important; }
}

/* Стили для инпутов даты в дашборде */
.date-input-minimal {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px 2px;
    font-size: 0.8rem; /* Уменьшил для телефона по вашей просьбе */
    color: #008ba3;
    font-weight: 600;
    background-color: #fdfdfd;
    max-width: 90px;
    text-align: center;
    transition: border-color 0.2s;
    display: inline-block;
}

.date-input-minimal:focus {
    border-color: #008ba3;
    box-shadow: none;
    outline: none;
}

/* Скрытый элемент (для плавности) */
[style*="display: none"] {
    opacity: 0;
}

/* --- Стили для ОТЧЕТОВ (modules/reports) --- */

/* Вертикальный разделитель между колонками на планшетах и ПК */
@media (min-width: 768px) {
    .border-start-md {
        border-left: 1px dashed #e0e0e0;
    }
}

/* Transactions: group filter + 50/50 buttons */
.tx-op-buttons{max-width:420px}
@media (max-width: 576px){
  .tx-op-buttons{width:100%;max-width:none}
}


/* Transactions unified search + filter */
.tx-searchbar .form-control{min-height:44px;}
.tx-searchbar .btn{min-height:44px;}
.tx-searchbar .input-group-text{min-height:44px;display:flex;align-items:center;}
.tx-filter-toggle{width:44px;padding:0;display:flex;align-items:center;justify-content:center;}
.tx-filter-toggle i{font-size:16px;}

/* ------------------------------------------------------------------
   Guest pages (login/register): keep footer at the bottom
   ------------------------------------------------------------------ */
html, body { height: 100%; }

body.guest-layout{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.guest-layout > main{
  flex: 1 0 auto;
}

body.guest-layout > footer{
  margin-top: auto !important;
}


/* ============================================================
   МОДУЛЬ СДЕЛКИ (CRM UI v40) - Добавьте это в style.css
   ============================================================ */

/* 1. Стили для KPI внутри карточки "Предмет сделки" */
.kpi-internal-row {
    margin-bottom: 24px;
}

.kpi-box {
    background-color: #f8f9fa; /* Светлый фон */
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    height: 100%;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-box:hover {
    background-color: #f1f3f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.kpi-box .label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.kpi-box .value {
    font-size: 18px; /* Крупный шрифт для цифр */
    font-weight: 800;
    color: #212529;
    white-space: nowrap;
    line-height: 1.2;
}

.kpi-box .sub {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 4px;
    font-weight: 500;
}

/* 2. Общие стили для карточек сделки */
.deal-container {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.deal-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    height: 100%;
    overflow: hidden;
}

.deal-card-header {
    background: #fff;
    padding: 20px 24px 0 24px;
    margin-bottom: 10px;
}

.deal-card-body {
    padding: 10px 24px 24px 24px;
}

.deal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    background: #eef2ff;
    color: #4f46e5;
    flex-shrink: 0;
}

.info-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

/* 3. АДАПТИВНОСТЬ ТАБЛИЦ (Для мобильных) */
/* Этот блок критически важен для вашего 2-го скриншота */

@media (max-width: 768px) {
    /* Скрываем шапку таблицы на мобильных */
    .responsive-schedule-table thead,
    .responsive-transaction-table thead {
        display: none;
    }

    /* Превращаем строки в карточки */
    .responsive-schedule-table tbody tr,
    .responsive-transaction-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    }

    /* Ячейки становятся строками внутри карточки */
    .responsive-schedule-table td,
    .responsive-transaction-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
        border-bottom: 1px dashed #f3f4f6;
        text-align: right;
    }

    .responsive-schedule-table td:last-child,
    .responsive-transaction-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Добавляем заголовки слева через data-label */
    .responsive-schedule-table td[data-label]::before,
    .responsive-transaction-table td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: #6b7280;
        font-size: 11px;
        text-transform: uppercase;
        margin-right: 15px;
        text-align: left;
    }
    
    /* Исправление для полей ввода оплаты на мобильном */
    .pay-input-group {
        width: 100%;
        margin-top: 10px;
        flex-direction: column;
    }
    .pay-buttons-wrapper {
        width: 100%;
        display: flex;
        gap: 5px;
        margin-top: 5px;
    }
    .pay-buttons-wrapper .btn {
        flex: 1;
    }
}


/* ==============================================================
   СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН И КНОПОК (CRM UI v55)
   ============================================================== */

/* --- 1. Кнопка на всю ширину для мобильных устройств --- */
@media (max-width: 767.98px) {
    .btn-mobile-full {
        width: 100% !important;
        display: block !important;
        margin-top: 8px; /* Небольшой отступ сверху */
        
    }
}

/* --- 2. Модальное окно оплаты (Bootstrap Modal) --- */
#payModal .modal-content {
    border-radius: 24px;       /* Сильное скругление углов */
    border: none;              /* Убираем рамку */
    box-shadow: 0 15px 50px rgba(0,0,0,0.15); /* Мягкая тень */
    overflow: hidden;
}

#payModal .modal-header {
    border-bottom: none;       /* Убираем линию под заголовком */
    padding: 24px 24px 10px 24px;
}

#payModal .modal-title {
    font-weight: 800;          /* Очень жирный заголовок */
    font-size: 1.4rem;
}

#payModal .modal-body {
    padding: 10px 24px 30px 24px;
}

/* Поле ввода суммы (Крупное) */
#modal_pay_amount {
    font-size: 2rem;           /* Очень крупные цифры */
    font-weight: 700;
    padding: 15px 20px;
    border-radius: 16px;
    border: 2px solid #f3f4f6;
    margin-bottom: 8px;
    text-align: center;        /* Цифры по центру */
    box-shadow: none;
}

#modal_pay_amount:focus {
    border-color: #0d6efd;     /* Синяя рамка при фокусе */
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* Кнопки внутри модального окна */
#payModal .btn {
    border-radius: 50px;       /* Кнопки-пилюли */
    font-size: 1.1rem;
    padding: 12px 0;
}

#payModal .btn-primary {
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

#payModal .btn-light {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    color: #6b7280;
}


/* --- 3. Стили для уведомлений (SweetAlert2) --- */
/* Чтобы они выглядели так же стильно, как и основное окно */

div:where(.swal2-container) div:where(.swal2-popup) {
    border-radius: 24px !important;
    padding: 2em !important;
}

div:where(.swal2-container) h2:where(.swal2-title) {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
}

div:where(.swal2-container) .swal2-html-container {
    font-size: 1.1rem !important;
    color: #4b5563 !important;
}

div:where(.swal2-container) button:where(.swal2-styled) {
    border-radius: 50px !important;
    padding: 12px 30px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    margin: 0 5px 10px 5px !important;
}

/* Цвет кнопки подтверждения */
div:where(.swal2-container) button:where(.swal2-confirm) {
    background-color: #0d6efd !important;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3) !important;
}

/* Цвет кнопки отмены */
div:where(.swal2-container) button:where(.swal2-cancel) {
    background-color: #f3f4f6 !important;
    color: #4b5563 !important;
}