/* Forward Test Section */
.forward-test-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .forward-test-layout {
        grid-template-columns: 1fr;
    }
}

.ft-accounts-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ft-account-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 420px;
    overflow-y: auto;
}

.ft-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="dark"] .ft-account-item {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.ft-account-item:hover {
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.ft-account-item.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.08));
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.ft-account-name {
    font-weight: 700;
    color: #1e293b;
}

[data-theme="dark"] .ft-account-name {
    color: #f1f5f9;
}

.ft-account-balance {
    font-size: 0.8rem;
    color: #64748b;
}

.ft-account-delete {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ft-account-delete:hover {
    background: #ef4444;
    color: white;
}

.ft-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ft-stat-card {
    padding: 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.15);
    text-align: center;
}

.ft-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
}

[data-theme="dark"] .ft-stat-value {
    color: #f8fafc;
}

.ft-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.ft-stat-value.positive { color: #10b981; }
.ft-stat-value.negative { color: #ef4444; }

.ft-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.ft-risk-toggle {
    display: flex;
    gap: 0.5rem;
}

.ft-risk-btn {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .ft-risk-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.ft-risk-btn.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.ft-direction-toggle,
.ft-result-toggle {
    display: flex;
    gap: 0.5rem;
}

.ft-dir-btn,
.ft-result-btn {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

[data-theme="dark"] .ft-dir-btn,
[data-theme="dark"] .ft-result-btn {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.ft-dir-btn.active.buy {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.ft-dir-btn.active.sell {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.ft-result-btn.active.win {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.ft-result-btn.active.loss {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.ft-result-btn.active.be {
    border-color: #94a3b8;
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
}

.ft-chart-container {
    position: relative;
    height: 320px;
    margin-top: 1rem;
}

.ft-trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ft-trades-table th,
.ft-trades-table td {
    padding: 0.6rem 0.75rem;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="dark"] .ft-trades-table th,
[data-theme="dark"] .ft-trades-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ft-trades-table th {
    font-weight: 700;
    color: #64748b;
    font-size: 0.75rem;
}

.ft-pnl-win { color: #10b981; font-weight: 700; }
.ft-pnl-loss { color: #ef4444; font-weight: 700; }
.ft-pnl-be { color: #94a3b8; font-weight: 600; }

.ft-trades-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="dark"] .ft-trades-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ft-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.ft-selected-count {
    font-size: 0.8rem;
    color: #64748b;
}

.ft-trades-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-right: auto;
}

.ft-btn-danger {
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.ft-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

.ft-checkbox-cell {
    width: 40px;
    text-align: center !important;
    vertical-align: middle;
}

.ft-trade-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.ft-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.ft-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.ft-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.ft-modal {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .ft-modal {
    background: #1e293b;
    color: #f1f5f9;
}

.ft-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.ft-modal-actions button {
    flex: 1;
}

.ft-modal-wide {
    max-width: 520px;
}

.ft-account-item-body {
    flex: 1;
    min-width: 0;
}

.ft-prop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.ft-prop-item {
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.8);
}

[data-theme="dark"] .ft-prop-item {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

.ft-prop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.ft-prop-value {
    color: #3b82f6;
    font-size: 0.8rem;
}

.ft-prop-hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.ft-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

[data-theme="dark"] .ft-progress-bar {
    background: rgba(255, 255, 255, 0.1);
}

.ft-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.ft-progress-green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.ft-progress-red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.ft-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.ft-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.ft-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.ft-prop-form-block {
    padding: 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
}

[data-theme="dark"] .ft-prop-form-block {
    border-color: rgba(255, 255, 255, 0.15);
}

.ft-celebration-modal {
    text-align: center;
    max-width: 400px;
}

.ft-celebration-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

#ftChartCard .ft-chart-container {
    min-height: 320px;
}
