/* quant_a-web — minimalist analytical dashboard */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background: #f6f7f9;
    color: #222;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-header {
    background: #fff;
    border-bottom: 1px solid #e1e4e8;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .brand {
    font-size: 20px;
    font-weight: 700;
    color: #2980b9;
    text-decoration: none;
}

.app-header .brand .sub {
    font-size: 13px;
    color: #777;
    font-weight: 400;
    margin-left: 8px;
}

.app-header .meta {
    font-size: 12px;
    color: #888;
}

.mode-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
    background: #fff3e0;
    color: #bf8700;
    text-transform: uppercase;
}
.mode-badge.real { background: #e6f4ea; color: #1a7f37; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 32px 64px;
}

/* Home page hero */
.hero {
    background: linear-gradient(135deg, #2980b9 0%, #6dd5ed 100%);
    color: #fff;
    padding: 56px 40px;
    border-radius: 12px;
    margin-bottom: 24px;
    text-align: center;
}
.hero h1 {
    margin: 0 0 8px; font-size: 32px; font-weight: 700;
}
.hero .tagline { font-size: 16px; opacity: 0.9; margin-bottom: 24px; }
.hero form {
    display: inline-flex; gap: 8px;
    background: #fff; padding: 6px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hero input[type="text"] {
    border: none; outline: none;
    padding: 12px 16px;
    font-size: 16px;
    width: 280px;
    border-radius: 6px;
    color: #222;
}
.hero button {
    background: #2980b9; color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.hero button:hover { background: #1f6391; }

/* Section card */
.section {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.section h2 {
    margin: 0 0 14px;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
table th, table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    text-align: right;
}
table th:first-child, table td:first-child,
table th:nth-child(2), table td:nth-child(2),
table th:nth-child(3), table td:nth-child(3) {
    text-align: left;
}
table thead th {
    background: #f7f7f9;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}
table tbody tr:hover { background: #fafbfc; }
table tbody tr.is-pick { background: #e6f4ea; }
table tbody tr.is-pick:hover { background: #d4ecd8; }
table a { color: #0969da; text-decoration: none; }
table a:hover { text-decoration: underline; }

.pos { color: #1a7f37; }
.neg { color: #cf222e; }

/* Pick summary cards on home */
.picks-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 12px;
}
.pick-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 14px 16px;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
}
.pick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.pick-card .symbol { font-weight: 700; font-size: 15px; }
.pick-card .name { color: #555; font-size: 13px; margin-top: 2px; }
.pick-card .industry { color: #888; font-size: 11px; margin-top: 4px; }
.pick-card .verdict-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 0.04em;
}

/* Analysis page header */
.stock-head {
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.stock-head .title { font-size: 24px; font-weight: 700; margin: 0; }
.stock-head .industry { color: #777; font-size: 14px; margin-top: 4px; }
.stock-head .price-row { color: #555; font-size: 13px; margin-top: 6px; }
.stock-head .verdict-bar {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 6px; min-width: 220px;
}
.verdict-large {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    min-width: 180px;
}
.verdict-meta { color: #888; font-size: 11px; }

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.stat-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.stat-card {
    background: #f7f7f9;
    border-radius: 6px;
    padding: 10px 14px;
}
.stat-card .label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.stat-card .value {
    font-size: 18px;
    font-weight: 600;
    margin-top: 4px;
}

/* Factor radar (CSS-only horizontal bars) */
.factor-bars { display: flex; flex-direction: column; gap: 10px; }
.factor-row { display: flex; align-items: center; gap: 12px; }
.factor-row .name {
    font-size: 12px;
    width: 220px;
    color: #444;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.factor-row .bar-track {
    flex: 1;
    height: 18px;
    background: linear-gradient(to right, #fff 0%, #f0f0f0 50%, #fff 100%);
    border-radius: 3px;
    position: relative;
    border: 1px solid #eee;
}
.factor-row .bar-mid {
    position: absolute; left: 50%; top: 0; bottom: 0;
    width: 1px; background: #ccc;
}
.factor-row .bar-fill {
    position: absolute;
    top: 0; bottom: 0;
    background: #2980b9;
    border-radius: 2px;
    opacity: 0.85;
}
.factor-row .bar-fill.neg { background: #cf222e; }
.factor-row .value {
    width: 50px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Multi-agent debate columns */
.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}
.col {
    padding: 16px 18px;
    border-radius: 6px;
    font-size: 13px;
}
.col-bull { background: #e6f4ea; border-left: 3px solid #1a7f37; }
.col-bear { background: #fdecea; border-left: 3px solid #cf222e; }
.col-risk { background: #f0f4f8; border-left: 3px solid #0969da; }
.col h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
}
.col .field { margin: 8px 0; }
.col .field-label {
    color: #555;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.col ul { margin: 4px 0 8px 16px; padding: 0; }
.col li { margin: 3px 0; }
.col .empty { color: #aaa; font-style: italic; }

.col .sources {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #aaa;
    font-size: 12px;
}
.col .sources .label-line {
    color: #555;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.col .sources a { color: #0969da; text-decoration: none; word-break: break-all; }
.col .sources a:hover { text-decoration: underline; }
.col .sources .meta { color: #888; font-size: 11px; }
.col .no-sources {
    color: #999;
    font-style: italic;
    font-size: 11px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
}

/* Synth (committee decision) block */
.synth-block {
    background: #fff8e1;
    border: 1px solid #f0c36d;
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 14px;
}
.synth-block h3 { margin: 0 0 8px; font-size: 14px; }
.synth-block .memo {
    font-style: italic;
    color: #444;
    margin: 8px 0;
    line-height: 1.6;
}
.synth-block .triggers { margin-top: 8px; font-size: 13px; }

/* News timeline */
.news-list { margin: 8px 0 0; padding: 0; list-style: none; }
.news-list li {
    padding: 10px 14px;
    border-left: 3px solid #2980b9;
    background: #fafbfc;
    margin: 6px 0;
    border-radius: 0 4px 4px 0;
}
.news-list li .news-title { font-weight: 600; font-size: 13px; }
.news-list li .news-finding { color: #555; font-size: 12px; margin-top: 4px; }
.news-list li .news-meta { color: #888; font-size: 11px; margin-top: 4px; }
.news-list li .news-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 10px;
    margin-left: 6px;
}

/* Empty / not-found state */
.empty-state {
    background: #fff;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    color: #555;
}
.empty-state h2 { margin-top: 0; }
.empty-state .back {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: #2980b9;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}

/* Footer */
.app-footer {
    text-align: center;
    color: #888;
    font-size: 12px;
    padding: 24px;
}
.app-footer a { color: #888; }

/* Responsive */
@media (max-width: 1024px) {
    .three-col { grid-template-columns: 1fr; }
    .picks-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid, .stat-grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .container { padding: 12px; }
    .stat-grid, .stat-grid.cols-6 { grid-template-columns: repeat(2, 1fr); }
    .picks-grid { grid-template-columns: 1fr; }
}
