/* ==================== TECHNICAL DASHBOARD ==================== */
/* Dark theme matching Stage 1 mockup. Three-card layout:
     [PRICE POSITION wide]
     [RSI gauge] [ADX gauge]
   Mobile: single column. */

.td-dashboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.td-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.td-card {
    background: #1a1d23;
    border: 1px solid #2a2f37;
    border-radius: 12px;
    padding: 14px 16px;
    color: #f3f4f6;
    position: relative;
    min-height: 80px;
}

.td-card-wide {
    /* Full-width price-position bar at top of dashboard */
}

.td-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.td-card-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #9ca3af;
    text-transform: uppercase;
}

.td-empty {
    color: #6b7280;
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
}

/* ─── Price Range Card ─── */

.td-pricerange-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

.td-pricerange-current {
    font-size: 24px;
    font-weight: 700;
    color: #f3f4f6;
    letter-spacing: -0.01em;
}

.td-pricerange-meta {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.td-pricerange-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.td-pricerange-labels {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: #9ca3af;
    height: 14px;
}

.td-pricerange-low,
.td-pricerange-high {
    z-index: 1;
}

.td-pricerange-cur {
    position: absolute;
    transform: translateX(-50%);
    color: #f3f4f6;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

/* Hide overlapping current label if it gets too close to high label */
.td-pricerange-labels:has(.td-pricerange-cur[style*="9"]) .td-pricerange-high {
    opacity: 0.4;
}

/* ─── Gauge Cards (RSI / ADX) ─── */

.td-gauge-svg {
    width: 100%;
    max-width: 260px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.td-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 4px auto 0;
    text-align: center;
}

.td-card .td-pill {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.td-pill-good {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.td-pill-neutral {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.td-pill-bad {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.td-pill-muted {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ─── Geographic Mix Donut ─── */

.td-geomix-row {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-top: 8px;
}

.td-geomix-svg {
    width: 220px;
    height: 220px;
    flex: 0 0 220px;
    display: block;
}

.td-geomix-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.td-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #f3f4f6;
}

.td-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex: 0 0 12px;
}

.td-legend-label {
    flex: 1;
    color: #d1d5db;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-legend-value {
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

/* ─── Mobile ─── */

@media (max-width: 700px) {
    .td-card-row {
        grid-template-columns: 1fr;
    }

    .td-pricerange-current {
        font-size: 20px;
    }

    .td-card {
        padding: 12px 14px;
    }

    .td-geomix-row {
        flex-direction: column;
        gap: 16px;
    }

    .td-geomix-svg {
        flex: 0 0 auto;
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
}
