/* ============ ШРИФТЫ ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* ============ ПЕРЕМЕННЫЕ (тёмная тема) ============ */
[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-hover: #1c1c1c;
    --border: #222222;
    --border-light: #2a2a2a;
    --text: #e8e8e8;
    --text-secondary: #888888;
    --text-muted: #555555;
    --input-bg: #1a1a1a;
}

/* ============ ПЕРЕМЕННЫЕ (светлая тема) ============ */
[data-theme="light"] {
    --bg: #f5f5f5;
    --bg-card: #ffffff;
    --bg-hover: #e8e8e8;
    --border: #d0d0d0;
    --border-light: #c0c0c0;
    --text: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --input-bg: #f0f0f0;
}

/* ============ БАЗА ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ============ ЛОГОТИП ============ */
.logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text);
    text-decoration: none;
    transition: 0.2s;
}

.logo-text .dot {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-text:hover {
    color: var(--text-secondary);
}

/* ============ НАВИГАЦИЯ ============ */
.navbar-custom {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-link-custom {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.8px;
    padding: 6px 14px;
    border-radius: 4px;
    transition: 0.2s;
    text-transform: lowercase;
}

.nav-link-custom:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.nav-link-custom.active {
    color: var(--text);
    background: var(--bg-hover);
}

/* ============ ПРОФИЛЬ ============ */
.nav-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: 0.2s;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.nav-profile:hover {
    border-color: var(--border-light);
}

.avatar-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-hover);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-hover);
    text-transform: uppercase;
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 40px;
    max-width: 100px;
    overflow: hidden;
}

.profile-username {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-balance {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-balance .currency {
    color: var(--text-secondary);
}

/* ============ ДРОПДАУН ============ */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    min-width: 220px;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: 0.2s;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    z-index: 999;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 1px 0;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: 0.15s;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-height: 38px;
}

.dropdown-item-custom i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.dropdown-item-custom:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.dropdown-item-custom:hover i {
    color: var(--text-secondary);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 8px;
}

.dropdown-item-custom.logout {
    color: var(--text-muted);
}

.dropdown-item-custom.logout:hover {
    color: #cc4444;
}

.dropdown-item-custom.logout:hover i {
    color: #cc4444;
}

/* ============ ГЕРО ============ */
.hero-section {
    padding: 50px 0 36px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: 2.8rem;
    font-weight: 200;
    letter-spacing: 5px;
    color: var(--text);
    margin-bottom: 8px;
}

.hero-title .dot {
    color: var(--text-secondary);
    font-weight: 700;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 2px;
}

/* ============ ЗАГОЛОВКИ ============ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 36px 0 20px;
}

.section-title {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text);
}

/* ============ КАРТОЧКИ ============ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: 0.25s;
}

.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.product-image-wrapper {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--bg);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.product-card:hover .product-image {
    transform: scale(1.02);
}

.product-body {
    padding: 14px 16px 18px;
}

.product-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.product-tags {
    display: flex;
    gap: 4px;
    margin: 6px 0 10px;
    flex-wrap: wrap;
}

.badge-custom {
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: lowercase;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.product-price {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.3px;
}

.product-author {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 400;
}

/* ============ КНОПКИ ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 28px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0px) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    color: #0a0a0a;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 16px rgba(255, 255, 255, 0.05);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ffffff 0%, #aaaaaa 100%);
    color: #0a0a0a;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.12);
}

.btn-outline {
    border: 1.5px solid #333333;
}

.btn-outline:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #ffffff, #666666);
    color: #0a0a0a;
}

.btn-sm {
    padding: 6px 18px;
    font-size: 0.7rem;
}

.btn-lg {
    padding: 14px 40px;
    font-size: 0.95rem;
}

.btn-success {
    background: #00aa44;
    color: #fff;
    border: none;
    padding: 6px 16px;
    font-size: 0.7rem;
    border-radius: 6px;
    transition: 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-success:hover {
    background: #00cc55;
    color: #fff;
    text-decoration: none;
}

.btn-danger {
    background: #aa2222;
    color: #fff;
    border: none;
    padding: 6px 16px;
    font-size: 0.7rem;
    border-radius: 6px;
    transition: 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-danger:hover {
    background: #cc3333;
    color: #fff;
    text-decoration: none;
}

/* ============ ФОРМЫ ============ */
.auth-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 36px 40px;
    max-width: 380px;
    width: 100%;
}

