/* Quant Edge dashboard — builds on the tokens in style.css */

.qd { display: flex; flex-direction: column; gap: 1.25rem; }
.qd b { font-weight: 600; }
.qd .pos { color: var(--accent-green); }
.qd .neg { color: var(--accent-red); }
.qd .buy { color: var(--accent-green); }
.qd .sell { color: var(--accent-red); }
.qd .hold { color: var(--accent-gold); }
.qd .aside { color: #bc8cff; }
.qd-muted { color: var(--text-secondary); }
.qd-small { font-size: 0.75rem; }
.qd-warn { color: var(--accent-gold); }

/* header */
.qd-header { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.qd-header h1 { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 700; }
.qd-accent { color: var(--accent-blue); }
.qd-tagline { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.35rem; max-width: 620px; line-height: 1.45; }
.qd-health { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; min-width: 280px; }
.qd-health-row { display: flex; align-items: center; gap: 0.5rem; }
.qd-health .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-secondary); flex-shrink: 0; }
.qd-health .dot.ready { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); animation: pulse 2s infinite; }
.qd-health .dot.training { background: var(--accent-gold); }
.qd-health .dot.error { background: var(--accent-red); }

/* tabs */
.qd-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.qd-tab {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem;
    padding: 0.6rem 1rem; min-width: 118px; cursor: pointer;
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 10px;
    color: var(--text-primary); font-family: var(--font-body);
    transition: border-color .2s, background .2s, transform .2s;
}
.qd-tab:hover { border-color: var(--accent-blue); transform: translateY(-1px); }
.qd-tab.active { border-color: var(--accent-blue); background: rgba(88, 166, 255, 0.12); }
.qd-tab-sym { font-family: var(--font-heading); font-weight: 600; font-size: 0.92rem; }
.qd-tab-nice { font-size: 0.7rem; color: var(--text-secondary); }
.qd-tab-dec { margin-top: 0.2rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.8px; }

/* summary */
.qd-summary { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: center; }
.qd-sym { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600; }
.qd-sym span { font-size: 0.8rem; color: var(--text-secondary); font-weight: 400; }
.qd-px { font-family: var(--font-heading); font-size: 2.3rem; font-weight: 700; margin: 0.15rem 0; font-variant-numeric: tabular-nums; }
.qd-sum-price .qd-muted { font-size: 0.75rem; }
.qd-sum-text { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.92rem; line-height: 1.5; }
.qd-sum-text span { font-size: 0.8rem; }

/* horizon cards */
.qd-horizons { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.qd-card { display: flex; flex-direction: column; gap: 0.85rem; padding: 1.15rem; border-top: 3px solid var(--glass-border); }
.qd-card.buy { border-top-color: var(--accent-green); }
.qd-card.sell { border-top-color: var(--accent-red); }
.qd-card.aside { border-top-color: #bc8cff; }
.qd-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.qd-card-h { font-family: var(--font-heading); font-weight: 600; text-transform: capitalize; }
.qd-dec { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.5px; }
.qd-lean { font-size: 0.78rem; color: var(--text-secondary); margin-top: -0.5rem; }

.qd-bars { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.75rem; }
.qd-bar-row { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 0.5rem; color: var(--text-secondary); }
.qd-bar-row b { color: var(--text-primary); text-align: right; font-variant-numeric: tabular-nums; }
.qd-bar { height: 8px; background: rgba(255, 255, 255, 0.07); border-radius: 4px; overflow: hidden; }
.qd-bar i { display: block; height: 100%; border-radius: 4px; }
.qd-bar i.move { background: var(--accent-blue); }
.qd-bar i.cost { background: var(--accent-red); opacity: 0.75; }
.qd-edge { font-size: 0.8rem; margin-top: 0.15rem; }

.qd-conv-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }
.qd-conv-label b { color: var(--text-primary); }
.qd-conv-bar { position: relative; height: 8px; margin: 0.35rem 0 0.25rem; background: rgba(255, 255, 255, 0.07); border-radius: 4px; }
.qd-conv-bar i { display: block; height: 100%; background: var(--accent-gold); border-radius: 4px; }
.qd-conv-bar em { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text-primary); }

