
.profile-page {
    min-height: 100vh;
    padding: 2rem 0;
    background: var(--bg-primary);
}
.profile-card-unified {
    background: #0f141c;
    border: 1px solid #1e2430;
    border-radius: 14px;
    overflow: visible;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.profile-header-unified {
    padding: 1.75rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    border-bottom: 1px solid #1e2430;
    background: #121927;
    position: relative;
    justify-content: space-between;
    flex-wrap: wrap;
}
.profile-header-unified.compact {
    padding: 1.25rem;
}
.profile-header-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.profile-locale-controls {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    margin-left: auto;
    align-items: flex-start;
}
.switchers {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.dropdown-wrapper {
    position: relative;
}
.dropdown-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #3a3f4a;
    border-radius: 10px;
    cursor: pointer;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #0f141c;
    border: 1px solid #1e2430;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    padding: 0.5rem 0;
    display: none;
    z-index: 1000;
}
.dropdown-wrapper.active .dropdown-menu,
.dropdown-wrapper.open .dropdown-menu {
    display: block;
}
.dropdown-menu-item {
    margin: 0;
    padding: 0.5rem 1rem;
    color: #e5e7eb;
    cursor: pointer;
}
.dropdown-menu-item:hover {
    background: rgba(255,255,255,0.05);
}
.dropdown-arrow-icon {
    color: #cbd1dc;
}
.currency-switcher__logo {
    width: 28px;
    height: 28px;
}
.language-switcher__logo {
    width: 28px;
    height: 20px;
}
.switcher-label {
    color: #e5e7eb;
    font-weight: 600;
}
.switcher-icon {
    width: 20px;
    height: 20px;
}
/* Keep language/currency dropdowns visible in header on profile page.
   This is especially important for unauthenticated users (profileContent hidden). */
body[data-page="profile"] .csmoney-header .header-right .dropdown-wrapper {
    display: inline-block;
}

/* Ensure shared header locale block is visible on /profile (some profile-specific styles may conflict). */
body[data-page="profile"] .csmoney-header .header-lang-currency {
    display: flex;
}
@media (max-width: 768px) {
    .profile-locale-controls {
        width: 100%;
        justify-content: flex-start;
    }
}
.profile-info-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.profile-username-inline {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
    color: #e5e7eb;
}
.profile-meta-line {
    display: flex;
    gap: 0.4rem;
    align-items: baseline;
    color: #cdd3e3;
    font-size: 0.95rem;
}
.profile-meta-label {
    color: #8ea4c3;
}
.profile-meta-value.balance {
    color: #26ff7c;
    font-weight: 700;
}
.profile-info-block .profile-meta-line {
    display: none;
}
.tradelink-section-unified.compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tradelink-inline {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.tradelink-input-wrapper.small {
    max-width: 380px;
    flex: 1;
}
.tradelink-input-unified {
    width: 100%;
}

.profile-header-unified::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
}

.profile-left-section {
    flex-shrink: 0;
}

.profile-avatar-unified {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid #2f3440;
    display: block;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.profile-avatar-unified:hover {
    transform: scale(1.02);
    border-color: #4c5566;
}
.profile-avatar-unified.small {
    width: 64px;
    height: 64px;
}
.profile-avatar-unified.small + .profile-info-block {
    margin-left: 0.5rem;
}
.profile-fields {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.profile-field-row {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    background: #0f141c;
    border: 1px solid #1e2430;
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.profile-field-title {
    color: #cdd3e3;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.profile-field-title .external-link {
    color: #8ea4c3;
    text-decoration: none;
}
.profile-field-value input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: #0d111a;
    border: 1px solid #2f3440;
    border-radius: 8px;
    color: #e5e7eb;
}
.save-button,
.edit-button {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: #0f172a;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(249,115,22,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}
.save-button:hover,
.edit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(249,115,22,0.45);
}
.edit-button[disabled] {
    background: rgba(255,255,255,0.06);
    color: #cbd5e1;
    box-shadow: none;
    cursor: default;
}
.profile-field-info {
    grid-column: 2 / 4;
    color: #fca5a5;
    font-size: 0.9rem;
}
.profile-field-info {
    display: none;
}
.profile-field-value.email {
    color: #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.profile-field-value.email {
    display: none;
}

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

.profile-name-with-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.profile-username-unified {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.profile-status-badge-new {
    display: none;
}
.profile-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.profile-form-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    align-items: center;
    gap: 0.75rem;
}
.profile-form-row label {
    color: #cdd3e3;
    font-weight: 600;
    font-size: 0.95rem;
}
.profile-input-wrap {
    width: 100%;
}
.tradelink-input-unified.small {
    height: 34px;
    padding: 0.4rem 0.75rem;
    font-size: 0.95rem;
}
.btn-save-small {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: #0f172a;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(249,115,22,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}
.btn-save-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(249,115,22,0.45);
}
.btn-save-small.ghost {
    background: rgba(255,255,255,0.06);
    color: #cbd5e1;
    box-shadow: none;
}
.profile-warning {
    grid-column: 1 / -1;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.profile-status-badge-new::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -0.5rem;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 8px #10b981;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px #10b981;
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 12px #10b981;
    }
}

.profile-details-unified {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-label-unified {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
    min-width: 75px;
}

.detail-value-unified {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.balance-highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.profile-tabs-unified {
    display: flex;
    gap: 0.5rem;
    background: transparent;
    border-bottom: none;
    position: relative;
    padding: 0.5rem 0;
}

.tab-btn-unified {
    flex: 1;
    padding: 1rem 1.25rem;
    background: #0f141c;
    border: 1px solid #1e2430;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.tab-btn-unified:hover {
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 8px 20px rgba(59,130,246,0.25);
}

.tab-btn-unified.active {
    color: #fff;
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(14,165,233,0.12));
}

.tab-btn-unified.active::after {
    display: none;
}

.tab-content-unified {
    padding: 2.5rem;
    min-height: 400px;
}

.tab-pane-unified {
    display: none;
}

.tab-pane-unified.active {
    display: block;
}

.tradelink-section-unified {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
    padding: 2.5rem;
    border-radius: 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(99, 102, 241, 0.05);
    position: relative;
    overflow: hidden;
}

.tradelink-section-unified::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 50%, 
        var(--primary-color) 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tradelink-label-unified {
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tradelink-label-unified::before {
    content: '🔗';
    font-size: 1.25rem;
}

.tradelink-input-wrapper {
    margin-bottom: 1.5rem;
    position: relative;
}

.tradelink-input-unified {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: all 0.3s ease;
}

.tradelink-input-unified:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15),
                0 4px 12px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.tradelink-input-unified::placeholder {
    color: var(--text-muted);
    font-family: system-ui, -apple-system, sans-serif;
}

.btn-save-tradelink-unified {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-save-tradelink-unified::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-save-tradelink-unified:hover::before {
    left: 100%;
}

.btn-save-tradelink-unified:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-save-tradelink-unified:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.inventory-grid-unified {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    width: 100%;
}

.item-unavailable {
    position: relative;
    opacity: 0.6;
}

.item-unavailable .inventory-item-name {
    color: var(--text-muted) !important;
}

.unavailable-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.inventory-item {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, transparent 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.inventory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inventory-item:hover::before {
    opacity: 1;
}

.inventory-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.inventory-item img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.inventory-item-name {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 32px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.inventory-item-price {
    color: var(--success-color);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.inventory-item-actions {
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.btn-sell {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.btn-sell::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-sell:hover::before {
    left: 100%;
}

.btn-sell:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.no-items-unified {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    text-align: center !important;
    width: 100%;
}

.no-items-icon-unified {
    width: 110px;
    height: 110px;
    background: transparent;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem auto;
}

.no-items-icon-unified::before {
    content: '!';
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-muted);
}

.no-items-unified h3 {
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 auto 0.75rem auto !important;
    text-align: center !important;
    width: 100%;
}

.no-items-unified p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 500px;
    line-height: 1.6;
    margin: 0 auto !important;
    text-align: center !important;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 1.75rem 0;
    font-weight: 400;
}

.history-section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--csmoney-orange);
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.3px;
}

.section-title-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    fill: var(--csmoney-orange);
    filter: drop-shadow(0 2px 4px rgba(255, 107, 0, 0.3));
}

.history-section-header,
.security-section-header,
.referral-section-header {
    margin-bottom: 1.75rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 0, 0.05), transparent);
    transition: left 0.5s ease;
}

.history-item:hover::before {
    left: 100%;
}

.history-item:hover {
    border-color: rgba(255, 107, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.08) 0%, rgba(255, 107, 0, 0.03) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.history-item-image-wrapper {
    position: relative;
    flex-shrink: 0;
}

.history-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
    padding: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.history-item-status-icon {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #0f172a;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-name {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-item-date {
    color: #94a3b8;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.history-item-date svg {
    color: #64748b;
    flex-shrink: 0;
}

.history-item-price {
    color: #10b981;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-withdraw {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.15) 0%, rgba(255, 107, 0, 0.1) 100%);
    color: #ff6b00;
    border: 1.5px solid rgba(255, 107, 0, 0.4);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-withdraw::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.4s ease;
}

.btn-withdraw:hover::before {
    left: 100%;
}

.btn-withdraw:hover {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.25) 0%, rgba(255, 107, 0, 0.15) 100%);
    border-color: rgba(255, 107, 0, 0.6);
    color: #ff8533;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3);
}

.btn-withdraw:active {
    transform: translateY(0);
}

.btn-withdraw .btn-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.btn-withdraw span {
    font-weight: 700;
}

.security-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.02) 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.security-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.security-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.security-card:hover::before {
    opacity: 1;
}

