/**
 * Folyo - Portfolio Page Styles (Enhanced Professional Design)
 */

/* User Profile Avatar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(22, 199, 132, 0.3);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(22, 199, 132, 0.4);
}

.avatar-text {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

/* Portfolio Container Layout */
.portfolio-container {
    display: flex;
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg,
        var(--bg-secondary) 0%,
        var(--bg-primary) 50%,
        var(--bg-secondary) 100%);
}

/* Add smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Improve text rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Selection colors */
::selection {
    background-color: rgba(22, 199, 132, 0.3);
    color: var(--text-primary);
}

/* Enhanced Sidebar */
.portfolio-sidebar {
    width: 320px;
    background: linear-gradient(180deg,
        var(--bg-primary) 0%,
        rgba(22, 199, 132, 0.02) 50%,
        var(--bg-secondary) 100%);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    box-shadow:
        4px 0 24px rgba(0, 0, 0, 0.06),
        inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar-content {
    padding: 36px 24px;
}

.sidebar-toggle {
    display: none;
}

/* Sidebar Item (Overview) - Enhanced */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: none;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 28px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--blue));
    transform: scaleY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 4px 4px 0;
}

.sidebar-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(22, 199, 132, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.sidebar-item:hover {
    background: linear-gradient(90deg,
        rgba(22, 199, 132, 0.1) 0%,
        rgba(22, 199, 132, 0.05) 50%,
        transparent 100%);
    transform: translateX(6px);
}

.sidebar-item.active {
    background: linear-gradient(90deg,
        rgba(22, 199, 132, 0.15) 0%,
        rgba(59, 130, 246, 0.1) 100%);
    box-shadow:
        0 4px 16px rgba(22, 199, 132, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.sidebar-item.active::before {
    transform: scaleY(1);
}

.sidebar-item.active::after {
    opacity: 1;
}

.sidebar-icon {
    font-size: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sidebar-text {
    flex: 1;
    min-width: 0;
}

.sidebar-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.sidebar-section-header h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.btn-icon:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

/* Enhanced Wallet Items */
.wallets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.wallet-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.wallet-item::after {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(22, 199, 132, 0.1), transparent);
    transition: left 0.6s ease;
}

.wallet-item:hover {
    background: rgba(22, 199, 132, 0.08);
    transform: translateX(6px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

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

.wallet-item:hover::after {
    left: 100%;
}

.wallet-item.active {
    background: linear-gradient(135deg,
        rgba(22, 199, 132, 0.12) 0%,
        rgba(59, 130, 246, 0.08) 100%);
    box-shadow: 0 6px 20px rgba(22, 199, 132, 0.15);
}

.wallet-item.active::before {
    opacity: 1;
}

.wallet-icon {
    font-size: 24px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

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

.wallet-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.wallet-value.negative {
    color: var(--red);
}

/* Wallet Item Wrapper */
.wallet-item-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-item-wrapper .wallet-item {
    flex: 1;
}

.wallet-item-edit {
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.wallet-item-edit:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    opacity: 1;
    transform: scale(1.1);
}

.wallet-item-wrapper:hover .wallet-item-edit {
    opacity: 1;
}

/* Enhanced Create Portfolio Button */
.btn-create-portfolio {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(22, 199, 132, 0.3);
}

.btn-create-portfolio:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 199, 132, 0.4);
}

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

.btn-create-portfolio span:first-child {
    font-size: 20px;
}

/* Main Content */
.portfolio-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: var(--bg-secondary);
    position: relative;
}

/* Sidebar Toggle - Hidden by default (shown on mobile) */
.sidebar-toggle {
    display: none;
}

/* Portfolio Views */
.portfolio-view {
    display: none;
}

.portfolio-view.active {
    display: block;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animations for child elements */
.portfolio-view.active > * {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.portfolio-view.active > *:nth-child(1) {
    animation-delay: 0.1s;
}

.portfolio-view.active > *:nth-child(2) {
    animation-delay: 0.2s;
}

.portfolio-view.active > *:nth-child(3) {
    animation-delay: 0.3s;
}

.portfolio-view.active > *:nth-child(4) {
    animation-delay: 0.4s;
}

/* Enhanced Portfolio Header */
.portfolio-header,
.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding: 40px;
    background: linear-gradient(135deg,
        rgba(22, 199, 132, 0.05) 0%,
        var(--bg-primary) 50%,
        rgba(59, 130, 246, 0.05) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-header:hover,
.wallet-header:hover {
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transform: translateY(-2px);
}

.portfolio-header::before,
.wallet-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(22, 199, 132, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.portfolio-header::after,
.wallet-header::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-20px, -20px);
    }
}

.portfolio-title-section,
.wallet-title-section {
    flex: 1;
    z-index: 1;
}

.portfolio-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-total-value,
.wallet-total-value {
    font-size: 48px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--primary-color), var(--blue), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

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

.portfolio-change,
.wallet-change {
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.portfolio-change.positive,
.wallet-change.positive {
    color: var(--green);
    background: rgba(22, 199, 132, 0.1);
}

.portfolio-change.negative,
.wallet-change.negative {
    color: var(--red);
    background: rgba(234, 57, 67, 0.1);
}

.portfolio-change .arrow,
.wallet-change .arrow {
    font-size: 14px;
}

.portfolio-change-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

/* Overview Stats Section */
.overview-stats {
    display: flex;
    gap: 24px;
    margin: 24px 32px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.overview-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overview-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.overview-stat-value.positive {
    color: var(--green);
}

.overview-stat-value.negative {
    color: var(--red);
}

.portfolio-actions,
.wallet-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1;
}

/* Enhanced Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.toggle-switch:hover {
    background: var(--bg-hover);
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background-color: var(--bg-tertiary);
    border-radius: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    box-shadow: 0 2px 8px rgba(22, 199, 132, 0.3);
}

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

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

/* Enhanced Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 199, 132, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 199, 132, 0.4);
}

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

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

.btn-primary:active,
.btn-secondary:active {
    transform: translateY(0) scale(0.97);
}

/* Pulse animation for CTA buttons */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(22, 199, 132, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(22, 199, 132, 0.5);
    }
    100% {
        box-shadow: 0 4px 12px rgba(22, 199, 132, 0.3);
    }
}

.btn-primary {
    animation: pulse 2s ease-in-out infinite;
}

.btn-primary:hover {
    animation: none;
}

/* Wallet Name */
.wallet-name {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

/* Enhanced Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--blue), var(--primary-color));
    background-size: 200% 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(22, 199, 132, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(22, 199, 132, 0.3);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.stat-value.positive {
    color: var(--green);
}

.stat-value.negative {
    color: var(--red);
}

.performer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.performer-token {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.performer-value {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.performer-value.positive {
    color: var(--green);
}

.performer-value.negative {
    color: var(--red);
}

.performer-percent {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Enhanced Allocation Section */
.allocation-section {
    background: linear-gradient(135deg,
        rgba(22, 199, 132, 0.03) 0%,
        var(--bg-primary) 30%,
        rgba(59, 130, 246, 0.03) 100%);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 36px;
    margin-bottom: 32px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.allocation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--primary-color),
        var(--blue),
        transparent);
    opacity: 0.5;
}

.allocation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.allocation-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.allocation-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 10px;
}

.allocation-tab {
    padding: 8px 20px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.allocation-tab:hover {
    color: var(--text-primary);
}

.allocation-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 199, 132, 0.3);
}

.allocation-content {
    display: flex;
    gap: 48px;
    align-items: center;
}

.allocation-chart-wrapper {
    flex-shrink: 0;
    position: relative;
    padding: 20px;
    background: radial-gradient(circle,
        rgba(22, 199, 132, 0.05) 0%,
        transparent 70%);
    border-radius: 50%;
}

.allocation-chart-wrapper canvas {
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.15));
    transition: transform 0.4s ease;
}

