/* Right Portfolio Panel */
.right-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: 350px;
    height: 100vh;
    background: #1a1a1a;
    border-left: 1px solid #2a2a2a;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.right-panel.open {
    transform: translateX(0);
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #e3e3e3;
    margin: 0;
}

.close-panel {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e3e3e3;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.close-panel:hover {
    background: #2a2a2a;
    border-color: #3a3a3a;
    transform: translateY(-1px);
}

/* Portfolio Content */
.portfolio-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.portfolio-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
}

.stat-label {
    color: #888;
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #e3e3e3;
}

.stat-value.positive {
    color: #8b5cf6;
}

.stat-value.negative {
    color: #FF6B6B;
}

/* Portfolio Actions */
.portfolio-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.portfolio-btn {
    flex: 1;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e3e3e3;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.portfolio-btn:hover {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.portfolio-btn.primary {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.portfolio-btn.primary:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Portfolio Items */
.portfolio-list {
    margin-top: 10px;
}

.portfolio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.portfolio-item:hover {
    border-color: #3a3a3a;
    background: #1f1f1f;
}

.ticker-info {
    display: flex;
    flex-direction: column;
}

.ticker-symbol {
    font-weight: 600;
    font-size: 16px;
    color: #8b5cf6;
    margin-bottom: 4px;
}

.ticker-shares {
    color: #888;
    font-size: 12px;
}

.ticker-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ticker-price {
    font-weight: 600;
    color: #e3e3e3;
    margin-bottom: 4px;
}

.ticker-change {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.ticker-change.positive {
    background: rgba(0, 255, 136, 0.1);
    color: #8b5cf6;
}

.ticker-change.negative {
    background: rgba(255, 68, 68, 0.1);
    color: #FF6B6B;
}

/* Add Ticker Form */
.add-ticker-form {
    margin-top: 20px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    display: none;
}

.add-ticker-form.show {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    color: #e3e3e3;
    font-size: 14px;
    margin-bottom: 5px;
}

.form-input {
    width: 100%;
    padding: 10px;
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #e3e3e3;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

.form-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.form-btn.cancel {
    background: #1a1a1a;
    color: #e3e3e3;
}

.form-btn.cancel:hover {
    background: #2a2a2a;
}

.form-btn.submit {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    border: none;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

.form-btn.submit:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}
/* Portfolio Fullscreen Overlay Styles */
.portfolio-overlay {
    position: fixed;
    top: 0;
    left: 260px; /* Учитываем ширину развернутого сайдбара */
    width: calc(100vw - 260px);
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    transition: left 0.3s ease, width 0.3s ease; /* Плавный переход */
}

/* Когда сайдбар свернут */
.sidebar.collapsed ~ .main-content .portfolio-overlay,
.portfolio-overlay.sidebar-collapsed {
    left: 60px; /* Ширина свернутого сайдбара */
    width: calc(100vw - 60px);
}

/* Когда сайдбар свернут */

.portfolio-overlay.hidden {
    display: none;
}

.portfolio-fullscreen-container {
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Portfolio Header */
.portfolio-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
    background: #1a1a1a;
}

.portfolio-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1300px; /* Same total width as Stock Detail content + sidebar */
}

.portfolio-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.portfolio-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 8px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.portfolio-back-btn:hover {
    background: #333;
    color: #fff;
}

.portfolio-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s;
}

.portfolio-title:hover {
    opacity: 0.8;
}

.portfolio-icon {
    color: #8b5cf6;
}

.portfolio-avatar {
    width: 24px;
    height: 24px;
    background: #caa999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.portfolio-letter {
    line-height: 1;
}

.dropdown-icon {
    color: #666;
}

.portfolio-avatar.small {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.portfolio-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 320px;
    margin-top: 8px;
}

.portfolio-dropdown.hidden {
    display: none;
}

.portfolio-dropdown-content {
    padding: 8px;
}

.portfolio-list {
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.portfolio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.portfolio-item:hover {
    background: #3a3a3a;
}

.portfolio-item.active {
    background: #8b5cf6;
}

.portfolio-item-name {
    flex: 1;
    color: #fff;
    font-weight: 500;
}

.check-icon {
    color: #fff;
    opacity: 0.8;
}

.portfolio-dropdown-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.portfolio-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: 1px solid #555;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    flex: 1;
}

.portfolio-action-btn:hover {
    background: #3a3a3a;
    border-color: #666;
}

.portfolio-action-btn.secondary {
    color: #ccc;
}

.portfolio-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portfolio-manage-btn,
.portfolio-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 13px;
}

.portfolio-manage-btn {
    background: transparent;
    border: 1px solid #333;
    color: #ccc;
}

.portfolio-manage-btn:hover {
    background: #333;
    color: #fff;
}

/* Manage Dropdown */
.manage-dropdown-container {
    position: relative;
}

.manage-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    overflow: hidden;
}

.manage-dropdown.hidden {
    display: none;
}

.manage-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.manage-dropdown-item:hover {
    background: #2a2a2a;
    color: #fff;
}

.manage-dropdown-item.danger {
    color: #ff6b6b;
}

.manage-dropdown-item.danger:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.manage-dropdown-item svg {
    flex-shrink: 0;
}

.portfolio-add-btn {
    background-color: rgba(0, 200, 200, 0.15);
    border: 1px solid rgba(124, 195, 228, 0.5);
    color: #7CC3E4;
}

.portfolio-add-btn:hover {
    background-color: rgba(0, 200, 200, 0.25);
    border-color: rgba(124, 195, 228, 0.7);
    color: #9DD5F0;
}

.portfolio-cash-btn {
    background: #1a1a1a !important;
    border: 1px solid #caa999 !important;
    color: #caa999 !important;
}

.portfolio-cash-btn:hover {
    background: #252525 !important;
    border-color: #e0c5b0 !important;
    color: #e0c5b0 !important;
}

/* Portfolio Content */
.portfolio-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
}