.security-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.security-card h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.security-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    font-size: 0.9rem;
}

.security-kyc-card {
    background: var(--bg-secondary);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.kyc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.kyc-title {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.kyc-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.kyc-title h3 {
    color: var(--text-primary);
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 0.375rem 0;
}

.kyc-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.kyc-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.kyc-status-badge.not-verified {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 2px solid #f59e0b;
}

.kyc-status-badge.verified {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 2px solid #10b981;
}

.status-icon {
    font-size: 1.125rem;
}

.kyc-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.kyc-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
}

.btn-kyc-verify {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-kyc-verify:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.security-sessions-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.sessions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sessions-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.btn-logout-all {
    padding: 0.625rem 1.25rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout-all:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
}

.session-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.session-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.session-info {
    flex: 1;
}

.session-device {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.375rem;
}

.session-details {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.session-current {
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.security-auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.security-auth-card h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
}

.auth-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-info {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

.auth-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.referral-link-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.75rem;
}

.referral-link-card label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.875rem;
}

.referral-link-wrapper {
    display: flex;
    gap: 0.875rem;
}

.referral-link-input {
    flex: 1;
    padding: 0.875rem 1.125rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Consolas', 'Monaco', monospace;
}

.referral-link-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-copy-ref {
    padding: 0.875rem 1.75rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-ref:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.ref-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
}

.ref-stat-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.02);
}

