/* ==========================================================================
   HALAL HUSTLE - Islamic-Inspired Color System
   
   Design Philosophy:
   - Deep Emerald Green: Traditional color of Islam, represents paradise & growth
   - Warm Gold/Amber: Prosperity, success, used in Islamic calligraphy
   - Teal Accents: Spirituality, depth, often seen in mosque tilework
   - Warm Ivory/Cream: Purity, cleanliness, easy on eyes for extended use
   - Subtle geometric patterns echo Islamic art without being overwhelming
   ========================================================================== */

:root {
    /* Primary - Emerald Green (Paradise, Growth, Islam) */
    --primary-900: #064e3b;
    --primary-800: #065f46;
    --primary-700: #047857;
    --primary-600: #059669;
    --primary-500: #10b981;
    --primary-400: #34d399;
    --primary-300: #6ee7b7;
    --primary-200: #a7f3d0;
    --primary-100: #d1fae5;
    --primary-50: #ecfdf5;
    
    /* Secondary - Warm Gold (Prosperity, Excellence) */
    --gold-900: #78350f;
    --gold-800: #92400e;
    --gold-700: #b45309;
    --gold-600: #d97706;
    --gold-500: #f59e0b;
    --gold-400: #fbbf24;
    --gold-300: #fcd34d;
    --gold-200: #fde68a;
    --gold-100: #fef3c7;
    --gold-50: #fffbeb;
    
    /* Accent - Deep Teal (Spirituality, Depth) */
    --teal-900: #134e4a;
    --teal-800: #115e59;
    --teal-700: #0f766e;
    --teal-600: #0d9488;
    --teal-500: #14b8a6;
    --teal-400: #2dd4bf;
    --teal-300: #5eead4;
    --teal-200: #99f6e4;
    --teal-100: #ccfbf1;
    --teal-50: #f0fdfa;
    
    /* Neutrals - Warm Ivory (Purity, Cleanliness) */
    --ivory-50: #fafaf9;
    --ivory-100: #f5f5f4;
    --ivory-200: #e7e5e4;
    --ivory-300: #d6d3d1;
    --ivory-400: #a8a29e;
    --ivory-500: #78716c;
    --ivory-600: #57534e;
    --ivory-700: #44403c;
    --ivory-800: #292524;
    --ivory-900: #1c1917;
    
    /* Semantic Colors */
    --success: var(--primary-500);
    --success-light: var(--primary-100);
    --warning: var(--gold-500);
    --warning-light: var(--gold-100);
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --info: var(--teal-600);
    --info-light: var(--teal-100);
    
    /* Background layers */
    --bg-body: linear-gradient(180deg, #f8f7f4 0%, #f5f3ef 100%);
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-muted: var(--ivory-100);
    
    /* Text colors */
    --text-primary: var(--ivory-900);
    --text-secondary: var(--ivory-600);
    --text-muted: var(--ivory-500);
    --text-inverse: #ffffff;
    
    /* Borders */
    --border-light: var(--ivory-200);
    --border-medium: var(--ivory-300);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.07), 0 2px 4px -2px rgba(28, 25, 23, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.05);
    --shadow-glow: 0 4px 20px rgba(5, 150, 105, 0.15);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-900) 0%, var(--primary-800) 50%, var(--primary-700) 100%);
    padding: 28px 36px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

/* Subtle geometric pattern overlay inspired by Islamic art */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.brand-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.brand-title {
    color: var(--text-inverse);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0;
}

.brand-tagline {
    color: var(--primary-200);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
}

.brand-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
    margin: 6px 0 0 0;
    max-width: 520px;
    line-height: 1.5;
}

header h1 {
    color: var(--text-inverse);
    font-size: 32px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.header-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.last-update {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.tab:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.tab.active {
    background: var(--primary-700);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

/* Tab Content */
.tab-content {
    display: none;
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--primary-400);
    color: var(--primary-700);
    background: var(--primary-50);
}

.filter-btn.active {
    background: var(--primary-700);
    color: var(--text-inverse);
    border-color: var(--primary-700);
}

.search-input, .filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Recommendations Layout with Sidebar */
.recommendations-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    min-height: calc(100vh - 200px);
}

.recommendations-sidebar {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

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

.sidebar-select {
    width: 100%;
}

.filter-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn-group .filter-btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    font-size: 13px;
}

.sidebar-section .filter-group {
    flex-direction: column;
    gap: 8px;
}

.sidebar-section .filter-group select {
    width: 100%;
}

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

.checkbox-filters .filter-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-filters .filter-checkbox-container:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.checkbox-filters input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-500);
}

.checkbox-filters .filter-label {
    font-size: 13px;
    color: var(--text-primary);
}

.checkbox-filters .filter-help {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: help;
}

.strategy-guide-btn {
    width: 100%;
    padding: 10px 14px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--primary-50), var(--teal-50));
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-md);
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.strategy-guide-btn:hover {
    background: linear-gradient(135deg, var(--primary-100), var(--teal-100));
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

.sidebar-actions {
    padding-top: 8px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.recommendations-main {
    min-width: 0; /* Prevent grid blowout */
}

.recommendations-main .section-header {
    margin-bottom: 16px;
}

.recommendations-main .section-header .filter-group {
    display: none; /* Hide legacy filter group */
}

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

.recommendation-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: var(--bg-card);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    min-height: 720px;
}

/* Compact cards: no min-height, minimal padding */
.recommendation-card.compact {
    min-height: auto;
    padding: 0;
}

.recommendation-card.compact:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.recommendation-card.buy {
    border-left: 4px solid var(--primary-500);
}

.recommendation-card.sell {
    border-left: 4px solid var(--danger);
}

.recommendation-card.existing {
    border-left: 4px solid var(--gold-500);
    background: var(--gold-50);
}

.recommendation-card.pending {
    border-left: 4px solid var(--teal-500);
    background: var(--teal-50);
}

/* Status Tags */
.card-status-tags {
    padding: 0 20px;
    margin-bottom: 10px;
}

.status-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 6px;
}

.status-tag:last-child {
    margin-bottom: 0;
}

.position-tag {
    background: linear-gradient(135deg, var(--gold-100) 0%, var(--gold-200) 100%);
    border: 1px solid var(--gold-400);
    color: var(--gold-800);
}

