/* App Styles - Private Application */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    background: #f8fafc;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-right: 1px solid #334155;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #334155;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-nav li {
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: #3b82f6;
}

.sidebar-nav .nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 1.1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

/* Top Header */
.top-header {
    background: #ffffff;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #e2e8f0;
    color: #475569;
}

#page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-name {
    font-weight: 500;
    color: #64748b;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f8fafc;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding: 0;
}

.dashboard-header .header-left h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.dashboard-header .header-left p {
    color: #64748b;
    font-size: 1.1rem;
}

.dashboard-header .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-range:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.metric-card .metric-icon {
    width: 50px;
    height: 50px;
    background: #3b82f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.metric-card .metric-icon i {
    font-size: 1.5rem;
    color: white;
}

.metric-content h3 {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.metric-change {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-change.positive {
    color: #10b981;
}

.metric-change.negative {
    color: #ef4444;
}

.metric-change.neutral {
    color: #64748b;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    grid-row: 1 / 3;
}

.holdings-card,
.activity-card,
.market-card {
    grid-column: 2;
}

/* Chart Card */
.chart-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-btn:hover,
.chart-btn.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Holdings Card */
.holdings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.holding-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.holding-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.stock-symbol {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1.1rem;
}

.stock-name {
    color: #64748b;
    font-size: 0.9rem;
}

.stock-price {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
}

.stock-change {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Activity Card */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.activity-icon {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.activity-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.activity-desc {
    color: #64748b;
    font-size: 0.8rem;
}

.activity-time {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-left: auto;
}

/* Market Card */
.market-indices {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.index-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.index-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.index-name {
    font-weight: 600;
    color: #3b82f6;
    font-size: 1rem;
}

.index-value {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.index-change {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Button Link */
.btn-link {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-link:hover {
    color: #1d4ed8;
}

/* Hover Effects */
.hover-effect {
    background: #f1f5f9 !important;
    transform: translateX(4px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border-color: #3b82f6 !important;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: #3b82f6;
}

.card-header {
    padding: 20px;
    background: #f8fafc;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
}

.card-body {
    padding: 20px;
    background: #ffffff;
    color: #1e293b;
}

/* Metric Row */
.metric-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.metric {
    text-align: center;
    flex: 1;
}

.metric .label {
    display: block;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.metric .value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #3b82f6;
}

/* Broker Status */
.broker-linked {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #10b981;
    font-weight: 500;
}

.broker-not-linked {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: #ffffff;
    border-color: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Sidebar Toggle */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link span {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 15px 10px;
}

.main-content.sidebar-collapsed {
    margin-left: 0;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        grid-row: auto;
    }
    
    .holdings-card,
    .activity-card,
    .market-card {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -250px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .dashboard-header .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .dashboard-header .header-left h1 {
        font-size: 2rem;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .chart-controls {
        flex-wrap: wrap;
    }
}

/* Bulk Update Progress */
.progress-container {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.progress-header h3 {
    margin: 0;
    color: #007bff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
}

/* Price Status Indicators */
.price-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.price-status.live {
    background: #d4edda;
    color: #155724;
}

.price-status.recent {
    background: #fff3cd;
    color: #856404;
}

.price-status.stale {
    background: #f8d7da;
    color: #721c24;
}

.price-status.end-of-day {
    background: #e2e3e5;
    color: #383d41;
}

.price-status.never-updated {
    background: #f8f9fa;
    color: #6c757d;
}

/* Script Actions */
.script-actions {
    display: flex;
    gap: 5px;
}

.script-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* Header Actions Layout */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.header-actions .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions .search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

/* Exchange Badges */
.exchange-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.exchange-badge.nse {
    background: #e3f2fd;
    color: #1976d2;
}

.exchange-badge.bse {
    background: #f3e5f5;
    color: #7b1fa2;
}

.exchange-badge.nse::before {
    content: "NSE";
}

.exchange-badge.bse::before {
    content: "BSE";
}
    
    .chart-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}



/* Holdings Screen Styles */
.holdings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding: 0;
}

.holdings-header .header-left h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.holdings-header .header-left p {
    color: #64748b;
    font-size: 1.1rem;
}

.holdings-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.holdings-header .header-right .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: 120px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    font-weight: 500;
}

/* Portfolio Summary */
.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.summary-icon {
    width: 50px;
    height: 50px;
    background: #3b82f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.summary-icon i {
    font-size: 1.5rem;
    color: white;
}

.summary-content h3 {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 4px;
}

.summary-change {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.summary-change.positive {
    color: #10b981;
}

.summary-change.negative {
    color: #ef4444;
}

.summary-change.neutral {
    color: #64748b;
}

/* Link Broker Accounts Section */
.link-broker-accounts-section {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.link-broker-accounts-section h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Broker Linking Layout */
.broker-linking-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.broker-linking-left {
    display: flex;
    flex-direction: column;
}

.broker-linking-right {
    display: flex;
    flex-direction: column;
}

/* Broker Selection Section */
.broker-selection-section {
    margin-bottom: 0;
}

.broker-selection-section h4 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 600;
}

.broker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.broker-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.broker-list-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
}

.broker-list-item.selected,
.broker-list-item:focus {
    border-color: #3b82f6;
    background: #f0f9ff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    text-decoration: none;
    color: inherit;
}

.broker-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.broker-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.broker-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.broker-name {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
}

.broker-desc {
    color: #64748b;
    font-size: 0.85rem;
}

.broker-arrow {
    color: #94a3b8;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.broker-list-item:hover .broker-arrow {
    color: #3b82f6;
    transform: translateX(4px);
}

/* Broker Configuration Section */
.broker-config-section {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.broker-config-section h4 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.broker-config-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Broker Accounts Section */
.broker-accounts-section {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.broker-accounts-section h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    color: #1e293b;
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: #f8fafc;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.connected {
    background: #dcfce7;
    color: #166534;
}

.status-badge.disconnected {
    background: #fef2f2;
    color: #dc2626;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.generate-key {
    background: #3b82f6;
    color: white;
}

.action-btn.generate-key:hover {
    background: #2563eb;
}

.action-btn.sync {
    background: #10b981;
    color: white;
}

.action-btn.sync:hover {
    background: #059669;
}

.action-btn.disconnect {
    background: #ef4444;
    color: white;
}

.action-btn.disconnect:hover {
    background: #dc2626;
}

/* Responsive Design for Broker Linking */
@media (max-width: 1200px) {
    .broker-linking-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .broker-linking-left {
        order: 1;
    }
    
    .broker-linking-right {
        order: 2;
    }
}

@media (max-width: 768px) {
    .broker-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .broker-option {
        padding: 16px;
    }
    
    .broker-option h4 {
        font-size: 1.1rem;
    }
    
    .broker-option p {
        font-size: 0.85rem;
    }
}

/* Holdings Table Container */
.holdings-table-container {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.table-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box i {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-size: 0.9rem;
}

#holdings-filter {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

#holdings-filter:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Holdings Table */
.table-wrapper {
    overflow-x: auto;
}

.holdings-table {
    width: 100%;
    border-collapse: collapse;
}

.holdings-table th {
    background: #f8fafc;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.holdings-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 0.9rem;
}

.holdings-table tbody tr:hover {
    background: #f8fafc;
}

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

/* Table Cell Styles */
.symbol-cell {
    font-weight: 700;
    color: #3b82f6;
}


.quantity-cell {
    font-weight: 600;
    text-align: right;
}

.price-cell {
    font-weight: 600;
    text-align: right;
}

.value-cell {
    font-weight: 700;
    text-align: right;
}

.pnl-cell {
    font-weight: 600;
    text-align: right;
}

.pnl-positive {
    color: #10b981;
}

.pnl-negative {
    color: #ef4444;
}

.pnl-neutral {
    color: #64748b;
}


/* Table Footer */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    color: #64748b;
    font-size: 0.9rem;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #3b82f6;
    font-size: 0.9rem;
}

.loading-indicator i {
    animation: spin 1s linear infinite;
}

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

/* Responsive Holdings */
@media (max-width: 768px) {
    .holdings-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .holdings-header .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .portfolio-summary {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .table-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .holdings-table {
        font-size: 0.8rem;
    }
    
    .holdings-table th,
    .holdings-table td {
        padding: 12px 8px;
    }
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-actions .btn {
    justify-content: flex-start;
    text-align: left;
    padding: 12px 16px;
}

.quick-actions .btn i {
    margin-right: 8px;
    width: 16px;
}

/* Dashboard Specific Styles */
.dashboard-grid .card {
    min-height: 200px;
}

.dashboard-grid .card:first-child {
    grid-column: 1 / -1;
}

.dashboard-grid .card:nth-child(2) {
    grid-column: 1 / -1;
}

/* Holdings List in Dashboard */
.dashboard-grid .holdings-list {
    max-height: 300px;
    overflow-y: auto;
}

.dashboard-grid .holding-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dashboard-grid .holding-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-grid .holding-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.dashboard-grid .stock-symbol {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.dashboard-grid .stock-name {
    color: #64748b;
    font-size: 0.8rem;
}

.dashboard-grid .stock-price {
    font-weight: 600;
    color: #3b82f6;
    font-size: 0.9rem;
}

.dashboard-grid .stock-change {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Activity List in Dashboard */
.dashboard-grid .activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.dashboard-grid .activity-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dashboard-grid .activity-icon {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.dashboard-grid .activity-content {
    flex: 1;
}

.dashboard-grid .activity-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.dashboard-grid .activity-desc {
    color: #64748b;
    font-size: 0.8rem;
}

.dashboard-grid .activity-time {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Market Indices in Dashboard */
.dashboard-grid .market-indices {
    max-height: 300px;
    overflow-y: auto;
}

.dashboard-grid .index-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dashboard-grid .index-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.dashboard-grid .index-value {
    font-weight: 700;
    color: #3b82f6;
    font-size: 1rem;
}

.dashboard-grid .index-change {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid .card:first-child,
    .dashboard-grid .card:nth-child(2) {
        grid-column: 1;
    }
    
    .quick-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .quick-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Portfolio Overview Values */
#total-value,
#today-pnl,
#active-holdings,
#active-algorithms {
    color: #3b82f6 !important;
    font-weight: 700;
}

/* Portfolio Overview Header Fix */
.dashboard-grid .card-header h3 {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.dashboard-grid .card-header h3 i {
    color: #3b82f6 !important;
}

/* Price Status Indicators */
.price-status {
    margin-left: 8px;
    font-size: 0.7rem;
}

.price-status .fas.fa-circle {
    font-size: 0.5rem;
}

.price-status.success .fas.fa-circle {
    color: #10b981 !important; /* Green for live price */
}

.price-status.cached .fas.fa-circle {
    color: #f59e0b !important; /* Orange for cached price */
}

/* Dashboard Metric Values */
.dashboard-grid .metric .value {
    color: #3b82f6;
    font-weight: 700;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.active {
    display: block !important;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Login Page Styles */
#login-page {
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    overflow: hidden;
    position: relative;
}

#login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-10px) translateY(-5px); }
    50% { transform: translateX(5px) translateY(-10px); }
    75% { transform: translateX(-5px) translateY(5px); }
}

.login-layout {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Left Side - System Overview (70%) */
.login-left {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: white;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

/* 3D Animation Container */
.animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#trading-canvas {
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.floating-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #00ffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.floating-icon i {
    font-size: 1.5rem;
    color: #00ffff;
    animation: pulse 2s ease-in-out infinite;
}

.floating-icon[data-icon="chart"] {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon[data-icon="robot"] {
    top: 30%;
    right: 15%;
    animation-delay: 1.5s;
}

.floating-icon[data-icon="clock"] {
    bottom: 30%;
    left: 20%;
    animation-delay: 3s;
}

.floating-icon[data-icon="shield"] {
    bottom: 20%;
    right: 10%;
    animation-delay: 4.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Features Carousel */
.features-carousel {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.carousel-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 20px;
    background: rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.1);
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.feature-content {
    text-align: center;
    padding: 40px;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: rotate 4s linear infinite;
}

.feature-icon i {
    font-size: 2rem;
    color: #000000;
}

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

.feature-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00ffff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-content p {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.6;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #00ffff;
    transform: scale(1.2);
}

/* System Flow */
.system-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 3;
    position: relative;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 255, 255, 0.1);
}

.flow-step:hover {
    transform: translateY(-5px);
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00ffff, #0080ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000000;
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

.step-content h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #ffffff;
}

.step-content p {
    font-size: 0.8rem;
    opacity: 0.7;
}

.flow-connector {
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #0080ff);
    position: relative;
}

.flow-connector::after {
    content: '';
    position: absolute;
    right: -5px;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 8px solid #00ffff;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* Background Particles */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ffff;
    border-radius: 50%;
    animation: particleFloat 8s linear infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    left: 30%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    left: 50%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    left: 70%;
    animation-delay: 6s;
}

.particle:nth-child(5) {
    left: 90%;
    animation-delay: 8s;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Highlighted step animation */
.flow-step.highlighted {
    background: rgba(0, 255, 255, 0.3) !important;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5) !important;
    transform: scale(1.05) !important;
}

.system-overview {
    max-width: 550px;
    width: 100%;
    animation: slideInLeft 1s ease-out;
}

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

.overview-header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease-out 0.2s both;
}

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

.overview-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
    to { text-shadow: 0 2px 20px rgba(255,255,255,0.2), 0 2px 10px rgba(0,0,0,0.3); }
}

.overview-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.system-flow {
    margin-bottom: 25px;
}

.flow-step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.8s ease-out both;
    position: relative;
    overflow: hidden;
}

.flow-step:nth-child(1) { animation-delay: 0.1s; }
.flow-step:nth-child(3) { animation-delay: 0.2s; }
.flow-step:nth-child(5) { animation-delay: 0.3s; }
.flow-step:nth-child(7) { animation-delay: 0.4s; }

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

.flow-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s;
}

.flow-step:hover::before {
    left: 100%;
}

.flow-step:hover {
    transform: translateX(8px) scale(1.02);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.step-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.step-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.flow-step:hover .step-icon::before {
    width: 100%;
    height: 100%;
}

.step-icon i {
    font-size: 1.3rem;
    color: white;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.flow-step:hover .step-icon i {
    transform: scale(1.1);
}

.step-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: white;
    transition: color 0.3s ease;
}

.flow-step:hover .step-content h3 {
    color: #fff;
}

.step-content p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0;
    line-height: 1.4;
    transition: opacity 0.3s ease;
}

.flow-step:hover .step-content p {
    opacity: 1;
}

.flow-arrow {
    text-align: center;
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.4);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

.flow-arrow i {
    font-size: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 25px;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.feature-item {
    text-align: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.feature-item:hover {
    transform: translateY(-3px) scale(1.05);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.feature-item i {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 8px;
    display: block;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.feature-item:hover i {
    transform: scale(1.2);
}

.feature-item span {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    position: relative;
    z-index: 1;
}

/* Right Side - Login Form (30%) */
.login-right {
    flex: 0 0 30%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #3b82f6;
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

/* Modern Input Container */
.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #3b82f6;
    z-index: 2;
    transition: all 0.3s ease;
    pointer-events: none; /* don't block typing/cursor */
}

.input-container input {
    width: 100%;
    padding: 14px 64px 14px 72px; /* widened to ensure placeholder/text never overlaps icon */
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    color: #1e293b;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-container input::placeholder {
    color: rgba(30, 41, 59, 0.6);
}

.input-container input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.input-container input:focus + .input-highlight {
    opacity: 1;
    transform: scaleX(1);
}

.input-highlight {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    transform: scaleX(0);
    transition: all 0.3s ease;
    opacity: 0;
}

.input-container:focus-within .input-icon {
    color: #3b82f6;
    transform: translateY(-50%) scale(1.1);
}

/* Password eye toggle */
.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    z-index: 2;
    pointer-events: auto; /* keep eye icon clickable */
}

/* Ensure icons don't overlap text at higher zoom or different DPI */
.input-container .input-icon {
    width: 32px;
    text-align: center;
    left: 8px;
}

@media (max-width: 480px) {
    .input-container input { padding: 14px 60px 14px 72px; }
}

.toggle-password:hover {
    color: #3b82f6;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #3b82f6;
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input:checked + .checkmark {
    background: #3b82f6;
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
}

.forgot-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    color: #1e40af;
    text-shadow: 0 0 5px #3b82f6;
}

/* Signup and Login Links */
.signup-link, .login-link, .back-to-login {
    text-align: center;
    margin-top: 20px;
}

.signup-btn, .login-switch-btn, .back-to-login-btn {
    color: #3b82f6;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.signup-btn:hover, .login-switch-btn:hover, .back-to-login-btn:hover {
    color: #1e40af;
    text-shadow: 0 0 5px #3b82f6;
}

.back-to-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.terms-link {
    color: #3b82f6;
    text-decoration: none;
    transition: all 0.3s ease;
}

.terms-link:hover {
    color: #1e40af;
    text-shadow: 0 0 5px #3b82f6;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn .btn-text {
    position: relative;
    z-index: 2;
}

.btn .btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    opacity: 1;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    width: auto;
    padding: 10px 16px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    width: auto;
    padding: 10px 16px;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    width: auto;
    padding: 10px 16px;
}

/* Keep full-width buttons where explicitly needed */
.quick-actions .btn,
.login-card .btn,
.broker-accounts-section .action-btn.full,
.form-actions .btn.full {
    width: 100% !important;
}

/* Order modal footer buttons layout */
#order-modal .modal-footer .btn {
    width: auto;
}

/* Simulation Modal Styles */
.simulation-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

.simulation-form-panel {
    flex: 0 0 400px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.simulation-results-panel {
    flex: 1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.simulation-form-panel input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.simulation-form-panel input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.simulation-form-panel label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.simulation-form-panel .form-group {
    margin-bottom: 16px;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 15px;
    border: 1px solid #f5c6cb;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.dashboard-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left h1 {
    color: #667eea;
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

#user-name {
    font-weight: 600;
    color: #333;
}

/* Navigation */
.dashboard-nav {
    background: #2c3e50;
    width: 250px;
    padding-top: 100px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.dashboard-nav ul {
    list-style: none;
    padding: 20px 0;
}

.dashboard-nav li {
    margin-bottom: 5px;
}

.dashboard-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dashboard-nav .nav-link:hover {
    background: #34495e;
    color: white;
}

.dashboard-nav .nav-link.active {
    background: #667eea;
    color: white;
}

.dashboard-nav .nav-link i {
    margin-right: 15px;
    width: 20px;
}

/* Main Content */
.dashboard-main {
    margin-left: 250px;
    margin-top: 100px;
    padding: 30px;
    width: calc(100% - 250px);
    min-height: calc(100vh - 100px);
}

/* Content Container */
#content-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Loading Indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #666;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-left {
        flex: 0 0 60%;
        padding: 20px;
    }
    
    .login-right {
        flex: 0 0 40%;
        padding: 20px;
    }
    
    .overview-header h1 {
        font-size: 2rem;
    }
    
    .system-overview {
        max-width: 450px;
    }
    
    .flow-step {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .step-icon {
        width: 45px;
        height: 45px;
    }
    
    .step-content h3 {
        font-size: 1rem;
    }
    
    .step-content p {
        font-size: 0.85rem;
    }
    
    .features-grid {
        gap: 12px;
        margin-top: 20px;
    }
    
    .feature-item {
        padding: 12px 8px;
    }
}

@media (max-width: 768px) {
    #login-page {
        height: 100vh;
        overflow-y: auto;
    }
    
    .login-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .login-left {
        flex: 0 0 50%;
        padding: 20px 15px;
        min-height: 50vh;
    }
    
    .login-right {
        flex: 0 0 50%;
        padding: 20px 15px;
        min-height: 50vh;
    }
    
    .overview-header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    .overview-subtitle {
        font-size: 1rem;
    }
    
    .system-overview {
        max-width: 100%;
    }
    
    .system-flow {
        margin-bottom: 20px;
    }
    
    .flow-step {
        flex-direction: column;
        text-align: center;
        margin-bottom: 15px;
        padding: 12px;
    }
    
    .step-icon {
        margin-right: 0;
        margin-bottom: 10px;
        width: 40px;
        height: 40px;
    }
    
    .step-icon i {
        font-size: 1.1rem;
    }
    
    .step-content h3 {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }
    
    .step-content p {
        font-size: 0.8rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 15px;
    }
    
    .feature-item {
        padding: 10px 6px;
    }
    
    .feature-item i {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }
    
    .feature-item span {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .login-left {
        padding: 15px 10px;
    }
    
    .login-right {
        padding: 15px 10px;
    }
    
    .overview-header h1 {
        font-size: 1.5rem;
    }
    
    .overview-subtitle {
        font-size: 0.9rem;
    }
    
    .flow-step {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .step-icon {
        width: 35px;
        height: 35px;
    }
    
    .step-icon i {
        font-size: 1rem;
    }
    
    .step-content h3 {
        font-size: 0.9rem;
    }
    
    .step-content p {
        font-size: 0.75rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .feature-item {
        padding: 8px 4px;
    }
    
    .feature-item i {
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .feature-item span {
        font-size: 0.7rem;
    }
}

/* Dashboard responsive styles */
@media (max-width: 768px) {
    .dashboard-nav {
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .dashboard-nav.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
        width: 100%;
    }
    
    .dashboard-header {
        padding: 15px 20px;
    }
    
    .header-left h1 {
        font-size: 1.2rem;
    }
}

/* Success Message Styles */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 9999;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Error Message Styles */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    z-index: 9999;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

.info-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #3b82f6;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    z-index: 9999;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

.warning-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f59e0b;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    z-index: 9999;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

/* Algorithm Statistics */
.algorithm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.stat-subtitle {
    font-size: 11px;
    color: #94a3b8;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #3b82f6;
    background: #f0f9ff;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 5px 0;
}

.stat-content p {
    color: #64748b;
    margin: 0;
    font-size: 14px;
}

/* Algorithm Tabs */
.algorithm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #f8fafc;
    color: #3b82f6;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Algorithm Grid */
.algorithms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.algorithm-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.algorithm-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
    transform: translateY(-4px);
}

.algorithm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.algorithm-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.algorithm-card p {
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

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

.algorithm-actions .btn {
    flex: 1;
    min-width: 80px;
    font-size: 12px;
    padding: 8px 12px;
}

/* Algorithm Details Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* General Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #ffffff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #ef4444;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Algorithm Details Tabs */
.algorithm-details-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0;
}

.detail-tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.detail-tab-btn:hover {
    background: #f8fafc;
    color: #3b82f6;
}

.detail-tab-btn.active {
    background: #3b82f6;
    color: white;
}

.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
}

/* Algorithm Info */
.algorithm-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-section p {
    margin: 0;
    color: #1e293b;
    font-size: 16px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fef2f2;
    color: #dc2626;
}

/* Configuration Form */
.config-form h4 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 18px;
}

.config-parameters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.config-parameter {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-parameter label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.config-parameter input,
.config-parameter select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.config-parameter input:focus,
.config-parameter select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.config-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Algorithm Requirements Tooltip */
.requirements-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    z-index: 9999;
    width: 100%;
    background: #fff;
    border: 2px solid #1976d2;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Temporary: make tooltip visible for debugging */
    /* display: block !important; */
    /* background: #ff0000 !important; /* Red background to make it visible */
}

.tooltip-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    animation: fadeInDown 0.2s ease-out;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
}

.tooltip-header h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.close-tooltip {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.close-tooltip:hover {
    opacity: 1;
    color: #dc2626;
}

.tooltip-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.requirements-details {
    font-size: 14px;
    line-height: 1.5;
}

.requirements-details div {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.requirements-details div:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.requirements-details strong {
    color: #374151;
    font-weight: 600;
}

/* Info Icon Hover Effects */
#requirements-info-icon {
    transition: all 0.2s ease;
}

#requirements-info-icon:hover {
    color: #1565c0;
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(25, 118, 210, 0.3);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Performance Metrics */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.metric-card h4 {
    margin: 0 0 12px 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

/* Signals Table */
.signals-table {
    overflow-x: auto;
}

.signals-table table {
    width: 100%;
    border-collapse: collapse;
}

.signals-table th,
.signals-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.signals-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

/* Market Ticker Styles */
.market-mini-ticker {
    display: flex;
    gap: 20px;
    align-items: center;
}

.mini-ticker-item {
    font-size: 12px;
    font-weight: 500;
}

.mini-full-text {
    color: #6b7280;
    transition: color 0.3s ease;
}

.mini-full-text.positive {
    color: #10b981;
}

.mini-full-text.negative {
    color: #ef4444;
}

.mini-full-text.loading {
    color: #6b7280;
    opacity: 0.7;
}

.signals-table td {
    color: #1e293b;
    font-size: 14px;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Signal Badges */
.signal-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.signal-badge.buy {
    background: #dcfce7;
    color: #166534;
}

.signal-badge.sell {
    background: #fef2f2;
    color: #dc2626;
}

/* Suggestions */
.suggestions-list {
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #f8fafc;
}

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

.suggestion-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 16px;
}

.confidence-badge {
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.suggestion-item p {
    margin: 8px 0;
    color: #64748b;
    font-size: 14px;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Algorithm Type Indicators */
.algorithm-card[data-algorithm-type="momentum"]::before {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.algorithm-card[data-algorithm-type="mean-reversion"]::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.algorithm-card[data-algorithm-type="trend-following"]::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* Status Badge Enhancements */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fef2f2;
    color: #dc2626;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.completed {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Market Data Mini Ticker in Header */
.market-mini-ticker {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-right: 15px;
    padding: 10px 18px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 100%;
    max-height: 80px;
}

.mini-ticker-item {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.mini-ticker-item:hover {
    transform: translateY(-1px);
}

.mini-full-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.2;
    white-space: nowrap;
}


/* Responsive Mini Ticker */
@media (max-width: 1200px) {
    .market-mini-ticker {
        gap: 20px;
        margin-right: 12px;
        padding: 8px 14px;
    }
    
    .mini-full-text {
        font-size: 13px;
    }
}

@media (max-width: 1024px) {
    .market-mini-ticker {
        gap: 18px;
        margin-right: 10px;
        padding: 6px 12px;
    }
    
    .mini-full-text {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .market-mini-ticker {
        gap: 15px;
        margin-right: 8px;
        padding: 5px 10px;
    }
    
    .mini-full-text {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .market-mini-ticker {
        display: none; /* Hide on very small screens to save space */
    }
}

/* Order Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: #64748b;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #ef4444;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Order Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 35px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form Select Styles */
.form-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #ffffff;
    color: #374151;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select:hover {
    border-color: #9ca3af;
}

/* Filters Summary */
.filters-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background: #e0f2fe;
    border: 1px solid #b3e5fc;
    border-radius: 20px;
    padding: 4px 8px;
    font-size: 12px;
    color: #0277bd;
}

.filter-label {
    font-weight: 600;
    margin-right: 4px;
}

.filter-value {
    margin-right: 4px;
}

.filter-remove {
    background: none;
    border: none;
    color: #0277bd;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    margin-left: 4px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.filter-remove:hover {
    background: #0277bd;
    color: white;
}

/* Table Header */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.table-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.table-info span {
    font-size: 14px;
    color: #64748b;
}

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

/* Loading Indicators */
.loading-indicator {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 16px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
}

.loading-spinner i {
    font-size: 16px;
    color: #3b82f6;
}

.end-message {
    text-align: center;
    padding: 20px;
    color: #059669;
    font-size: 14px;
    font-weight: 500;
}

.end-message i {
    margin-right: 8px;
    color: #10b981;
}

/* Infinite Scroll Trigger */
.infinite-scroll-trigger {
    height: 1px;
    margin-top: 20px;
}

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

.script-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.script-info small {
    color: #64748b;
    font-size: 12px;
}

.order-summary {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.order-summary h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
}

/* Notification System */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #3b82f6;
    padding: 16px 20px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification.info {
    border-left-color: #3b82f6;
}

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

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.notification-message {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    border-radius: 0 0 8px 8px;
    transition: width linear;
}

.notification.success .notification-progress {
    background: linear-gradient(90deg, #10b981, #059669);
}

.notification.error .notification-progress {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.notification.warning .notification-progress {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* Responsive notifications */
@media (max-width: 768px) {
    .notification-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        padding: 12px 16px;
    }
    
    .notification-title {
        font-size: 13px;
    }
    
    .notification-message {
        font-size: 12px;
    }
}

/* System Health Monitoring Styles */
.health-overview {
    margin-bottom: 30px;
}

.health-status-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid #3b82f6;
}

.status-indicator {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
}

.status-indicator.healthy {
    color: #10b981;
    background: #d1fae5;
}

.status-indicator.warning {
    color: #f59e0b;
    background: #fef3c7;
}

.status-indicator.error {
    color: #ef4444;
    background: #fee2e2;
}

.status-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: #1f2937;
}

.status-details p {
    margin: 0 0 5px 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.status-details small {
    color: #9ca3af;
    font-size: 0.8rem;
}

.health-components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.health-component {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
}

.health-component:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.health-component.healthy {
    border-left-color: #10b981;
}

.health-component.warning {
    border-left-color: #f59e0b;
}

.health-component.error {
    border-left-color: #ef4444;
}

.component-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.component-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.health-component.healthy .component-icon {
    background: #d1fae5;
    color: #10b981;
}

.health-component.warning .component-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.health-component.error .component-icon {
    background: #fee2e2;
    color: #ef4444;
}

.component-info {
    flex: 1;
}

.component-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #1f2937;
}

.component-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #6b7280;
}

.health-component.healthy .component-status {
    background: #d1fae5;
    color: #10b981;
}

.health-component.warning .component-status {
    background: #fef3c7;
    color: #f59e0b;
}

.health-component.error .component-status {
    background: #fee2e2;
    color: #ef4444;
}

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

.component-details {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.component-details pre {
    background: #f9fafb;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 10px;
    overflow-x: auto;
}

.health-log {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.health-log h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 1.1rem;
}

.log-container {
    max-height: 300px;
    overflow-y: auto;
    background: #f9fafb;
    border-radius: 8px;
    padding: 15px;
}

.log-entry {
    display: flex;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.85rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #6b7280;
    font-weight: 500;
    min-width: 120px;
}

.log-message {
    color: #374151;
    flex: 1;
}

.log-entry.success .log-time {
    color: #10b981;
}

.log-entry.warning .log-time {
    color: #f59e0b;
}

.log-entry.error .log-time {
    color: #ef4444;
}

/* Auto-fix button animations */
.btn.wrench-spinning {
    animation: wrenchSpin 1s linear infinite;
}

@keyframes wrenchSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading states */
.health-component.loading {
    opacity: 0.7;
    pointer-events: none;
}

.health-component.loading .component-status {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Responsive design */
@media (max-width: 768px) {
    .health-components-grid {
        grid-template-columns: 1fr;
    }
    
    .health-status-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .component-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .component-actions {
        justify-content: center;
    }
}

/* Typeahead Styles */
.typeahead-container {
    position: relative;
    width: 100%;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

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

.suggestion-symbol {
    font-weight: bold;
    color: #333;
}

.suggestion-name {
    color: #666;
    font-size: 0.9em;
    margin-left: 5px;
}

.suggestion-price {
    color: #28a745;
    font-weight: bold;
    float: right;
}

.suggestion-exchange {
    color: #6c757d;
    font-size: 0.8em;
    margin-left: 5px;
}

/* Algorithms V2 enhancements */
.algov2-layout .data-table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.algov2-layout h4 {
    margin: 0 0 8px 0;
    color: #0f172a;
}
#algov2-sim-form label {
    font-size: 12px;
    color: #64748b;
}
#algov2-sim-form input[type="date"],
#algov2-sim-form input[type="number"] {
    appearance: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) inset;
}
#algov2-sim-form input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
#algov2-actions .btn-primary { background:#f97316; border-color:#f97316; }
#algov2-actions .btn-primary:hover { background:#ea580c; border-color:#ea580c; }
#algov2-actions .btn-secondary { border-color:#f97316; color:#f97316; background:#fff; }
#algov2-actions .btn-secondary:hover { background:#fff7ed; }
/* Expanded rows container (orange theme only inside expanded) */
.sim-steps { background:#ffffff; border:1px solid #fde68a; border-radius:10px; padding:8px; }
.sim-steps .data-table th { background:#fff7ed; }
.sim-steps .data-table tr:hover { background:#fff7ed; }
#algov2-actions .btn {
    border-radius: 8px;
}
#algov2-orders-drawer .data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}