/* Профиль клиента - минималистичный дизайн */

.profile-simple-page {
    min-height: 100vh;
    background: var(--bg-primary);
}

.profile-simple-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Табы */
.profile-simple-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
}

.profile-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    white-space: nowrap;
}

.profile-tab svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.profile-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.profile-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.profile-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--bg-secondary);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
}

.profile-tab.active .profile-tab-count {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Контент табов */
.profile-simple-content {
    position: relative;
}

.profile-tab-content {
    display: none;
}

.profile-tab-content.active {
    display: block;
}

/* ========== ОБЗОР ========== */

.profile-overview {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Шапка профиля */
.profile-overview-header {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.profile-overview-user {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.profile-overview-avatar {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-overview-avatar svg {
    width: 32px;
    height: 32px;
}

.profile-overview-info {
    flex: 1;
}

.profile-overview-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.profile-overview-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.profile-overview-actions {
    display: flex;
    gap: 12px;
}

.profile-overview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-overview-btn svg {
    width: 18px;
    height: 18px;
}

.profile-overview-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.profile-overview-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.profile-overview-btn.secondary:hover {
    background: var(--bg-tertiary);
}

/* Статистика */
.profile-overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.profile-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.profile-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.profile-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Быстрые действия */
.profile-overview-quick {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.profile-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.profile-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.profile-quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.profile-quick-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
    transform: translateY(-1px);
}

/* ========== НАСТРОЙКИ ========== */

.profile-settings {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.profile-settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

/* Форма */
.profile-settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.profile-form-input {
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.profile-form-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: var(--card-bg);
}

.profile-form-input:read-only {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

.profile-form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

.profile-form-password {
    display: flex;
    gap: 12px;
}

.profile-form-password .profile-form-input {
    flex: 1;
}

.profile-form-btn-change {
    padding: 12px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.profile-form-btn-change:hover {
    background: var(--bg-tertiary);
}

.profile-form-btn-save {
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-form-btn-save:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Уведомления */
.profile-settings-notifications {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.profile-notification-info {
    flex: 1;
}

.profile-notification-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-notification-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Toggle switch */
.profile-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    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-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    transition: 0.3s;
    border-radius: 14px;
}

.profile-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.profile-toggle input:checked + .profile-toggle-slider {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.profile-toggle input:checked + .profile-toggle-slider:before {
    transform: translateX(22px);
}

/* ========== ЗАЯВКИ ========== */

.profile-requests-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-request-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.profile-request-card:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-request-card.status-new {
    border-left-color: #3b82f6;
}

.profile-request-card.status-progress {
    border-left-color: #f59e0b;
}

.profile-request-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-request-lot {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.profile-request-status {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.profile-request-card.status-new .profile-request-status {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.profile-request-card.status-progress .profile-request-status {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.profile-request-body {
    margin-bottom: 16px;
}

.profile-request-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-request-footer {
    display: flex;
    justify-content: flex-end;
}

.profile-request-btn {
    padding: 10px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-request-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* ========== АДАПТИВНОСТЬ ========== */

@media (max-width: 768px) {
    .profile-simple-container {
        padding: 16px 12px;
    }

    .profile-simple-tabs {
        gap: 4px;
        margin-bottom: 24px;
    }

    .profile-tab {
        padding: 10px 14px;
        font-size: 14px;
    }

    .profile-tab svg {
        width: 18px;
        height: 18px;
    }

    .profile-tab span:not(.profile-tab-count) {
        display: none;
    }

    .profile-tab-count {
        display: flex;
    }

    .profile-overview-header {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }

    .profile-overview-user {
        flex-direction: column;
        text-align: center;
    }

    .profile-overview-avatar {
        width: 56px;
        height: 56px;
        margin: 0 auto;
    }

    .profile-overview-name {
        font-size: 20px;
    }

    .profile-overview-actions {
        flex-direction: column;
    }

    .profile-overview-btn {
        width: 100%;
        justify-content: center;
    }

    .profile-overview-stats {
        grid-template-columns: 1fr;
    }

    .profile-quick-actions {
        grid-template-columns: 1fr;
    }

    .profile-form-password {
        flex-direction: column;
    }

    .profile-notification-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .profile-toggle {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .profile-tab {
        padding: 10px 12px;
    }

    .profile-overview-header {
        padding: 16px;
    }

    .profile-overview-avatar {
        width: 48px;
        height: 48px;
    }

    .profile-overview-name {
        font-size: 18px;
    }

    .profile-stat-value {
        font-size: 28px;
    }
}

/* ========== ИЗБРАННОЕ - КАРТОЧКИ ЛОТОВ ========== */

#favoritesGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 8px 0;
}

/* Адаптивная сетка для избранного */
@media (max-width: 1200px) {
    #favoritesGrid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    #favoritesGrid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 640px) {
    #favoritesGrid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    #favoritesGrid .lot-card-image {
        height: 180px;
    }
    
    #favoritesGrid .lot-card-price {
        font-size: 24px;
    }
    
    #favoritesGrid .lot-card-title {
        font-size: 15px;
    }
}

/* ── Клиентский мессенджер в профиле ──────────────────────────── */
.client-msg-layout {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 400px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.client-msg-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    background: #fafafa;
}
.client-msg-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.client-msg-chat-item:hover, .client-msg-chat-item.active {
    background: #eff6ff;
}
.client-msg-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.client-msg-chat-info {
    flex: 1;
    min-width: 0;
}
.client-msg-chat-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-msg-chat-preview {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-msg-chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.client-msg-time {
    font-size: 11px;
    color: #9ca3af;
}
.client-msg-unread {
    background: #3b82f6;
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
}
.client-msg-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.client-msg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.client-msg-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.client-msg-header-name {
    font-weight: 600;
    font-size: 15px;
}
.client-msg-header-sub {
    font-size: 12px;
    color: #9ca3af;
}
.client-msg-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    background: #f9fafb;
}
.client-msg-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.client-msg-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 14px;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.15s;
}
.client-msg-input:focus {
    border-color: #3b82f6;
}
.client-msg-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.client-msg-send-btn:hover {
    background: #2563eb;
}
.client-msg-file-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.client-msg-file-btn:hover {
    background: #e5e7eb;
}
@media (max-width: 600px) {
    .client-msg-layout {
        flex-direction: column;
        height: auto;
    }
    .client-msg-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 200px;
    }
    .client-msg-window {
        min-height: 360px;
    }
}