.order-tag {
    background: linear-gradient(135deg, var(--teal-100) 0%, var(--teal-200) 100%);
    border: 1px solid var(--teal-400);
    color: var(--teal-800);
}

.order-tag.sell {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid var(--danger);
    color: #b91c1c;
}

.status-icon {
    font-size: 14px;
}

.status-text {
    flex: 1;
}

.status-text strong {
    font-weight: 600;
}

.pl-value {
    margin-left: 4px;
    font-weight: 500;
}

.pl-value.positive {
    color: var(--primary-600);
}

.pl-value.negative {
    color: var(--danger);
}

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

.card-symbol {
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
}

.card-date {
    font-size: 12px;
    color: #6b7280;
}

.card-body {
    margin-bottom: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-company {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 5px;
}

.card-industry {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
    font-style: italic;
}

/* Clickable ticker symbol link on recommendations */
.ticker-link {
    color: var(--primary-700);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--primary-300);
    text-underline-offset: 2px;
    transition: all var(--transition-fast);
}

.ticker-link:hover {
    color: var(--primary-800);
    text-decoration-color: var(--primary-500);
}

.card-price-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.card-price {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.card-price.unavailable {
    font-size: 14px;
    color: #6b7280;
    font-weight: normal;
}

.chart-patterns {
    font-size: 11px;
    color: #6366f1;
    margin-top: 5px;
    font-weight: 500;
    text-align: center;
}

.card-chart-container {
    margin: 0;
    margin-top: 5px;
    height: 380px;
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    padding-bottom: 50px;
    overflow: visible;
}

.card-chart {
    width: 100% !important;
    height: 100% !important;
}

.rec-chart {
    width: 100%;
    height: 320px;
    min-height: 320px;
    align-self: flex-start;
    margin: 0;
    padding: 0;
    padding-bottom: 30px;
    vertical-align: top;
    position: relative;
    overflow: visible;
}

/* Make time scale dates more readable */
.rec-chart .tv-lightweight-charts table {
    font-size: 11px !important;
}

.rec-chart .tv-lightweight-charts table td {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
}

.rec-chart .tv-lightweight-charts .time-axis,
.rec-chart .tv-lightweight-charts [class*="time"] {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
}

/* Ensure time scale text is not clipped */
.rec-chart canvas + table,
.rec-chart div[class*="time-scale"],
.rec-chart .tv-lightweight-charts {
    overflow: visible !important;
}

.chart-unavailable {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 12px;
    background: #f9fafb;
    border-radius: 4px;
}

.card-sentiment {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    margin-top: 15px;
}

.card-rationale {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
    line-height: 1.5;
}

.card-price {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
}

/* Quality Indicators (from IBD Live Playbook v2) */
.quality-indicators {
    animation: fadeIn 0.3s ease-in-out;
}

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

.quality-badge {
    transition: all 0.2s ease;
    position: relative;
}

.quality-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Custom tooltip for quality indicators */
.quality-badge[data-tooltip] {
    position: relative;
    cursor: help;
}

.quality-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    max-width: 320px;
    min-width: 200px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    text-align: left;
    word-wrap: break-word;
    white-space: normal;
}

/* Adjust tooltip position if it would go off screen */
.quality-badge:hover .quality-tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* Ensure tooltip stays on screen */
@media (max-width: 768px) {
    .quality-tooltip {
        max-width: 300px;
        min-width: 250px;
        font-size: 11px;
        padding: 10px 12px;
    }
}

.quality-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.quality-tooltip strong {
    color: #60a5fa;
    font-weight: 600;
}

.quality-tooltip .tooltip-section {
    margin-bottom: 8px;
}

.quality-tooltip .tooltip-status {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #374151;
}

.quality-tooltip .tooltip-status-item {
    margin: 4px 0;
}

.quality-tooltip .tooltip-warning {
    color: #fbbf24;
    font-weight: 600;
    margin-top: 8px;
}

.quality-tooltip .tooltip-success {
    color: #34d399;
    font-weight: 600;
    margin-top: 8px;
}

.quality-tooltip .tooltip-error {
    color: #f87171;
    font-weight: 600;
    margin-top: 8px;
}

.strategy-score {
    transition: all 0.2s ease;
}

.strategy-criteria {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.strategy-criterion-badge {
    transition: all 0.2s ease;
    position: relative;
}

.strategy-criterion-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.criterion-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    white-space: normal;
    max-width: 300px;
    min-width: 200px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
}

.strategy-criterion-badge:hover .criterion-tooltip {
    opacity: 1;
    pointer-events: auto;
}

.criterion-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.strategy-score:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Collapsible section headers */
.quality-indicators-header:hover,
.strategy-criteria-header:hover,
.industry-indicators-header:hover,
.chart-analysis-header:hover {
    color: var(--primary-600);
}

.expand-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Hustle Score Badge */
.hustle-score {
    animation: pulse-glow 2s ease-in-out infinite;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: help;
}

.hustle-score:hover {
    transform: scale(1.05);
}

/* Progress indicators for all sections */
.strategy-criteria-progress,
.quality-indicators-progress,
.industry-indicators-progress,
.chart-analysis-progress {
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: flex-start;
}

.strategy-criteria-progress div,
.quality-indicators-progress div,
.industry-indicators-progress div,
.chart-analysis-progress div {
    transition: all 0.2s ease;
}

.strategy-criteria-progress div:hover,
.quality-indicators-progress div:hover,
.industry-indicators-progress div:hover,
.chart-analysis-progress div:hover {
    transform: scale(1.1);
}

/* Entry Grade Badge Styles */
.entry-grade-badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.entry-grade-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Entry Timing Section */
.entry-timing-section {
    animation: fadeIn 0.3s ease-in-out;
}

.entry-timing-section span {
    transition: background 0.2s ease;
}

/* Risk/Reward Section */
.risk-reward-section {
    animation: fadeIn 0.3s ease-in-out;
}

/* Grade-specific glow effects */
.entry-grade-badge[title*="A+"] {
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary-700);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
    background: var(--ivory-200);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--ivory-300);
    border-color: var(--ivory-400);
}

.btn-success {
    background: var(--primary-600);
    color: var(--text-inverse);
}