.portfolio-sidebar {
    flex: 0 0 300px;
    background: #0a0a0a;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-right: 30px;
}

.portfolio-main {
    flex: 0 0 1000px;
    background: #0a0a0a;
    padding: 0;
}

/* Portfolio Summary Card */
.portfolio-summary-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.summary-label {
    color: #999;
    font-size: 14px;
}

.time-selector .time-btn {
    background: #333;
    border: none;
    color: #ccc;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.time-selector .time-btn.active {
    background: #8b5cf6;
    color: #fff;
}

.summary-balance {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.summary-change {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.summary-change.positive .change-amount {
    color: #7CC3E4;
}

.summary-change.negative .change-amount {
    color: #FF6B6B;
}

.change-amount {
    font-weight: 600;
    font-size: 16px;
}

.change-value {
    color: #999;
    font-size: 14px;
}

.summary-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    color: #999;
    font-size: 14px;
}

.metric-value {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.metric-value.positive {
    color: #7CC3E4;
}

.metric-value.negative {
    color: #FF6B6B;
}

/* S&P 500 Comparison Card */
.sp500-comparison-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 0;
}

.sp500-comparison-card .card-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.comparison-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comparison-label {
    color: #999;
    font-size: 14px;
}

.comparison-value {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.comparison-value.positive {
    color: #4ADE80;
}

.comparison-value.negative {
    color: #FF6B6B;
}

.alpha-row {
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
    margin-top: 4px;
}

.alpha-row .comparison-label {
    color: #fff;
    font-weight: 500;
}

.comparison-period {
    color: #666;
    font-size: 11px;
    margin-top: 12px;
    text-align: right;
}

/* Performance Card */
.performance-card,
.holdings-card,
.events-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
}

.card-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.performance-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
}

.performance-item:last-child {
    border-bottom: none;
}

.performance-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.performance-label {
    color: #999;
    font-size: 12px;
}

.performance-ticker {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.performance-value.positive {
    color: #7CC3E4;
}

.performance-value.negative {
    color: #FF6B6B;
}

/* Holdings Card */
.holdings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.portfolios-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #999;
    font-size: 12px;
    cursor: pointer;
}

.holdings-chart {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.holdings-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-label {
    color: #ccc;
    font-size: 12px;
    flex: 1;
}

.legend-percent {
    color: #999;
    font-size: 12px;
    font-weight: 600;
}

/* Events Card */
.event-item {
    display: flex;
    gap: 16px;
    align-items: center;
}

.event-date {
    background: #333;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    min-width: 60px;
}

.event-day {
    color: #8b5cf6;
    font-size: 10px;
    font-weight: 600;
}

.event-number {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.event-year {
    color: #999;
    font-size: 10px;
}

.event-title {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.event-subtitle {
    color: #999;
    font-size: 12px;
    margin-bottom: 4px;
}

.event-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #8b5cf6;
    font-size: 11px;
    font-weight: 500;
}

/* Assets Section */
.assets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.assets-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.small-balances-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ccc;
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    border-radius: 24px;
    transition: 0.2s;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + label {
    background-color: #7CC3E4;
}

.toggle-switch input:checked + label:before {
    transform: translateX(20px);
}

/* Assets Table */
.assets-table {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 2.3fr 1.0fr 1fr 1.2fr 1fr 1.5fr 1.5fr;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 16px 20px;
}

.table-col {
    color: #999;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-body {
    /* Removed max-height and overflow to allow dynamic expansion */
}

.asset-row {
    display: grid;
    grid-template-columns: 2.3fr 1.0fr 1fr 1.2fr 1fr 1.5fr 1.5fr;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    align-items: center;
    transition: background-color 0.2s;
    cursor: pointer;
}


.asset-row:hover {
    background: #1a1a1a;
}

.asset-row:last-child {
    border-bottom: none;
}

.asset-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asset-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    overflow: hidden;
    text-transform: uppercase;
}

.asset-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: white;
}