.ref-stat-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.ref-stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ref-stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

.referral-info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
}

.referral-info-card h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.referral-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.referral-steps li {
    color: var(--text-primary);
    font-size: 0.9rem;
    padding-left: 1.75rem;
    position: relative;
    line-height: 1.5;
}

.referral-steps li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.125rem;
}

.loader {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

@media (max-width: 768px) {
    .profile-header-unified {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem;
    }

    .profile-name-with-badge {
        flex-direction: column;
        gap: 0.75rem;
    }

    .profile-info-unified {
        padding-top: 0;
        width: 100%;
    }

    .profile-tabs-unified {
        overflow-x: auto;
    }

    .tab-btn-unified {
        font-size: 0.8rem;
        padding: 1rem 1.25rem;
        white-space: nowrap;
    }

    .tab-content-unified {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    .inventory-grid-unified {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 0.75rem !important;
    }
    
    .profile-page {
        padding: 1rem 0;
    }
    
    .profile-card-unified {
        margin: 0 1rem;
    }
    
    .profile-header-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .profile-locale-controls {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .switchers {
        justify-content: center;
        width: 100%;
    }
    
    .tradelink-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tradelink-input-wrapper.small {
        max-width: 100%;
    }
    
    main {
        padding: 1rem !important;
    }
    
    .recent-sales-fullwidth {
        margin: 0 1rem 1rem 1rem !important;
    }

    .referral-link-wrapper {
        flex-direction: column;
    }

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

    .ref-stat-card {
        padding: 1.5rem;
    }

    .ref-stat-value {
        font-size: 1.75rem;
    }

    .history-item {
        flex-direction: column;
        text-align: center;
    }

    .history-item-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Стили для карточек способов вывода */
.withdraw-method-card {
    transition: all 0.3s ease;
}

.withdraw-method-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.withdraw-method-card[style*="border-color: var(--primary-color)"] {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.section-title-icon {
    display: inline-block;
    vertical-align: middle;
}

/* Стили для выбора предметов */
.inventory-item-checkbox-wrapper {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
}

.inventory-item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.inventory-item {
    position: relative;
}

.inventory-item:has(.inventory-item-checkbox:checked) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Панель действий продажи */
#sellButtonsContainer {
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(16,185,129,0.08));
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}

#sellButtonsContainer {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.1) 0%, rgba(255, 107, 0, 0.05) 100%);
    border: 1.5px solid rgba(255, 107, 0, 0.3);
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.15);
}

#sellButtonsContainer .btn-primary {
    background: linear-gradient(135deg, #ff6b00 0%, #ff4500 100%);
    color: #fff;
    font-weight: 800;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#sellButtonsContainer .btn-primary::before {
    display: none;
}

#sellButtonsContainer .btn-primary:hover::before {
    left: 100%;
}