.btn-success:hover {
    background: var(--primary-700);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-600) 0%, var(--gold-700) 100%);
}

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

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

.summary-card {
    background: var(--bg-muted);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.summary-card h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.summary-label {
    color: var(--text-muted);
    font-size: 14px;
}

.summary-value {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.summary-value.positive {
    color: var(--primary-600);
}

.summary-value.negative {
    color: var(--danger);
}

/* Positions Table */
.positions-section {
    margin-top: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--bg-muted);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
    position: relative;
}

th.sortable:hover {
    background: var(--ivory-200);
    color: var(--primary-700);
}

th.sortable .sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: var(--primary-600);
}

tr:hover {
    background: var(--primary-50);
}

/* Position Status Badges */
.position-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.hold-rule {
    background: var(--teal-100);
    color: var(--teal-800);
    border: 1px solid var(--teal-400);
}

.status-badge.profit-recommendation {
    background: var(--gold-100);
    color: var(--gold-800);
    border: 1px solid var(--gold-400);
}

.status-detail {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
}

/* Position Actions */
.position-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.position-actions .btn {
    padding: 4px 10px;
    font-size: 11px;
    white-space: nowrap;
    min-width: 60px;
}

.position-actions .btn-small {
    padding: 4px 8px;
    font-size: 11px;
}

/* ==========================================================================
   POSITION SUMMARY TABLE
   ========================================================================== */

.position-summary-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.position-summary-left {
    flex: 0 0 24%;
    max-width: 24%;
}

.position-summary-right {
    flex: 0 0 72%;
    max-width: 72%;
}

.portfolio-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-panel-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.stat-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.stat-value {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-600);
    line-height: 1;
    margin-bottom: 12px;
}

.stat-description {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 8px;
}

.fear-greed-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.fear-greed-value {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-600);
    line-height: 1;
}

.fear-greed-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: capitalize;
    margin-bottom: 12px;
}

/* Responsive layout */
@media (max-width: 1024px) {
    .position-summary-layout {
        flex-direction: column;
    }
    
    .position-summary-left,
    .position-summary-right {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.position-summary-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.position-summary-table thead {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--teal-50) 100%);
}

.position-summary-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--primary-200);
}

.position-summary-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    position: relative;
}

.position-summary-table th.sortable:hover {
    background: var(--primary-100);
    color: var(--primary-700);
}

.position-summary-table th.sortable .sort-indicator {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: var(--primary-500);
    opacity: 0.6;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.position-summary-table th.sortable:hover .sort-indicator {
    opacity: 1;
    color: var(--primary-700);
}

.position-summary-table th.sortable .sort-indicator.sort-asc,
.position-summary-table th.sortable .sort-indicator.sort-desc {
    opacity: 1;
    color: var(--primary-700);
    font-weight: 700;
}

/* Column header with help icon */
.column-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-600);
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.help-icon:hover {
    background: var(--primary-200);
    color: var(--primary-700);
    transform: scale(1.1);
}

.position-summary-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-secondary);
}

.position-summary-table tbody tr:hover {
    background: var(--primary-50);
    transition: background var(--transition-fast);
}

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

/* Symbol cell */
.position-summary-table .symbol-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.position-summary-table .symbol-cell .ticker-link {
    color: var(--primary-600);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.position-summary-table .symbol-cell .ticker-link:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

/* Position Size cell */
.position-summary-table .position-size-cell {
    min-width: 180px;
}

.position-size-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.position-size-rectangles {
    display: flex;
    gap: 4px;
    align-items: center;
}

.position-size-rect {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-300);
    border-radius: 3px;
    background: transparent;
    transition: all var(--transition-fast);
}

.position-size-rect.filled {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border-color: var(--primary-600);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.position-size-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

/* Entry Price cell */
.position-summary-table .entry-price-cell {
    font-weight: 500;
    color: var(--text-primary);
}

/* Entry Date cell */
.position-summary-table .entry-date-cell {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Gain cell */
.position-summary-table .gain-cell {
    font-weight: 600;
    font-size: 15px;
}

.position-summary-table .gain-cell.positive {
    color: var(--primary-600);
}

.position-summary-table .gain-cell.negative {
    color: var(--danger);
}

/* Hustle Score cell */
.position-summary-table .hustle-score-cell {
    min-width: 140px;
}

.hustle-score-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hustle-score-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 28px;
    text-align: center;
}

.hustle-score-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.hustle-score-icon {
    font-size: 14px;
    font-weight: 700;
}

.hustle-score-change-value {
    font-size: 12px;
}

.hustle-score-up {
    color: var(--primary-600);
    background: var(--primary-50);
}

.hustle-score-down {
    color: var(--danger);
    background: #fef2f2;
}

.hustle-score-neutral {
    color: var(--text-muted);
    background: var(--ivory-100);
}

/* Responsive styles */
@media (max-width: 768px) {
    .position-summary-table {
        font-size: 12px;
    }
    
    .position-summary-table th,
    .position-summary-table td {
        padding: 12px 10px;
    }
    
    .position-size-rect {
        width: 16px;
        height: 16px;
    }
    
    .hustle-score-value {
        font-size: 16px;
    }
}

/* Trade History */
#tradeHistoryTable {
    overflow-x: auto;
}

/* Trade Source Indicators */
.trade-source {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.trade-source.auto-trade {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.trade-source.manual-trade {
    background: linear-gradient(135deg, #f5f5f5 0%, #e5e5e5 100%);
    color: #525252;
    border: 1px solid #d4d4d4;
}

tr.auto-trade {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.05) 0%, transparent 30%);
}

tr.auto-trade:hover {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.1) 0%, #f8fafc 30%);
}

/* Journal Timeline */
.journal-timeline {
    position: relative;
    padding-left: 30px;
}

.journal-entry {
    position: relative;
    padding: 20px;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-left: 3px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.journal-entry::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-medium);
}

.journal-entry.buy {
    border-left-color: var(--primary-500);
}

.journal-entry.buy::before {
    background: var(--primary-500);
}

.journal-entry.sell {
    border-left-color: var(--danger);
}

.journal-entry.sell::before {
    background: var(--danger);
}

.journal-entry.reject {
    border-left-color: var(--gold-500);
}

