/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --white: #ffffff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;

    /* Factpay тема (тёмный лендинг) */
    --fact-bg: #0b0f1a;
    --fact-surface: #131829;
    --fact-surface2: #1a2138;
    --fact-accent: #f0a500;
    --fact-accent2: #ff6b35;
    --fact-text: #e8eaf0;
    --fact-text-muted: #7a84a0;
    --fact-border: rgba(255,255,255,0.07);
}

body {
    font-family: 'Arial', 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

/* Тёмная тема Factpay: включается добавлением класса fact-theme к body */
body.fact-theme {
    font-family: 'Onest', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--fact-bg);
    color: var(--fact-text);
    /* Переопределяем базовые переменные проекта под тёмную тему,
       чтобы все страницы (карточки/формы/тексты) стали читаемыми */
    --background-color: var(--fact-bg);
    --white: var(--fact-surface);
    --border-color: var(--fact-border);
    --text-color: var(--fact-text);
    --text-light: var(--fact-text-muted);
    --secondary-color: var(--fact-text-muted);
    --primary-color: var(--fact-accent);
}

body.fact-theme a {
    color: inherit;
}

body.fact-theme a:hover {
    color: var(--fact-accent);
}

body.fact-theme code,
body.fact-theme pre {
    color: var(--fact-text);
}

body.fact-theme .header {
    background-color: rgba(11, 15, 26, 0.95);
    border-bottom-color: var(--fact-border);
    box-shadow: none;
}

body.fact-theme .logo {
    color: var(--fact-text);
}

body.fact-theme .logo-link {
    font-family: 'Unbounded', system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.8px;
}

body.fact-theme .logo-link span {
    color: var(--fact-accent);
}

body.fact-theme .nav-link {
    color: var(--fact-text-muted);
}

body.fact-theme .nav-link:hover,
body.fact-theme .nav-link.active {
    color: var(--fact-text);
}

body.fact-theme .btn-nav-login,
body.fact-theme .btn-nav-register {
    border-radius: 8px;
}

/* Ключевые кадры анимаций */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Шапка */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.8rem;
}

.logo-link {
    color: inherit;
    text-decoration: none;
}

.logo-link:hover {
    color: inherit;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-shrink: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Кабинет аффилиата: верхнее меню — только Главная и Каталог офферов, остальное внизу */
.affiliate-cabinet .header .nav > a {
    display: none !important;
}
.affiliate-top-nav-links {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
}
.affiliate-top-nav-links .nav-link {
    white-space: nowrap;
}
.affiliate-bottom-nav {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.08);
}
.affiliate-nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 2rem;
    align-items: center;
}
.affiliate-nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.affiliate-nav-links a:hover {
    color: var(--primary-color);
}