.qd-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; padding-top: 0.6rem; border-top: 1px solid var(--glass-border); }
.qd-levels div { display: flex; flex-direction: column; gap: 0.1rem; }
.qd-levels span { color: var(--text-secondary); font-size: 0.68rem; }
.qd-levels b { font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.qd-levels em { font-style: normal; color: var(--text-secondary); font-size: 0.66rem; }

.qd-reason { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; }
.qd-drivers ul { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.25rem; font-size: 0.75rem; }

/* sections */
.qd-section { display: flex; flex-direction: column; gap: 1rem; }
.qd-section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.qd-section h2 { font-family: var(--font-heading); font-size: 1.25rem; }
.qd-sub { font-size: 0.78rem; font-weight: 400; color: var(--text-secondary); margin-left: 0.4rem; }
.qd-section-head p { font-size: 0.82rem; line-height: 1.5; margin-top: 0.35rem; max-width: 760px; }
.k-gross { color: var(--accent-blue); font-weight: 600; }
.k-net { color: var(--accent-red); font-weight: 600; }
.k-buy { color: var(--accent-gold); font-weight: 600; }

.qd-hbtns { display: flex; gap: 0.35rem; }
.qd-hbtn {
    padding: 0.35rem 0.85rem; border-radius: 999px; cursor: pointer;
    background: transparent; border: 1px solid var(--glass-border);
    color: var(--text-secondary); font-family: var(--font-body); font-size: 0.75rem; font-weight: 600;
}
.qd-hbtn:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.qd-hbtn.active { background: var(--accent-blue); border-color: var(--accent-blue); color: var(--bg-color); }

/* charts */
.qd-chart svg { width: 100%; height: auto; display: block; }
.qd-chart text { fill: var(--text-secondary); font-size: 12px; font-family: var(--font-body); }
.qd-chart text.ylab { font-size: 11px; }
.qd-chart line.grid { stroke: rgba(255, 255, 255, 0.06); }
.qd-chart line.zero { stroke: rgba(255, 255, 255, 0.28); stroke-dasharray: 4 4; }
.qd-chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; }
.qd-chart .ln.gross { stroke: var(--accent-blue); }
.qd-chart .ln.net { stroke: var(--accent-red); }
.qd-chart .ln.buyline { stroke: var(--accent-gold); stroke-dasharray: 6 4; }
.qd-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.4rem; }
.qd-legend span { display: flex; align-items: center; gap: 0.4rem; }
.qd-legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.qd-legend .gross i { background: var(--accent-blue); }
.qd-legend .net i { background: var(--accent-red); }
.qd-legend .buyline i { background: var(--accent-gold); }
.qd-legend b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.qd-empty { padding: 2rem 1rem; text-align: center; color: var(--text-secondary); font-size: 0.85rem;
    border: 1px dashed var(--glass-border); border-radius: 10px; }

/* tables (reuses .q-table from style.css) */
.q-table tr.sel td { background: rgba(88, 166, 255, 0.06); }
.qd-pill { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px;
    border: 1px solid currentColor; white-space: nowrap; }
.qd-verdicts { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; color: var(--text-secondary); }
.qd-verdict b { color: var(--text-primary); }
.qd-prog { width: 110px; height: 6px; background: rgba(255, 255, 255, 0.07); border-radius: 3px; overflow: hidden; }
.qd-prog i { display: block; height: 100%; background: var(--accent-blue); }

.qd-footer { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between;
    font-size: 0.75rem; color: var(--text-secondary); padding: 0.5rem 0.25rem 2rem; }
.qd-footer a { color: var(--accent-blue); text-decoration: none; }