#sellButtonsContainer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.5);
}

#sellButtonsContainer .btn-primary:active {
    transform: translateY(0);
}

#sellButtonsContainer .btn-primary svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

#sellButtonsContainer .btn-primary + .btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#sellButtonsContainer .btn-primary + .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Balance actions */
.profile-balance-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.btn-primary-outline {
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.5);
    color: #e5e7eb;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary-outline:hover {
    border-color: rgba(59,130,246,0.8);
    background: rgba(59,130,246,0.2);
}

/* Payment modals */
.payment-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.payment-modal {
    background: #0f141c;
    border: 1px solid #1e2430;
    border-radius: 12px;
    width: min(900px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.payment-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: #e5e7eb;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.deposit-withdraw-popup-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.deposit-sum-field {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: center;
}

.field {
    display: flex;
    align-items: center;
    background: #0d111a;
    border: 1px solid #1f2937;
    border-radius: 10px;
    overflow: hidden;
}

.field-currency {
    padding: 0.75rem 1rem;
    background: #111827;
    border-right: 1px solid #1f2937;
    color: #e5e7eb;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.field-input input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 1rem;
}

.currency-selector {
    position: relative;
}

.currency-selector-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #0d111a;
    border: 1px solid #1f2937;
    border-radius: 10px;
    cursor: pointer;
}

.currency-selector-logo {
    width: 28px;
    height: 28px;
}

.currency-selector__info p {
    margin: 0;
    color: #e5e7eb;
    line-height: 1.2;
}

.currency-selector-selected-currency-name {
    font-weight: 700;
}

.currency-selector-selected-currency {
    font-size: 0.9rem;
    color: #94a3b8;
}

.currency-selector-arrow-icon {
    color: #cbd1dc;
}

.currency-selector-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #0f141c;
    border: 1px solid #1e2430;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    padding: 0.75rem;
    display: none;
    z-index: 10;
}

.currency-selector__header {
    margin: 0 0 0.5rem 0;
    color: #94a3b8;
    font-weight: 600;
}

.currency-selector__item {
    display: grid;
    grid-template-columns: 32px 60px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.currency-selector__item:hover {
    background: rgba(255,255,255,0.04);
}

.currency-selector-menu-item {
    margin: 0;
    color: #e5e7eb;
    font-weight: 700;
}

.currency-selector__name {
    color: #94a3b8;
    font-size: 0.9rem;
}

.payment-systems-note,
.fields-description {
    color: #cbd5e1;
}

.payment-error {
    color: #f87171;
    font-weight: 600;
}

.make-action {
    margin-top: 1rem;
    padding: 0.9rem 1.2rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-radius: 10px;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.make-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(37,99,235,0.35);
}

.payment-modal .tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.payment-modal .tooltip .tooltip-text {
    position: absolute;
    left: 0;
    top: 120%;
    background: #0f141c;
    border: 1px solid #1e2430;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #e5e7eb;
    width: 260px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 20;
}

.payment-modal .tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

.recent-sales {
    width: 100%;
    margin: 0 0 0.25rem 0;
}

.recent-sales-track {
    display: flex;
    gap: 0.4rem;
    overflow-x: hidden;
    padding: 0.2rem 0.4rem 0.4rem;
    scrollbar-width: none;
}

.recent-sales-track::-webkit-scrollbar { display: none; }

.recent-sales-track.compact {
    gap: 0.3rem;
    padding: 0.2rem 0.4rem 0.4rem;
}

.recent-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.25rem;
    padding: 0.5rem;
    width: 150px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    min-height: 180px;
    overflow: hidden;
}

.recent-card:hover {
    transform: translateY(-2px);
    border-color: #8b5cf6;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.recent-card .image {
    width: 100%;
    height: 90px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
}

.recent-card .name {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    line-height: 1.25;
    word-break: break-word;
}

.recent-card .price {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 800;
    color: #10b981;
    font-size: 1rem;
}

.recent-sales-fullwidth {
    width: 100%;
    margin: 0;
    padding: 1.5rem 0;
    overflow: hidden;
}

.recent-sales-track-fullwidth {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.2rem 0 0.4rem;
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
}

.recent-sales-track-fullwidth.compact {
    grid-auto-columns: 140px;
    gap: 0.3rem;
    padding: 0.2rem 0 0.4rem;
}

.recent-sales-track-fullwidth::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.recent-sales-track-fullwidth::-webkit-scrollbar-track {
    display: none;
}

.recent-sales-track-fullwidth::-webkit-scrollbar-thumb {
    display: none;
}