/* Блоки навигации: гости (Войти, Регистрация) / авторизованные (блок пользователя + дропдаун) */
.nav-auth {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.nav-auth-guest .nav-link:first-of-type { margin-right: 0.25rem; }
/* Кнопки в шапке для гостя: Войти — вторичная (контур), Регистрация — основная */
.nav-auth-guest .nav-link.btn-nav-login {
    padding: 0.4rem 0.9rem;
    border-radius: 0.375rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
}
.nav-auth-guest .nav-link.btn-nav-login:hover { background: rgba(37, 99, 235, 0.08); color: var(--primary-color); }
.nav-auth-guest .nav-link.btn-nav-register {
    padding: 0.4rem 0.9rem;
    border-radius: 0.375rem;
    border: 2px solid var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}
.nav-auth-guest .nav-link.btn-nav-register:hover { background: #1e40af; color: var(--white); }
.nav-greeting { font-size: 0.9rem; color: var(--text-light); margin-right: 0.25rem; }
.nav-greeting .nav-user-name { font-weight: 600; color: var(--text-color); }
.nav-logout-btn { cursor: pointer; }

/* Блок пользователя в хедере (бейдж, имя, аватар, chevron) */
.nav-auth-user { position: relative; }
.user-block {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background: var(--white);
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}
.user-block:hover { border-color: var(--primary-color); background: rgba(37, 99, 235, 0.04); }
.user-block:focus { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.nav-role-badge { font-size: 0.75rem; }
.nav-user-short {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-avatar { font-size: 1.25rem; color: var(--text-light); }
.user-chevron { font-size: 0.7rem; color: var(--text-light); transition: transform 0.2s; }
.user-block[aria-expanded="true"] .user-chevron { transform: rotate(180deg); }

/* Дропдаун пользователя */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
}
.user-dropdown.is-open { display: block; }
.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    min-height: 44px;
    box-sizing: border-box;
}
.user-dropdown-item:hover { background: var(--background-color); }
.user-dropdown-divider { height: 1px; background: var(--border-color); margin: 0.25rem 0; }
.user-dropdown-logout { color: #b91c1c; font-weight: 500; }
.user-dropdown-logout:hover { background: rgba(185, 28, 28, 0.08); }
/* Ссылка «Админка» видна только пользователю с ролью admin (скрипт добавляет класс на body) */
#navAdminLink { display: none !important; }
body.role-admin #navAdminLink { display: block !important; }

/* Колокольчик уведомлений в шапке */
.notifications-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
}
.notifications-bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.notifications-bell:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.04);
    color: var(--primary-color);
}
.notifications-bell .fa-bell { font-size: 1rem; }
.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.1rem;
    text-align: center;
    color: var(--white);
    background: #dc2626;
    border-radius: 10px;
    box-sizing: border-box;
}
.notifications-badge.empty { display: none; }
.notifications-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    width: 320px;
    max-height: 360px;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    z-index: 1000;
    flex-direction: column;
}
.notifications-dropdown.is-open { display: flex; }
.notifications-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95rem;
}
.notifications-dropdown-body {
    overflow-y: auto;
    max-height: 280px;
}
.notifications-dropdown-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.notifications-dropdown-footer .btn-link {
    font-size: 0.875rem;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
}
.notifications-dropdown-footer .btn-link:hover { text-decoration: underline; }
.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.15s;
}
.notification-item:hover { background: var(--background-color); }
.notification-item:last-child { border-bottom: none; }
.notification-item.unread { background: rgba(37, 99, 235, 0.04); }
.notification-item .notification-title { font-weight: 500; font-size: 0.9rem; margin-bottom: 0.2rem; }
.notification-item .notification-body { font-size: 0.8rem; color: var(--text-light); }
.notification-item .notification-time { font-size: 0.75rem; color: var(--text-light); margin-top: 0.25rem; }
.notifications-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text-light); font-size: 0.9rem; }

/* Заглушки для гостей: каталог и оффер недоступны */
.offers-guest-stub,
.offer-guest-stub {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
}
.guest-stub-card {
    text-align: center;
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
}
.guest-stub-card .guest-stub-icon {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}
.guest-stub-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}
.guest-stub-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.guest-stub-card .btn { min-width: 200px; }

.user-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.balance {
    color: var(--primary-color);
    font-weight: bold;
}

/* Главный баннер */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hero-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}
.hero-shape-1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -80px;
    animation: float 8s ease-in-out infinite;
}
.hero-shape-2 {
    width: 180px;
    height: 180px;
    bottom: -40px;
    left: 10%;
    animation: float 6s ease-in-out infinite 1s;
}
.hero-shape-3 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 5%;
    animation: float 7s ease-in-out infinite 0.5s;
}

.hero-animate {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}
.hero-animate-delay-1 { animation-delay: 0.15s; }
.hero-animate-delay-2 { animation-delay: 0.35s; }

.hero-content { position: relative; z-index: 1; }

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}
.hero-buttons .btn-cta {
    transition: transform 0.3s, box-shadow 0.3s, filter 0.3s;
}
.hero-buttons .btn-cta:hover {
    animation: iconBounce 0.5s ease;
}

/* Кнопки */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