/* portfolio */
.qd-pf-controls { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.qd-gate { display: flex; gap: 0.6rem; align-items: center; font-size: 0.82rem; color: var(--text-secondary);
    padding: 0.7rem 0.9rem; border: 1px solid var(--glass-border); border-radius: 10px; flex-wrap: wrap; }
.qd-chart .ln.pf-nodelay { stroke: #bc8cff; }
.qd-chart .ln.pf-real { stroke: var(--accent-gold); stroke-width: 2.5; }
.qd-chart .ln.pf-limit { stroke: #6e7681; stroke-dasharray: 6 4; }
.qd-legend .pf-nodelay i, .qd-swatch.pf-nodelay { background: #bc8cff; }
.qd-legend .pf-real i, .qd-swatch.pf-real { background: var(--accent-gold); }
.qd-legend .pf-limit i, .qd-swatch.pf-limit { background: #6e7681; }
.qd-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.45rem; vertical-align: middle; }
.qd-swatch.gross { background: var(--accent-blue); }
.qd-swatch.net { background: var(--accent-red); }

@media (max-width: 760px) {
    .qd-pf-controls { align-items: flex-start; }
    body { padding: 1rem; }
    .qd-summary { grid-template-columns: 1fr; }
    .qd-header h1 { font-size: 1.5rem; }
}

/* 4-hour strategy panel */
.qd-st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; margin: 0.8rem 0; }
.qd-st-kpis > div { background: rgba(255, 255, 255, 0.03); border-radius: 10px; padding: 0.7rem;
    display: flex; flex-direction: column; gap: 0.2rem; }
.qd-st-kpis b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.qd-st-kpis span { font-size: 0.75rem; color: var(--text-secondary); }
.qd-old-h { margin: 1.6rem 0 0.4rem; font-size: 1.05rem; }
.qd details summary { cursor: pointer; color: var(--text-secondary); margin: 0.6rem 0; }
.qd-st-orders { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.7rem; margin-bottom: 0.8rem; }
.qd-st-order { background: rgba(255, 255, 255, 0.03); border-radius: 10px; padding: 0.8rem; font-size: 0.82rem;
    display: flex; flex-direction: column; gap: 0.3rem; font-variant-numeric: tabular-nums; }
.qd-st-oh { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }

/* alignment signals */
.qd-align { border: 1px solid rgba(255, 200, 60, 0.25); }
.qd-align.qd-al-live { border-color: rgba(255, 200, 60, 0.8); box-shadow: 0 0 24px rgba(255, 200, 60, 0.18); }
.qd-alert-btn { background: rgba(255, 200, 60, 0.12); color: #ffd560; border: 1px solid rgba(255, 200, 60, 0.4);
    border-radius: 8px; padding: 0.4rem 0.8rem; cursor: pointer; font-size: 0.8rem; white-space: nowrap; }
.qd-al-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.7rem; margin: 0.6rem 0 1rem; }
.qd-al-card { border-radius: 12px; padding: 0.9rem; background: rgba(255, 200, 60, 0.06); border: 1px solid rgba(255, 200, 60, 0.45);
    display: flex; flex-direction: column; gap: 0.3rem; font-variant-numeric: tabular-nums; animation: qdPulse 2s ease-in-out 3; }
.qd-al-top { display: flex; justify-content: space-between; align-items: center; }
.qd-al-rule { font-weight: 700; font-size: 0.8rem; color: #ffd560; }
.qd-al-sym { font-size: 1.3rem; font-weight: 700; }
.qd-al-lv { display: flex; justify-content: space-between; font-size: 0.85rem; }
.qd-al-none { padding: 0.9rem; border-radius: 10px; background: rgba(255, 255, 255, 0.03); color: var(--text-secondary); font-size: 0.85rem; }
.qd-al-tag { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.al-a.qd-al-tag { background: rgba(88, 166, 255, 0.15); color: #79b8ff; }
.al-b.qd-al-tag { background: rgba(63, 185, 80, 0.15); color: #56d364; }
.al-c.qd-al-tag { background: rgba(255, 200, 60, 0.15); color: #ffd560; }
.al-d.qd-al-tag { background: rgba(188, 140, 255, 0.15); color: #c9a2ff; }
.al-e.qd-al-tag { background: rgba(255, 123, 114, 0.15); color: #ff9b94; }
@keyframes qdPulse { 0%, 100% { box-shadow: 0 0 0 rgba(255, 200, 60, 0); } 50% { box-shadow: 0 0 22px rgba(255, 200, 60, 0.35); } }
@media (max-width: 600px) { .qd-section-head { flex-wrap: wrap; gap: 0.6rem; } }