.allocation-chart-wrapper:hover canvas {
    transform: scale(1.05) rotate(5deg);
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    transition: all 0.4s ease;
}

.allocation-chart-wrapper:hover .chart-center-text {
    transform: translate(-50%, -50%) scale(1.1);
}

.chart-center-value {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    letter-spacing: -1px;
}

.chart-center-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    display: block;
}

.allocation-legend {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.legend-item:hover {
    background: linear-gradient(90deg,
        rgba(22, 199, 132, 0.08) 0%,
        rgba(59, 130, 246, 0.05) 100%);
    transform: translateX(6px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.legend-token {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.legend-percent {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-secondary);
}

/* Enhanced Holdings and Assets Sections */
.holdings-section,
.assets-section {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.03) 0%,
        var(--bg-primary) 30%,
        rgba(22, 199, 132, 0.03) 100%);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 36px;
    margin-bottom: 32px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.holdings-section::before,
.assets-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--blue),
        var(--primary-color),
        transparent);
    opacity: 0.5;
}

.holdings-section h2,
.assets-section h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 28px 0;
    letter-spacing: -0.5px;
    position: relative;
    padding-left: 16px;
}

.holdings-section h2::before,
.assets-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 28px;
    background: linear-gradient(180deg, var(--primary-color), var(--blue));
    border-radius: 3px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Enhanced Tables */
