/* ================================================
   VISUAL COMPONENTS — CHARTS, RINGS, SPARKLINES
   ================================================ */

/* ---------- BAR CHART ---------- */
.bar-chart {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-meta { display: flex; justify-content: space-between; align-items: center; }
.bar-label { font-size: 13px; font-weight: 600; color: var(--text-on-dark); }
.section--light .bar-label { color: var(--text-on-light); }
.bar-value { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--emerald-bright); }
.bar-track { width: 100%; height: 10px; border-radius: 6px; background: rgba(255,255,255,0.06); overflow: hidden; }
.section--light .bar-track { background: var(--border-on-light); }
.bar-fill {
    height: 100%;
    border-radius: 6px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: linear-gradient(90deg, var(--emerald) 0%, var(--emerald-bright) 100%);
}
.bar-fill--gold { background: linear-gradient(90deg, var(--gold-hover) 0%, var(--gold) 100%); }

/* ---------- PROGRESS RING ---------- */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ring-svg { transform: rotate(-90deg); overflow: visible; }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 8; }
.section--light .ring-bg { stroke: var(--border-on-light); }
.ring-progress {
    fill: none;
    stroke: var(--emerald-bright);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.ring-progress--gold { stroke: var(--gold); }
.ring-inner { position: relative; display: inline-block; }
.ring-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) rotate(90deg);
    text-align: center;
    font-family: var(--display);
    font-weight: 800;
    font-size: 22px;
    color: var(--text-on-dark);
    line-height: 1;
}
.section--light .ring-label { color: var(--text-on-light); }
.ring-sub { font-size: 11px; font-weight: 500; color: var(--muted-on-dark); display: block; margin-top: 3px; }
.section--light .ring-sub { color: var(--muted-on-light); }
.ring-name { font-size: 13px; font-weight: 600; color: var(--text-on-dark); text-align: center; }
.section--light .ring-name { color: var(--text-on-light); }
.rings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 640px; margin: 40px auto 0; }
@media(max-width:600px) { .rings-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- SPARKLINE ---------- */
.sparkline-wrap {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.section--light .sparkline-wrap { background: var(--paper-card); border-color: var(--border-on-light); }
.sparkline-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.sparkline-title { font-size: 13px; font-weight: 600; color: var(--muted-on-dark); margin-bottom: 4px; }
.section--light .sparkline-title { color: var(--muted-on-light); }
.sparkline-value { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--text-on-dark); line-height: 1; }
.section--light .sparkline-value { color: var(--text-on-light); }
.sparkline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(34, 201, 122, 0.12);
    color: var(--emerald-bright);
}
.sparkline-badge--red { background: rgba(181, 75, 50, 0.12); color: #e07060; }
.sparkline-svg { width: 100%; height: auto; overflow: visible; }
.sparkline-area { fill: url(#sparkGrad); opacity: 0.25; }
.sparkline-path { fill: none; stroke: var(--emerald-bright); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sparkline-path--gold { stroke: var(--gold); }
.sparkline-path--red { stroke: #e07060; }

/* ---------- ANALYTICS WIDGET ---------- */
.analytics-widget {
    background: var(--ink-2);
    border: 1px solid var(--border-on-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg), 0 0 80px rgba(34, 201, 122, 0.04);
}
.analytics-widget__bar {
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-on-dark);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.analytics-widget__dot { width: 10px; height: 10px; border-radius: 50%; }
.analytics-widget__dot:nth-child(1) { background: #ff5f57; }
.analytics-widget__dot:nth-child(2) { background: #febc2e; }
.analytics-widget__dot:nth-child(3) { background: #28c840; }
.analytics-widget__title { font-family: var(--mono); font-size: 11px; color: var(--muted-on-dark); margin-left: 6px; flex: 1; }
.analytics-widget__body { padding: 24px; }
.analytics-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-on-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 24px;
}
.analytics-kpi { background: var(--ink-2); padding: 16px 12px; text-align: center; }
.analytics-kpi__label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-on-dark); margin-bottom: 6px; }
.analytics-kpi__val { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--text-on-dark); }
.analytics-kpi__change { font-family: var(--mono); font-size: 10px; margin-top: 3px; color: var(--emerald-bright); }
.analytics-kpi__change--neg { color: #e07060; }

/* ---------- ROI VISUAL ---------- */
.roi-visual {
    background: var(--ink-2);
    border: 1px solid var(--border-on-dark);
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    text-align: left;
}
.roi-visual::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: var(--emerald-glow);
    filter: blur(60px);
    pointer-events: none;
}
.roi-visual__header { font-family: var(--mono); font-size: 11px; color: var(--muted-on-dark); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 20px; }
.roi-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-on-dark); font-size: 14px; }
.roi-row:last-of-type { border-bottom: none; }
.roi-row__label { color: var(--muted-on-dark); }
.roi-row__val { font-family: var(--mono); font-weight: 700; color: var(--text-on-dark); }
.roi-row__val--green { color: var(--emerald-bright); }
.roi-row__val--gold { color: var(--gold); }
.roi-total { margin-top: 16px; padding: 16px; background: rgba(34, 201, 122, 0.08); border: 1px solid rgba(34, 201, 122, 0.15); border-radius: var(--radius-sm); text-align: center; }
.roi-total__label { font-size: 12px; color: var(--muted-on-dark); margin-bottom: 4px; }
.roi-total__val { font-family: var(--display); font-weight: 900; font-size: 32px; color: var(--emerald-bright); }

/* ---------- DOT GRID ---------- */
.dot-grid {
    position: absolute;
    width: 240px; height: 240px;
    opacity: 0.07;
    pointer-events: none;
    background-image: radial-gradient(circle, var(--emerald-bright) 1px, transparent 1px);
    background-size: 18px 18px;
}

/* ---------- VISUAL SPLIT ---------- */
.visual-split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
@media(max-width:860px) { .visual-split { grid-template-columns: 1fr; gap: 48px; } }
.visual-split__content { text-align: left; }

/* ---------- METRIC PILL ---------- */
.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-on-dark);
    white-space: nowrap;
}
.metric-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-bright); animation: pulse 2s ease-in-out infinite; }
.metric-pill .dot--gold { background: var(--gold); }

/* ---------- VISUAL BADGE ---------- */
.visual-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-on-dark);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.visual-badge__icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.visual-badge__icon--green { background: rgba(34, 201, 122, 0.15); }
.visual-badge__icon--gold { background: rgba(240, 168, 60, 0.15); }
.visual-badges-stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- ICON RING ---------- */
.icon-ring {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    margin: 0 auto 12px;
    position: relative;
}
.icon-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    opacity: 0.2;
}
.icon-ring--emerald { background: var(--emerald-glow); color: var(--emerald-bright); }
.icon-ring--gold { background: var(--gold-glow); color: var(--gold); }

/* ---------- VISUAL STRIP ---------- */
.visual-strip { padding: 60px 0; background: var(--ink-2); overflow: hidden; position: relative; }
.visual-strip::before, .visual-strip::after {
    content: '';
    position: absolute; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-on-dark), transparent);
}
.visual-strip::before { top: 0; }
.visual-strip::after { bottom: 0; }

/* ---------- FLOATING CHART BADGES ---------- */
.chart-badge {
    position: absolute;
    background: rgba(10,15,13,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-on-dark);
    white-space: nowrap;
    z-index: 3;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: floatY 4s ease-in-out infinite;
}
.chart-badge--tl { top: 12%; left: -8%; animation-delay: 0s; }
.chart-badge--br { bottom: 12%; right: -8%; animation-delay: 2s; }
@media(max-width:860px) { .chart-badge { display: none; } }