.auth-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.auth-title .dot {
    color: var(--text-secondary);
    font-weight: 700;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
}

.auth-card .form-group {
    margin-bottom: 14px;
}

.auth-card .form-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
    text-transform: lowercase;
}

.auth-card .form-control {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 6px;
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    transition: 0.2s;
}

.auth-card .form-control:focus {
    border-color: var(--text-muted);
    outline: none;
}

.auth-card .form-control::placeholder {
    color: var(--text-muted);
}

.auth-card .btn-submit {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    color: #0a0a0a;
    border: none;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: 0.3s;
    cursor: pointer;
    margin-top: 4px;
}

.auth-card .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 300;
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: 0.2s;
}

.auth-footer a:hover {
    color: var(--text);
}

.btn-submit-apply {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #d0d0d0 100%);
    color: #0a0a0a;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-submit-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(255, 255, 255, 0.1);
}

/* ============ ФУТЕР ============ */
.footer-custom {
    margin-top: 60px;
    padding: 28px 0 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 1px;
    position: relative;
}

.footer-custom::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: var(--text-muted);
    margin: 6px auto;
    opacity: 0.3;
}

/* ============ АНИМАЦИЯ ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ============ СКРОЛЛ ============ */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============ КУРСОР ============ */
a, button, .nav-profile, .btn, .dropdown-item-custom, .product-card, input, select, textarea, label {
    cursor: pointer !important;
}

/* ============ АДАПТИВ ============ */
@media (max-width: 768px) {
    .navbar-custom .container {
        flex-direction: column;
        gap: 10px;
    }
    .nav-left {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-profile {
        width: 100%;
        justify-content: center;
    }
    .hero-title {
        font-size: 2rem;
        letter-spacing: 3px;
    }
    .auth-card {
        padding: 24px 20px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .product-body {
        padding: 10px 12px 14px;
    }
    .product-title {
        font-size: 0.75rem;
    }
    .profile-dropdown {
        min-width: 180px;
        max-width: 220px;
        right: -20px;
        left: auto;
    }
}

/* ============ ДОПОЛНИТЕЛЬНЫЕ КЛАССЫ ============ */

.page-title { font-weight: 300; letter-spacing: 2px; margin-bottom: 24px; }
.page-count { color: var(--text-muted); font-weight: 400; }

.application-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    padding: 20px 24px;
    margin-bottom: 16px;
    transition: 0.25s;
}

.application-card:hover {
    border-color: var(--border-light);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: 12px;
}

.application-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.app-pseudonym {
    font-weight: 600;
    font-size: 1rem;
}

.app-fullname {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.application-details {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 6px;
}

.application-details strong {
    color: var(--text-muted);
}

.app-date {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 4px;
}

.application-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-pending {
    background: #f0a030 !important;
    color: #fff !important;
}

.status-approved {
    background: #22a854 !important;
    color: #fff !important;
}

.status-rejected {
    background: #cc4444 !important;
    color: #fff !important;
}

.ticket-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px 20px;
    margin-bottom: 10px;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ticket-title {
    font-weight: 500;
}

.ticket-date {
    color: var(--text-muted);
    font-size: 0.7rem;
    display: block;
}

.ticket-open {
    background: #f0a030 !important;
    color: #fff !important;
}

.ticket-progress {
    background: #2a7acc !important;
    color: #fff !important;
}

.ticket-closed {
    background: #666 !important;
    color: #fff !important;
}

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

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.chat-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
}

.chat-back:hover {
    color: var(--text);
}

.chat-title {
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0;
}

.chat-messages {
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--bg);
}

.chat-message {
    margin-bottom: 12px;
}

.chat-message-self {
    text-align: right;
}

.chat-message-other {
    text-align: left;
}

.chat-bubble {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
    font-size: 0.9rem;
}

.chat-bubble-self {
    background: var(--text);
    color: var(--bg);
}

.chat-bubble-other {
    background: var(--bg-hover);
    color: var(--text);
}

.chat-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--text-muted);
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state .empty-title {
    font-size: 1.2rem;
    font-weight: 300;
}

.empty-state .empty-subtitle {
    font-weight: 300;
}

