@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
    /* Theme Base - Sky Glassmorphism Light Mode */
    --bg-gradient: linear-gradient(135deg, #E0F2FE 0%, #F0F9FF 50%, #EEF2FF 100%);
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-bg-hover: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(14, 165, 233, 0.08);
    --glass-shadow-hover: 0 16px 48px 0 rgba(14, 165, 233, 0.15);
    
    /* Typography Colors */
    --text-primary: #0F172A;     /* Slate 900 */
    --text-secondary: #475569;   /* Slate 600 */
    --text-muted: #64748B;       /* Slate 500 */
    
    /* Asset Category Colors (Confirmed) */
    --color-small-cap: #0284C7;  /* Sky Blue */
    --color-mid-cap: #10B981;    /* Emerald Green */
    --color-dividend: #F59E0B;   /* Sunburst Orange */
    --color-large-cap: #EF4444;   /* Crimson Red */
    
    /* Semantic Colors */
    --color-success: #10B981;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-danger: #EF4444;
    --color-danger-bg: rgba(239, 68, 68, 0.12);
    --color-warning: #F59E0B;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-info: #06B6D4;
    --color-info-bg: rgba(6, 182, 212, 0.12);
    
    /* Yellow/Amber tag badge */
    --badge-yellow-bg: rgba(245, 158, 11, 0.12);
    --badge-yellow-text: #B45309; /* Amber 700 */

    /* Transition speeds */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Prompt', 'Outfit', -apple-system, sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    padding: 2.5rem 1.5rem;
}

/* Background floating decorative elements (Clouds/Sky Blobs) */
.background-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(186, 230, 253, 0.4) 0%, rgba(224, 242, 254, 0) 70%);
    top: -100px;
    left: -100px;
    z-index: -2;
    filter: blur(60px);
    animation: floating-blob 25s infinite alternate ease-in-out;
}

.background-glow-right {
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(199, 210, 254, 0.3) 0%, rgba(238, 242, 255, 0) 70%);
    bottom: -150px;
    right: -150px;
    z-index: -2;
    filter: blur(80px);
    animation: floating-blob-reverse 30s infinite alternate ease-in-out;
}

@keyframes floating-blob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.1); }
}

@keyframes floating-blob-reverse {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-100px, -60px) scale(1.15); }
}

/* Container & Layout */
.dashboard-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

/* Header Section */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
    color: #fff;
    font-size: 1.5rem;
}

.header-titles h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-titles p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-add {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
    transition: var(--transition-smooth);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 4.5fr 7.5fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphic Box Panels */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--glass-shadow);
    padding: 2.25rem;
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    box-shadow: var(--glass-shadow-hover);
}

/* Left Panel: Donut Chart Section */
.left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    min-height: 520px;
}

.chart-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.donut-slice {
    fill: none;
    stroke-width: 24;
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
    cursor: pointer;
}



.chart-center-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    width: 180px;
    text-align: center;
}

.chart-center-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.chart-center-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.15rem 0;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
    line-height: 1.1;
    word-break: break-all;
}

.chart-center-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    margin-top: 0.1rem;
}

.chart-center-profit {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
}

.chart-center-profit.positive {
    color: #047857; /* Emerald 700 */
    background: var(--color-success-bg);
}

.chart-center-profit.negative {
    color: #B91C1C; /* Red 700 */
    background: var(--color-danger-bg);
}

/* Legend section below Donut */
.chart-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.4);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.legend-item:hover {
    background: rgba(255,255,255,0.4);
}

.legend-item.dimmed {
    opacity: 0.35;
}

.legend-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4);
}

.legend-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Right Panel: Asset Allocation List */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-header-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-header-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-header-target-total {
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Target Allocation progress bar wrapper */
.allocation-progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: rgba(255,255,255,0.3);
    padding: 1rem 1.25rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.overall-progress-bar-container {
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.2);
}

.overall-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10B981 0%, #059669 100%);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    gap: 1rem;
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.5;
}