.journal-entry.reject::before {
    background: var(--gold-500);
}

.journal-entry.alert {
    border-left-color: var(--teal-500);
}

.journal-entry.alert::before {
    background: var(--teal-500);
}

.journal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.journal-type {
    font-weight: 600;
    font-size: 14px;
}

.journal-timestamp {
    font-size: 12px;
    color: #6b7280;
}

/* Stock Research: emphasize dates */
.research-entry .research-date {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* Stock Research sentiment shading */
.research-entry.bullish {
    background: #ecfdf3; /* light green */
    border-left-color: #16a34a;
}

.research-entry.bullish::before {
    background: #16a34a;
}

.research-entry.bearish {
    background: #fef2f2; /* light red */
    border-left-color: #dc2626;
}

.research-entry.bearish::before {
    background: #dc2626;
}

.research-entry.neutral {
    background: #fffbeb; /* light yellow */
    border-left-color: #f59e0b;
}

.research-entry.neutral::before {
    background: #f59e0b;
}

/* Stock Research price display */
.research-price-info {
    margin-top: 8px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 4px;
}

.price-positive {
    color: #16a34a;
    font-weight: 600;
}

.price-negative {
    color: #dc2626;
    font-weight: 600;
}

.journal-details {
    margin: 10px 0;
    font-size: 14px;
}

.journal-reason {
    background: #f9fafb;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 13px;
    color: #4b5563;
}

.journal-notes {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

#commentModal .modal-content {
    max-width: 500px;
    width: 90%;
}

#commentModal textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.trade-preview {
    background: #f9fafb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.trade-form {
    margin-top: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

/* =============================================================================
   Settings / Configuration Page Styles
   ============================================================================= */

/* Section Description */
.section-description {
    color: #6b7280;
    font-size: 14px;
    margin-top: 5px;
}

/* Settings Container */
.settings-container {
    max-width: 800px;
}

/* Config Form */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Settings Sections */
.settings-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.section-note {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 15px;
}

/* Setting Items */
.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

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

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

/* Help Button */
.help-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #9ca3af;
    background: white;
    color: #6b7280;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.help-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Help Text */
.help-text {
    display: none;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
}

.help-text.visible {
    display: block;
}

/* Radio Group (Trading Mode) */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.radio-option input[type="radio"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: #1e40af;
}

.radio-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-label strong {
    font-size: 14px;
    color: #1f2937;
}

.radio-label small {
    font-size: 12px;
    color: #6b7280;
}

/* Input with Prefix/Suffix */
.input-with-prefix,
.input-with-suffix {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-prefix:focus-within,
.input-with-suffix:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-prefix,
.input-suffix {
    padding: 10px 12px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    border: none;
}

.input-with-prefix input,
.input-with-suffix input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.input-with-prefix input:focus,
.input-with-suffix input:focus {
    outline: none;
}

/* Input Hint */
.input-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

/* Input Validation States */
.input-with-prefix:has(input.valid),
.input-with-suffix:has(input.valid) {
    border-color: #10b981;
}

.input-with-prefix:has(input.invalid),
.input-with-suffix:has(input.invalid) {
    border-color: #ef4444;
}

.input-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
}

/* Bands Table */
.bands-table-container {
    margin-top: 12px;
    overflow-x: auto;
}

.bands-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.bands-table thead {
    background: #f3f4f6;
}

.bands-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.bands-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

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

.bands-table .band-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.bands-table .band-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Ranges Container */
.ranges-container {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.range-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.range-item label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* Toggle Switch */
.toggle-item {
    display: flex;
    flex-direction: column;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: not-allowed;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: #d1d5db;
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #10b981;
}

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

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.6;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}

.toggle-label.enabled {
    color: #059669;
}

.toggle-label.disabled {
    color: #6b7280;
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.settings-actions .btn {
    min-width: 150px;
}

.settings-actions .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Config Message */
.config-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 15px;
}

.config-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.config-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.config-message.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* ============================================================================
   Industry Research Page Styles
   ============================================================================ */

/* Upload Section */
.industry-upload-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.upload-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.upload-card h3 {
    font-size: 16px;
    color: #374151;
    margin-bottom: 8px;
}

.upload-description {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
}

.upload-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #6b7280;
}

.dropzone-icon {
    font-size: 32px;
}

.dropzone-content.uploading {
    color: #2563eb;
}

.dropzone-content.success {
    color: #059669;
}

.dropzone-content.error {
    color: #dc2626;
}

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

.industry-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #e5e7eb;
}

.industry-card h3 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 15px;
}

.industry-card.rising-card {
    border-left-color: #10b981;
}

.industry-card.falling-card {
    border-left-color: #ef4444;
}

.industry-card.momentum-card {
    border-left-color: #8b5cf6;
}

.industry-card.leaders-card {
    border-left-color: #f59e0b;
}

/* Industry List Items */
.industry-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.industry-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    transition: background 0.2s;
}

.industry-item:hover {
    background: #f3f4f6;
}

.industry-rank {
    font-weight: 700;
    font-size: 14px;
    color: #374151;
    min-width: 35px;
}

.industry-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.industry-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.industry-change {
    font-size: 12px;
    color: #6b7280;
}

.industry-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.industry-badge.positive {
    background: #d1fae5;
    color: #065f46;
}

.industry-badge.negative {
    background: #fee2e2;
    color: #991b1b;
}

.industry-badge.new {
    background: #fef3c7;
    color: #92400e;
}

/* Transcript Section */
.transcript-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.transcript-section h3 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 15px;
}

.transcript-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sentiment Overview */
.sentiment-overview {
    background: white;
    border-radius: 8px;
    padding: 15px;
}

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

.sentiment-header h4 {
    font-size: 14px;
    color: #374151;
}

.analysis-date {
    font-size: 12px;
    color: #6b7280;
}

.sentiment-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.sentiment-badge.positive {
    background: #d1fae5;
    color: #065f46;
}

.sentiment-badge.negative {
    background: #fee2e2;
    color: #991b1b;
}

.sector-sentiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.sector-sentiment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
}

.sector-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.sector-mentions {
    font-size: 11px;
    color: #6b7280;
}

.sector-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.sector-badge.positive {
    background: #d1fae5;
    color: #065f46;
}

