/*
 * ПСПН - Партнёрская Сеть Продаж и Наград
 * 
 * FAVICON FILES (не удалять!):
 * - /assets/images/favicon.png - основной (192x192, закруглённые углы)
 * - /assets/images/favicon-large.png - большой (331x331, закруглённые углы)
 * 
 * Источник: загружен пользователем 11.04.2026
 * Обработка: добавлены закруглённые углы (20% радиус)
 */

/**
 * ПСПН - Основные стили
 * Версия 2.0.6 - Тёмная тема с улучшениями
 */

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

:root {
    --primary: #0066CC;
    --primary-dark: #004C99;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;

    --bg-main: #1a1a2e;
    --bg-card: #16213e;
    --bg-dark: #0f0f1a;

    --text-main: #e0e0e0;
    --text-muted: #888;

    --border-color: #2a2a4a;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --radius: 8px;

    --header-height: 70px;
    --nav-height: 70px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-main);
    background: var(--bg-main);
}

a {
    color: #4da6ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === HEADER === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--primary);
    color: #fff;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}


/* Логотип в header без промежутков */
.logo-icon-wrapper {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.8);
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.65rem;
    opacity: 0.95;
    line-height: 1.2;
    white-space: normal;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-role {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    text-transform: capitalize;
}

/* Кнопка выхода в шапке */
.logout-form {
    display: inline-flex;
    align-items: center;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

.user-avatar img,
.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* === MAIN CONTENT === */
.main-content {
    min-height: 100%;
    padding: 16px;
    padding-top: calc(var(--header-height) + 16px);
    padding-bottom: calc(var(--nav-height) + 32px);
    max-width: 600px;
    margin: 0 auto;
}

.main-content.auth-page {
    padding-top: 0;
    padding-bottom: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
}

/* === БЛОК ПРИВЕТСТВИЯ ДАШБОРД === */
.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
    color: #fff;
    text-align: center;
    box-shadow: var(--shadow);
}

.welcome-header {
    margin-bottom: 8px;
}

/* Логотип без промежутков */
.welcome-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    display: block;
}

.welcome-logo img,
.welcome-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.8);
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.1;
}

.welcome-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1.2;
}

/* Подсветка текста приветствия */
.welcome-text {
    font-size: 1rem;
    margin-bottom: 2px;
    line-height: 1.3;
    text-shadow: 
        0 0 10px rgba(255,255,255,0.3),
        0 0 20px rgba(200,150,255,0.2);
}

.welcome-role {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.2;
    margin-bottom: 0;
}

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    z-index: 100;
    overflow-x: auto;
    padding: 0 4px;
    gap: 2px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 8px;
    color: #fff;
    text-decoration: none;
    min-width: 48px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.nav-item:hover {
    color: #fff;
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.nav-label {
    font-size: 0.7rem;
    margin-top: 2px;
    white-space: nowrap;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 12px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: #fff;
}

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

.card-body {
    padding: 16px;
}

/* === FORMS === */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-dark);
    color: var(--text-main);
    transition: border-color 0.2s;
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

/* === CUSTOM DROPDOWN === */
.custom-dropdown {
    position: relative;
    width: 100%;
    font-size: 1rem;
}

.custom-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s;
}

.custom-dropdown-header:hover {
    border-color: var(--primary);
}