/* Slices cards lists */
.slices-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* Slice Item Card layout */
.slice-card {
    display: grid;
    grid-template-columns: 2.8fr 2.5fr 2.5fr 2.5fr 1.7fr;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.slice-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-3px);
    box-shadow: var(--glass-shadow-hover);
    border-color: rgba(255,255,255,0.8);
}

.slice-card.highlighted {
    border-color: #0ea5e9;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.15);
}

.slice-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--slice-color, var(--text-secondary));
    border-radius: 6px 0 0 6px;
}

/* Column 1: Asset Type & Yellow Badge */
.col-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
}

.asset-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.asset-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.stock-count-badge {
    background: var(--badge-yellow-bg);
    color: var(--badge-yellow-text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Column 2: Current Money Value & Profit/Loss */
.col-value {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    justify-content: center;
}

.asset-money {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.asset-return {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.asset-return.positive {
    color: #047857; /* Emerald 700 */
}

.asset-return.negative {
    color: #B91C1C; /* Red 700 */
}

/* Column 2.5 (New!): Target Difference Column */
.col-diff {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    justify-content: center;
}

.diff-money {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.2px;
}

.diff-money.positive-diff {
    color: #0284C7; /* Needs more investment - Sky blue */
}

.diff-money.negative-diff {
    color: #F59E0B; /* Surplus - Rebalance orange */
}

.diff-money.balanced-diff {
    color: var(--text-muted); /* Perfectly balanced */
}

.diff-money.profit-positive {
    color: #10B981;
}

.diff-money.profit-negative {
    color: #EF4444;
}

.diff-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Column 3: Current Share % & Target % + Orange/Red Target Progress Bar */
.col-percentage {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
    padding-right: 1rem;
}

.percentage-text-row {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.current-share {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.target-share {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.target-mini-progress-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 99px;
    margin-top: 0.15rem;
    overflow: hidden;
    border: 0.5px solid rgba(255,255,255,0.3);
}

.target-mini-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B 0%, #EF4444 100%); /* Orange-Red as prompt */
    border-radius: 99px;
    transition: width 0.5s ease-in-out;
}

/* Column 4: Action Buttons */
.col-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-action {
    border: none;
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    letter-spacing: 0.2px;
}

.btn-action.edit {
    background: rgba(14, 165, 233, 0.1);
    color: #0284C7;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.btn-action.edit:hover {
    background: #0284C7;
    color: #fff;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
    transform: translateY(-1px);
}

.btn-action.delete {
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.btn-action.delete:hover {
    background: #EF4444;
    color: #fff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
    transform: translateY(-1px);
}

/* Responsive adjustments for cards */
@media (max-width: 640px) {
    .slice-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }
    .col-actions {
        justify-content: flex-start;
        border-top: 1px solid rgba(0,0,0,0.05);
        padding-top: 0.75rem;
        margin-top: 0.5rem;
    }
    .col-percentage {
        padding-right: 0;
    }
}

/* Premium Modals (Glassmorphic Modal Popup) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(224, 242, 254, 0.5); /* Sky blue tint overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    margin: auto;
}

.modal-overlay.active .modal-window {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-primary);
}

.modal-close.delete {
    color: #EF4444 !important;
    background: none !important;
    border: none !important;
    padding: 0;
    box-shadow: none !important;
    transform: none !important;
}

.modal-close.delete:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #EF4444 !important;
    box-shadow: none !important;
    transform: translateY(-1px) !important;
}

.modal-close.delete:disabled {
    background: none !important;
    border: none !important;
    color: #94A3B8 !important;
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.modal-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(14, 165, 233, 0.15);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    outline: none;
}

.form-input:focus {
    border-color: #0284C7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Color Picker Container */
.color-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.suggested-colors {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.color-swatch {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 0 auto;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 2px 6px rgba(0, 0, 0, 0.05);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--text-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.color-swatch.selected::after {
    content: '✓';
    font-size: 0.95rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.custom-color-container {
    display: flex;
    align-items: center;
}

.custom-color-picker-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(14, 165, 233, 0.15);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    width: 100%;
    justify-content: center;
    user-select: none;
    position: relative;
}

.custom-color-picker-label:hover {
    border-color: #0284C7;
    background: #fff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.custom-color-picker-label input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.custom-color-picker-label::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--selected-custom-color, #0284C7);
    border: 1px solid rgba(0,0,0,0.15);
    transition: var(--transition-smooth);
}

.modal-footer {
    padding: 1.25rem 2rem 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.btn-confirm {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
}

/* Warnings/Banner inside Modal */
.validation-warning {
    background: var(--color-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #B91C1C;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: none; /* Dynamic visibility */
}

/* --- Lock Delete & Money Visibility Toggle Switches --- */
.list-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.visibility-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.45rem 1rem;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: var(--transition-smooth);
    user-select: none;
}

.visibility-toggle-label:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.visibility-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.visibility-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.visibility-toggle-switch input:checked + .slider-round {
    background: linear-gradient(135deg, #0284C7 0%, #0369a1 100%); /* Premium sky blue for show values state */
}

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

.lock-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.45rem 1rem;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: var(--transition-smooth);
    user-select: none;
}

.lock-toggle-label:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.lock-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.lock-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1; /* Slate 300 */
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.lock-toggle-switch input:checked + .slider-round {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); /* Premium red for lock active state */
}

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

/* Locked Delete Button State */
.btn-action.delete:disabled {
    background: rgba(148, 163, 184, 0.08) !important;
    color: #94A3B8 !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.55;
}

/* --- Emergency Cash Reserve Styles --- */

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.emergency-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    min-height: auto;
}

.emergency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
}

.emergency-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.emergency-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emergency-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-add-emergency {
    background: rgba(2, 132, 199, 0.1);
    color: #0284C7;
    border: 1px solid rgba(2, 132, 199, 0.2);
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition-smooth);
}

.btn-add-emergency:hover {
    background: #0284C7;
    color: #fff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
    transform: translateY(-1px);
}

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

/* Emergency reserves list container */
.emergency-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.emergency-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.75rem 1.25rem;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.emergency-item-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow-hover);
    border-color: rgba(255,255,255,0.7);
}

.emergency-item-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #0284C7; /* Beautiful blue indicator */
    border-radius: 4px 0 0 4px;
}

.col-emergency-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.emergency-item-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.emergency-item-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.col-emergency-actions {
    display: flex;
    gap: 0.4rem;
}

/* Summary Footer */
.emergency-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(2, 132, 199, 0.05);
    border: 1px solid rgba(2, 132, 199, 0.1);
    border-radius: 14px;
    padding: 0.75rem 1.25rem;
    margin-top: 0.5rem;
}

