/**
 * Custom CSS for Options Writer Journal
 * Modern financial SaaS design with enhanced UX
 */

/* Enhanced CSS Variables */
:root {
    /* Primary Brand Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #1c1b77 100%);
    --primary-color: #5973e6;
    --primary-dark: #505dd6;
    --primary-light: #e6fffa;
    
    /* Financial Colors */
    --profit-color: #10b981;
    --profit-bg: #ecfdf5;
    --profit-border: #a7f3d0;
    --loss-color: #ef4444;
    --loss-bg: #fef2f2;
    --loss-border: #fecaca;
    --neutral-color: #6b7280;
    
    /* Background & Surface */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Border & Dividers */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --divider: #e5e7eb;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --surface: #1e293b;
    --surface-hover: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --border-light: #475569;
    --divider: #475569;
    
    --profit-bg: rgba(16, 185, 129, 0.1);
    --loss-bg: rgba(239, 68, 68, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg-secondary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.text-muted {
    color: var(--text-muted) !important;
}

/* Enhanced Navbar */
.navbar {
    background: var(--primary-gradient) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md) 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.navbar-brand i {
    font-size: 1.75rem;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: var(--space-sm) var(--space-md) !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    margin: 0 var(--space-xs);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateY(-1px);
}

.nav-link i {
    margin-right: var(--space-xs);
    opacity: 0.8;
}

/* Add this to your existing CSS */
#themeIcon, #footerThemeIcon {
    transition: transform 0.15s ease-in-out;
}

.nav-link .bi, .btn .bi {
    transition: transform 0.15s ease-in-out;
}

/* Enhanced Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-lg);
}

/* Financial Color Classes */
.profit {
    color: var(--profit-color) !important;
}

.loss {
    color: var(--loss-color) !important;
}

.profit-bg {
    background-color: var(--profit-bg) !important;
    border-color: var(--profit-border) !important;
}

.loss-bg {
    background-color: var(--loss-bg) !important;
    border-color: var(--loss-border) !important;
}

/* Enhanced Tables */
.table {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: var(--space-lg);
}

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

.table tbody tr:hover {
    background: var(--surface-hover);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.table tbody td {
    padding: var(--space-lg);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

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

/* Enhanced Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-lg);
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-no-border {
    border: none !important;
    box-shadow: none !important;
}

/* Enhanced Badges */
.badge {
    font-weight: 500;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: var(--profit-color);
    color: white;
}

.badge-danger {
    background: var(--loss-color);
    color: white;
}

.badge-info {
    background: var(--primary-color);
    color: white;
}

/* Form Enhancements */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: var(--surface);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

/* Position Snapshot Enhancement */
.position-metric {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.position-metric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.position-metric .metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.position-metric .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Chart Enhancements */
.chart-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

canvas {
    max-width: 100%;
    border-radius: var(--radius-md);
}

/* Alert Enhancements (continued) */
.alert {
    border: none;
    border-left: 4px solid;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background: var(--profit-bg);
    border-left-color: var(--profit-color);
    color: var(--profit-color);
}

.alert-danger {
    background: var(--loss-bg);
    border-left-color: var(--loss-color);
    color: var(--loss-color);
}

.alert-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-left-color: var(--primary-color);
    color: var(--primary-dark);
}

/* DataTables Enhancements */
.dataTables_wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.dataTables_wrapper .dataTables_length select {
    padding: var(--space-sm) 2rem var(--space-sm) var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
}

.dataTables_wrapper .dataTables_filter input {
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-left: var(--space-md);
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: var(--space-sm) var(--space-md);
    margin: 0 var(--space-xs);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
}

/* Dropdown Enhancements */
.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-sm);
    margin-top: var(--space-sm);
}

.dropdown-item {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--primary-color);
    transform: translateX(4px);
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: var(--space-sm) 0;
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    transition: width 0.6s ease;
}