.btn-like {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-like:hover {
    color: var(--text);
}

.avatar-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.avatar-large .avatar-placeholder {
    font-size: 3rem;
}

.avatar-upload {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
    font-size: 0.8rem;
}

.post-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.post-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.post-author {
    font-weight: 500;
    font-size: 0.9rem;
}

.post-date {
    color: var(--text-muted);
    font-size: 0.7rem;
    display: block;
}

.post-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.post-image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.post-image img {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    background: var(--bg);
}

.post-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: 0.2s;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    border-left: 3px solid var(--text-secondary);
}

.notification-item .notif-time {
    color: var(--text-muted);
    font-size: 0.6rem;
}

.wallet-balance {
    font-size: 2.5rem;
    font-weight: 300;
    text-align: center;
    padding: 20px 0;
}

.transaction-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.transaction-item .amount-positive {
    color: #44cc44;
}

.transaction-item .amount-negative {
    color: #cc4444;
}

.search-input {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 6px;
    width: 100%;
}

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

.search-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.top-master-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
}

.top-master-item .rank {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 30px;
}

.top-master-item .rank-1 { color: #ffd700; }
.top-master-item .rank-2 { color: #c0c0c0; }
.top-master-item .rank-3 { color: #cd7f32; }

/* ============ ФИЛЬТРЫ ============ */

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 130px;
}

.filter-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding-left: 4px;
}

.filter-select,
.filter-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: inherit;
    transition: 0.2s;
    width: 100%;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 30px;
}

.filter-input {
    background-image: none;
    padding-right: 12px;
    cursor: text;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--text-muted);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 0;
}

.filter-btn {
    background: var(--text);
    color: var(--bg);
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.filter-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.filter-reset {
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.filter-reset:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.price-range {
    display: flex;
    gap: 6px;
    align-items: center;
}

.price-range input {
    width: 70px;
}

.price-range span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .filter-bar {
        padding: 12px;
        gap: 8px;
    }
    .filter-group {
        min-width: 100%;
    }
    .filter-actions {
        width: 100%;
    }
    .filter-btn, .filter-reset {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}

/* ============ СОРТИРОВКА НА ГЛАВНОЙ ============ */
.sort-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sort-chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 20px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sort-chip:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.sort-chip.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
    font-weight: 500;
}

/* ============ АДМИН-ПАНЕЛЬ ============ */

.btn-admin-success {
    background: #22a854 !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    transition: 0.2s !important;
    cursor: pointer !important;
}
.btn-admin-success:hover {
    background: #1a8a44 !important;
    transform: scale(1.02);
}

.btn-admin-danger {
    background: #cc4444 !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    transition: 0.2s !important;
    cursor: pointer !important;
}
.btn-admin-danger:hover {
    background: #aa3333 !important;
    transform: scale(1.02);
}

.btn-admin-primary {
    background: #2a7acc !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    transition: 0.2s !important;
    cursor: pointer !important;
}
.btn-admin-primary:hover {
    background: #1a5aaa !important;
    transform: scale(1.02);
}

.admin-input {
    background: var(--bg) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 0.7rem !important;
    width: auto !important;
    min-width: 120px !important;
}

.admin-input:focus {
    border-color: var(--text-secondary) !important;
    outline: none !important;
}

/* ============ ВКЛАДКИ В АДМИНКЕ ============ */

.nav-tabs {
    border-bottom: 1px solid var(--border) !important;
}

.nav-tabs .nav-link {
    color: var(--text) !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-bottom: none !important;
    padding: 8px 16px !important;
    border-radius: 6px 6px 0 0 !important;
    margin-right: 4px !important;
    font-size: 0.8rem !important;
    transition: 0.2s !important;
}

.nav-tabs .nav-link:hover {
    background: var(--bg-hover) !important;
    color: var(--text) !important;
}

.nav-tabs .nav-link.active {
    background: var(--bg-hover) !important;
    color: var(--text) !important;
    border-bottom: 2px solid var(--text) !important;
    font-weight: 500 !important;
}

/* ============================================ */
/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ ============ */
/* ============================================ */

/* ============ NAVBAR НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .navbar-custom {
        padding: 8px 0;
    }
    .navbar-custom .container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    .nav-left {
        gap: 12px;
        width: 100%;
        justify-content: space-between;
    }
    .logo-text {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }
    .nav-links {
        gap: 2px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        order: 3;
        margin-top: 8px;
    }
    .nav-link-custom {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    .nav-profile {
        padding: 4px 10px 4px 4px;
        gap: 8px;
    }
    .profile-info {
        max-width: 80px;
    }
    .profile-username {
        font-size: 0.65rem;
    }
    .profile-balance {
        font-size: 0.55rem;
    }
    .profile-dropdown {
        min-width: 200px;
        max-width: 260px;
        right: -10px;
    }
    .dropdown-item-custom {
        font-size: 0.75rem;
        padding: 9px 12px;
    }
}

@media (max-width: 480px) {
    .navbar-custom .container {
        padding: 0 12px;
    }
    .nav-link-custom {
        font-size: 0.65rem;
        padding: 4px 8px;
        letter-spacing: 0.3px;
    }
}

/* ============ КОШЕЛЁК НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .wallet-balance {
        font-size: 2rem;
        padding: 14px 0;
    }
    .auth-card {
        padding: 20px 16px;
    }
    .auth-card h3 {
        font-size: 1.2rem !important;
    }
    .ticket-card {
        padding: 12px 14px;
    }
    .ticket-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .ticket-header > div {
        width: 100%;
    }
    .application-card {
        padding: 14px 16px;
    }
    .application-header {
        flex-direction: column;
    }
    .application-actions {
        width: 100%;
    }
    .application-actions .btn,
    .application-actions .btn-admin-success,
    .application-actions .btn-admin-danger,
    .application-actions .btn-admin-primary {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    /* Кнопки пополнения / вывода в столбик */
    .wallet-form-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .wallet-form-row input,
    .wallet-form-row select,
    .wallet-form-row button {
        width: 100% !important;
    }
}

