:root {
    --color-bg-secondary: #1f2933;
}

body.page {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0b1020;
    color: #f5f5f7;
}

.topbar {
    background: #111827;
    border-bottom: 1px solid #1f2933;
}

.topbar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 600;
}

.brand-link {
    color: #f5f5f7;
    text-decoration: none;
}

.brand-link:hover {
    color: #ffffff;
}

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

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link-button {
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.nav-link-button:hover {
    color: #ffffff;
}

.nav-separator {
    color: #4b5563;
    margin: 0 0.25rem;
}

.nav-user {
    color: #9ca3af;
    font-size: 0.9rem;
}

.main {
    max-width: 1440px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

.section h1 {
    margin-top: 0;
}

.card {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    background: #111827;
    border: 1px solid #1f2933;
}

.button, button[type="submit"], button[type="button"] {
    background: #2563eb;
    border-radius: 0.375rem;
    border: none;
    padding: 0.5rem 1rem;
    color: #f9fafb;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.button:hover, button[type="submit"]:hover, button[type="button"]:hover {
    background: #1d4ed8;
}

.button-secondary {
    background: #374151;
}

.button-secondary:hover {
    background: #4b5563;
}

.button-primary {
    background: #2563eb;
}

.button-primary:hover {
    background: #1d4ed8;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.counter-value {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Auth styles */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
}

.auth-form {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    background: #1f2937;
    color: #f5f5f7;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.error-message {
    background: #7f1d1d;
    border: 1px solid #991b1b;
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert-warning {
    background: #422006;
    border-color: #78350f;
    color: #fde68a;
}

.alert strong {
    font-weight: 600;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #9ca3af;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Section styles */
.section {
    padding: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b7280;
    margin: 0 0 0.25rem 0;
}

.section-subtitle {
    color: #9ca3af;
    margin: 0.25rem 0 0 0;
}

/* Strategy grid */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.strategy-card {
    display: block;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    background: #111827;
    border: 1px solid #1f2933;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.strategy-card:hover {
    border-color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.strategy-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.strategy-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.strategy-card-description {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.strategy-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

.strategy-status {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.strategy-status-draft {
    background: #374151;
    color: #9ca3af;
}

.strategy-status-testing {
    background: #1e3a5f;
    color: #60a5fa;
}

.strategy-status-active {
    background: #14532d;
    color: #4ade80;
}

.strategy-status-paused {
    background: #78350f;
    color: #fbbf24;
}

.strategy-empty {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.strategy-empty p {
    margin: 0.5rem 0;
}

/* Modal styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: #111827;
    border: 1px solid #1f2933;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #1f2933;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #f5f5f7;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #1f2933;
}

/* Form enhancements */
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    background: #1f2937;
    color: #f5f5f7;
    font-size: 0.9rem;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    background: #1f2937;
    color: #f5f5f7;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.form-group select:focus {
    outline: none;
    border-color: #2563eb;
}

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

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Button variations */
.button-full {
    width: 100%;
}

.button-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.button-danger {
    background: #991b1b !important;
}

.button-danger:hover {
    background: #7f1d1d !important;
}

.button-icon {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 0.25rem;
}

.button-icon:hover {
    color: #f5f5f7;
    background: #374151;
}

.button-danger-subtle {
    background: #ef4444 !important;
}

.button-danger-subtle:hover {
    color: #ef4444 !important;
    background: #450a0a !important;
}

/* Text utilities */
.text-muted {
    color: #6b7280;
}

.text-small {
    font-size: 0.8rem;
}

/* Strategy detail page */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #f5f5f7;
}

.breadcrumb-separator {
    color: #4b5563;
}

.strategy-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .strategy-content {
        grid-template-columns: 1fr;
    }
}

.strategy-sidebar .card {
    margin-bottom: 1rem;
}

.card-title {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header .card-title {
    margin: 0;
}

/* Rules */
.rules-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rules-empty {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.rules-empty p {
    margin: 0.5rem 0;
}

.rule-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    overflow: hidden;
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #111827;
    border-bottom: 1px solid #374151;
}

.rule-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rule-number {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background: #374151;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

.rule-name-input {
    background: transparent;
    border: 1px solid transparent;
    color: #f5f5f7;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    min-width: 150px;
}

.rule-name-input:hover {
    border-color: #374151;
}

.rule-name-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #1f2937;
}

.rule-body {
    padding: 1rem;
}

.rule-section {
    margin-bottom: 1.25rem;
}

.rule-section:last-child {
    margin-bottom: 0;
}

.rule-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin: 0 0 0.25rem 0;
}

.rule-section-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0 0.75rem 0;
}

/* Conditions */
.conditions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.condition-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.condition-field,
.condition-operator,
.condition-compare-field {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.5rem;
    border: 1px solid #374151;
    border-radius: 0.25rem;
    background: #111827;
    color: #f5f5f7;
    font-size: 0.85rem;
}

.condition-threshold {
    width: 80px;
    padding: 0.4rem 0.5rem;
    border: 1px solid #374151;
    border-radius: 0.25rem;
    background: #111827;
    color: #f5f5f7;
    font-size: 0.85rem;
}

.condition-period {
    width: 70px;
    padding: 0.4rem 0.5rem;
    border: 1px solid #374151;
    border-radius: 0.25rem;
    background: #111827;
    color: #f5f5f7;
    font-size: 0.85rem;
}

.condition-field:focus,
.condition-operator:focus,
.condition-threshold:focus,
.condition-period:focus,
.condition-compare-field:focus {
    outline: none;
    border-color: #2563eb;
}

.condition-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.condition-delete {
    flex-shrink: 0;
}

/* Actions */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

.actions-grid .form-group {
    margin-bottom: 0;
}

.actions-grid label {
    font-size: 0.75rem;
    color: #9ca3af;
}

.actions-grid select,
.actions-grid input {
    padding: 0.4rem 0.5rem;
    border: 1px solid #374151;
    border-radius: 0.25rem;
    background: #111827;
    color: #f5f5f7;
    font-size: 0.85rem;
}

.actions-grid select:focus,
.actions-grid input:focus {
    outline: none;
    border-color: #2563eb;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #1f2933;
}

.table th {
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #1e3a8a;
    font-size: 0.75rem;
}

.badge-muted {
    background: #374151;
    color: #9ca3af;
}

.metrics {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.metrics li {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid #1f2933;
}

.metrics .label {
    color: #9ca3af;
}

.metrics .value {
    font-weight: 600;
}

.muted {
    color: #6b7280;
}

.detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}

.chart-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chart-frame {
    position: relative;
    width: 100%;
    height: 240px;
}

.chart-canvas {
    position: absolute;
    inset: 0;
}

/* Backtest pages */
.backtest-strategy-section {
    margin-top: 2rem;
}

.backtest-strategy-section:first-child {
    margin-top: 0;
}

.backtest-strategy-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #f5f5f7;
}

.backtest-strategy-title a {
    color: #60a5fa;
    text-decoration: none;
}

.backtest-strategy-title a:hover {
    text-decoration: underline;
}

.backtest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.backtest-card {
    display: block;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #111827;
    border: 1px solid #1f2933;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}

.backtest-card:hover {
    border-color: #374151;
    transform: translateY(-2px);
}

.backtest-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.backtest-card-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: #f5f5f7;
}

.backtest-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.backtest-status-pending {
    background: #374151;
    color: #9ca3af;
}

.backtest-status-running {
    background: #1e40af;
    color: #93c5fd;
}

.backtest-status-completed {
    background: #065f46;
    color: #6ee7b7;
}

.backtest-status-failed {
    background: #7f1d1d;
    color: #fca5a5;
}

.backtest-status-cancelled {
    background: #78350f;
    color: #fcd34d;
}

.backtest-status-large {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

.backtest-card-description {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.backtest-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

.backtest-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
}

.backtest-empty p:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Backtest detail page */
.backtest-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.backtest-status-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-message {
    color: #9ca3af;
    margin: 0;
}

.backtest-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.backtest-config-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.backtest-config-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 500;
}

.backtest-config-value {
    font-size: 1rem;
    color: #f5f5f7;
}

.backtest-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #1f2937;
    border-radius: 0.375rem;
    border: 1px solid #374151;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 500;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f5f5f7;
}

.metric-positive {
    color: #6ee7b7;
}

.metric-negative {
    color: #fca5a5;
}

.card-error {
    border-color: #991b1b;
    background: #450a0a;
}

.error-message {
    color: #fca5a5;
    margin: 0.5rem 0 0;
    font-family: monospace;
    font-size: 0.875rem;
}

.chart-container {
    margin-top: 1rem;
    height: 300px;
}

.chart-container canvas {
    max-height: 300px;
}

/* Trades table */
.table-container {
    margin-top: 1rem;
    overflow-x: auto;
}

.trades-table {
    font-size: 0.875rem;
}

.trades-table thead th {
    background: #1f2937;
    position: sticky;
    top: 0;
    z-index: 1;
}

.trades-table tbody tr:hover {
    background: #1f2937;
}

.trade-side {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.trade-side-buy {
    background: #065f46;
    color: #6ee7b7;
}

.trade-side-sell {
    background: #7f1d1d;
    color: #fca5a5;
}

.trade-net-positive {
    color: #6ee7b7;
    font-weight: 600;
}

.trade-net-negative {
    color: #fca5a5;
    font-weight: 600;
}

/* Sortable table styles */
.sortable-table .sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.sortable-table .sortable-header:hover {
    background: #374151;
}

.sortable-table .sortable-header::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    opacity: 0.4;
    font-size: 0.75rem;
}

.sortable-table .sortable-header.sort-asc::after {
    content: '↑';
    opacity: 1;
}

.sortable-table .sortable-header.sort-desc::after {
    content: '↓';
    opacity: 1;
}

/* Search bar styles */
.search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.search-input {
    flex: 1;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    color: #f9fafb;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.search-input::placeholder {
    color: #6b7280;
}
/* Pagination styles */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pagination-info {
    color: #9ca3af;
    font-size: 0.875rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.pagination-pages {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.pagination-pages span:not(.button) {
    color: #6b7280;
    padding: 0 0.25rem;
}
.button-active {
    background: #1e40af;
    cursor: default;
}
.button-active:hover {
    background: #1e40af;
}

select:disabled, input:disabled {
    opacity: 0.7;
}

/* Tab navigation styles */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #374151;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    color: #9ca3af;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
    color: #e5e7eb;
}

.tab-active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
}

.tab-active:hover {
    color: #60a5fa;
}

/* Bulk actions bar */
.bulk-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    border-top: 1px solid #374151;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 100;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.3);
}

.bulk-actions #selected-count {
    color: #e5e7eb;
    font-weight: 500;
    margin-right: auto;
}

/* Checkbox column */
.checkbox-column {
    width: 40px;
    text-align: center;
}

.checkbox-column input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Selected instruments list in modal */
.selected-instruments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #1f2937;
    border-radius: 4px;
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

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

.alert a {
    color: #6ee7b7;
    text-decoration: underline;
}

/* Instrument search component for backtest */
.instrument-search-container {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2937;
    border: 1px solid #374151;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px solid #374151;
}

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

.search-result-item:hover {
    background: #374151;
}

.search-result-item .symbol {
    font-weight: 600;
    color: #60a5fa;
}

.search-result-item .name {
    font-size: 0.875rem;
    color: #9ca3af;
}

.search-result-item .coverage {
    font-size: 0.75rem;
    color: #6b7280;
}

.search-result-empty {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Selected instruments tags */
.selected-instruments-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    min-height: 2rem;
}

.instrument-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.instrument-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
}

.instrument-tag button:hover {
    opacity: 1;
}

/* Larger modal for backtest form */
.modal-lg {
    max-width: 600px;
    width: 90%;
}

/* Backtest progress bar */
.backtest-progress {
    margin-top: 1rem;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #374151;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