.emergency-total-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.emergency-total-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0284C7; /* Highlighted blue */
}

/* Empty State */
.emergency-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.15);
    border: 1px dashed rgba(255,255,255,0.4);
    border-radius: 16px;
}

/* --- Slices List Header Row --- */
.slices-header-row {
    display: grid;
    grid-template-columns: 2.8fr 2.5fr 2.5fr 2.5fr 1.7fr;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.02);
    padding-bottom: 0.25rem;
    user-select: none;
}

.slices-header-row div {
    opacity: 0.85;
}

@media (max-width: 640px) {
    .slices-header-row {
        display: none !important;
    }
}

/* --- Slices Detail Modal Styles (Sub-Assets Layout) --- */
.detail-modal-window {
    max-width: 760px !important;
}

.detail-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2.25rem;
}

.detail-summary-banner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: 100%;
}

.summary-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 18px;
    padding: 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
    transition: var(--transition-smooth);
}

.summary-card:hover {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.85);
    transform: translateY(-1px);
}

.summary-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.summary-card-value-return {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    display: inline-block;
    margin-top: 0.1rem;
}

.detail-info-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
}

.detail-info-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.detail-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.detail-info-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
}

.detail-info-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Nested Sub-Assets Grid Layout --- */
.sub-assets-header-row {
    display: grid;
    grid-template-columns: 2.5fr 2.3fr 2.3fr 2.3fr 2fr;
    align-items: center;
    padding: 0 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding-bottom: 0.35rem;
    user-select: none;
}

