.portfolio-page {
    display: grid;
    gap: 0.75rem;
}

.portfolio-stats-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.portfolio-asset {
    display: grid;
    gap: 0.18rem;
}

.portfolio-asset__name {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.portfolio-asset__symbol {
    color: var(--color-text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.portfolio-actions {
    display: inline-flex;
    gap: 0.4rem;
}

.portfolio-action {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text-soft);
    border-radius: 999px;
    padding: 0.42rem 0.68rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    opacity: 1;
    transition: 160ms ease;
}

.portfolio-action:hover {
    transform: translateY(-1px);
}

.portfolio-action--buy:hover {
    border-color: rgba(86, 168, 121, 0.34);
    background: rgba(39, 84, 56, 0.24);
    color: #d2ffe4;
}

.portfolio-action--sell:hover {
    border-color: rgba(190, 86, 86, 0.34);
    background: rgba(86, 39, 39, 0.22);
    color: #ffd4d4;
}

.portfolio-action--buy {
    border-color: rgba(86, 168, 121, 0.22);
    color: #b6f0cf;
    background: rgba(39, 84, 56, 0.16);
}

.portfolio-action--sell {
    border-color: rgba(190, 86, 86, 0.2);
    color: #f2b9b9;
    background: rgba(86, 39, 39, 0.14);
}

.portfolio-table th:nth-child(2),
.portfolio-table th:nth-child(3),
.portfolio-table th:nth-child(4),
.portfolio-table th:nth-child(5),
.portfolio-table th:nth-child(6),
.portfolio-table th:nth-child(7),
.portfolio-table th:nth-child(8),
.portfolio-table td:nth-child(2),
.portfolio-table td:nth-child(3),
.portfolio-table td:nth-child(4),
.portfolio-table td:nth-child(5),
.portfolio-table td:nth-child(6),
.portfolio-table td:nth-child(7),
.portfolio-table td:nth-child(8) {
    text-align: right;
}

.portfolio-table th:nth-child(9),
.portfolio-table td:nth-child(9) {
    text-align: center;
}

.portfolio-trades-table th:nth-child(4),
.portfolio-trades-table th:nth-child(5),
.portfolio-trades-table th:nth-child(6),
.portfolio-trades-table td:nth-child(4),
.portfolio-trades-table td:nth-child(5),
.portfolio-trades-table td:nth-child(6) {
    text-align: right;
}

.stat-card__value {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1280px) {
    .portfolio-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .portfolio-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portfolio-actions {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .portfolio-stats-grid {
        grid-template-columns: 1fr;
    }
}