.custom-dropdown.open .custom-dropdown-header {
    border-color: var(--primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-dropdown-arrow {
    font-size: 0.7rem;
    color: var(--primary);
    transition: transform 0.2s;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
    border: 1px solid var(--primary);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.custom-dropdown-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 10px;
}

.custom-dropdown-option:hover {
    background: rgba(0,102,204,0.15);
}

.custom-dropdown-option.selected {
    background: var(--primary);
    color: #fff;
}

.custom-dropdown-option.selected:hover {
    background: var(--primary-dark);
}

.dropdown-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #fff;
    color: var(--primary);
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.dropdown-text {
    flex: 1;
}

/* === EDIT PROJECT BTN === */
.edit-project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.edit-project-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.edit-project-btn.save {
    background: #28a745;
    border-color: #28a745;
}

.edit-project-btn.save:hover {
    background: #218838;
    border-color: #218838;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    margin-bottom: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #2a2a4a;
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

/* === AUTH PAGES === */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 24px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

/* Заголовок ПСПН на странице входа */
.auth-logo h1 {
    font-size: 2rem;
    color: #fff;
    text-shadow:
        0 0 10px rgba(255,255,255,0.3),
        0 0 20px rgba(255,255,255,0.2),
        0 0 30px rgba(255,255,255,0.1);
    -webkit-text-stroke: 1px rgba(255,255,255,0.5);
    text-stroke: 1px rgba(255,255,255,0.5);
}

.auth-logo p {
    color: var(--text-muted);
    margin-top: 8px;
}

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

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
}

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

.auth-links {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
}

/* === AUTH TAGLINE (Promo blocks) === */
.auth-tagline {
    background: #072140;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
}

/* === STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === TABLES === */
.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    background: var(--bg-dark);
    font-weight: 600;
    font-size: 0.875rem;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-admin { background: #dc3545; color: white; }
.badge-owner { background: #6f42c1; color: white; }
.badge-leader { background: #fd7e14; color: white; }
.badge-seller { background: #28a745; color: white; }
.badge-buyer { background: #17a2b8; color: white; }

/* === ALERTS === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--danger);
    color: #ff6b6b;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid var(--success);
    color: #6bff6b;
}

/* === UTILITIES === */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }

/* === AUTH PAGE EXTRA STYLES === */

/* Разделительная линия */
.divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.3);
    margin: 16px 0;
}

/* Контейнер для логотипа кулон (основной) */
.auth-logo-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.auth-logo-main img {
    width: 100%;
    height: auto;
    max-width: 300px;
    border-radius: 16px;
}

/* Контейнер для логотипа QR (вторичный) */
.auth-logo-secondary {
    margin-top: 32px;
    padding-top: 0;
}

.auth-logo-secondary .logo-wrapper {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.auth-logo-secondary .logo-wrapper img {
    max-width: 160px;
    max-height: 160px;
    width: auto;
    height: auto;
    border-radius: 16px;
    border: 3px solid rgba(255,255,255,0.8);
}

/* Alert стили для auth страниц */
.alert-success-auth {
    background: #efe;
    border: 1px solid #0a0;
    padding: 12px;
    border-radius: var(--radius);
    color: #060;
    margin-bottom: 16px;
}

.alert-error-auth {
    background: #fee;
    border: 1px solid #f00;
    padding: 12px;
    border-radius: var(--radius);
    color: #c00;
    margin-bottom: 16px;
}

/* Промо-блок стили */
.promo-block {
    margin-top: 4px;
}

.promo-block p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.promo-block ul {
    margin: 0 0 12px 0;
    padding-left: 20px;
    line-height: 1.8;
    text-align: left;
}

/* === MODAL WINDOW === */
.qr-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.qr-modal-content {
    background: var(--bg-card);
    margin: 90px auto 0;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.qr-modal-title {
    color: #FFD700;
}

.qr-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 4px;
}

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

.qr-modal-body {
    padding: 20px;
    line-height: 1.6;
    color: var(--text-main);
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Прокрутка для модальных окон */
.qr-modal-body::-webkit-scrollbar {
    width: 6px;
}
.qr-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.qr-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
.qr-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Кнопки подсказок - унифицированный стиль */
/* Круглая кнопка синего цвета с белой каймой 2px и восклицательным знаком */
.qr-info-btn {
    position: absolute;
    top: -8px;
    right: -20px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: 2px solid #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
}
.qr-info-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.qr-wrapper {
    position: relative;
    display: inline-block;
}
.qr-info-btn-small {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: 2px solid #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-left: 8px;
    vertical-align: middle;
}
.qr-info-btn-small:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* === OFFER SEARCH DROPDOWN === */
.offer-search-wrapper {
    position: relative;
}

.offer-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.offer-search-dropdown.show {
    display: block;
}

.offer-search-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.offer-search-item:last-child {
    border-bottom: none;
}

.offer-search-item:hover {
    background: var(--primary);
    color: #fff;
}

.search-highlight {
    background: rgba(255, 215, 0, 0.4);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.offer-search-item:hover .search-highlight {
    background: rgba(255, 255, 255, 0.3);
}

.offer-search-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
}

/* === INFO WARNING BLOCK === */
.info-warning-block {
    background: #fff3cd;
    color: #856404;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-warning-block a {
    color: #856404;
    text-decoration: underline;
}

.info-warning-block a:hover {
    color: #533f03;
}

.info-warning-block strong {
    color: #856404;
}

.info-warning-block small {
    color: #6c5a0d;
}

/* === ADMIN PANEL === */
.dashboard-container {
    padding: 0;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.dashboard-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.dashboard-card .card-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.dashboard-card .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.dashboard-card .card-actions .btn {
    margin-bottom: 0;
}

/* Блок Ком.Предложение - отдельный стиль */
.offer-proposal-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid #2a4a6a;
}

.offer-proposal-card .card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.offer-proposal-card .card-description {
    font-size: 0.9rem;
    color: #a8c8e8;
    margin-bottom: 16px;
}

.offer-proposal-card .project-badge {
    background: rgba(0, 102, 204, 0.3);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    border-left: 4px solid #4da6ff;
    color: #e0f0ff;
}

.offer-proposal-card .empty-message {
    text-align: center;
    padding: 20px;
    color: #8899aa;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Селектор ролей */
#role-selector {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

#role-selector:focus {
    outline: none;
    border-color: var(--primary);
}

/* Мини-статистика в карточках */
.stats-mini {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.stat-mini-item {
    text-align: center;
    flex: 1;
}

.stat-mini-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-mini-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Инлайн статистика */
.stat-inline {
    padding: 12px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-inline-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Список советов */
.tips-list {
    margin: 12px 0;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

.tips-list li {
    margin-bottom: 4px;
}

/* Мини-список товаров */
.products-mini-list {
    margin: 12px 0;
}

.product-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.product-mini-item:last-child {
    border-bottom: none;
}

.product-mini-name {
    font-size: 0.9rem;
    color: var(--text-main);
}

.product-mini-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

/* === BREADCRUMBS === */
.breadcrumbs {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumbs-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumbs-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs-item a:hover {
    color: #4da6ff;
    text-decoration: underline;
}

.breadcrumbs-separator {
    color: var(--text-muted);
    margin: 0 8px;
    user-select: none;
}

.breadcrumbs-current {
    color: var(--text-muted);
    font-weight: 500;
}

.breadcrumbs-current span {
    color: var(--text-main);
}

/* Адаптивность для маленьких экранов */
@media (max-width: 480px) {
    .breadcrumbs {
        padding: 8px 10px;
    }

    .breadcrumbs-list {
        font-size: 0.8rem;
    }

    .breadcrumbs-separator {
        margin: 0 6px;
    }
}

/* === ПОДСВЕЧЕННАЯ КНОПКА "СОХРАНИТЬ" === */
.save-btn-glow {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.save-btn-glow:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

/* === КНОПКИ КОНТАКТОВ ВЛАДЕЛЬЦА === */
.btn-contact-owner {
    background: rgba(0, 102, 204, 0.95);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3), 0 0 20px rgba(0, 102, 204, 0.15);
}

.btn-contact-owner:hover {
    background: rgba(0, 86, 179, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4), 0 0 25px rgba(0, 102, 204, 0.25);
}


/* === СТРАНИЦА OFFER (ШАБЛОНЫ А И Б) === */
/* Переопределяем стили auth-page для offer-container */
.main-content.auth-page .offer-container {
    width: 100%;
    max-width: 800px;
    padding: 0 16px 16px 16px;
}

/* Убираем центрирование auth-page для offer */
.main-content.auth-page:has(.offer-container) {
    display: block;
    align-items: stretch;
    justify-content: flex-start;
    padding: 16px;
    padding-top: 16px;
}

/* ============================================
   UTILITY CLASSES - Вспомогательные классы
   Добавлять сюда часто используемые стили
   ============================================ */

/* Выравнивание */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Поля ввода */
.input-centered {
    display: block;
    margin: 0 auto;
    text-align: center;
}

.input-small {
    max-width: 120px;
}

.input-medium {
    max-width: 200px;
}

/* Flexbox утилиты */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

/* Отступы */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.my-1 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-2 { margin-top: 1rem; margin-bottom: 1rem; }

/* Подблоки с границей */
.subblock {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.subblock-primary {
    border-color: var(--primary);
}

.subblock-success {
    border-color: var(--success);
}


/* Карточки - общие стили */
.card .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.card .card-actions .btn {
    margin-bottom: 0;
}

.card-body {
    padding: 16px;
}

/* Мини статистика в карточках */
.stats-mini {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.stat-mini-item {
    text-align: center;
    flex: 1;
}

.stat-mini-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.stat-mini-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-inline {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.stat-inline-value {
    font-weight: 600;
    color: var(--primary);
}

/* Список советов */
.tips-list {
    padding-left: 20px;
    margin-bottom: 12px;
}

.tips-list li {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Мини список продуктов */
.products-mini-list {
    margin-bottom: 12px;
}

.product-mini-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.product-mini-item:last-child {
    border-bottom: none;
}

.product-mini-name {
    font-size: 0.9rem;
}

.product-mini-price {
    font-size: 0.85rem;
    color: var(--success);
}

/* ============================================
   СТРАНИЦА ПОЛНОГО ПРЕДЛОЖЕНИЯ (full-offer.php)
   ============================================ */

/* Контейнер страницы */
.full-offer-page {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Суперблок */
.superblock {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* Шапка суперблока */
.superblock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.superblock-header-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.superblock-header-title .icon {
    font-size: 1rem;
}

.superblock-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-heart {
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.save-heart:hover {
    transform: scale(1.2);
}

/* Тело суперблока */
.superblock-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Шаблон А - Презентация */
.template-a {
    width: 100%;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.template-a-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.template-a-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
}

.template-a-views {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

.template-a-body {
    padding: 0;
}

/* PDF Превью контейнер */
.pdf-preview-container {
    position: relative;
    width: 100%;
    background: #2a2a3e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    cursor: pointer;
}

.pdf-preview-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

.pdf-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #888;
}

.pdf-preview-placeholder span:first-child {
    font-size: 4rem;
}

.pdf-preview-placeholder span:last-child {
    font-size: 1rem;
}

.pdf-load-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.pdf-load-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Полный просмотр PDF */
.pdf-full-view {
    position: relative;
    width: 100%;
    height: 600px;
    background: #2a2a3e;
}

.pdf-full-view iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.pdf-close-btn:hover {
    background: rgba(220, 53, 69, 0.9);
}

/* Промокод */
.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #333;
    border-radius: 8px;
    margin: 12px 16px;
    font-weight: 500;
}

.promo-badge-label {
    font-size: 0.85rem;
}

.promo-badge-value {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.promo-badge-copy {
    background: rgba(255,255,255,0.3);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.promo-badge-copy:hover {
    background: rgba(255,255,255,0.5);
}

/* Ко��такты владельца */
.template-a-contacts {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    background: var(--bg-dark);
}

.btn-contact-owner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.btn-contact-owner:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Шаблоны Б - Товары/услуги */
.template-b-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Заголовок секции товаров */
.template-b-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.template-b-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.template-b-section-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Блок отдельного товара (Шаблон Б) */
.template-b-block {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Убираем overflow для подсвеченных блоков - чтобы была видна метка */
.template-a.offer-highlight,
.template-b-block.offer-highlight {
    overflow: visible !important;
    margin-top: 32px !important;
}

.template-b-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

/* Закругляем шапку подсвеченного блока */
.template-b-block.offer-highlight .template-b-header {
    border-radius: 9px 9px 0 0;
}

.template-a.offer-highlight .template-a-header {
    border-radius: 9px 9px 0 0;
}

.template-b-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
}

.template-b-views {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

.template-b-body {
    padding: 0;
}

/* Контакты в Шаблоне Б */
.template-b-contacts {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    background: var(--bg-dark);
}

/* Метка контактов */
.contacts-label {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Строка с промокодом, скидкой и сердечком */
.promo-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    flex-wrap: wrap;
    background: var(--bg-dark);
}

/* Кнопка сердечка для сохранения */
.save-heart-btn {
    font-size: 1.4rem;
    text-decoration: none;
    transition: transform 0.2s;
    line-height: 1;
}

.save-heart-btn:hover {
    transform: scale(1.2);
}

/* Бейдж скидки */
.discount-badge-wrapper {
    position: relative;
    display: inline-block;
    cursor: help;
}

.discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s;
}

.discount-badge-wrapper:hover .discount-badge {
    transform: scale(1.05);
}

/* Tooltip для скидки */
.discount-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    max-width: 280px;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.discount-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #333;
}

/* Показ tooltip при наведении (десктоп) */
.discount-badge-wrapper:hover .discount-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Показ tooltip при клике (мобильные) */
.discount-badge-wrapper.tooltip-active .discount-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Предупреждение без контактов */
.owner-warning.no-contacts {
    margin: 12px 16px;
    text-align: center;
    padding: 12px;
    background: #fff3cd;
    color: #856404;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Данные предложения в Шаблоне Б */
.template-b-offer-data {
    padding: 12px 16px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
}

.offer-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
    margin-bottom: 0;
}

.offer-description:last-child {
    margin-bottom: 0;
}

.offer-discount {
    font-size: 0.9rem;
    color: var(--success);
    padding: 8px 12px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 6px;
    display: inline-block;
}

.offer-discount strong {
    color: var(--success);
}

/* Блок SEO тегов в Шаблоне Б */
.template-b-seo-data {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.seo-data-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
}

.seo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.seo-tags:last-child {
    margin-bottom: 0;
}

.seo-tag {
    display: inline-block;
    background: rgba(0, 102, 204, 0.15);
    color: #4da6ff;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 102, 204, 0.3);
}

.seo-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Предупреждение для владельца */
.owner-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 16px 0;
    text-align: center;
}

.owner-warning-title {
    font-size: 1rem;
    font-weight: 600;
    color: #856404;
}

.owner-warning-text {
    font-size: 0.85rem;
    color: #856404;
    margin-top: 8px;
}

/* Регистрация для неавторизованных */
.full-offer-register {
    text-align: center;
    margin-top: 16px;
    padding: 16px;
}

/* ============================================
   КАТАЛОГ - СТИЛИ ПОИСКА
   ============================================ */

/* Подсветка чисел в заголовке результатов */
.highlight-number {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(0, 102, 204, 0.15);
    border-radius: 12px;
    font-weight: 600;
    color: var(--primary);
}

/* Кнопка "Посмотреть предложения" */
.btn-view-offers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(0, 102, 204, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 102, 204, 0.3);
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-view-offers:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* Подсветка предложения при переходе из поиска */
/* Подсветка найденного предложения из поиска - мигает 10 сек, потом статика */
.offer-highlight {
    outline: 3px solid #0066CC !important;
    outline-offset: 2px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.15) 0%, rgba(0, 102, 204, 0.05) 100%) !important;
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.3) !important;
    position: relative;
    animation: highlightBlink 1s ease-in-out 10;
    animation-fill-mode: forwards;
}

@keyframes highlightBlink {
    0%, 100% {
        outline-color: #0066CC;
        box-shadow: 0 0 20px rgba(0, 102, 204, 0.3);
    }
    50% {
        outline-color: #4da6ff;
        box-shadow: 0 0 30px rgba(0, 102, 204, 0.6), 0 0 40px rgba(0, 102, 204, 0.3);
    }
}

.offer-highlight::before {
    content: "🔍 Совпадение с поиском";
    position: absolute;
    top: -28px;
    left: 0;
    background: linear-gradient(135deg, #0066CC, #0052a3);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px 6px 0 0;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10;
    animation: labelBlink 1s ease-in-out 10;
    animation-fill-mode: forwards;
}

@keyframes labelBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Скролл к подсвеченному элементу */
.offer-highlight-target {
    scroll-margin-top: 120px;
}

/* === REQUISITS STYLES === */
.requisit-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.requisit-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    min-width: 70px;
}
.requisit-value {
    flex: 1;
    word-break: break-all;
}
.copy-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}
.copy-btn:hover {
    background: var(--primary-dark);
}