.sub-assets-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

/* Premium scrollbar for the sub-assets list */
.sub-assets-list::-webkit-scrollbar {
    width: 5px;
}
.sub-assets-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.01);
    border-radius: 99px;
}
.sub-assets-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 99px;
}
.sub-assets-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.16);
}

.sub-asset-accordion-item {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    margin-bottom: 0.55rem;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.sub-asset-accordion-item:hover {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.75);
}

.sub-asset-accordion-item.active {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.04);
}

.sub-asset-row-header {
    display: grid;
    grid-template-columns: 2.5fr 2.3fr 2.3fr 2.3fr 2fr;
    align-items: center;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    user-select: none;
}

.sub-asset-name-col {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    text-align: left;
}

.sub-asset-value-col {
    font-family: 'Outfit', 'Prompt', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    line-height: 1.25;
}

.sub-asset-diff-col {
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

.sub-asset-target-col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.5rem;
}

.sub-asset-percentage-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: right;
    color: var(--text-primary);
    line-height: 1;
}

.sub-asset-progress-container {
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.1rem;
}

.sub-asset-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B 0%, #EF4444 100%);
    border-radius: 99px;
    transition: width 0.5s ease-in-out;
}

.sub-asset-delete-col {
    display: flex;
    justify-content: flex-end;
}

.sub-asset-delete-col .btn-action {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 8px;
    height: 26px;
    min-height: auto;
}

.grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.grid-cell {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.cell-label {
    color: var(--text-muted);
    font-weight: 500;
}

.cell-value {
    color: var(--text-primary);
    font-weight: 700;
    font-family: 'Outfit', 'Prompt', sans-serif;
}

.btn-action.buy-sell:disabled {
    background: rgba(148, 163, 184, 0.08) !important;
    color: #94A3B8 !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.5;
}

.sub-assets-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.45);
    border-radius: 16px;
    text-align: center;
}

.detail-modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* Responsive adjustments for sub-assets layout */
@media (max-width: 768px) {
    .detail-modal-body {
        padding: 1.5rem;
        gap: 1.25rem;
    }
    .detail-summary-banner {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .summary-card {
        padding: 1rem;
    }
    .summary-card-value {
        font-size: 1.5rem;
    }
    .sub-assets-header-row {
        grid-template-columns: 1fr;
        display: none;
    }
    .sub-asset-accordion-item {
        margin-bottom: 0.5rem;
    }
    .sub-asset-row-header {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.85rem;
        align-items: start;
    }
    .mobile-only-label {
        display: block !important;
    }
    .sub-asset-value-col {
        align-items: flex-end;
        text-align: right;
    }
    .sub-asset-profit-col {
        grid-column: 1;
        text-align: left;
        margin-top: 0.25rem;
    }
    .sub-asset-target-col {
        grid-column: 2;
        text-align: right;
        margin-top: 0.25rem;
        padding: 0;
        align-items: flex-end;
    }
    .sub-asset-rebalance-col {
        grid-column: span 2;
        text-align: left;
        margin-top: 0.5rem;
        border-top: 1px dashed rgba(0,0,0,0.06);
        padding-top: 0.5rem;
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
        border-radius: 10px;
        font-weight: 600;
    }
    .sub-asset-rebalance-col.positive-diff {
        background: rgba(2, 132, 199, 0.06);
        border: 1px solid rgba(2, 132, 199, 0.12);
    }
    .sub-asset-rebalance-col.negative-diff {
        background: rgba(245, 158, 11, 0.06);
        border: 1px solid rgba(245, 158, 11, 0.12);
    }
    .sub-asset-rebalance-col.balanced-diff {
        background: rgba(148, 163, 184, 0.06);
        border: 1px solid rgba(148, 163, 184, 0.12);
    }
    .sub-asset-rebalance-col span.diff-money {
        font-size: 0.85rem !important;
    }
    .sub-asset-rebalance-col div {
        font-size: 0.72rem !important;
        margin-top: 0 !important;
    }
}

/* --- LOGIN MODAL & DASHBOARD BLURRING CUSTOM STYLES --- */
.blurred-dashboard {
    filter: blur(25px) saturate(180%) !important;
    pointer-events: none !important;
    opacity: 0.35 !important;
    user-select: none !important;
    transition: filter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

.login-modal-window {
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.8) ;
    background: rgba(255, 255, 255, 0.55) ;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.15) ;
}

