/* Momentum Engine Dashboard — Dark Trading Theme */

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
}

.navbar { border-bottom: 1px solid #30363d !important; }
.navbar-brand { font-weight: 700; letter-spacing: 1px; color: #58a6ff !important; }

/* Tabs */
.nav-tabs { border-bottom: 1px solid #30363d; }
.nav-tabs .nav-link {
    color: #8b949e;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}
.nav-tabs .nav-link.active {
    color: #58a6ff;
    background: transparent;
    border-bottom: 2px solid #58a6ff;
}
.nav-tabs .nav-link:hover { color: #c9d1d9; }

/* Cards */
.card {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px;
}
.card-header {
    background: #1c2128 !important;
    border-bottom: 1px solid #30363d !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    color: #c9d1d9;
}

/* Tables rendered from markdown */
.card-body table {
    width: 100%;
    margin-bottom: 0;
}
.card-body table th {
    color: #58a6ff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #30363d;
    padding: 0.4rem 0.5rem;
}
.card-body table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #21262d;
    font-size: 0.85rem;
    vertical-align: middle;
}
.card-body table tr:hover { background: #1c2128; }

/* Markdown overrides — ensure all text is visible on dark background */
.card-body h1 { font-size: 1.1rem; color: #58a6ff; margin-bottom: 0.5rem; }
.card-body h2 { font-size: 1rem; color: #79c0ff; margin-top: 1rem; }
.card-body h3 { font-size: 0.9rem; color: #e6edf3; margin-top: 0.75rem; }
.card-body h4 { font-size: 0.85rem; color: #d2a8ff; margin-top: 0.5rem; }
.card-body p { color: #c9d1d9; margin-bottom: 0.4rem; }
.card-body li { color: #c9d1d9; }
.card-body a { color: #58a6ff; }
.card-body em { color: #8b949e; }
.card-body blockquote {
    border-left: 3px solid #58a6ff;
    padding-left: 0.75rem;
    color: #c9d1d9;
    background: #1c2128;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    margin: 0.25rem 0;
    border-radius: 0 4px 4px 0;
}
.card-body strong { color: #f0f6fc; }
.card-body code {
    background: #1c2128;
    color: #79c0ff;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}
.card-body pre {
    background: #0d1117;
    color: #c9d1d9;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #21262d;
    font-size: 0.8rem;
}
.card-body hr { border-top: 1px solid #30363d; margin: 0.5rem 0; }

/* Ensure all text in cards is visible */
.card-body, .card-body * { color: inherit; }
.card-body { color: #c9d1d9; }

/* Symbol links */
.sym-link {
    color: #58a6ff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}
.sym-link:hover { text-decoration: underline; color: #79c0ff; }

/* Gain/loss colors */
.gain { color: #3fb950 !important; }
.loss { color: #f85149 !important; }
.hot { color: #d29922 !important; }

/* Health badges */
.badge-healthy { background: #238636; }
.badge-degraded { background: #9e6a03; color: #000; }
.badge-critical { background: #da3633; }

/* Log viewer */
.log-pre {
    background: #0d1117;
    color: #8b949e;
    font-size: 0.72rem;
    line-height: 1.4;
    padding: 0.5rem;
    border: 1px solid #21262d;
    border-radius: 4px;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Form controls */
.form-control, .form-select {
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
    color: #c9d1d9 !important;
    font-size: 0.85rem;
}
.form-control:focus, .form-select:focus {
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 2px rgba(88,166,255,0.2) !important;
}

/* Spinner */
.spinner-border-sm { width: 1rem; height: 1rem; color: #58a6ff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* Stock detail panel */
.detail-label { color: #8b949e; font-size: 0.75rem; text-transform: uppercase; }
.detail-value { color: #e6edf3; font-weight: 600; font-size: 0.95rem; }

/* Responsive */
@media (max-width: 768px) {
    .card-body table { font-size: 0.75rem; }
    .card-body table th, .card-body table td { padding: 0.2rem 0.3rem; }
}
