.strategy-config-page {
    background: #f5f7fb;
}

.strategy-config-page .card {
    border-radius: 0.8rem;
}

.algo-hero-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.algo-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e7f0ff, #f3efff);
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-transform: lowercase;
}

.algo-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.algo-tag {
    background: #f4f6fb;
    color: #4b5563;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
}

.algo-capital-box {
    min-width: 116px;
}

.algo-capital-label {
    color: #6b7280;
    font-size: 0.78rem;
}

.algo-capital-value {
    color: #1f2937;
    font-size: 1.35rem;
    font-weight: 700;
}

.btn-deploy {
    min-width: 140px;
    border: none;
    color: #ffffff;
    background: linear-gradient(90deg, #4f46e5 0%, #6d28d9 100%);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.btn-deploy:hover,
.btn-deploy:focus {
    color: #ffffff;
}

.btn-deploy.is-deployed,
.btn-deploy:disabled {
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
    box-shadow: none;
    opacity: 1;
}

.algo-tabs {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.algo-tab {
    border: 1px solid #d9dfec;
    background: #ffffff;
    border-radius: 0.65rem;
    padding: 0.45rem 0.8rem;
    color: #6b7280;
    font-size: 0.88rem;
}

.algo-tab.active {
    color: #10b981;
    border-color: #99f6e4;
    background: #f0fdfa;
}

.algo-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.algo-list-item {
    width: 100%;
    border: 1px solid #e5e9f3;
    background: #ffffff;
    border-radius: 0.85rem;
    text-align: left;
    padding: 0.9rem 1rem;
    transition: all 0.18s ease-in-out;
}

.algo-list-item:hover,
.algo-list-item.active {
    border-color: #9dc1ff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
    background: #f8fbff;
}

.algo-list-title {
    font-weight: 700;
    color: #1f2937;
}

.algo-list-meta {
    font-size: 0.8rem;
    color: #2563eb;
    margin-top: 0.15rem;
}

.algo-list-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 0.35rem;
}

.strategy-config-page .table th,
.strategy-config-page .table td {
    white-space: nowrap;
    vertical-align: middle;
}

.strategy-config-page .table thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5b6276;
}


.qty-input {
    max-width: 110px;
}

.backtest-btn {
    min-width: 92px;
}

.backtest-row td {
    background: #fbfdff;
}

.backtest-result {
    border: 1px solid #e6ecf6;
    border-radius: 0.7rem;
    padding: 0.75rem;
}

.backtest-chart-wrap {
    height: 170px;
    background: #ffffff;
    border: 1px solid #edf2fa;
    border-radius: 0.6rem;
    padding: 0.3rem;
}

.backtest-chart {
    width: 100%;
    height: 160px;
}

.backtest-line {
    fill: none;
    stroke: #2563eb;
    stroke-width: 2.2;
}

.backtest-trades-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6a7287;
}

.backtest-trades-table tbody td {
    font-size: 0.86rem;
    vertical-align: top;
}

.backtest-trades-table .fw-semibold {
    color: #1f2937;
}

.day-select,
.index-select {
    min-width: 150px;
    border-radius: 0.55rem;
    border-color: #d9dfea;
}

.strategy-config-page .card-header {
    border-bottom: 1px solid #ecf0f7;
    padding: 0.9rem 1rem;
}

.strategy-config-page .card-header strong {
    font-size: 1rem;
}

.row-changed {
    background: #fff7e6;
}

/* ─── Performance Panel Styles ─── */
.perf-period-btns {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.perf-period-btn {
    border: 1px solid #d9dfec;
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.perf-period-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.perf-period-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.perf-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.perf-stat {
    text-align: center;
    padding: 1rem;
    background: #f8fbff;
    border-radius: 0.6rem;
    border: 1px solid #e5ecf6;
}

.perf-stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.perf-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
}

.chart-canvas-wrap {
    height: 250px;
    background: #ffffff;
    border: 1px solid #edf2fa;
    border-radius: 0.6rem;
    padding: 1rem;
}

/* ─── Best & Worst Trades Styles ─── */
.bw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.bw-card {
    background: #f8fbff;
    border: 1px solid #e5ecf6;
    border-radius: 0.7rem;
    padding: 1rem;
}

.bw-card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bw-trade-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem;
    background: #ffffff;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #f0f4f8;
}

.bw-trade-rank {
    font-weight: 700;
    color: #6b7280;
    font-size: 0.9rem;
    min-width: 32px;
}

.bw-trade-info {
    flex: 1;
    min-width: 0;
}

.bw-trade-symbol {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

.bw-trade-time {
    font-size: 0.75rem;
    white-space: nowrap;
}

.bw-trade-pnl {
    font-weight: 700;
    font-size: 0.9rem;
    text-align: right;
}

/* ─── Calendar Styles ─── */
.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5ecf6;
}

.cal-nav-btn {
    background: #ffffff;
    border: 1px solid #d9dfec;
    border-radius: 0.5rem;
    padding: 0.4rem 0.8rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.cal-nav-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.cal-month-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.1rem;
}

.cal-table {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    background: #ffffff;
    padding: 1rem;
    border-radius: 0.7rem;
    border: 1px solid #e5ecf6;
}

.cal-header {
    display: contents;
}

.cal-day-header {
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    color: #6b7280;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cal-body {
    display: contents;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: #f8fbff;
    border: 1px solid #e5ecf6;
    color: #1f2937;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: default;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.cal-day.empty {
    background: transparent;
    border: none;
}

.cal-day-num {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.cal-day-trades {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 0.15rem;
}

.cal-day.clickable {
    cursor: pointer;
}

.cal-day.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cal-day-profit {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #86efac;
    color: #166534;
}

.cal-day-profit .cal-day-num {
    color: #166534;
}

.cal-day-profit .cal-day-trades {
    color: #15803d;
}

.cal-day-loss {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
    color: #7f1d1d;
}

.cal-day-loss .cal-day-num {
    color: #7f1d1d;
}

.cal-day-loss .cal-day-trades {
    color: #991b1b;
}

.cal-day-neutral {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-color: #d1d5db;
    color: #374151;
}

.cal-detail-table {
    font-size: 0.85rem;
}

.cal-detail-table thead th {
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #6b7280;
    border-bottom: 2px solid #e5ecf6;
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.cal-detail-table tbody td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f0f4f8;
}