.sector-badge.negative {
    background: #fee2e2;
    color: #991b1b;
}

/* Ticker Mentions */
.transcript-mentions h4 {
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px;
}

.ticker-mentions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ticker-mention-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #eff6ff;
    border-radius: 6px;
}

.ticker-symbol {
    font-weight: 600;
    font-size: 13px;
    color: #1e40af;
}

.ticker-count {
    font-size: 11px;
    color: #6b7280;
}

/* Transcript Quotes */
.transcript-quotes h4 {
    font-size: 14px;
    color: #374151;
    margin-bottom: 10px;
}

.quotes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quote-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border-left: 3px solid #e5e7eb;
}

.quote-item.positive {
    border-left-color: #10b981;
}

.quote-item.negative {
    border-left-color: #ef4444;
}

.quote-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.quote-speaker {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.quote-time {
    font-size: 11px;
    color: #9ca3af;
}

.quote-sentiment {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.quote-sentiment.positive {
    background: #d1fae5;
    color: #065f46;
}

.quote-sentiment.negative {
    background: #fee2e2;
    color: #991b1b;
}

.quote-text {
    font-size: 13px;
    color: #4b5563;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 8px;
}

.quote-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quote-ticker {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 3px;
}

/* Rankings Section */
.rankings-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.rankings-section h3 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 15px;
}

.rankings-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

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

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

.rankings-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
}

.rankings-table tbody tr:hover {
    background: #f9fafb;
}

.rankings-table .rank-cell {
    font-weight: 700;
    color: #1f2937;
}

.rankings-table .name-cell {
    font-weight: 500;
}

.rankings-table .positive {
    color: #059669;
}

.rankings-table .negative {
    color: #dc2626;
}

/* Empty and Error States */
.empty-state {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.error-state {
    text-align: center;
    padding: 20px;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 8px;
}

/* Clickable Industry Items */
.industry-item.clickable,
.name-cell.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.industry-item.clickable:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.name-cell.clickable:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Industry Stocks Modal */
.industry-stocks-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.industry-stocks-content {
    margin-top: 20px;
}

.stocks-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.stock-count {
    font-weight: 600;
    color: #1f2937;
}

.search-info {
    font-size: 12px;
    color: #6b7280;
}

.stocks-grid {
    display: grid;
    gap: 15px;
}

.stock-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.2s;
}