/* Loading States */
.spinner-border {
    color: var(--primary-color);
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Utility Classes */
.text-success-emphasis {
    color: var(--profit-color) !important;
}

.text-danger-emphasis {
    color: var(--loss-color) !important;
}

.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

.border-gradient {
    border: 2px solid;
    border-image: var(--primary-gradient) 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Footer Enhancement */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: var(--space-2xl) 0;
}

footer .text-muted {
    color: var(--text-muted) !important;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-dark);
}

/* Offcanvas Enhancements */
.offcanvas {
    background: var(--surface);
    border: none;
    box-shadow: var(--shadow-xl);
}

.offcanvas-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-xl);
}

.offcanvas-body {
    padding: var(--space-xl);
}

/* Animation Classes */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-open {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-closed {
    background: var(--profit-bg);
    color: var(--profit-color);
}

.status-expired {
    background: #f3f4f6;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .kpi-card {
        padding: var(--space-lg);
    }
    
    .kpi-value {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --space-xs: 0.25rem;
        --space-sm: 0.5rem;
        --space-md: 0.75rem;
        --space-lg: 1rem;
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
    }
    
    .navbar {
        padding: var(--space-sm) 0;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: var(--space-md);
    }
    
    .card-header {
        padding: var(--space-md);
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: var(--space-sm);
    }
    
    .kpi-card {
        padding: var(--space-md);
    }
    
    .kpi-value {
        font-size: 1.75rem;
    }
    
    .position-metric {
        padding: var(--space-md);
    }
}