.asset-symbol {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.asset-name {
    color: #999;
    font-size: 12px;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.current-price {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.price-change.positive {
    color: #7CC3E4;
}

.price-change.negative {
    color: #FF6B6B;
}

.profit-value.positive,
.current-profit.positive {
    color: #7CC3E4;
}

.profit-value.negative,
.current-profit.negative {
    color: #FF6B6B;
}

/* Общие классы для положительных и отрицательных значений */
.positive {
    color: #7CC3E4 !important;
}

.negative {
    color: #FF6B6B !important;
}

.invested-value,
.avg-price {
    color: #ccc;
    font-size: 14px;
}

.current-profit-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profit-percent {
    font-size: 12px;
}

.holdings-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.holdings-amount {
    color: #fff;
    font-weight: 500;
}

.holdings-shares {
    color: #999;
    font-size: 12px;
}

/* Transaction Modal */
.transaction-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
}

.modal-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

/* Metrics Settings Modal */
.metrics-settings-modal {
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.metrics-settings-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.metrics-settings-modal .modal-header h3 {
    flex: 1;
}

.metrics-total-badge {
    background: rgba(124, 195, 228, 0.15);
    color: #7cc3e4;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.metrics-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 !important;
}

.metrics-category {
    border-bottom: 1px solid #333;
}

.metrics-category:last-child {
    border-bottom: none;
}

.metrics-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.metrics-category-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.metrics-category-arrow {
    color: #666;
    font-size: 10px;
    transition: transform 0.2s;
}

.metrics-category-arrow.collapsed {
    transform: rotate(-90deg);
}

.metrics-category-title {
    font-weight: 500;
    color: #fff;
    flex: 1;
    font-size: 14px;
}

.metrics-category-count {
    background: #333;
    color: #888;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.metrics-category-content {
    padding: 0 20px 15px 20px;
}

.metrics-category-content.collapsed {
    display: none;
}

.metrics-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a2a;
}

.metrics-checkbox-item:last-child {
    border-bottom: none;
}

.metrics-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #7cc3e4;
    cursor: pointer;
}

.metrics-checkbox-item label {
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    flex: 1;
}

.metrics-checkbox-item:hover label {
    color: #fff;
}

.metrics-settings-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #333;
}

.metrics-settings-modal .btn-secondary {
    background: transparent;
    border: 1px solid #444;
    color: #999;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.metrics-settings-modal .btn-secondary:hover {
    border-color: #7cc3e4;
    color: #7cc3e4;
}

.metrics-settings-modal .btn-primary {
    background: #7cc3e4;
    border: none;
    color: #000;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.metrics-settings-modal .btn-primary:hover {
    background: #9dd4ed;
}

/* Metrics Reorder Mode */
#metricsReorderBtn.active {
    background: rgba(124, 195, 228, 0.25);
    color: #7cc3e4;
}

.metrics-reorder-active .stock-detail-metric-item {
    cursor: grab;
    position: relative;
    padding-left: 24px;
    transition: background 0.15s, transform 0.15s;
    border: 1px solid transparent;
    border-radius: 6px;
}

.metrics-reorder-active .stock-detail-metric-item::before {
    content: '\2807';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 14px;
    line-height: 1;
}

.metrics-reorder-active .stock-detail-metric-item:hover {
    background: rgba(124, 195, 228, 0.08);
    border-color: #333;
}

.metrics-reorder-active .stock-detail-metric-item.dragging {
    opacity: 0.3;
    border: 1px dashed #555;
}

.metrics-reorder-active .stock-detail-metric-item.drag-over-before {
    border-top: 2px solid #7cc3e4;
    margin-top: -1px;
}

.metrics-reorder-active .stock-detail-metric-item.drag-over-after {
    border-bottom: 2px solid #7cc3e4;
    margin-bottom: -1px;
}

/* Universal Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-modal.hidden { display: none; }
.confirm-modal .modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}
.confirm-modal-content {
    position: relative;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.2s ease-out;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.confirm-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.confirm-modal-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}
.confirm-modal-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}
.confirm-modal-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px;
}
.confirm-modal-message {
    color: #999;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 24px;
}
.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}
.confirm-btn.cancel {
    background: #333;
    border: 1px solid #444;
    color: #ccc;
}
.confirm-btn.cancel:hover {
    background: #444;
    color: #fff;
}
.confirm-btn.danger {
    background: #ef4444;
    border: none;
    color: #fff;
}
.confirm-btn.danger:hover {
    background: #dc2626;
}
.confirm-btn.primary {
    background: #8b5cf6;
    border: none;
    color: #fff;
}
.confirm-btn.primary:hover {
    background: #7c3aed;
}
.confirm-btn.warning {
    background: #f59e0b;
    border: none;
    color: #000;
}
.confirm-btn.warning:hover {
    background: #d97706;
}

.modal-search {
    padding: 20px 24px 20px;
}

.search-input {
    width: 100%;
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.transaction-tabs {
    display: flex;
    padding: 20px 24px 0;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 8px 16px;
    background: #333;
    border: none;
    border-radius: 6px;
    color: #ccc;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #79d3d3;
    color: #111;
}

.transaction-form {
    padding: 20px 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
    margin-bottom: 0 !important;
}

.cash-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    color: #8b5cf6;
    font-size: 20px;
    transition: opacity 0.2s;
    padding: 4px;
    min-width: 28px;
    text-align: center;
}

.cash-checkbox:not(:checked) + .checkmark {
    opacity: 0.3;
}

.cash-balance {
    color: #888;
    font-size: 12px;
    margin-left: auto;
}

.form-select,
.amount-input,
.price-input,
.datetime-input {
    width: 100%;
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
}

.form-select:focus,
.amount-input:focus,
.price-input:focus,
.datetime-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.amount-input-group,
.price-input-group {
    display: flex;
    align-items: center;
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    padding-right: 16px;
}

.amount-input-group:focus-within,
.price-input-group:focus-within {
    border-color: #8b5cf6;
}

.sell-all-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 8px;
    transition: background 0.2s;
}

.sell-all-btn:hover {
    background: #dc2626;
}

.note-input {
    width: 100%;
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.note-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.note-input::placeholder {
    color: #666;
}

.note-group.hidden {
    display: none;
}

.note-icon {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.note-icon:hover {
    opacity: 1;
}

.note-icon.has-note {
    opacity: 0.9;
}

/* Transaction Note Modal */
.note-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.note-modal.hidden {
    display: none;
}