.holdings-table,
.assets-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.holdings-table th,
.assets-table th {
    text-align: left;
    padding: 16px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    background: var(--bg-secondary);
}

.holdings-table tr,
.assets-table tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Table row entrance animation */
.holdings-table tbody tr,
.assets-table tbody tr {
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.holdings-table tbody tr:nth-child(1),
.assets-table tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

.holdings-table tbody tr:nth-child(2),
.assets-table tbody tr:nth-child(2) {
    animation-delay: 0.1s;
}

.holdings-table tbody tr:nth-child(3),
.assets-table tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

.holdings-table tbody tr:nth-child(4),
.assets-table tbody tr:nth-child(4) {
    animation-delay: 0.2s;
}

.holdings-table tbody tr:nth-child(5),
.assets-table tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

.holdings-table tbody tr:nth-child(n+6),
.assets-table tbody tr:nth-child(n+6) {
    animation-delay: 0.3s;
}

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

/*
.holdings-table tbody tr::before,
.assets-table tbody tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--primary-color), var(--blue));
    transition: height 0.3s ease;
    border-radius: 0 4px 4px 0;
}
*/

.holdings-table tbody tr:hover,
.assets-table tbody tr:hover {
    background: linear-gradient(90deg,
        rgba(22, 199, 132, 0.08) 0%,
        rgba(59, 130, 246, 0.04) 50%,
        transparent 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.holdings-table tbody tr:hover::before,
.assets-table tbody tr:hover::before {
    height: 100%;
}

.holdings-table td,
.assets-table td {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: var(--text-primary);
}

.holdings-table tr:last-child td,
.assets-table tr:last-child td {
    border-bottom: none;
}

/* Enhanced Asset Cell */
.asset-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.asset-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.asset-logo::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.asset-cell:hover .asset-logo {
    transform: scale(1.15) rotate(5deg);
    box-shadow:
        0 8px 24px rgba(22, 199, 132, 0.3),
        0 0 0 3px rgba(22, 199, 132, 0.2);
}

.asset-cell:hover .asset-logo::before {
    opacity: 0.3;
}

.asset-info {
    display: flex;
    flex-direction: column;
}

.asset-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.asset-symbol {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Enhanced Wallet Badges */
.wallet-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wallet-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.wallet-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.wallet-badge-icon {
    font-size: 13px;
}

/* Enhanced Price Changes */
.holdings-table td.change-positive,
.assets-table td.change-positive,
.change-positive {
    color: var(--green) !important;
    font-weight: 700;
}

.holdings-table td.change-negative,
.assets-table td.change-negative,
.change-negative {
    color: var(--red) !important;
    font-weight: 700;
}

.change-neutral {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Holdings Value */
.holdings-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.holdings-amount {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.holdings-token {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Enhanced Action Buttons in Table */
.table-action-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.table-action-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--blue));
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 199, 132, 0.3);
    border-color: transparent;
}

/* Mobile Cards (Hidden by default) */
.holdings-cards,
.assets-cards {
    display: none;
}

/* Enhanced Loading State */
.portfolio-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    gap: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(22, 199, 132, 0.1);
    border-top-color: var(--primary-color);
    border-right-color: var(--blue);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite reverse;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-secondary) 0%,
        var(--bg-hover) 50%,
        var(--bg-secondary) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-header {
    height: 200px;
    margin-bottom: 32px;
    border-radius: 24px;
}

.skeleton-card {
    height: 150px;
    margin-bottom: 20px;
    border-radius: 20px;
}

.skeleton-table-row {
    height: 60px;
    margin-bottom: 12px;
    border-radius: 12px;
}

/* Smooth Scrollbar */
.portfolio-sidebar::-webkit-scrollbar,
.portfolio-content::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.portfolio-sidebar::-webkit-scrollbar-track,
.portfolio-content::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.portfolio-sidebar::-webkit-scrollbar-thumb,
.portfolio-content::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--blue));
    border-radius: 4px;
    transition: background 0.3s ease;
}

.portfolio-sidebar::-webkit-scrollbar-thumb:hover,
.portfolio-content::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--blue), var(--primary-color));
}