.login-modal-header {
    border-bottom: none !important;
    padding-top: 2rem !important;
    padding-bottom: 0.25rem !important;
}

.login-modal-subtitle {
    margin-top: -0.25rem;
    line-height: 1.5;
}

.login-toggle-mode a {
    transition: var(--transition-smooth);
}

.login-toggle-mode a:hover {
    text-decoration: underline !important;
    opacity: 0.85;
}

#loginValidationWarning {
    text-align: center;
    line-height: 1.4;
    animation: shake 0.3s ease-in-out;
}

/* --- MOBILE BOTTOM NAVIGATION STYLING --- */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 6rem !important; /* Spacing so nav bar doesn't overlay bottom elements */
    }
    
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        z-index: 999;
        padding: 0.65rem 1rem;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.05);
    }
    
    .nav-item {
        background: none;
        border: none;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        cursor: pointer;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        transition: var(--transition-smooth);
        min-width: auto;
        flex: 1;
    }
    
    .nav-item span {
        font-size: 0.7rem;
        font-weight: 600;
    }
    
    .nav-item.active {
        color: var(--color-small-cap);
        transform: translateY(-2px);
    }
    
    .nav-item.active svg {
        stroke-width: 3px;
        filter: drop-shadow(0 2px 4px rgba(2, 132, 199, 0.2));
    }
    
    /* Toggle Panel Visibility on Mobile */
    .mobile-tab-content {
        display: none !important;
    }
    
    .mobile-tab-content.active-tab {
        display: flex !important;
        animation: fadeIn 0.4s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* PREMIUM MOBILE HEADER REDESIGN (Welcome Banner & Balanced Buttons) */
    .dashboard-header {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 1.5rem !important;
        gap: 1.25rem !important;
        border-radius: 28px !important;
        text-align: left !important;
    }
    
    .header-brand {
        align-items: center !important;
        gap: 0.75rem !important;
    }
    
    .header-icon {
        width: 44px !important;
        height: 44px !important;
        border-radius: 14px !important;
        flex-shrink: 0 !important;
    }
    
    .header-titles h1 {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }
    
    .header-titles p {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-top: 0.15rem !important;
    }
    
    .header-actions {
        display: flex !important;
        width: 100% !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    /* Buttons inside header actions should be 50% each on mobile */
    .header-actions button, 
    .header-actions .btn-add, 
    .header-actions .btn-action {
        flex: 1 1 50% !important;
        width: 50% !important;
        justify-content: center !important;
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
        margin: 0 !important;
        border-radius: 12px !important;
        min-height: 44px !important; /* Touch target minimum */
    }
    
    /* Keep Logout text compact */
    #logoutBtnText {
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* SHIMMER ANIMATION EFFECT FOR REAL-TIME STOCKS LOADING */
@keyframes shimmerAnimation {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.shimmer-placeholder {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.1) 37%, rgba(0, 0, 0, 0.05) 63%);
    background-size: 200% 100%;
    animation: shimmerAnimation 1.5s infinite linear;
}

/* TRANSACTION PANEL & HISTORY CARD STYLING */
.transaction-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    min-height: auto;
    margin-top: 1.5rem;
}

.transaction-item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.85rem 1.25rem;
    transition: var(--transition-bounce);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.transaction-item-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow-hover);
    border-color: rgba(255,255,255,0.7);
}

.col-tx-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tx-main-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tx-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
}