@media (max-width: 576px) {
    .btn {
        padding: var(--space-sm);
        font-size: 0.875rem;
    }
    
    .nav-link {
        padding: var(--space-xs) var(--space-sm) !important;
        margin: 0;
    }
    
    .dropdown-item {
        padding: var(--space-xs) var(--space-sm);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer,
    .no-print,
    .dropdown,
    .offcanvas {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
        box-shadow: none;
    }
    
    .table {
        border-collapse: collapse;
    }
    
    .table thead th,
    .table tbody td {
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
    
    [data-bs-theme="dark"] {
        --border-color: #ffffff;
        --text-secondary: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Additional CSS for enhanced header - add to your app.css */
.nav-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.nav-stats-label {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-stats-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.user-dropdown:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar i {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-email {
    font-size: 0.75rem;
    opacity: 0.8;
}

.user-menu {
    min-width: 280px;
    padding: 0.5rem;
    z-index: 1050 !important;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.user-avatar-large i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.user-details .user-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.user-details .user-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notification-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-header {
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .user-info {
        display: none;
    }
    
    .nav-stats {
        display: none;
    }
    
    .user-menu {
        min-width: 250px;
    }
    
    .user-profile-header {
        padding: 0.75rem;
    }
}




/* Responsive Footer */

/* Responsive Design */
@media (max-width: 768px) {
    .footer {
        padding: var(--space-xl) 0 var(--space-md);
    }
    
    .footer-stats {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .footer-legal {
        justify-content: center;
        margin-top: var(--space-md);
    }
    
    .footer-theme-toggle {
        margin-left: 0;
        margin-top: var(--space-sm);
    }
    
    .disclaimer-content {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .disclaimer-content i {
        align-self: flex-start;
    }
}

@media (max-width: 576px) {
    .footer-legal {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: center;
    }
    
    .footer-stats {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .footer-disclaimer {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color);
}


/* ============================================
   DASHBOARD ENHANCEMENTS
   ## 2. ADDITIONAL CSS FOR DASHBOARD (add to app.css)
   ============================================ */

/* Dashboard Header */
.dashboard-header-container {
    margin: -1.5rem -2.5rem 2rem -2.5rem;
}

.dashboard-header-gradient {
    background: linear-gradient(135deg, #667eea 0%, #343247 100%);
    padding: 1.5rem 0;
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.dashboard-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.dashboard-meta-info {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.dashboard-actions .btn {
    font-weight: 500;
}

/* Modern KPI Cards */
.kpi-card-modern {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.kpi-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 0.5rem;
}

.kpi-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.kpi-card-primary .kpi-icon-wrapper {
    background: linear-gradient(135deg, #667eea, #2e2b48);
}

.kpi-card-success .kpi-icon-wrapper {
    background: linear-gradient(135deg, #10b981, #059669);
}

.kpi-card-warning .kpi-icon-wrapper {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.kpi-card-info .kpi-icon-wrapper {
    background: linear-gradient(135deg, #0dcaf0, #0891b2);
}

.kpi-trend-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.trend-up {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.trend-down {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.kpi-card-body {
    padding: 0.5rem 1.5rem 1rem;
}

.kpi-label-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.kpi-sublabel-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.kpi-value-large {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0.5rem 0;
}

.kpi-comparison-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.kpi-card-footer {
    padding: 0 1.5rem 1rem;
}

.kpi-mini-chart {
    height: 40px;
}

.kpi-progress-ring {
    position: relative;
    width: 50px;
    height: 50px;
}

.progress-ring-svg {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.1);
    stroke-width: 4;
}

.progress-ring-fill {
    fill: none;
    stroke: #fbbf24;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: #fbbf24;
}

.kpi-secondary-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Secondary KPI Cards */
.secondary-kpi-card-modern {
    background: white;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.secondary-kpi-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.secondary-kpi-icon-wrapper {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.secondary-kpi-content {
    flex: 1;
}

.secondary-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

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

/* Chart Cards */
.chart-card-modern {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.chart-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chart-title-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.chart-subtitle-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.chart-period-controls .btn-check:checked + .btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.chart-card-body {
    padding: 1.5rem;
    position: relative;
}

/* Positions Card */
.positions-card-modern {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.positions-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.positions-summary-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.summary-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-primary {
    background: rgba(13, 110, 253, 0.15);
    color: #0a58ca;
}

.badge-secondary {
    background: rgba(108, 117, 125, 0.15);
    color: #495057;
}

.positions-card-body {
    padding: 0;
}

/* Positions Table */
.positions-table-modern {
    margin: 0;
    width: 100%;
}

.positions-table-modern thead th {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.th-sortable {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.th-sortable:hover {
    color: var(--primary-color);
}

.th-sortable i {
    font-size: 0.75rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.th-sortable:hover i {
    opacity: 1;
}

.positions-table-modern tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.position-row-modern {
    transition: background-color 0.2s ease;
}

.position-row-modern:hover {
    background: rgba(102, 126, 234, 0.03);
}


/* Table Cell Styles */
.ticker-cell-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ticker-symbol-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.ticker-date-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.strategy-badge-modern {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.strategy-covered_call, .strategy-cc { 
    background: rgba(25, 135, 84, 0.15); 
    color: #0f5132; 
}

.strategy-cash_secured_put, .strategy-np { 
    background: rgba(13, 110, 253, 0.15); 
    color: #084298; 
}

.strategy-iron_condor { 
    background: rgba(255, 193, 7, 0.15); 
    color: #997404; 
}

.strategy-vps, .strategy-vcs { 
    background: rgba(13, 202, 240, 0.15); 
    color: #055160; 
}

.position-details-wrapper {
    font-size: 0.85rem;
}

.legs-summary-text {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.legs-more-text {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.delta-exposure-text {
    color: #0dcaf0;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.dit-cell-wrapper {
    text-align: center;
}

.dit-value-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.dit-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.dit-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.risk-cell-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.risk-value-text {
    font-weight: 600;
    color: var(--text-primary);
}

.risk-indicator-badge {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.risk-low {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.risk-medium {
    background: rgba(255, 193, 7, 0.15);
    color: #f59e0b;
}

.risk-high {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.pl-cell-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pl-value-text {
    font-weight: 700;
    font-size: 1.05rem;
}

.pl-arrow-icon {
    font-size: 1.25rem;
}

.return-cell-wrapper {
    position: relative;
}

.return-value-text {
    font-weight: 700;
    font-size: 1.05rem;
}

.return-progress-bar {
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.return-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* Footer */
.positions-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--bg-tertiary);
}

.summary-stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label-footer {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Empty State */
.empty-state-container {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .kpi-value-large {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .dashboard-header-gradient {
        padding: 1.5rem 0;
    }
    
    .dashboard-main-title {
        font-size: 1.75rem;
    }
    
    .dashboard-subtitle {
        font-size: 0.95rem;
    }
    
    .kpi-value-large {
        font-size: 1.75rem;
    }
    
    .positions-card-header {
        flex-direction: column;
    }
    
    .summary-stats-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .positions-table-modern {
        font-size: 0.85rem;
    }
    
    .positions-table-modern thead th,
    .positions-table-modern tbody td {
        padding: 0.75rem 0.5rem;
    }
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] .kpi-card-modern,
[data-bs-theme="dark"] .chart-card-modern,
[data-bs-theme="dark"] .positions-card-modern,
[data-bs-theme="dark"] .secondary-kpi-card-modern {
    background: var(--surface);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .position-row-modern:hover {
    background: rgba(102,126, 234, 0.08);
}

/* ============================================
   CHAIN VIEW ENHANCEMENTS
   ============================================ */

/* Chain Header */
.chain-header-modern {
    background: linear-gradient(135deg, #667eea 0%, #2e2b48 100%);
    padding: 2rem 0;
    margin: -1.5rem -1.5rem 0 -1.5rem;
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.chain-title-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chain-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}



.chain-notes-section {
    margin-top: 0.5rem;
}

.notes-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.notes-edit-form textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.notes-edit-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chain-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Metric Cards */
.metric-card-modern {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
    height: 100%;
}

.metric-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.metric-icon-badge {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

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

.metric-progress-wrapper {
    width: 100%;
    margin-top: 0.75rem;
}

.metric-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.metric-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
    border-radius: 2px;
    transition: width 0.3s ease;
}


/* Days in Trade Card - Inline Progress Layout */
.metric-value-with-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-progress-inline {
    flex: 1;
    min-width: 60px;
}

.metric-progress-inline .metric-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.metric-progress-inline .metric-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Ensure the Days in Trade card has consistent height */
.metric-card-modern .metric-value-with-progress .metric-value {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Modern Card Component */
.card-modern {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card-modern-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--bg-tertiary);
}

.card-modern-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-modern-body {
    padding: 1.5rem;
}

/* Snapshot Metrics */
.snapshot-metric-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
}

.snapshot-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.snapshot-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.snapshot-subtext {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Greeks Boxes */
.greeks-box {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.greeks-box:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.greeks-symbol {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.greeks-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.greeks-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.greeks-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Action Bar */
.chain-actions-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
}

.btn-action {
    font-weight: 500;
    padding: 0.6rem 1.25rem;
}

/* Legs Section */
.leg-card-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.leg-card-wrapper:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.leg-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.leg-info-col {
    flex: 1;
}

.leg-title-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.leg-strike {
    color: var(--primary-color);
    font-weight: 700;
}

.leg-expiry {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.leg-meta-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.leg-meta-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.leg-actions-col {
    flex-shrink: 0;
}

.leg-executions-table {
    padding: 0;
}

.leg-executions-table table {
    margin: 0;
}

.leg-executions-table thead {
    background: var(--bg-secondary);
}

.leg-executions-table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
}

.leg-executions-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .chain-header-modern {
        padding: 1.5rem 0;
    }
    
    .chain-title-large {
        font-size: 1.75rem;
    }
    
    .metric-card-modern {
        flex-direction: column;
        text-align: center;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .chain-actions-bar {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
    }
    
    .leg-header-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .leg-actions-col {
        width: 100%;
    }
    
    .leg-actions-col .btn-group {
        width: 100%;
    }
    
    .leg-actions-col .btn {
        flex: 1;
    }
}

/* Dark Mode */
[data-bs-theme="dark"] .metric-card-modern,
[data-bs-theme="dark"] .card-modern {
    background: var(--surface);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .snapshot-metric-box,
[data-bs-theme="dark"] .greeks-box {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .greeks-box:hover {
    background: var(--surface-hover);
}

[data-bs-theme="dark"] .leg-card-wrapper {
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .leg-header-row {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}




/* ============================================
   NAVBAR ENHANCEMENTS
   ============================================ */

/* Modern Navbar */
.navbar-modern {
    background: linear-gradient(135deg, #667eea 0%, #2e2b48 100%);
    box-shadow: 0 2px 20px rgba(102, 126, 234, 0.3);
    padding: 0.75rem 0;
    border: none;
    z-index: 1030;
    position: relative;
}

.navbar-modern .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
}

.navbar-modern .navbar-brand i {
    margin-right: 0.5rem;
    font-size: 1.75rem;
}

.navbar-modern .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-modern .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-modern .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-modern .navbar-btn {
    color: rgba(255, 255, 255, 0.9) !important;
    border: none;
    background: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.navbar-modern .navbar-btn:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar .dropdown-menu {
    z-index: 1050 !important;
}

/* Nav Stats */
.nav-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.nav-stats-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-stats-value {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 0.125rem;
}

.nav-stats-value.profit {
    color: #10b981;
}

.nav-stats-value.loss {
    color: #ef4444;
}

/* User Dropdown */
.user-dropdown {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    padding: 0.5rem !important;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.user-dropdown:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}


.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
}

.user-avatar i {
    font-size: 1.5rem;
    color: white;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

/* User Menu Dropdown */
.user-menu {
    min-width: 280px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-top: 0.5rem;
}

.user-profile-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: 50%;
    flex-shrink: 0;
}

.user-avatar-large i {
    font-size: 1.75rem;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name-large {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.user-email-small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.user-menu .dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.user-menu .dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.user-menu .dropdown-item i {
    width: 16px;
    text-align: center;
}

/* Notification Dropdown */
.notification-dropdown {
    min-width: 320px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg);
    margin-top: 0.5rem;
    z-index: 1050 !important;
}

.notification-dropdown .dropdown-header {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Quick Action Bar */
.quick-action-bar {
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    padding: 0.75rem 0;
}

.quick-stats {
    display: flex;
    gap: 2rem;
}

.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quick-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quick-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.125rem;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .navbar-modern .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0.125rem 0;
    }
    
    .user-info {
        display: none !important;
    }
    
    .nav-stats {
        margin: 0.5rem 0;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .user-menu {
    background: var(--surface);
}

[data-theme="dark"] .user-profile-header {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .notification-dropdown {
    background: var(--surface);
}

[data-theme="dark"] .notification-dropdown .dropdown-header {
    background: var(--bg-tertiary);
}





/* ============================================
   NAVBAR ENHANCEMENTS
   ============================================ */

/* Modern Navbar */
.navbar-modern {
    background: linear-gradient(135deg, #667eea 0%, #2e2b48 100%);
    box-shadow: 0 2px 20px rgba(102, 126, 234, 0.3);
    padding: 0.75rem 0;
    border: none;
}

.navbar-modern .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
}

.navbar-modern .navbar-brand i {
    margin-right: 0.5rem;
    font-size: 1.75rem;
}

.navbar-modern .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-modern .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-modern .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-modern .navbar-btn {
    color: rgba(255, 255, 255, 0.9) !important;
    border: none;
    background: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.navbar-modern .navbar-btn:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}

/* Navigation Stats */
.nav-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-right: 1rem;
}

.nav-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.nav-stats-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.nav-stats-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.nav-stats-value.profit {
    color: #10b981;
}

.nav-stats-value.loss {
    color: #ef4444;
}

/* Quick Action Bar */
.quick-action-bar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

/* Responsive Navbar */
@media (max-width: 991.98px) {
    .nav-stats {
        display: none;
    }
    
    .quick-action-bar {
        display: none;
    }
}

/* ============================================
   FOOTER STYLING - REDESIGNED
   Add this to app.css or replace existing footer styles
   ============================================ */

/* Footer Base */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: 3rem 2rem 1.5rem 2rem;
    position: relative;
}

/* Footer Brand Section */
.footer-brand {
    margin-bottom: 0;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-logo i {
    font-size: 1.75rem;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0;
    max-width: 600px;
    font-size: 0.95rem;
}

.footer-version-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-version-info .badge {
    font-weight: 500;
    padding: 0.35rem 0.75rem;
}

/* Footer Sections */
.footer-section {
    margin-bottom: 0;
}

.footer-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    position: relative;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 2rem;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.65rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(0.25rem);
}

.footer-links a i {
    font-size: 0.875rem;
    opacity: 0.7;
    width: 16px;
    text-align: center;
}

/* Footer Theme Toggle */
.footer-theme-toggle {
    margin-top: 0;
}

.footer-theme-toggle .btn {
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    background: var(--surface);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-theme-toggle .btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.footer-theme-toggle .btn i {
    font-size: 1.1rem;
}

/* Enhanced Disclaimer Section */
.footer-disclaimer {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.disclaimer-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.disclaimer-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
    margin-top: 0.125rem;
}

.disclaimer-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.disclaimer-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Footer Bottom - Better Aligned */
.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

.footer-copyright {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

/* Responsive Footer */
@media (max-width: 991.98px) {
    .footer {
        padding: 2.5rem 0 1.5rem;
    }
    
    .footer-description {
        max-width: 100%;
    }
    
    .footer-section {
        margin-bottom: 2rem;
    }
    
    .footer-title::after {
        left: 0;
        transform: none;
    }
}

@media (max-width: 767.98px) {
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-disclaimer {
        padding: 1rem;
    }
    
    .disclaimer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .disclaimer-icon {
        align-self: center;
    }
    
    .footer-bottom {
        padding-top: 1rem;
        margin-top: 1.5rem;
    }
    
    .footer-copyright,
    .footer-tagline {
        text-align: center !important;
    }
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] .footer-disclaimer {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .footer-theme-toggle .btn {
    border-color: var(--border-color);
    background: var(--bg-tertiary);
}

[data-bs-theme="dark"] .footer-theme-toggle .btn:hover {
    background: var(--surface-hover);
}


/* ============================================
   NOTES ENHANCEMENTS
   ============================================ */

.chain-notes-section {
    margin-top: 1rem;
}

.notes-display-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.notes-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.notes-icon {
    color: var(--warning);
    font-size: 1.1rem;
}

.notes-label {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.notes-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
}

.notes-edit-form {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.notes-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notes-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.notes-edit-form textarea {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.notes-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   TAG ENHANCEMENTS
   ============================================ */

.chain-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.813rem;
    font-weight: 500;
    color: white;
}

.tag-badge-small {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

.tag-remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.tag-remove-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.tag-quick-add-wrapper {
    position: relative;
    display: inline-block;
}

.tag-quick-add-input {
    padding: 0.375rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    min-width: 150px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s;
}

.tag-quick-add-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tag-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.tag-suggestion-item {
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-suggestion-item:hover {
    background: var(--surface-hover);
}

.tag-suggestion-create {
    color: var(--primary-color);
    font-weight: 600;
}

.tag-suggestion-create:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tag-suggestion-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.5rem 0;
}

/* Tag Color Classes */
.bg-primary { background-color: #667eea !important; }
.bg-secondary { background-color: #64748b !important; }
.bg-success { background-color: #10b981 !important; }
.bg-danger { background-color: #ef4444 !important; }
.bg-warning { background-color: #f59e0b !important; }
.bg-info { background-color: #3b82f6 !important; }
.bg-purple { background-color: #8b5cf6 !important; }
.bg-pink { background-color: #ec4899 !important; }
.bg-indigo { background-color: #6366f1 !important; }
.bg-teal { background-color: #14b8a6 !important; }

.tag-dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
}




/* Quick Create Tag Modal */
.quick-color-picker {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.color-radio-option {
    cursor: pointer;
    position: relative;
}

.color-radio-option input[type="radio"] {
    display: none;
}

.color-badge {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.color-badge i {
    color: white;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.color-radio-option input[type="radio"]:checked + .color-badge {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.color-radio-option input[type="radio"]:checked + .color-badge i {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .notes-edit-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .notes-toolbar {
        width: 100%;
    }
    
    .notes-toolbar .btn {
        flex: 1;
    }
}

/* ============================================
   CONTAINER MARGINS FIX
   ============================================ */

.container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================
   ENHANCED TAG SYSTEM
   ============================================ */

.chain-tags-section {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.tags-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    padding-top: 0.4rem;
    flex-shrink: 0;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}

/* Tag Quick Add Input */
.tag-quick-add-wrapper {
    position: relative;
    display: inline-block;
}

.tag-quick-add-input {
    width: 150px;
    padding: 0.4rem 0.75rem;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.tag-quick-add-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
    width: 200px;
}

.tag-quick-add-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Tag Suggestions Dropdown */
.tag-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    min-width: 250px;
    max-width: 350px;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
}

[data-bs-theme="dark"] .tag-suggestions-dropdown {
    background: var(--surface);
    border-color: var(--border-color);
}

.tag-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-light);
}

.tag-suggestion-item:last-child {
    border-bottom: none;
}

.tag-suggestion-item:hover {
    background: var(--bg-tertiary);
}

.tag-suggestion-create {
    color: var(--primary-color);
    font-weight: 500;
}

.tag-suggestion-create i {
    margin-right: 0.5rem;
}

.tag-suggestion-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

/* Updated tag badges for better visibility */
.tag-badge {
    padding: 0.45rem 0.9rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ============================================
   NOTES CARD IMPROVEMENTS
   ============================================ */

.notes-content {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.notes-content pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.notes-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.notes-edit-form textarea {
    resize: vertical;
    min-height: 200px;
}

.notes-actions {
    display: flex;
    gap: 0.5rem;
}

.notes-edit-form {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.notes-edit-form textarea {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
}

.notes-edit-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   REMOVE OLD NOTES STYLES (if they conflict)
   ============================================ */

/* DELETE these if they exist in your app.css: */
/*
.chain-notes-section
.notes-display-card
.notes-header
.notes-icon
.notes-label
*/

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
    .chain-tags-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tags-label {
        padding-top: 0;
    }
    
    .tags-container {
        width: 100%;
    }
    
    .tag-quick-add-input {
        width: 120px;
    }
    
    .tag-quick-add-input:focus {
        width: 150px;
    }
    
    .tag-suggestions-dropdown {
        min-width: 200px;
        max-width: calc(100vw - 2rem);
    }
}

/* Enhanced tag styling for quick-add */
.tag-quick-add-wrapper {
    position: relative;
    display: inline-block;
}

.tag-quick-add-input {
    border: 1px dashed #dee2e6;
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 0.875rem;
    width: 150px;
    transition: all 0.2s;
}

.tag-quick-add-input:focus {
    border-color: #0d6efd;
    border-style: solid;
    outline: none;
    width: 200px;
}

.tag-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
}

.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.tag-suggestion-item:hover {
    background-color: #f8f9fa;
}

.tag-suggestion-create {
    color: #0d6efd;
    font-weight: 500;
    border-top: 1px solid #dee2e6;
}

.tag-suggestion-create:hover {
    background-color: #e7f1ff;
}

.tag-suggestion-divider {
    height: 1px;
    background-color: #dee2e6;
    margin: 4px 0;
}

.tag-badge-small {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    color: white;
}

/* Quick color picker for tag creation */
.quick-color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-radio-option {
    position: relative;
    cursor: pointer;
}

.color-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.color-badge {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.color-badge i {
    opacity: 0;
    transition: opacity 0.2s;
}

.color-radio-option input[type="radio"]:checked + .color-badge {
    border-color: #198754;
    transform: scale(1.1);
}

.color-radio-option input[type="radio"]:checked + .color-badge i {
    opacity: 1;
}

.color-badge:hover {
    transform: scale(1.15);
}

/* Execution impact preview */
.metric-progress-inline {
    margin-top: 4px;
}

.metric-progress-bar {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.metric-progress-fill {
    height: 100%;
    background-color: #0d6efd;
    transition: width 0.3s ease;
}



/* Add to the end of your existing CSS */

/* ============================================
   REAL-TIME P/L UPDATES (Shared)
   ============================================ */

.pl-cell-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pl-value-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.pl-split-display {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pl-realized-text {
    font-weight: 600;
    font-size: 1rem;
}

.pl-unrealized-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.pl-arrow-icon {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.return-cell-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.return-value-text {
    font-weight: 600;
    font-size: 1rem;
}

.return-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bs-gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.return-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bs-success), var(--bs-info));
    transition: width 0.3s ease;
}

/* Chain View Specific */
.metric-card-pl-loading {
    position: relative;
}

.metric-card-pl-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pl-breakdown-text {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}


/* Stragegy Pages */
.badge.text-bg-teal   { background-color:#20c997!important; color:#000!important; }
.badge.text-bg-orange { background-color:#fd7e14!important; color:#000!important; }
.badge.text-bg-cyan   { background-color:#0dcaf0!important; color:#000!important; }
.badge.text-bg-rose   { background-color:#e11d48!important; color:#fff!important; }
.badge.text-bg-purple { background-color:#6f42c1!important; color:#fff!important; }
.badge.text-bg-indigo { background-color:#6610f2!important; color:#fff!important; }
.badge.text-bg-blue   { background-color:#0d6efd!important; color:#fff!important; }
.badge.text-bg-yellow { background-color:#ffc107!important; color:#000!important; }
.badge.text-bg-amber  { background-color:#ffbf00!important; color:#000!important; }
.badge.text-bg-lime   { background-color:#84cc16!important; color:#000!important; }
.badge.text-bg-olive  { background-color:#556b2f!important; color:#fff!important; }
.badge.text-bg-brown  { background-color:#8b4513!important; color:#fff!important; }
.badge.text-bg-slate  { background-color:#64748b!important; color:#fff!important; }
.badge.text-bg-pink   { background-color:#d63384!important; color:#fff!important; }
.badge.text-bg-violet { background-color:#7c3aed!important; color:#fff!important; }
.badge.text-bg-azure  { background-color:#0ea5e9!important; color:#000!important; }
.badge.text-bg-coral  { background-color:#ff7f50!important; color:#000!important; }
.badge.text-bg-gold   { background-color:#f59e0b!important; color:#000!important; }
.badge.text-bg-silver { background-color:#6b7280!important; color:#fff!important; }
.badge.text-bg-bronze { background-color:#b08d57!important; color:#000!important; }
.badge.text-bg-magenta{ background-color:#d946ef!important; color:#000!important; }
.badge.text-bg-maroon { background-color:#800000!important; color:#fff!important; }
.badge.text-bg-navy   { background-color:#001f3f!important; color:#fff!important; }
.badge.text-bg-sky    { background-color:#38bdf8!important; color:#000!important; }
.badge.text-bg-mint   { background-color:#2dd4bf!important; color:#000!important; }
.badge.text-bg-cream  { background-color:#fffdd0!important; color:#000!important; }

/* Market Data Upgrade Prompts */
.market-data-upgrade-prompt {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.market-data-upgrade-prompt .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Data freshness with upgrade option */
#dataFreshness .btn-sm {
    vertical-align: middle;
}

/* Distinguish between OFF (user choice) and unavailable (technical) */
.badge.bg-secondary i.bi-lock {
    margin-right: 0.25rem;
}

/* Make upgrade links in tables not trigger row click */
.pl-cell-wrapper a,
.leg-market-data-status a {
    position: relative;
    z-index: 10;
}


/* Setup banner styling */
#setupBanner {
    border-left: 4px solid var(--bs-info);
}

#setupBanner .bi {
    color: var(--bs-info);
}