/* Mobile scrollbar optimization */
@media (max-width: 768px) {
    .portfolio-sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .portfolio-sidebar::-webkit-scrollbar-thumb {
        background: rgba(22, 199, 132, 0.5);
    }

    .portfolio-sidebar::-webkit-scrollbar-thumb:hover {
        background: var(--primary-color);
    }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Performance: GPU acceleration for animated elements */
.portfolio-header,
.wallet-header,
.stat-card,
.sidebar-item,
.wallet-item,
.allocation-chart-wrapper,
.holdings-table tbody tr,
.assets-table tbody tr {
    will-change: transform;
}

.portfolio-view.active {
    will-change: auto;
}

/* Dark mode specific enhancements */
.theme-dark .portfolio-sidebar,
.theme-dark .portfolio-header,
.theme-dark .wallet-header,
.theme-dark .stat-card,
.theme-dark .allocation-section,
.theme-dark .holdings-section,
.theme-dark .assets-section {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.theme-dark .sidebar-item.active,
.theme-dark .wallet-item.active {
    background: linear-gradient(90deg,
        rgba(22, 199, 132, 0.2) 0%,
        rgba(59, 130, 246, 0.15) 100%);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    min-height: 60vh;
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.empty-portfolios {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
}

.empty-message {
    padding: 40px 20px !important;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Transactions Section */
.transactions-section {
    margin-top: 40px;
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.transactions-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Transactions Filters */
.transactions-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.filter-input::placeholder {
    color: var(--text-tertiary);
}

.filter-select {
    cursor: pointer;
}

/* Sortable Table Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.sortable:hover {
    background-color: var(--bg-hover) !important;
}

.sort-icon {
    display: inline-block;
    width: 12px;
    margin-left: 4px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.sort-icon::before {
    content: '⇅';
    font-size: 12px;
}

.sortable.sort-asc .sort-icon::before {
    content: '▲';
    opacity: 1;
}

.sortable.sort-desc .sort-icon::before {
    content: '▼';
    opacity: 1;
}

.sortable.sort-asc .sort-icon,
.sortable.sort-desc .sort-icon {
    opacity: 1;
    color: var(--primary-color);
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.transactions-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.transactions-table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transactions-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.transactions-table tbody tr:last-child {
    border-bottom: none;
}

.transactions-table tbody tr:hover {
    background: var(--bg-secondary);
}

.transactions-table td {
    padding: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.transaction-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.transaction-type.buy {
    background: rgba(22, 199, 132, 0.1);
    color: var(--primary-color);
}

.transaction-type.sell {
    background: rgba(234, 57, 67, 0.1);
    color: var(--red);
}

.transaction-crypto {
    display: flex;
    align-items: center;
    gap: 10px;
}

.transaction-crypto img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.transaction-crypto-info {
    display: flex;
    flex-direction: column;
}

.transaction-crypto-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.transaction-crypto-symbol {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.btn-icon-sm:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-icon-sm.danger:hover {
    background: var(--red);
    color: #ffffff;
}

/* Transactions Empty State */
.transactions-empty {
    text-align: center;
    padding: 60px 20px;
}

.transactions-empty .empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.transactions-empty h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.transactions-empty p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .transactions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .transactions-actions {
        width: 100%;
    }

    .transactions-actions button {
        flex: 1;
    }
}

/* ========================================
   HISTORY CHART SECTION
   ======================================== */

.history-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.history-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.history-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Period Buttons */
.period-buttons {
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.period-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.period-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.period-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(22, 199, 132, 0.3);
}

/* Chart Container */
.history-chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 16px;
}

.history-chart-container canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* Tooltip */
.chart-tooltip {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
    min-width: 140px;
}

.chart-tooltip.visible {
    opacity: 1;
}

.tooltip-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.tooltip-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tooltip-change {
    font-size: 12px;
    font-weight: 500;
}

.tooltip-change.positive {
    color: var(--green);
}

.tooltip-change.negative {
    color: var(--red);
}

/* Loading State */
.chart-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.chart-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.chart-empty {
    display: none;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .history-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .period-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .period-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 13px;
    }

    .history-chart-container {
        min-height: 200px;
        padding: 12px;
    }

    .chart-tooltip {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 120px;
    }

    .tooltip-value {
        font-size: 15px;
    }

    .tooltip-date {
        font-size: 11px;
    }

    .tooltip-change {
        font-size: 11px;
    }
}

/* ========================================
   CHARTS GRID - SIDE BY SIDE LAYOUT
   ======================================== */

.charts-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

/* Desktop: History + Allocation lado a lado (50% cada) */
@media (min-width: 769px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Remove margins individuais já que o gap controla o espaçamento */
    .charts-grid .history-section,
    .charts-grid .allocation-section {
        margin-bottom: 0;
    }
}

/* Tablet intermediário (769px - 1024px): ajuste de proporção */
@media (min-width: 769px) and (max-width: 1024px) {
    .charts-grid {
        gap: 16px;
    }
}

/* Mobile: Manter layout stacked (um embaixo do outro) */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Em mobile, mantém as margins individuais */
    .charts-grid .history-section,
    .charts-grid .allocation-section {
        margin-bottom: 16px;
    }
}