.tx-badge.buy {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.tx-badge.sell {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.tx-ticker {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.04);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
}

.tx-sub-row {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.col-tx-amount {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tx-value-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.tx-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.tx-date-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.transaction-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.15);
    border: 1px dashed rgba(255,255,255,0.4);
    border-radius: 16px;
    text-align: center;
}

.btn-tx-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    opacity: 0.4;
}

.btn-tx-delete:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.08);
    opacity: 1;
}

/* --- MONTHLY GROUPED TRANSACTION ACCORDION POPUP STYLING --- */
.monthly-group-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.monthly-group-card:hover {
    border-color: rgba(30, 58, 138, 0.15);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.04);
}

.monthly-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    cursor: pointer;
    background: #fff;
    user-select: none;
    transition: background 0.2s ease;
    gap: 0.5rem;
}

.monthly-group-header:hover {
    background: rgba(0, 0, 0, 0.01);
}

.monthly-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monthly-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    min-width: 80px;
}

.monthly-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.monthly-stats-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.monthly-stat-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    white-space: nowrap;
}

.monthly-stat-pill.buy-pill {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
}

.monthly-stat-pill.sell-pill {
    background: rgba(239, 68, 68, 0.08);
    color: #B91C1C;
}

.monthly-stat-pill.net-pill {
    background: rgba(30, 58, 138, 0.06);
    color: #1D4ED8;
}

.monthly-stat-pill.net-pill.positive {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.monthly-stat-pill.net-pill.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #B91C1C;
}

.monthly-chevron {
    color: var(--text-muted);
    transition: transform 0.2s ease-in-out;
    flex-shrink: 0;
}

.monthly-group-header.active .monthly-chevron {
    transform: rotate(90deg);
}

.monthly-group-content {
    display: none;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: rgba(0, 0, 0, 0.005);
    padding: 0.75rem 1rem;
    overflow-x: auto;
}

.monthly-group-content.active {
    display: block;
}

.monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.monthly-table th {
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.04);
}

.monthly-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    vertical-align: middle;
}

.monthly-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.01);
}

.tx-cell-type {
    font-weight: 600;
}

.tx-cell-type.buy {
    color: #10B981;
}

.tx-cell-type.sell {
    color: #EF4444;
}

.monthly-tx-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive adjustments for Monthly Modal */
@media (max-width: 600px) {
    .monthly-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    
    .monthly-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .monthly-stats-pills {
        justify-content: flex-start;
    }
    
    .monthly-table th:nth-child(5), /* Price */
    .monthly-table td:nth-child(5),
    .monthly-table th:nth-child(7), /* Notes */
    .monthly-table td:nth-child(7) {
        display: none;
    }
}

/* --- PROFIT / LOSS SUMMARY DASHBOARD STYLING --- */
.pnl-dashboard-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pnl-stat-card {
    position: relative;
    overflow: hidden;
}

.pnl-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #CBD5E1; /* Default slate border on left */
    border-radius: 4px 0 0 4px;
}

/* Green border for positive P/L */
.pnl-stat-card.positive-pnl::after {
    background: #10B981;
}

/* Red border for negative P/L */
.pnl-stat-card.negative-pnl::after {
    background: #EF4444;
}

.pnl-stat-card.positive-pnl {
    border-color: rgba(16, 185, 129, 0.15) !important;
    background: linear-gradient(135deg, #ffffff 0%, rgba(16, 185, 129, 0.02) 100%) !important;
}

.pnl-stat-card.negative-pnl {
    border-color: rgba(239, 68, 68, 0.15) !important;
    background: linear-gradient(135deg, #ffffff 0%, rgba(239, 68, 68, 0.02) 100%) !important;
}

.pnl-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

.pnl-filters select:hover {
    border-color: var(--primary-light);
    background: var(--bg-hover);
}

@media (max-width: 600px) {
    .pnl-stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .pnl-header-row {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .pnl-filters {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .pnl-filters select {
        flex: 1;
        font-size: 0.8rem !important;
        padding: 0.35rem 0.5rem !important;
    }
}