.stock-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stock-card.bullish {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.stock-card.bearish {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.stock-card.neutral {
    border-left-color: #6b7280;
}

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

.stock-ticker {
    font-weight: 700;
    font-size: 16px;
    color: #1e40af;
    cursor: pointer;
}

.stock-ticker:hover {
    text-decoration: underline;
}

.stock-date {
    font-size: 12px;
    color: #6b7280;
}

.stock-name {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 6px;
}

.stock-sentiment {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.stock-sentiment.bullish {
    color: #059669;
}

.stock-sentiment.bearish {
    color: #dc2626;
}

.stock-sentiment.neutral {
    color: #6b7280;
}

.stock-commentary {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 8px;
    font-style: italic;
}

.stock-analyst {
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
}

/* Sentiment Summary Styles */
.sentiment-summary-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.sentiment-header-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sentiment-overall,
.sentiment-trend,
.sentiment-mentions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 150px;
}

.sentiment-emoji,
.trend-emoji {
    font-size: 32px;
}

.mentions-count {
    font-size: 32px;
    font-weight: 700;
    color: #3b82f6;
}

.sentiment-details,
.trend-details,
.mentions-details {
    display: flex;
    flex-direction: column;
}

.sentiment-label,
.trend-label,
.mentions-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sentiment-value,
.trend-value {
    font-size: 16px;
    font-weight: 600;
}

.sentiment-value.bullish,
.trend-value.improving {
    color: #16a34a;
}

.sentiment-value.bearish,
.trend-value.declining {
    color: #dc2626;
}

.sentiment-value.neutral,
.trend-value.stable {
    color: #ca8a04;
}

.mentions-recent {
    font-size: 12px;
    color: #64748b;
}

/* Sentiment Distribution Bar */
.sentiment-distribution {
    margin-bottom: 20px;
}

.distribution-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: #e5e7eb;
    margin-bottom: 8px;
}

.bar-segment {
    transition: width 0.3s ease;
}

.bar-segment.bullish {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.bar-segment.neutral {
    background: linear-gradient(90deg, #facc15, #eab308);
}

.bar-segment.bearish {
    background: linear-gradient(90deg, #f87171, #dc2626);
}

.distribution-labels {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.dist-label {
    font-size: 12px;
    font-weight: 500;
}

.dist-label.bullish { color: #16a34a; }
.dist-label.neutral { color: #ca8a04; }
.dist-label.bearish { color: #dc2626; }

/* Key Themes */
.key-themes {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.themes-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.themes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.theme-pill {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.no-themes {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

/* Analyst Quotes */
.analyst-quotes-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.quotes-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.quotes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analyst-quote {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    border-left: 4px solid #e5e7eb;
}

.analyst-quote.quote-bullish {
    border-left-color: #22c55e;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.05), white);
}

.analyst-quote.quote-bearish {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.05), white);
}

.analyst-quote.quote-neutral {
    border-left-color: #eab308;
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.05), white);
}

.quote-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.quote-analyst {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
}

.quote-date {
    font-size: 11px;
    color: #6b7280;
}

.quote-sentiment {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f1f5f9;
}

.quote-sentiment.bullish {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.1);
}

.quote-sentiment.bearish {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.quote-sentiment.neutral {
    color: #ca8a04;
    background: rgba(234, 179, 8, 0.1);
}

.quote-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    font-style: italic;
}

/* Stocks Section in Modal */
.stocks-section {
    margin-top: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .recommendations-layout {
        grid-template-columns: 220px 1fr;
        gap: 16px;
    }
    
    .recommendations-sidebar {
        padding: 16px;
    }
    
    .sidebar-section {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
}

@media (max-width: 768px) {
    .recommendations-layout {
        grid-template-columns: 1fr;
    }
    
    .recommendations-sidebar {
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        padding: 16px;
    }
    
    .sidebar-section {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
    
    .sidebar-actions {
        grid-column: 1 / -1;
    }
    
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-summary {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    table {
        font-size: 12px;
    }
    
    /* Settings responsive */
    .settings-section {
        padding: 15px;
    }
    
    .radio-group {
        gap: 8px;
    }
    
    .radio-option {
        padding: 10px 12px;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .settings-actions .btn {
        width: 100%;
    }
    
    /* Industry page responsive */
    .industry-upload-section {
        grid-template-columns: 1fr;
    }
    
    .industry-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .rankings-controls {
        flex-direction: column;
    }
    
    .sector-sentiment-grid {
        grid-template-columns: 1fr;
    }
}

/* Manual Recommendation Styles */
.manual-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    cursor: help;
}

#recommendationModal .modal-content {
    max-width: 500px;
    width: 90%;
}

#recommendationModal .form-group {
    margin-bottom: 18px;
}

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

#recommendationModal .form-group input[type="text"],
#recommendationModal .form-group input[type="date"],
#recommendationModal .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#recommendationModal .form-group input[type="text"]:focus,
#recommendationModal .form-group input[type="date"]:focus,
#recommendationModal .form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#recommendationModal .form-group input[type="text"] {
    text-transform: uppercase;
}

#addRecommendationBtn {
    margin-left: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
}

.edit-manual-btn,
.delete-manual-btn {
    font-size: 12px;
    padding: 6px 12px;
}

.edit-manual-btn:hover {
    background: #4b5563;
}

.delete-manual-btn:hover {
    background: #dc2626;
}

/* Profit Rules Diagram Styles */
.profit-rules-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profit-rules-diagram {
    margin-top: 20px;
}

.flow-diagram-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: #f9fafb;
    border-radius: 8px;
    position: relative;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    position: relative;
}

.step-number {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.flow-node {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 24px;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.flow-node:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.node-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}

.node-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    font-size: 15px;
}

.node-subtitle {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.start-node {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.decision-node {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.action-node {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.hold-node {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.sell-node {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.skip-node {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.alert-node {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.flow-connector {
    width: 3px;
    height: 30px;
    background: linear-gradient(to bottom, #3b82f6, #60a5fa);
    margin: 10px 0;
    border-radius: 2px;
}

.flow-connector.conditional {
    background: linear-gradient(to bottom, #f59e0b, #fbbf24);
}

.decision-branches {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    width: 100%;
    justify-content: center;
}

.decision-branch {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 280px;
}

.branch-connector {
    width: 3px;
    height: 20px;
    margin-bottom: 8px;
    border-radius: 2px;
}

.hold-branch .branch-connector {
    background: linear-gradient(to bottom, #8b5cf6, #a78bfa);
}

.continue-branch .branch-connector {
    background: linear-gradient(to bottom, #f59e0b, #fbbf24);
}

.enabled-branch .branch-connector,
.small-branch .branch-connector {
    background: linear-gradient(to bottom, #10b981, #34d399);
}

.disabled-branch .branch-connector,
.large-branch .branch-connector {
    background: linear-gradient(to bottom, #6366f1, #818cf8);
}

.branch-label {
    background: #1f2937;
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    min-width: 60px;
}

.hold-branch .branch-label {
    background: #8b5cf6;
}

.continue-branch .branch-label {
    background: #f59e0b;
}

.enabled-branch .branch-label,
.small-branch .branch-label {
    background: #10b981;
}

.disabled-branch .branch-label,
.large-branch .branch-label {
    background: #6366f1;
}

.nested-step {
    margin-top: 20px;
    width: 100%;
}

.nested-step .step-number {
    left: -20px;
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* Rules Summary */
.rules-summary {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.rules-summary h4 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 16px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.rule-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.rule-content {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.rule-content strong {
    color: #1f2937;
    display: block;
    margin-bottom: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .flow-branch {
        flex-direction: column;
        gap: 20px;
    }
    
    .rules-grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ Section Styles */
.faq-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.faq-content {
    margin-top: 20px;
}

.faq-category {
    margin-bottom: 30px;
}

.faq-category h4 {
    color: #1f2937;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.faq-item {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.faq-question {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    user-select: none;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: #f3f4f6;
}

.faq-question.active {
    background: #eff6ff;
    border-bottom: 1px solid #e5e7eb;
}

.faq-icon {
    color: #3b82f6;
    font-size: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-question.active .faq-icon {
    transform: rotate(90deg);
}

.faq-question strong {
    color: #1f2937;
    font-size: 14px;
    flex: 1;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
    background: white;
}

.faq-answer.active {
    max-height: 2000px;
    padding: 20px;
}

.faq-answer p {
    color: #374151;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    color: #374151;
    font-size: 13px;
    line-height: 1.7;
    margin: 12px 0 12px 20px;
    padding-left: 20px;
}

.faq-answer li {
    margin-bottom: 8px;
}

.faq-answer li:last-child {
    margin-bottom: 0;
}

.faq-answer strong {
    color: #1f2937;
    font-weight: 600;
}

/* ==========================================================================
   LANDING HERO SECTION
   Beautiful landing page highlighting Halal, CANSLIM, Fear & Greed
   ========================================================================== */

.landing-hero {
    position: relative;
    margin: 24px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
    transition: max-height 0.4s ease-out;
}

/* Landing hero collapsed state */
.landing-hero.collapsed .hero-background,
.landing-hero.collapsed .hero-content {
    display: none;
}

.landing-hero.collapsed {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--teal-700) 100%);
}

.hero-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.hero-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.landing-hero.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.landing-hero:not(.collapsed) .hero-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    z-index: 10;
    padding: 12px 20px;
    border-radius: 0 var(--radius-lg) 0 var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.landing-hero:not(.collapsed) .toggle-text {
    display: none;
}

.landing-hero:not(.collapsed) .toggle-icon::before {
    content: "▲ Hide";
    font-size: 13px;
}

.landing-hero:not(.collapsed) .toggle-icon {
    transform: none;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--teal-700) 50%, var(--primary-600) 100%);
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
    opacity: 0.6;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 60px 40px;
    color: var(--text-inverse);
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-inverse);
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 64px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-inverse);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 24px 0;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.hero-description {
    font-size: 18px;
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto 48px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hero-description strong {
    color: var(--text-inverse);
    font-weight: 600;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto 48px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-inverse);
}

.feature-card p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin: 48px auto;
    max-width: 800px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--gold-300);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-cta {
    margin: 48px 0;
}

.btn-large {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.disclaimer-box {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-top: 48px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    gap: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.disclaimer-icon {
    font-size: 32px;
    flex-shrink: 0;
    margin-top: 4px;
}

.disclaimer-content {
    flex: 1;
    text-align: left;
}

.disclaimer-content h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-700);
    margin: 0 0 12px 0;
}

.disclaimer-content p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.disclaimer-content p:last-child {
    margin-bottom: 0;
}

.disclaimer-content p strong {
    color: var(--gold-800);
    font-weight: 600;
}

/* Responsive styles for landing hero */
@media (max-width: 768px) {
    .hero-content {
        padding: 40px 24px;
    }
    
    .hero-title {
        font-size: 42px;
    }
    
    .hero-subtitle {
        font-size: 20px;
    }
    
    .hero-description {
        font-size: 16px;
        margin-bottom: 32px;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 32px;
    }
    
    .feature-card {
        padding: 24px 20px;
    }
    
    .hero-stats {
        gap: 32px;
        margin: 32px auto;
    }
    
    .stat-number {
        font-size: 36px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .disclaimer-box {
        padding: 20px 24px;
        flex-direction: column;
        gap: 16px;
    }
    
    .disclaimer-icon {
        font-size: 28px;
    }
    
    .disclaimer-content {
        text-align: center;
    }
    
    .btn-large {
        padding: 14px 32px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 32px 20px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .hero-description {
        font-size: 15px;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .stat-number {
        font-size: 32px;
    }
}

/* ==========================================================================
   ONBOARDING SECTION
   Welcome experience for new users explaining the WHY and HOW
   ========================================================================== */

.onboarding-section {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--teal-50) 50%, var(--gold-50) 100%);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Subtle decorative pattern */
.onboarding-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-100) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.onboarding-section.hidden {
    display: none;
}

.onboarding-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.onboarding-header h2 {
    color: var(--primary-800);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.onboarding-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--ivory-500);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.onboarding-close:hover {
    color: var(--ivory-700);
}

.onboarding-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 1;
}

.onboarding-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.onboarding-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.onboarding-card h3 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.onboarding-card p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.65;
    margin: 0 0 12px 0;
}

.onboarding-card p:last-of-type {
    margin-bottom: 0;
}

.onboarding-card p.highlight {
    background: var(--primary-50);
    border-left: 3px solid var(--primary-500);
    padding: 10px 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--primary-800);
    font-weight: 500;
    margin-top: 14px;
}

.onboarding-card p.tip {
    background: var(--gold-50);
    border: 1px solid var(--gold-200);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--gold-800);
    margin-top: 16px;
}

.onboarding-card ul,
.onboarding-card ol {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    margin: 12px 0;
    padding-left: 0;
    list-style: none;
}

.onboarding-card ul li,
.onboarding-card ol li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.onboarding-card ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-500);
    font-weight: bold;
}

.onboarding-card ol {
    counter-reset: step-counter;
}

.onboarding-card ol li {
    counter-increment: step-counter;
    padding-left: 28px;
}

.onboarding-card ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Why card specific styling */
.why-card {
    border-top: 3px solid var(--primary-500);
}

/* How card specific styling */
.how-card {
    border-top: 3px solid var(--teal-500);
}

/* Start card specific styling */
.start-card {
    border-top: 3px solid var(--gold-500);
}

.onboarding-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 1;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.dont-show-again input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-600);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .onboarding-content {
        grid-template-columns: 1fr;
    }
    
    .onboarding-section {
        padding: 20px;
    }
    
    .onboarding-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .onboarding-footer .btn {
        width: 100%;
    }
}

/* ==========================================================================
   JANUARY VOLATILITY WARNING
   ========================================================================== */

.january-warning {
    background: linear-gradient(135deg, var(--gold-50) 0%, var(--warning-light) 100%);
    border: 2px solid var(--gold-400);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

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

.warning-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
}

.warning-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-text {
    flex: 1;
}

.warning-text strong {
    display: block;
    color: var(--gold-800);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.warning-text p {
    color: var(--gold-700);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.warning-close {
    background: transparent;
    border: none;
    color: var(--gold-600);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.warning-close:hover {
    background: var(--gold-200);
    color: var(--gold-800);
}

@media (max-width: 768px) {
    .january-warning {
        padding: 14px 16px;
    }
    
    .warning-content {
        gap: 12px;
    }
    
    .warning-icon {
        font-size: 20px;
    }
    
    .warning-text strong {
        font-size: 14px;
    }
    
    .warning-text p {
        font-size: 12px;
    }
    
    .onboarding-footer .btn {
        width: 100%;
    }
}

/* =============================================================================
   Score Guide Modal
   ============================================================================= */

.score-guide-modal {
    max-width: 700px;
    width: 95%;
}

.score-guide-body {
    padding: 0;
}

.score-guide-intro {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    text-align: center;
}

.score-guide-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.score-legend-item {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-md);
}

.score-legend-item.score-green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.score-legend-item.score-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.score-legend-item.score-red {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.score-guide-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 16px;
}

.score-tab {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.score-tab:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.score-tab.active {
    color: var(--primary-700);
    border-bottom-color: var(--primary-500);
    background: var(--primary-50);
}

.score-tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

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

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

.score-tab-content h4 {
    color: var(--primary-700);
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-light);
}

.score-tab-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.score-tab-content li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.score-tab-content li:last-child {
    border-bottom: none;
}

.score-tab-content li::before {
    content: '▸';
    position: absolute;
    left: 6px;
    color: var(--primary-500);
    font-weight: bold;
}

.score-tab-content li strong {
    color: var(--primary-700);
}

.guide-note {
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--gold-50);
    border-left: 3px solid var(--gold-500);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 12px;
    color: var(--gold-800);
    font-style: italic;
}

/* Contextual Help Icon */
.help-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-600);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: auto;
    flex-shrink: 0;
}

.help-info-icon:hover {
    background: var(--primary-500);
    color: white;
    transform: scale(1.1);
}

/* Score Guide Button on Hustle Score */
.score-guide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 6px;
    border: none;
    vertical-align: middle;
}

.score-guide-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
}

/* Mobile responsiveness for Score Guide Modal */
@media (max-width: 600px) {
    .score-guide-tabs {
        flex-wrap: wrap;
    }
    
    .score-tab {
        flex: 1 1 45%;
        font-size: 11px;
        padding: 8px 4px;
    }
    
    .score-guide-legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .score-legend-item {
        font-size: 12px;
    }
}


/* ===== AUTO-BUY LOG TAB ===== */
.autobuy-status-card {
    background: linear-gradient(135deg, #1a2234 0%, #2d3a4f 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.status-item.status-enabled {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-item.status-disabled {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-icon {
    font-size: 24px;
}

.status-details {
    flex: 1;
}

.status-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.status-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #fca5a5;
}

.error-icon {
    font-size: 24px;
}

.decision-log-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

.decision-log-table thead {
    background: linear-gradient(135deg, #1a2234 0%, #2d3a4f 100%);
    color: white;
}

.decision-log-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.decision-log-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

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

.decision-row.buy {
    background: rgba(16, 185, 129, 0.05);
}

.decision-row.skip,
.decision-row.skipped {
    background: rgba(251, 191, 36, 0.05);
}

.decision-row.error {
    background: rgba(239, 68, 68, 0.05);
}

.time-cell {
    font-family: 'SF Mono', Monaco, 'Consolas', monospace;
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.symbol-cell .ticker-link {
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
}

.symbol-cell .ticker-link:hover {
    text-decoration: underline;
}

.decision-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.decision-badge.buy {
    background: #d1fae5;
    color: #065f46;
}

.decision-badge.skip,
.decision-badge.skipped {
    background: #fef3c7;
    color: #92400e;
}

.decision-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.reason-cell {
    font-size: 13px;
    color: #374151;
    max-width: 300px;
}

.details-cell {
    font-size: 12px;
    color: #6b7280;
}

.details-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.no-details {
    color: #9ca3af;
}

.refresh-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}



/* =============================================================================
   Help Guide Additional Styles
   ============================================================================= */

/* Guide Table */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.guide-table th,
.guide-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.guide-table th {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guide-table tr:hover td {
    background: var(--gray-50);
}

/* Glossary List */
.glossary-list {
    margin: 0;
    padding: 0;
}

.glossary-list dt {
    font-weight: 700;
    color: var(--primary-700);
    font-size: 14px;
    margin-top: 16px;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--primary-200);
}

.glossary-list dt:first-child {
    margin-top: 0;
}

.glossary-list dd {
    margin: 8px 0 0 0;
    padding-left: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Help Button - Floating */
.help-button-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--teal-600) 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-button-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(5, 150, 105, 0.5);
}

/* ==========================================================================
   PORTFOLIO STYLES
   ========================================================================== */

.portfolio-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.portfolio-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.portfolio-section h3 {
    margin: 0 0 16px 0;
    color: var(--primary-800);
    font-size: 16px;
    font-weight: 600;
}

.account-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.pnl-summary {
    min-height: 250px;
}

.positions-table,
.open-orders-table {
    overflow-x: auto;
}

/* ==========================================================================
   TRADE HISTORY STYLES
   ========================================================================== */

.trade-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.trade-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.trade-search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.trade-filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 140px;
}

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

.trade-history-table {
    overflow-x: auto;
}

.trade-source {
    font-size: 12px;
    font-weight: 500;
}

.trade-source.auto-trade {
    color: var(--primary-600);
}

.trade-source.manual-trade {
    color: var(--text-muted);
}

tr.auto-trade {
    background-color: rgba(16, 185, 129, 0.03);
}

/* ==========================================================================
   STRATEGY FILTER & GUIDE
   ========================================================================== */

/* Strategy Filter Container */
.strategy-filter-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.strategy-info-btn:hover {
    transform: scale(1.1);
}

/* Strategy Guide Panel */
.strategy-guide {
    margin: 16px 0;
    background: linear-gradient(135deg, var(--primary-50), var(--teal-50));
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.strategy-guide.collapsed .strategy-guide-content {
    display: none;
}

.strategy-guide-toggle {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-800);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    transition: background-color 0.2s ease;
}

.strategy-guide-toggle:hover {
    background: rgba(16, 185, 129, 0.1);
}

.strategy-guide-toggle .toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.strategy-guide-content {
    padding: 20px;
    border-top: 1px solid var(--primary-200);
}

.strategy-guide-intro {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.strategy-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Individual Strategy Card */
.strategy-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.strategy-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.strategy-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.strategy-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.strategy-conditions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.conditions-column {
    font-size: 12px;
}

.conditions-column h5 {
    margin: 0 0 6px 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conditions-column.ideal h5 {
    color: var(--primary-700);
}

.conditions-column.avoid h5 {
    color: var(--danger);
}

.conditions-column ul {
    margin: 0;
    padding-left: 16px;
    color: var(--text-muted);
}

.conditions-column ul li {
    margin-bottom: 3px;
    line-height: 1.4;
}

.conditions-column.ideal ul li {
    color: var(--primary-700);
}

.conditions-column.avoid ul li {
    color: var(--text-muted);
}

.strategy-select-btn {
    width: 100%;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-select-btn:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transform: translateY(-1px);
}

/* Risk Badge */
.risk-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
}

.risk-badge.low {
    background: var(--primary-100);
    color: var(--primary-800);
}

.risk-badge.medium {
    background: var(--gold-100);
    color: var(--gold-800);
}

.risk-badge.high {
    background: var(--danger-light);
    color: var(--danger);
}

/* Short-Sale Warning Badge */
.short-sale-warning {
    animation: pulse-warning 2s ease-in-out infinite;
}

.short-sale-warning.severe {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.short-sale-warning.moderate {
    background: #fef3c7 !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Settings Strategy Description Box */
.strategy-description-box {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    border-radius: 8px;
}

.strategy-description-box .risk-badge {
    margin-left: 4px;
}

/* Responsive adjustments for strategy guide */
@media (max-width: 768px) {
    .strategy-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .strategy-conditions {
        grid-template-columns: 1fr;
    }
    
    .strategy-filter-container {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
    
    .strategy-guide-toggle {
        font-size: 13px;
        padding: 10px 16px;
    }
}