/* ============ ПРОФИЛЬ НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .profile-content {
        padding-top: 120px !important;
    }
    .profile-background {
        height: 280px !important;
    }
    .profile-avatar-big {
        width: 100px;
        height: 100px;
        margin: -70px auto 10px;
    }
    .profile-header-card {
        padding: 18px 16px;
    }
    .profile-header-card h3 {
        font-size: 1.1rem !important;
    }
    .profile-tabs {
        gap: 2px;
        margin: 16px 0 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .profile-tabs::-webkit-scrollbar {
        display: none;
    }
    .profile-tab {
        padding: 8px 14px;
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    .social-links {
        gap: 6px;
    }
    .social-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    .user-mini-card {
        padding: 10px 12px;
    }
    .user-mini-avatar {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    .user-mini-name {
        font-size: 0.8rem;
    }
    .user-mini-city {
        font-size: 0.65rem;
    }
    /* Статистика в профиле */
    .profile-stats-row {
        gap: 10px !important;
    }
    .profile-stats-row > div {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .profile-content {
        padding-top: 100px !important;
    }
    .profile-background {
        height: 240px !important;
    }
    .profile-avatar-big {
        width: 85px;
        height: 85px;
        margin: -60px auto 8px;
    }
    .profile-header-card {
        padding: 14px 12px;
    }
    .profile-tab {
        padding: 7px 11px;
        font-size: 0.7rem;
    }
}

/* ============ МОДАЛКА QR НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    #paymentModal > div {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        padding: 20px 16px !important;
        margin: 0 !important;
    }
    #paymentModal {
        padding: 0 !important;
    }
    #paymentModal h3 {
        font-size: 1.2rem !important;
    }
    #paymentModal .form-group input,
    #paymentModal .form-group textarea,
    #paymentModal .form-group select {
        font-size: 0.85rem !important;
        padding: 10px 12px !important;
    }
    #qrImg {
        max-width: 220px !important;
        max-height: 220px !important;
    }
}

/* ============ ЧАТЫ НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .chat-container {
        padding: 14px 12px;
        border-radius: 8px;
    }
    .chat-messages {
        min-height: 300px;
        max-height: 55vh;
        padding: 12px;
    }
    .chat-bubble {
        max-width: 85%;
        font-size: 0.85rem;
        padding: 7px 12px;
    }
    .chat-form {
        flex-direction: row;
        gap: 8px;
    }
    .chat-input {
        padding: 9px 12px;
        font-size: 0.85rem;
    }
    .chat-form .btn {
        padding: 9px 14px;
        font-size: 0.75rem;
    }
    .chat-title {
        font-size: 0.95rem !important;
    }
    /* Список чатов */
    .chats-list .product-card {
        padding: 12px 14px !important;
    }
}