.note-modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.note-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.note-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.note-modal-body {
    padding: 20px;
}

.note-modal-textarea {
    width: 100%;
    min-height: 150px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.note-modal-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
}

.note-modal-textarea::placeholder {
    color: #666;
}

.note-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #333;
}

.note-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.note-modal-btn.cancel {
    background: #333;
    color: #ccc;
}

.note-modal-btn.cancel:hover {
    background: #444;
}

.note-modal-btn.save {
    background: #8b5cf6;
    color: #fff;
}

.note-modal-btn.save:hover {
    background: #7c3aed;
}

/* Pre-filled ticker display in transaction modal */
.prefilled-ticker-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.prefilled-ticker-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prefilled-ticker-symbol {
    font-size: 18px;
    font-weight: 600;
    color: #8b5cf6;
}

.prefilled-ticker-name {
    font-size: 14px;
    color: #888;
}

.prefilled-ticker-change {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.prefilled-ticker-change:hover {
    border-color: #666;
    color: #fff;
}

.amount-input,
.price-input {
    border: none;
    background: transparent;
    padding: 12px 16px;
}

.amount-currency,
.price-currency {
    color: #999;
    font-size: 12px;
    font-weight: 600;
}

.currency-select {
    background: #2a2a2a;
    border: none;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    min-width: 50px;
}

.currency-select:focus {
    outline: none;
    background: #333;
}

.price-options {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.price-option-btn {
    padding: 6px 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.price-option-btn.active {
    background: #79d3d3;
    border-color: #79d3d3;
    color: #111;
}

.total-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px 16px;
}

.total-amount-input {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    min-width: 0;
    font-family: inherit;
}

.total-amount-input::placeholder {
    color: #666;
}

.total-amount-input::-webkit-inner-spin-button,
.total-amount-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-currency {
    color: #999;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

.action-btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.action-btn.secondary {
    background: #333;
    color: #ccc;
    flex: 1;
}

.action-btn.secondary:hover {
    background: #444;
}

.action-btn.primary {
    background: #79d3d3;
    color: #111;
    flex: 2;
    font-weight: 600;
}

.action-btn.primary:hover {
    background: #5fbfbf;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    padding: 12px;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #333;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-ticker {
    font-weight: bold;
    color: #fff;
    font-size: 14px;
}

.suggestion-name {
    color: #ccc;
    font-size: 12px;
    margin-top: 2px;
}

.suggestion-sector {
    color: #888;
    font-size: 11px;
    margin-top: 2px;
}

.no-suggestions {
    padding: 12px;
    color: #666;
    font-size: 12px;
    text-align: center;
}

.modal-search {
    position: relative;
    margin-bottom: 20px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Input Area */
.input-container {
    padding: 20px;
    flex-shrink: 0;
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.chat-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 6px 15px;
    color: #e3e3e3;
    font-size: 15px;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.4;
    height: auto;
}

.chat-input:focus {
    outline: none;
}

/* Input actions bar */
.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
}

.send-button {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #888;
}

.send-button:hover {
    color: #caa999;
    background: rgba(202, 169, 153, 0.1);
}

/* Upload Button */
.upload-button {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #888;
}

.upload-button:hover {
    color: #caa999;
    background: rgba(202, 169, 153, 0.1);
}

.upload-button.uploading {
    opacity: 0.5;
    pointer-events: none;
}

/* Document Card (inside input area, Claude-style vertical) */
.document-chip {
    display: flex;
    flex-direction: column;
    width: 72px;
    height: 90px;
    background: #1e1e2e;
    border: 1px solid #3a3a4a;
    border-radius: 8px;
    z-index: 5;
    overflow: hidden;
    margin: 8px 12px;
    flex-shrink: 0;
}

.document-chip .doc-chip-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #252535;
}

.document-chip .doc-chip-ext {
    background: #e85d04;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* File type colors */
.document-chip .doc-chip-ext[data-ext="pdf"] { background: #dc2626; }
.document-chip .doc-chip-ext[data-ext="doc"],
.document-chip .doc-chip-ext[data-ext="docx"] { background: #2563eb; }
.document-chip .doc-chip-ext[data-ext="txt"] { background: #6b7280; }
.document-chip .doc-chip-ext[data-ext="png"],
.document-chip .doc-chip-ext[data-ext="jpg"],
.document-chip .doc-chip-ext[data-ext="jpeg"] { background: #7c3aed; }

.document-chip .doc-chip-footer {
    padding: 6px 8px;
    background: #1e1e2e;
    border-top: 1px solid #3a3a4a;
}

.document-chip .doc-chip-name {
    color: #aaa;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.document-chip .doc-chip-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.document-chip .doc-chip-remove:hover {
    background: #ff6b6b;
    color: white;
}

/* Document chip inside chat message */
.message-document {
    display: inline-flex;
    flex-direction: column;
    width: 72px;
    height: 90px;
    background: #1e1e2e;
    border: 1px solid #3a3a4a;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.message-document .doc-chip-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #252535;
}

.message-document .doc-chip-ext {
    background: #e85d04;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-document .doc-chip-ext[data-ext="pdf"] { background: #dc2626; }
.message-document .doc-chip-ext[data-ext="doc"],
.message-document .doc-chip-ext[data-ext="docx"] { background: #2563eb; }
.message-document .doc-chip-ext[data-ext="txt"] { background: #6b7280; }
.message-document .doc-chip-ext[data-ext="png"],
.message-document .doc-chip-ext[data-ext="jpg"],
.message-document .doc-chip-ext[data-ext="jpeg"] { background: #7c3aed; }

.message-document .doc-chip-footer {
    padding: 6px 8px;
    background: #1e1e2e;
    border-top: 1px solid #3a3a4a;
}

.message-document .doc-chip-name {
    color: #aaa;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Document chip is now in flex flow, no padding adjustment needed */

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a2e;
    border: 1px solid #3a3a4a;
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification .toast-icon {
    font-size: 18px;
    font-weight: bold;
}

.toast-notification .toast-message {
    color: #e3e3e3;
    font-size: 14px;
}

.toast-success {
    border-color: #00dd77;
}
.toast-success .toast-icon {
    color: #00dd77;
}

.toast-error {
    border-color: #ff6b6b;
}
.toast-error .toast-icon {
    color: #ff6b6b;
}

.toast-info {
    border-color: #7CC3E4;
}
.toast-info .toast-icon {
    color: #7CC3E4;
}

/* Suggestions System - Vertical List */
.suggestions-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 20px;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(26, 26, 46, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(124, 195, 228, 0.2);
}

.suggestions-container.hidden {
    display: none;
}

.suggestions-title {
    font-size: 13px;
    color: #caa999;
    margin-bottom: 8px;
    font-weight: 500;
}

.suggestion-btn {
    background: transparent;
    border: 1px solid #555;
    color: #888;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.suggestion-btn::before {
    content: '→';
    opacity: 0.5;
}

.suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #777;
    color: #aaa;
}

.suggestion-btn:active {
    transform: translateY(0);
}

.suggestion-btn .suggestion-icon {
    font-size: 14px;
    opacity: 0.6;
}

/* Quick Actions - Initial Chat Buttons */
.quick-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: fixed;
    bottom: 120px;
    left: 60px;
    right: 0;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 100;
    box-sizing: border-box;
    transition: left 0.3s ease;
}

.quick-action-btn {
    background: transparent;
    border: 1px solid #555;
    color: #888;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #777;
    color: #aaa;
}

.quick-action-btn:active {
    transform: translateY(0);
}

.quick-action-btn .qa-icon {
    font-size: 16px;
}

/* Loading */
.spinner {
    border: 2px solid #2a2a2a;
    border-top: 2px solid #8b5cf6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Scrollbar styling */
.alerts-list::-webkit-scrollbar,
.alert-detail-left::-webkit-scrollbar,
.alert-detail-right::-webkit-scrollbar,
.chat-container::-webkit-scrollbar,
.position-detail-view::-webkit-scrollbar,
.portfolio-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.alerts-list::-webkit-scrollbar-track,
.alert-detail-left::-webkit-scrollbar-track,
.alert-detail-right::-webkit-scrollbar-track,
.chat-container::-webkit-scrollbar-track,
.position-detail-view::-webkit-scrollbar-track,
.portfolio-content-wrapper::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.alerts-list::-webkit-scrollbar-thumb,
.alert-detail-left::-webkit-scrollbar-thumb,
.alert-detail-right::-webkit-scrollbar-thumb,
.chat-container::-webkit-scrollbar-thumb,
.position-detail-view::-webkit-scrollbar-thumb,
.portfolio-content-wrapper::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.alerts-list::-webkit-scrollbar-thumb:hover,
.alert-detail-left::-webkit-scrollbar-thumb:hover,
.alert-detail-right::-webkit-scrollbar-thumb:hover,
.chat-container::-webkit-scrollbar-thumb:hover,
.position-detail-view::-webkit-scrollbar-thumb:hover,
.portfolio-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Collapsed sidebar styles */

.sidebar.collapsed .sidebar-menu {
    padding: 5px;
    padding-top: 40px; /* Сохраняем отступ и в свернутом состоянии */
}

.sidebar.collapsed .menu-item {
    padding: 10px 8px;
    justify-content: center;
}

.sidebar.collapsed .menu-item span:not(.menu-icon) {
    display: none;
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
    font-size: 16px;
}

.sidebar.collapsed .chat-list {
    display: none;
}

.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .user-avatar {
    width: auto;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 4px;
    justify-content: center;
}
.sidebar.collapsed .tg-link-btn {
    left: 50%;
    transform: translateX(-50%);
}

/* Position Detail Styles */
.position-left-panel {
    width: 320px;
    background: #1a1a1a;
    border-right: 1px solid #2a2a2a;
    padding: 24px;
    overflow-y: auto;
}

.position-right-panel {
    flex: 1;
    background: #0a0a0a;
    padding: 24px;
    overflow-y: auto;
}

.stock-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stock-price-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-symbol {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.stock-price {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.stock-change {
    font-size: 16px;
    font-weight: 600;
}

.stock-chart-mini {
    display: flex;
    align-items: center;
}

.stock-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.stock-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    color: #888;
    font-size: 14px;
}

.detail-value {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.recent-transactions-section {
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.transaction-search {
    position: relative;
    display: flex;
    align-items: center;
}

.transaction-search svg {
    position: absolute;
    left: 12px;
    color: #666;
    z-index: 1;
}

.transaction-search input {
    padding: 8px 12px 8px 40px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    width: 200px;
}

.transaction-search input::placeholder {
    color: #666;
}

.transactions-table {
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

.transactions-table .table-header {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr 1fr 1fr;
    padding: 16px 20px;
    background: transparent;
    border-bottom: 1px solid #2a2a2a;
    font-weight: 600;
    color: #ccc;
    font-size: 14px;
}

.transactions-table .table-body {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1fr 1fr 1fr;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    align-items: center;
    transition: background-color 0.2s;
}

.transaction-row:hover {
    background: #1a1a1a;
}

.transaction-row:last-child {
    border-bottom: none;
}

.transaction-date {
    color: #ccc;
    font-size: 14px;
}

.transaction-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.transaction-type.buy {
    color: #7CC3E4;
}

.transaction-type.sell {
    color: #FF6B6B;
}

.transaction-quantity {
    color: white;
    font-weight: 600;
}

.transaction-price {
    color: white;
    font-weight: 600;
}

.transaction-total {
    color: white;
    font-weight: 600;
}

.transaction-gain {
    font-weight: 600;
}

/* Position Detail View Styles */
.position-detail-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #0a0a0a;
    overflow-y: auto;
}

.position-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #0a0a0a;
}

.position-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    background: #0a0a0a;
    max-width: 1000px; /* Same width as Stock Detail */
    margin: 0 auto; /* Center the content */
}

.back-button {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.back-button:hover {
    background: #333;
}

.position-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    margin-left: 20px;
}

.position-logo {
    width: 30px; /* Уменьшили на 25% (было 40px) */
    height: 30px; /* Уменьшили на 25% (было 40px) */
    border-radius: 6px; /* Пропорционально уменьшили (было 8px) */
    background: #8b5cf6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px; /* Уменьшили на 25% (было 18px) */
}

.position-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.position-info h2 {
    color: #fff;
    margin: 0;
    font-size: 18px; /* Сделали такой же как у цены */
    font-weight: 600;
}

.position-info span {
    color: #888;
    font-size: 14px;
}

.position-actions {
    display: flex;
    gap: 12px;
}

.edit-asset-btn {
    background: #1a1a1a;
    color: white;
    border: 1px solid #2a2a2a;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.edit-asset-btn:hover {
    background: #333;
}

.edit-asset-dropdown {
    position: relative;
}

.edit-asset-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 4px;
    min-width: 140px;
    z-index: 1000;
    margin-top: 4px;
}

.dropdown-item {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
    text-align: left;
}

.dropdown-item:hover {
    background: #2a2a2a;
}

.dropdown-item.delete-item:hover {
    background: #dc2626;
}

/* Delete Asset Modal */
.delete-modal {
    max-width: 380px;
    width: 380px;
}

.delete-modal .modal-body {
    padding: 0 24px 24px 24px;
}

.move-modal {
    max-width: 380px;
    width: 380px;
}

.move-modal .modal-body {
    padding: 0 24px 24px 24px;
}

.move-warning {
    color: #e3e3e3;
    font-size: 14px;
    margin-top: 16px;
    margin-bottom: 0;
    line-height: 1.4;
    opacity: 0.8;
}

.delete-warning {
    color: #e3e3e3;
    font-size: 18px;
    margin-bottom: 24px;
    line-height: 1.4;
}

.delete-option {
    margin-bottom: 32px;
    padding-left: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #bbb;
    font-size: 20px;
}

.delete-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #444;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.delete-checkbox:checked {
    background: #666;
    border-color: #666;
}

.delete-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.modal-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px 24px 24px;
}

.btn-delete {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-delete:hover {
    background: #b91c1c;
}

.btn-primary {
    background: linear-gradient(135deg, #7CC3E4 0%, #5BA3C4 100%);
    color: #1a1a1a;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 195, 228, 0.3);
}

.btn-cancel {
    background: transparent;
    color: #bbb;
    border: 1px solid #444;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-cancel:hover {
    color: white;
    border-color: #666;
}

/* Support Modal */
.support-modal {
    max-width: 500px;
}

.support-modal .modal-body {
    padding: 0 24px 20px;
}

.support-modal .form-group {
    margin-bottom: 16px;
}

.support-modal .form-label {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.support-modal .form-input {
    width: 100%;
    background: #252522;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
}

.support-modal .form-input:focus {
    outline: none;
    border-color: #7CC3E4;
}

.support-modal textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

.support-modal select.form-input {
    cursor: pointer;
}

.support-notes-counter {
    text-align: right;
    color: #666;
    font-size: 11px;
    margin-top: 4px;
}

.watchlist-add-modal .form-input::placeholder {
    color: #555;
}

.watchlist-search-wrapper {
    position: relative;
}

.watchlist-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #252522;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.watchlist-search-results.hidden {
    display: none;
}

.watchlist-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.watchlist-search-result:hover {
    background: rgba(124, 195, 228, 0.1);
}

.watchlist-search-result img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}

.watchlist-search-result-info {
    flex: 1;
}

.watchlist-search-result-ticker {
    font-weight: 600;
    color: #e3e3e3;
}

.watchlist-search-result-name {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.add-transaction-btn {
    background-color: rgba(0, 200, 200, 0.15);
    border: 1px solid rgba(124, 195, 228, 0.5);
    color: #7CC3E4;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-transaction-btn:hover {
    background-color: rgba(0, 200, 200, 0.25);
    border-color: rgba(124, 195, 228, 0.7);
    color: #9DD5F0;
}

/* Position Details Row (50/50 layout) */
.position-details-row {
    display: flex;
    gap: 12px;
    padding: 0 12px;
    align-items: flex-start;
}

/* Position Details (Left Side) */
.position-details {
    flex: 1;
    min-width: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Position News (Right Side) - matches balance card height */
.position-news {
    flex: 1;
    min-width: 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 350px;
    overflow: hidden;
}

.position-news-header {
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.position-news-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.position-news-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.position-news-list::-webkit-scrollbar {
    width: 6px;
}

.position-news-list::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

.position-news-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.position-news-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.position-news-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #252525;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.position-news-item:hover {
    background: #303030;
}

.position-news-image {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #333;
}

.position-news-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.position-news-title {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.position-news-meta {
    color: #888;
    font-size: 11px;
    display: flex;
    gap: 8px;
}

.position-news-empty {
    color: #666;
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
}

/* Chart & Company Info (Right Top) */
.position-chart-section {
    grid-column: 2;
    grid-row: 1;
    background: #0a0a0a;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* Transactions (Full Width Bottom) */
.position-transactions {
    grid-column: 1 / -1;
    grid-row: 2;
    background: #1a1a1a;
    padding: 0;
    overflow-y: auto;
}

.position-balance-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    padding: 12px 20px 8px 20px;
}

.position-balance-card h3 {
    color: #888;
    font-size: 14px;
    margin: 0 0 12px 0;
    font-weight: 500;
}

.balance-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.balance-main span:first-child {
    color: #fff;
    font-size: 28px;
    font-weight: 600;
}

.balance-main span:last-child {
    color: #888;
    font-size: 14px;
}

.balance-change {
    display: flex;
    gap: 8px;
}

.balance-change span {
    font-size: 14px;
    font-weight: 500;
}

.position-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 350px;
}

.position-metrics {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0 0 12px 12px;
    border-top: none;
    padding: 8px 20px 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    color: #888;
    font-size: 14px;
}

.metric-value {
    color: #fff;
    font-weight: 500;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Position Chart Section (Right Side) */
.position-chart-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stock-info {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    padding: 8px 20px; /* Еще меньше вертикальные отступы */
    height: 60px; /* Еще больше уменьшили высоту */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    margin-top: 5px; /* Сместили вниз на 5px */
    margin-left: -10px; /* Сместили влево на 10px */
}

.stock-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-price span:first-child {
    color: #fff;
    font-size: 18px; /* Уменьшили на 25% (было 24px) */
    font-weight: 600;
}

.stock-price span:last-child {
    font-size: 14px;
    font-weight: 500;
}

.stock-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stock-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-detail-row span:first-child {
    color: #888;
    font-size: 14px;
}

.stock-detail-row span:last-child {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}


/* Position Transactions (Bottom) */
.position-transactions {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
    margin: 12px 12px 12px 12px;
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.transactions-header h3 {
    color: #fff;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.transactions-search .search-input {
    background: #0a0a0a;
    border: 1px solid #2a2a2a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
}

.transactions-search .search-input::placeholder {
    color: #666;
}

.transactions-table {
    width: 100%;
}

.transactions-header-row {
    display: grid;
    grid-template-columns: 100px 70px 80px 90px 90px 90px 50px;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 8px;
}

.transactions-header-row div {
    color: #888;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.transactions-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-row {
    display: grid;
    grid-template-columns: 100px 70px 80px 90px 90px 90px 50px;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #1a1a1a;
    align-items: center;
}

.transaction-col {
    color: #fff;
    font-size: 14px;
}

.transaction-type {
    font-weight: 500;
    text-transform: uppercase;
}

.transaction-type.buy {
    color: #7CC3E4;
}

.transaction-type.sell {
    color: #FF6B6B;
}

.transaction-type.dividend {
    color: #f59e0b;
}

/* Create Portfolio Modal Styles */
.create-portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.create-portfolio-modal.hidden {
    display: none;
}

.create-portfolio-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    width: 67%;
    max-width: 360px;
    max-height: 67vh;
    overflow-y: auto;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.create-portfolio-form {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-label {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

/* Avatar Section */
.avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.portfolio-avatar-preview {
    width: 64px;
    height: 64px;
    background: #4FC3F7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.avatar-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-text {
    color: #aaa;
    font-size: 14px;
}

.avatar-change-btn {
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-start;
}

.avatar-change-btn:hover {
    background: #444;
    border-color: #666;
}

/* Input Fields */
.input-with-counter {
    position: relative;
}

.form-input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    padding: 12px 16px;
    padding-right: 60px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #7CC3E4;
    box-shadow: 0 0 0 3px rgba(124, 195, 228, 0.1);
}

.form-input::placeholder {
    color: #666;
}

.char-counter {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Textarea */
.textarea-wrapper {
    position: relative;
}

.form-textarea {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    padding: 12px 16px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: #7CC3E4;
    box-shadow: 0 0 0 3px rgba(124, 195, 228, 0.1);
}

.form-textarea::placeholder {
    color: #666;
}

.char-counter-bottom {
    color: #666;
    font-size: 12px;
    margin-top: 8px;
    display: block;
}

/* Toggle Option */
.toggle-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #222;
    border: 1px solid #333;
    border-radius: 12px;
}

.toggle-icon {
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

.toggle-content {
    flex: 1;
}

.toggle-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.toggle-subtitle {
    color: #aaa;
    font-size: 14px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #7CC3E4;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Create Button */
.create-portfolio-btn {
    background: #7CC3E4;
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.create-portfolio-btn:hover {
    background: #6AB5D8;
    transform: translateY(-2px);
}

.create-portfolio-btn:active {
    transform: translateY(0);
}

/* Edit Portfolio List Modal Styles */
.edit-portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 12000;
}

.edit-portfolio-modal.hidden {
    display: none;
}

.edit-portfolio-content {
    background: #1a1a1a;
    border-radius: 16px;
    min-width: 400px;
    max-width: 500px;
    max-height: 70vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.portfolios-list {
    padding: 0 24px 24px 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.portfolio-item-edit {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #2a2a2a;
    gap: 12px;
}

.portfolio-item-edit:last-child {
    border-bottom: none;
}

.portfolio-drag-handle {
    color: #666;
    cursor: grab;
    padding: 4px;
}

.portfolio-drag-handle:active {
    cursor: grabbing;
}

.portfolio-avatar-edit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #000;
    flex-shrink: 0;
}

.portfolio-name-edit {
    flex: 1;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.portfolio-name-input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    width: 100%;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.portfolio-name-input:focus {
    border-color: #7CC3E4;
    background: rgba(124, 195, 228, 0.1);
}

.portfolio-actions-edit {
    display: flex;
    gap: 8px;
}

.portfolio-edit-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-edit-btn:hover {
    color: #7CC3E4;
    background: rgba(124, 195, 228, 0.1);
}

.portfolio-edit-btn.delete:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

.portfolio-edit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Edit Portfolio Modal specific styles */
#editPortfolioModal .modal-footer {
    flex-direction: column;
    gap: 8px;
    padding: 0 18px 18px 18px;
}

#editPortfolioModal .create-portfolio-btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 14px;
}

#editPortfolioModal .create-portfolio-btn.cancel {
    background: #666;
}

#editPortfolioModal .create-portfolio-btn.cancel:hover {
    background: #777;
}

/* Welcome Tooltip Styles */
.welcome-tooltip {
    position: absolute;
    top: 50%;
    right: -280px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #7CC3E4 0%, #6AB5D8 100%);
    color: #000;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(124, 195, 228, 0.3);
    z-index: 1000;
    min-width: 240px;
    animation: tooltipFadeIn 0.5s ease-out;
}

.welcome-tooltip.hidden {
    display: none;
}

.tooltip-arrow {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #7CC3E4;
}

.tooltip-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #000;
}

.tooltip-text {
    font-size: 14px;
    color: #222;
    opacity: 0.8;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Pulse animation for Add Asset button when tooltip is shown */
.portfolio-add-btn.highlight {
    animation: buttonPulse 2s infinite;
    box-shadow: 0 0 0 4px rgba(124, 195, 228, 0.3);
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 195, 228, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(124, 195, 228, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(124, 195, 228, 0);
    }
}