/* Крупные CTA в hero — больше и привлекательнее */
.btn-cta {
    font-size: 1.15rem;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-cta-primary {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid rgba(255,255,255,0.8);
}

.btn-cta-primary:hover {
    background: rgba(255,255,255,0.95);
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.btn-cta-accent {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
    border: none;
}

.btn-cta-accent:hover {
    filter: brightness(1.08);
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(245, 158, 11, 0.4);
}

.btn-cta-supplier {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
}

.btn-cta-supplier:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(16, 185, 129, 0.4);
}

.btn-cta.btn-cta-primary,
.btn-cta.btn-cta-accent,
.btn-cta.btn-cta-supplier {
    min-width: 200px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-outline {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-outline:hover {
    background-color: rgba(37, 99, 235, 0.06);
    color: var(--primary-color);
}

.btn-accent {
    background: linear-gradient(135deg, #f97316, #facc15);
    color: #111827;
    border: none;
}

.btn-accent:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Преимущества */
.categories {
    padding: 3rem 0;
    background-color: var(--white);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background-color: var(--background-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
}
.category-card.animated {
    opacity: 1;
    transform: translateY(0);
}
.category-card.animated { transition-delay: calc(0.05s * var(--i, 0)); }
.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}
.category-card:hover .category-icon {
    transform: scale(1.1);
}
.category-icon {
    transition: transform 0.35s ease;
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.category-icon.food { background: linear-gradient(135deg, #22c55e, #4ade80); }
.category-icon.construction { background: linear-gradient(135deg, #f97316, #fb923c); }
.category-icon.auto { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.category-icon.other { background: linear-gradient(135deg, #6366f1, #a855f7); }
.category-icon.equipment { background: linear-gradient(135deg, #64748b, #94a3b8); }
.category-icon.chemistry { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.category-icon.textile { background: linear-gradient(135deg, #ec4899, #f472b6); }
.category-icon.packaging { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.category-icon.electronics { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.category-icon.furniture { background: linear-gradient(135deg, #b45309, #d97706); }

.category-card h3 {
    font-size: 1.05rem;
}

.category-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.features {
    padding: 4rem 0;
    background-color: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 0.5rem;
    background-color: var(--background-color);
    transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(24px);
}
.feature-card.animated {
    opacity: 1;
    transform: translateY(0);
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.15);
}
.feature-card:hover .feature-icon {
    transform: scale(1.1);
    color: #1d4ed8;
}
.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: transform 0.35s ease, color 0.3s ease;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Инфографика: цифры платформы */
.infographic-section {
    padding: 3.5rem 0;
    background: linear-gradient(180deg, var(--white) 0%, #f1f5f9 100%);
}
.infographic-title {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}
.infographic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}
.infographic-item {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 1rem;
    background: var(--white);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
}
.infographic-item.animated {
    opacity: 1;
    transform: translateY(0);
}
.infographic-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}
.infographic-icon-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.infographic-icon-wrap i {
    font-size: 1.75rem;
    color: var(--primary-color);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}
.infographic-item:hover .infographic-icon-wrap i {
    transform: scale(1.15);
}
.infographic-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.2);
    animation: pulse-ring 2s ease-out infinite;
}
.infographic-number {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}
.infographic-suffix {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}
.infographic-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.35rem;
}

/* Поиск */
.search-section {
    padding: 3rem 0;
    background-color: var(--background-color);
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
}

.search-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.search-box-inline {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Футер */
.footer {
    background-color: var(--text-color);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    font-size: 1.5rem;
    color: var(--white);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.social-link:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* Страница входа/регистрации */
.auth-section {
    padding: 4rem 0;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.auth-container {
    width: 100%;
    max-width: 520px;
    min-width: 480px;
    margin: 0 auto;
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

@media (max-width: 520px) {
    .auth-container { min-width: 0; }
}

/* Темная тема Factpay для форм */
body.fact-theme .auth-section {
    background-color: transparent;
}

body.fact-theme .auth-container {
    background-color: var(--fact-surface);
    border: 1px solid var(--fact-border);
    box-shadow: 0 18px 45px rgba(0,0,0,0.5);
}

body.fact-theme .auth-form h2 {
    color: var(--fact-text);
}

body.fact-theme .auth-form label,
body.fact-theme .role-label {
    color: rgba(232, 234, 240, 0.78);
}

body.fact-theme .auth-form input,
body.fact-theme .auth-form select,
body.fact-theme .auth-form textarea {
    background-color: rgba(26, 33, 56, 0.92);
    border-color: rgba(255,255,255,0.12);
    color: rgba(232, 234, 240, 0.98);
}

body.fact-theme .auth-form input::placeholder,
body.fact-theme .auth-form textarea::placeholder {
    color: rgba(122, 132, 160, 0.9);
}

body.fact-theme .auth-form input:focus,
body.fact-theme .auth-form select:focus,
body.fact-theme .auth-form textarea:focus {
    outline: none;
    border-color: rgba(240, 165, 0, 0.65);
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.18);
}

body.fact-theme .role-btn {
    background-color: rgba(26, 33, 56, 0.7);
    border-color: rgba(255,255,255,0.12);
}

body.fact-theme .role-btn .role-title {
    color: rgba(232, 234, 240, 0.95);
}

body.fact-theme .role-btn .role-desc {
    color: rgba(122, 132, 160, 0.95);
}

body.fact-theme .role-btn.active {
    border-color: var(--fact-accent);
    background-color: rgba(240, 165, 0, 0.12);
    box-shadow: 0 0 0 1px rgba(240, 165, 0, 0.35), 0 10px 25px rgba(0,0,0,0.35);
}

body.fact-theme .auth-tabs {
    border-bottom-color: var(--fact-border);
}

body.fact-theme .auth-tab {
    color: var(--fact-text-muted);
}

body.fact-theme .auth-tab.active {
    color: var(--fact-accent);
    border-bottom-color: var(--fact-accent);
}

body.fact-theme .auth-divider {
    color: var(--fact-text-muted);
}

body.fact-theme .auth-divider::before,
body.fact-theme .auth-divider::after {
    background: var(--fact-border);
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.auth-form {
    display: none;
    padding: 2rem;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.role-buttons {
    margin-bottom: 1.5rem;
}

.role-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.role-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.role-btn {
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.role-btn .role-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.role-btn .role-desc {
    font-size: 0.8rem;
    color: var(--text-light);
}

.role-btn.active {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.role-select-hidden {
    display: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.auth-forgot-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-color, #2563eb);
    text-decoration: none;
}
.auth-forgot-link:hover {
    text-decoration: underline;
}

.auth-description {
    color: var(--text-muted, #64748b);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.auth-message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}
.auth-message.success {
    background: #ecfdf5;
    color: #065f46;
}
.auth-message.error {
    background: #fef2f2;
    color: #991b1b;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider span {
    background-color: var(--white);
    padding: 0 1rem;
    position: relative;
    color: var(--text-light);
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-social {
    width: 100%;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-social:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Дашборд */
.dashboard-page {
    background-color: var(--background-color);
}

.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 250px;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--background-color);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.sidebar-link i {
    width: 20px;
}

.dashboard-main {
    flex: 1;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
}

.dashboard-header-desc {
    margin-top: 0.35rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.dashboard-header-desc a {
    color: var(--primary-color);
}

.offer-status {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}
.offer-status.status-active { background: #d1fae5; color: #065f46; }
.offer-status.status-draft { background: #fef3c7; color: #92400e; }
.offer-status:not(.status-active):not(.status-draft) { background: #e2e8f0; color: #475569; }

/* Страница профиля пользователя */
.profile-page { background: #f8fafc; min-height: 100vh; }
.profile-main { padding: 2rem 1rem 3rem; }
.profile-page-title { font-size: 1.75rem; margin-bottom: 1.5rem; color: var(--text-color); }
.profile-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
}
.profile-card {
    background: var(--white);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.profile-card-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 1rem; color: var(--text-color); }
.profile-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.profile-card-head .profile-card-title { margin-bottom: 0; }
.profile-user-id { font-size: 0.85rem; color: var(--text-light); background: #f1f5f9; padding: 0.25rem 0.5rem; border-radius: 0.25rem; }
.profile-card-personal { display: flex; gap: 1.25rem; align-items: flex-start; }
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    display: flex; align-items: center; justify-content: center;
    color: #b91c1c; font-size: 2rem; flex-shrink: 0;
}
.profile-personal-fields { flex: 1; min-width: 0; }
.profile-field { margin-bottom: 0.75rem; }
.profile-field-label { display: block; font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.2rem; }
.profile-field-value { font-weight: 500; color: var(--text-color); }
.profile-link { display: inline-block; margin-top: 0.5rem; color: var(--primary-color); text-decoration: underline; font-size: 0.9rem; }
.profile-link:hover { color: #1e40af; }
.profile-link-inline { margin-top: 0.25rem; margin-left: 0.5rem; }
.profile-link-danger { color: #dc2626; margin-top: 1rem; }
.profile-link-danger:hover { color: #b91c1c; }
.profile-account-fields .profile-field { margin-bottom: 1rem; }
.profile-notifications { display: flex; flex-direction: column; gap: 1rem; }
.profile-notify-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.profile-notify-label { font-size: 0.95rem; color: var(--text-color); }
.profile-toggle { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.profile-toggle-input { opacity: 0; width: 0; height: 0; }
.profile-toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1; border-radius: 26px; transition: 0.3s;
}
.profile-toggle-slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px;
    background: var(--white); border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.profile-toggle-input:checked + .profile-toggle-slider { background: var(--primary-color); }
.profile-toggle-input:checked + .profile-toggle-slider:before { transform: translateX(22px); }
.profile-modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); align-items: center; justify-content: center; padding: 1rem; }
.profile-modal.active { display: flex; }
.profile-modal-content { background: var(--white); padding: 1.5rem; border-radius: 0.5rem; max-width: 400px; width: 100%; }
.profile-modal-content h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.profile-modal-content .form-group { margin-bottom: 1rem; }
.profile-modal-content .form-group label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--text-color); }
.profile-modal-content .form-control { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #e2e8f0; border-radius: 0.375rem; font-size: 1rem; }
.profile-modal-content .btn { margin-right: 0.5rem; margin-top: 0.25rem; }

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Графики */
.chart-section,
.charts-grid {
    margin-bottom: 2rem;
}

.chart-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.75rem;
}

/* Выбор типа кабинета (dashboard.html) */
.dashboard-choose-role {
    padding: 4rem 0 6rem;
    min-height: 60vh;
}
.role-choice-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.role-choice-card h1 {
    text-align: center;
    margin-bottom: 0.5rem;
}
.role-choice-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}
.role-choice-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.role-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}
.role-choice-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}
.role-choice-btn i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.role-choice-title {
    font-weight: 600;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}
.role-choice-text {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Блоки в кабинетах */
.dashboard-block {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.dashboard-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.dashboard-block-header h2 { margin: 0; }
.dashboard-block-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.dashboard-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-light);
}
.dashboard-empty-state i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
    display: block;
}
.dashboard-empty-state p {
    margin-bottom: 1.25rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.dashboard-empty-state .btn {
    margin-top: 0.5rem;
}
/* Пустое состояние на странице подключений */
#connectionsContent .dashboard-empty-state {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    border: 1px dashed var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
#connectionsContent .dashboard-empty-state i {
    color: #cbd5e1;
}
#connectionsContent .dashboard-empty-state p {
    color: var(--text-light);
    font-size: 1rem;
}

/* ——— Мои подключения (аффилиат) ——— */
.connections-header-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.connections-header-wrap .connections-title-block {
    flex: 1;
    min-width: 0;
}
.connections-header-wrap h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.35rem 0;
}
.connections-header-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}
.connections-header-wrap .btn {
    flex-shrink: 0;
}

.connections-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 1rem 0;
}
.connections-cards {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.connection-card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.connection-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.connection-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.connection-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
    min-width: 0;
}
.connection-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
.connection-status-badge i {
    font-size: 0.7rem;
}
.connection-card-payout {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}
.connection-meta {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.connection-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.connection-meta-label {
    font-size: 0.85rem;
    color: var(--text-light);
    min-width: 140px;
}
.connection-meta-value {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-family: ui-monospace, monospace;
    color: var(--text-color);
    word-break: break-all;
}
.connection-meta-value a {
    color: var(--primary-color);
    text-decoration: none;
}
.connection-meta-value a:hover {
    text-decoration: underline;
}
.connection-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--secondary-color);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.connection-copy-btn:hover {
    background: var(--background-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.postback-card {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid var(--border-color);
}
.postback-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.75rem 0;
}
.postback-card > p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}
.postback-url-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.postback-url-row code {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    background: var(--background-color);
    border-radius: 0.375rem;
    color: var(--text-color);
    word-break: break-all;
}
.postback-code-wrap {
    position: relative;
    margin: 1rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid #334155;
}
.postback-code-wrap pre {
    margin: 0;
    padding: 1.25rem 1.5rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
    overflow-x: auto;
}
.postback-code-wrap .postback-copy-code {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.postback-code-wrap .postback-copy-code:hover {
    background: rgba(255,255,255,0.2);
    color: #f1f5f9;
}
.postback-card .postback-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0.75rem 0 0 0;
    line-height: 1.5;
}
.postback-card .postback-hint code {
    font-size: 0.85em;
    padding: 0.15rem 0.35rem;
    background: var(--background-color);
    border-radius: 0.25rem;
    color: var(--text-color);
}

.toast-copy {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.65rem 1.25rem;
    border-radius: 0.5rem;
    background: #1e293b;
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 9999;
    pointer-events: none;
}
.toast-copy.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Бейдж роли в шапке */
.user-role-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}
.user-role-badge.supplier {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.user-role-badge.affiliate {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
}

.user-profile-email {
    font-size: 0.9rem;
    color: var(--text-light);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-logout:hover {
    color: var(--text-color);
    border-color: var(--text-light);
    background: rgba(0, 0, 0, 0.04);
}

.chart-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.chart-card h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* Создание оффера — wizard */
.create-offer-header {
    margin-bottom: 1.5rem;
}

.create-offer-header h1 {
    margin-bottom: 0.25rem;
}

.create-offer-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
}

.required-mark {
    color: var(--error-color);
}

.wizard-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.wizard-step:hover {
    border-color: var(--primary-color);
}

.wizard-step.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.wizard-step.done {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
}

.wizard-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.wizard-step.active .wizard-step-num,
.wizard-step.done .wizard-step-num {
    background: var(--primary-color);
    color: var(--white);
}

.wizard-step.done .wizard-step-num {
    background: var(--success-color);
}

.wizard-step-label {
    font-size: 0.9rem;
}

.create-offer-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
}

.wizard-panel h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}

.offer-rates-fields { margin-bottom: 0.5rem; }
.offer-rate-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.offer-rate-row input { padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: 0.35rem; }

/* Блоки «Трафик и правила» — карточки и чекбоксы */
.traffic-block {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.traffic-block:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.traffic-block-agreement { border-left: 4px solid #2563eb; }
.traffic-block-forbidden { border-left: 4px solid #dc2626; }
.traffic-block-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.traffic-block-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    flex-shrink: 0;
    font-size: 1.25rem;
}
.traffic-block-agreement .traffic-block-icon { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.traffic-block-forbidden .traffic-block-icon { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.traffic-block-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.25rem 0;
}
.traffic-block-hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}
.offer-traffic-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem 1.25rem;
}
.traffic-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: normal;
    cursor: pointer;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
    min-height: 2.5rem;
}
.traffic-checkbox-item:hover { background: var(--background-color); }
.traffic-checkbox-item input[type="checkbox"] {
    margin: 0;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}
.traffic-checkbox-item span { line-height: 1.3; }
.traffic-block-forbidden .traffic-checkbox-item input[type="checkbox"] { accent-color: #dc2626; }
.traffic-extra-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 640px) {
    .traffic-extra-fields { grid-template-columns: 1fr; }
}
.traffic-extra-fields .form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.traffic-extra-fields .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.traffic-extra-icon { margin-right: 0.35rem; color: var(--text-light); font-size: 0.9rem; }
.traffic-extra-fields label { display: block; margin-bottom: 0.35rem; font-weight: 500; }

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.wizard-actions-right {
    display: flex;
    gap: 0.75rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Офферы */
.offers-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.offers-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.filters-section {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.filter-select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    width: 100%;
}

.offers-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Каталог офферов: карточка как в макете — иконка слева, контент справа, категория-пилюля */
.offer-card {
    background-color: var(--white);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.offer-card.animate-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: transform 0.35s ease, box-shadow 0.35s ease, opacity 0.5s ease;
    transition-delay: calc(0.05s * var(--i, 0));
}
.offer-card.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}
.offer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.offer-card:hover .offer-card__icon {
    transform: scale(1.03);
}

.offer-card__icon {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 0.5rem;
    background-color: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: transform 0.25s ease;
}

.offer-card__body {
    flex: 1;
    min-width: 0;
    position: relative;
    padding-top: 0.15rem;
}

.offer-card__category {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.offer-card__title {
    font-size: 1.1rem;
    margin: 0 0 0.4rem 0;
    padding-right: 6rem;
    line-height: 1.35;
}

.offer-card__desc {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.offer-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.offer-card__cpa {
    color: var(--primary-color);
    font-weight: 600;
}

.offer-card__geo,
.offer-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.offer-card__rating i {
    color: #f59e0b;
}

.offer-card__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Сетка каталога: одна колонка для полноширинных карточек */
.offers-list.offers-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Старые классы для совместимости (dashboard и др.) */
.offer-image {
    width: 120px;
    height: 120px;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
    flex-shrink: 0;
}
.offer-content { flex: 1; }
.offer-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 1rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.offer-content h3 { margin-bottom: 0.5rem; }
.offer-meta {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}
.offer-actions { display: flex; gap: 1rem; margin-top: 1rem; }

.offer-card-mini {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.offer-cpa {
    color: var(--primary-color);
    font-weight: bold;
    margin: 0.5rem 0;
}

/* Таблицы */
.table-section {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

.data-table th {
    background-color: var(--background-color);
    font-weight: 600;
    color: var(--text-color);
}

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

.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

/* Выплаты */
.balance-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.balance-card {
    text-align: center;
    margin-bottom: 2rem;
}

.balance-amount {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.balance-note {
    color: var(--text-light);
}

.balance-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.payment-methods {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.method-card {
    text-align: center;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.method-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.method-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.transactions-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Поддержка */
.faq-search {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 0.5rem;
}

.faq-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.faq-question {
    padding: 1rem;
    background-color: var(--background-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.faq-question:hover {
    background-color: var(--border-color);
}

.faq-question i {
    transition: transform 0.3s;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s, padding 0.3s;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 1rem;
}

.faq-answer p,
.faq-answer ol,
.faq-answer ul {
    margin-bottom: 0.5rem;
}

/* Контакты (страница без сайдбара) */
.contacts-page { padding: 2rem 0 3rem; }
.contacts-page .container { max-width: 900px; }
.contacts-page-title { font-size: 2rem; margin-bottom: 1.5rem; color: var(--text-color); }

/* Поддержка (страница без сайдбара, как контакты) */
.support-page { padding: 2rem 0 3rem; }
.support-page .container { max-width: 900px; }
.support-page-title { font-size: 2rem; margin-bottom: 1.5rem; color: var(--text-color); }
.support-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.support-section-title { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-color); }
.support-section-desc { margin-bottom: 1.25rem; color: var(--text-light); }
.support-section-desc a { color: var(--primary-color); text-decoration: none; }
.support-section-desc a:hover { text-decoration: underline; }
.support-section .faq-search { margin-bottom: 1.25rem; background-color: var(--background-color); box-shadow: none; }
.support-section .faq-section { margin-bottom: 0; background-color: transparent; box-shadow: none; padding: 0; }

.contacts-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.support-section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5rem 0;
}

.faq-block {
    margin-top: 0.5rem;
}

.faq-block-title {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
}

.contacts-section h2 {
    margin-bottom: 1.5rem;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-card {
    padding: 1.25rem;
    background-color: var(--background-color);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.contact-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.contact-card p {
    margin-bottom: 0.25rem;
}

.contact-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-card a:hover {
    text-decoration: underline;
}

.contact-note {
    font-size: 0.85rem;
    color: var(--text-light);
}

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

.contacts-address h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.contacts-address p {
    margin-bottom: 0.25rem;
}

.contacts-address .fa-map-marker-alt {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.contact-form-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.contact-form {
    max-width: 600px;
}

/* Чат-бот */
.chatbot-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: transform 0.3s;
}

.chatbot-button:hover {
    transform: scale(1.1);
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 2rem;
    width: 400px;
    height: 500px;
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.chatbot-window.active {
    display: flex;
}

.chatbot-header {
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 0.5rem 0.5rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.chatbot-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.chatbot-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    max-width: 80%;
}

.chatbot-message.bot {
    background-color: var(--background-color);
    align-self: flex-start;
}

.chatbot-message.user {
    background-color: var(--primary-color);
    color: var(--white);
    align-self: flex-end;
    margin-left: auto;
}

.chatbot-input {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chatbot-input input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
}

.chatbot-input button {
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* Новости */
.news-section,
.top-offers-section {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.news-item {
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: 0.5rem;
}

.news-date {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.news-item h3 {
    margin-bottom: 0.5rem;
}

/* Демо-страница */
.demo-hero {
    margin: 2rem 0 1rem;
}

.demo-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.demo-hero p {
    color: var(--text-light);
}

.demo-cases {
    margin: 2rem 0;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.demo-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.demo-card h3 {
    margin-bottom: 0.5rem;
}

.demo-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.demo-card ul {
    padding-left: 1.1rem;
    font-size: 0.95rem;
}

.demo-video-section {
    margin: 2rem 0;
}

.demo-video-placeholder {
    margin-top: 1rem;
    border-radius: 0.75rem;
    border: 2px dashed var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.demo-video-placeholder i {
    font-size: 2rem;
    color: var(--primary-color);
}

.demo-cta {
    margin: 2rem 0 3rem;
    text-align: center;
}

.demo-cta h2 {
    margin-bottom: 0.5rem;
}

.demo-cta p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        transition: left 0.3s;
        z-index: 200;
    }

    .sidebar.active {
        left: 0;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-window {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .offer-card {
        flex-direction: column;
    }

    .offer-card__icon {
        width: 100%;
        min-width: 100%;
        height: 80px;
        font-size: 2rem;
    }

    .offer-card__category {
        position: static;
        margin-bottom: 0.5rem;
    }

    .offer-card__title {
        padding-right: 0;
    }

    .offer-image {
        width: 100%;
        height: 200px;
    }
}

/* Страница «О компании» */
.about-page {
    padding: 2rem 0 4rem;
}

.about-hero {
    margin-bottom: 3rem;
}

.about-hero h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.about-lead {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 720px;
}

.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.about-section p {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.about-list {
    list-style: none;
    padding-left: 0;
}

.about-list li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.about-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.about-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.about-value-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.about-value-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.about-value-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.about-value-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0;
}

.about-cta {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

.about-cta p {
    margin-bottom: 1.5rem;
}

.about-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Страница детального просмотра оффера */
.offer-detail-page .dashboard-layout { display: none; }
.offer-detail-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 20px 4rem;
    align-items: start;
}
.offer-sidebar {
    background: var(--white);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 5rem;
}
.offer-sidebar-logo {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}
.offer-sidebar-logo.offer-logo-mts { background: #e30611; }
.offer-sidebar-url {
    font-size: 0.8rem;
    color: var(--text-light);
    word-break: break-all;
    margin-bottom: 0.5rem;
}
.offer-sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}
.offer-sidebar-category {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 1rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}
.offer-sidebar-cta { margin-bottom: 1.5rem; }
.offer-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}
.offer-sidebar-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}
.offer-sidebar-link:hover { text-decoration: underline; }
.offer-sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.offer-copy-inn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
}
.offer-copy-inn:hover { color: var(--primary-color); }

.offer-detail-main { min-width: 0; }
.offer-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.offer-kpi-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.offer-kpi-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.35rem;
}
.offer-kpi-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

.offer-collapse-section {
    background: var(--white);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.offer-collapse-head {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
}
.offer-collapse-head:hover { background: #e2e8f0; }
.offer-collapse-head i {
    color: var(--text-light);
    transition: transform 0.2s;
}
.offer-collapse-section.active .offer-collapse-head { background: #e2e8f0; }
.offer-collapse-body {
    display: none;
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}
.offer-collapse-section.active .offer-collapse-body { display: block; }
.offer-section-content {
    line-height: 1.7;
    color: var(--text-color);
}
.offer-section-content ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.offer-section-content li { margin-bottom: 0.25rem; }

.offer-rates-table-wrap,
.offer-conditions-table-wrap { overflow-x: auto; }
.offer-rates-table,
.offer-conditions-table {
    width: 100%;
    border-collapse: collapse;
}
.offer-rates-table tr,
.offer-conditions-table tr {
    border-bottom: 1px solid var(--border-color);
}
.offer-rates-table td,
.offer-conditions-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: top;
}
.offer-rates-table .offer-table-value,
.offer-conditions-table .offer-table-value {
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.offer-traffic-section { padding: 0.25rem 0; }
.offer-traffic-subtitle {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-color);
}
.offer-traffic-subtitle:first-child { margin-top: 0; }
.offer-traffic-icon { margin-right: 0.35rem; }
.offer-traffic-icon.agreement { color: #7c3aed; }
.offer-traffic-icon.forbidden { color: var(--error-color); }
.offer-traffic-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.35rem 1.5rem;
    padding-left: 1.25rem;
    margin: 0 0 0.5rem;
    color: var(--text-color);
}
@media (max-width: 900px) {
    .offer-detail-layout { grid-template-columns: 1fr; }
    .offer-sidebar { position: static; }
}

/* Модальное окно «Выбор региона» */
.region-picker-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}
.region-picker-overlay.region-picker-open {
    display: flex;
}
.region-picker-modal {
    background: var(--white);
    border-radius: 0.5rem;
    max-width: 520px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.region-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.region-picker-header h2 {
    margin: 0;
    font-size: 1.25rem;
}
.region-picker-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0 0.25rem;
}
.region-picker-close:hover {
    color: var(--text-color);
}
.region-picker-search-wrap {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.region-picker-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}
.region-picker-tree-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    min-height: 280px;
}
.region-picker-tree {
    padding: 0 1rem;
}
.region-picker-row {
    display: flex;
    align-items: center;
    padding: 0.35rem 0;
    gap: 0.35rem;
}
.region-picker-expand,
.region-picker-expand-placeholder {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.region-picker-expand {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
}
.region-picker-expand::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 5px solid var(--text-light);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    position: absolute;
    left: 4px;
    top: 50%;
    margin-top: -4px;
    transition: transform 0.15s;
}
.region-picker-expand.expanded::before {
    transform: rotate(90deg);
}
.region-picker-expand-placeholder {
    display: inline-block;
}
.region-picker-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    flex: 1;
}
.region-picker-cb {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}
.region-picker-name {
    flex: 1;
}
.region-picker-count {
    color: var(--primary-color);
    font-weight: 500;
}
.region-picker-children {
    display: none;
}
.region-picker-children.region-picker-children-open {
    display: block;
}
.region-picker-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}
.region-picker-empty {
    padding: 1.5rem;
    color: var(--text-light);
    text-align: center;
    margin: 0;
}
.region-picker-empty code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--background-color);
    border-radius: 0.25rem;
    font-size: 0.85em;
    color: var(--text-color);
    word-break: break-all;
}