/* ============ ФИЛЬТРЫ НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .filter-bar {
        padding: 12px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        min-width: 100%;
        flex: none;
    }
    .filter-label {
        font-size: 0.6rem;
    }
    .filter-actions {
        width: 100%;
        flex-direction: row;
    }
    .filter-btn,
    .filter-reset {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    .price-range {
        gap: 4px;
    }
    .price-range input {
        width: auto;
        flex: 1;
    }
    .sort-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .sort-chips::-webkit-scrollbar {
        display: none;
    }
    .sort-chip {
        flex-shrink: 0;
        font-size: 0.7rem;
        padding: 6px 12px;
    }
}

/* ============ КАРТОЧКИ ТОВАРОВ НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-body {
        padding: 10px 12px 14px;
    }
    .product-title {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }
    .product-price {
        font-size: 0.85rem;
    }
    .product-tags {
        margin: 4px 0 6px;
    }
    .badge-custom {
        font-size: 0.55rem;
        padding: 2px 6px;
    }
    .product-card .btn-sm {
        padding: 5px 8px;
        font-size: 0.65rem;
    }
}

/* ============ ФОРМЫ НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .auth-container {
        padding: 20px 12px;
        min-height: auto;
    }
    .auth-card {
        padding: 22px 18px;
    }
    .auth-title {
        font-size: 1.2rem;
    }
    .auth-subtitle {
        font-size: 0.75rem;
    }
    .form-control {
        font-size: 0.85rem !important;
        padding: 10px 12px !important;
    }
    .btn-submit,
    .btn-submit-apply {
        font-size: 0.85rem !important;
        padding: 12px !important;
    }
}

/* ============ HERO НА МОБИЛЬНОМ ============ */
@media (max-width: 768px) {
    .hero-section {
        padding: 30px 0 24px;
    }
    .hero-title {
        font-size: 1.8rem !important;
        letter-spacing: 2px;
    }
    .hero-subtitle {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
}

/* ============ МОДАЛКИ ============ */
@media (max-width: 480px) {
    #paymentModal > div {
        border-radius: 0 !important;
        padding: 16px 12px !important;
    }
    .auth-card {
        padding: 18px 14px;
    }
}

/* ============ ТАБЫ (ADMIN) ============ */
@media (max-width: 768px) {
    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tabs .nav-link {
        font-size: 0.7rem !important;
        padding: 6px 10px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .page-title {
        font-size: 1.2rem !important;
    }
}

/* ============ ОБЩИЕ УЛУЧШЕНИЯ ============ */
@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }
    .section-header {
        margin: 20px 0 14px;
    }
    .section-title {
        font-size: 0.9rem;
    }
    .empty-state {
        padding: 40px 16px;
    }
    .empty-icon {
        font-size: 3rem !important;
    }
    .empty-title {
        font-size: 1rem !important;
    }
    .empty-subtitle {
        font-size: 0.8rem;
    }
}

/* ============ СТАТИСТИКА ============ */
@media (max-width: 768px) {
    .stat-card {
        padding: 14px 12px !important;
    }
    .stat-icon {
        font-size: 1.3rem !important;
    }
    .stat-value {
        font-size: 1.3rem !important;
    }
    .stat-label {
        font-size: 0.65rem !important;
    }
    .stat-item {
        padding: 10px 12px !important;
    }
}

/* ============ ЗАКАЗЫ ============ */
@media (max-width: 768px) {
    .order-card {
        padding: 12px 14px !important;
    }
    .order-card > div {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .order-card > div > div:last-child {
        text-align: left !important;
        min-width: auto !important;
    }
}

/* ============ ЧАТЫ ============ */
.chat-container {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 24px;
}
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.chat-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
}
.chat-back:hover { color: var(--text); }
.chat-title {
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0;
    font-size: 1rem;
}
.chat-messages {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}
.chat-message-self {
    align-items: flex-end;
    text-align: right;
}
.chat-message-other {
    align-items: flex-start;
    text-align: left;
}
.chat-bubble {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 14px;
    max-width: 75%;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.5;
}
.chat-bubble-self {
    background: var(--text);
    color: var(--bg);
    border-bottom-right-radius: 4px;
}
.chat-bubble-other {
    background: var(--bg-hover);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.chat-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 3px;
    padding: 0 4px;
}
.chat-form {
    display: flex;
    gap: 10px;
}
.chat-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}
.chat-input:focus {
    outline: none;
    border-color: var(--text-muted);
}