* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
    background: #0d1117;
    color: #c9d1d9;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #21262d;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.3rem;
    color: #58a6ff;
}

nav a {
    color: #8b949e;
    text-decoration: none;
    margin-left: 20px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

nav a.active {
    color: #f0f6fc;
    background: #21262d;
}

nav a:hover { color: #f0f6fc; }

.summary-bar {
    display: flex;
    gap: 24px;
    padding: 10px 16px;
    background: #161b22;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 24px;
}

thead {
    background: #161b22;
    position: sticky;
    top: 0;
}

th {
    padding: 8px 12px;
    text-align: left;
    color: #8b949e;
    font-weight: 600;
    border-bottom: 1px solid #21262d;
    cursor: pointer;
    user-select: none;
}

th:hover { color: #f0f6fc; }

td {
    padding: 8px 12px;
    border-bottom: 1px solid #21262d;
}

tbody tr:hover { background: #161b22; }
.holding-row { cursor: pointer; }

/* Tension colors */
.tension-low { color: #3fb950; }
.tension-medium { color: #d29922; }
.tension-high { color: #f85149; }

/* Trajectory colors */
.trajectory-accelerating { color: #3fb950; }
.trajectory-stable { color: #c9d1d9; }
.trajectory-decelerating { color: #d29922; }
.trajectory-deteriorating { color: #f85149; }

/* Pass/Fail */
.pass { color: #3fb950; }
.fail { color: #f85149; }

/* Price change */
.positive { color: #3fb950; }
.negative { color: #f85149; }
.neutral { color: #d29922; }

/* Alert badges */
.alert-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 1px 2px;
}

.alert-action { color: #f85149; background: rgba(248, 81, 73, 0.15); }
.alert-review { color: #d29922; background: rgba(210, 153, 34, 0.15); }
.alert-info { color: #58a6ff; background: rgba(88, 166, 255, 0.15); }

/* Detail row */
.detail-row td { padding: 0; }
.detail-content {
    padding: 16px 24px;
    background: #161b22;
    border-left: 3px solid #58a6ff;
}

.detail-content h4 {
    color: #58a6ff;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.detail-content p {
    font-size: 0.85rem;
    line-height: 1.5;
    max-width: 800px;
}

.detail-content ul {
    list-style: none;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-content li {
    background: #21262d;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.beliefs { margin-bottom: 12px; }

/* Data quality warning flags */
.flag-warning {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #d29922;
    background: rgba(210, 153, 34, 0.15);
    cursor: help;
}

tr.has-warning td:first-child strong::after {
    content: " *";
    color: #d29922;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #8b949e;
    font-style: italic;
}

/* Filter bar */
.filter-bar {
    margin-bottom: 12px;
}

.filter-bar input {
    background: #161b22;
    border: 1px solid #21262d;
    color: #c9d1d9;
    padding: 8px 12px;
    border-radius: 6px;
    width: 300px;
    font-size: 0.85rem;
}

.filter-bar input::placeholder { color: #484f58; }
.filter-bar input:focus { outline: none; border-color: #58a6ff; }

/* Run info */
.run-info {
    color: #8b949e;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

/* Small text in table cells */
small {
    display: block;
    color: #8b949e;
    font-size: 0.75rem;
}

h2 {
    font-size: 1.1rem;
    color: #c9d1d9;
    margin: 24px 0 12px;
}

/* Explainer section */
.explainer {
    margin-top: 32px;
    padding: 20px 24px;
    background: #161b22;
    border-radius: 6px;
    border: 1px solid #21262d;
}

.explainer h2 {
    color: #8b949e;
    font-size: 0.95rem;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.explainer dl {
    display: grid;
    gap: 12px;
}

.explainer dt {
    font-weight: 600;
    color: #c9d1d9;
    font-size: 0.85rem;
}

.explainer dd {
    margin: 2px 0 0 0;
    color: #8b949e;
    font-size: 0.8rem;
    line-height: 1.6;
    max-width: 900px;
}

/* --- Enriched Screen --- */

.enriched-heading {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #21262d;
}

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 28px;
}

.category-a { color: #3fb950; background: rgba(63, 185, 80, 0.15); }
.category-b { color: #d29922; background: rgba(210, 153, 34, 0.15); }
.category-c { color: #8b949e; background: rgba(139, 148, 158, 0.15); }
.category-d { color: #f85149; background: rgba(248, 81, 73, 0.15); }

/* SMA signal colors */
.sma-below-50d { color: #f85149; }
.sma-crossing { color: #d29922; }
.sma-above-50d-early { color: #58a6ff; }
.sma-above-50d-confirmed { color: #3fb950; }

/* Volume signal colors */
.vol-low-volume { color: #8b949e; }
.vol-normal { color: #c9d1d9; }
.vol-elevated { color: #58a6ff; }
.vol-accumulation { color: #3fb950; }
.vol-distribution { color: #f85149; }

/* Activist badge */
.activist-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 1px 2px;
    color: #8b949e;
    background: rgba(139, 148, 158, 0.15);
}
.activist-validated {
    color: #3fb950;
    background: rgba(63, 185, 80, 0.15);
}
