/* =========================================================================
   Charts & Analytics UI Components
   ========================================================================= */

   
   :root {
    --ch-bg: #0f172a;
    --ch-surface: rgba(30, 41, 59, 0.7);
    --ch-border: rgba(148, 163, 184, 0.1);
    --ch-text: #f8fafc;
    --ch-text-dim: #94a3b8;
    
    --ch-cyan: #06b6d4;
    --ch-cyan-glow: rgba(6, 182, 212, 0.3);
    
    --ch-purple: #8b5cf6;
    --ch-purple-glow: rgba(139, 92, 246, 0.3);
    
    --ch-pink: #ec4899;
    --ch-green: #10b981;
    --ch-orange: #f59e0b;
}

body.dark-mode {
    --ch-bg: #0f172a;
}

/* Base Styles */
.charts-wrapper {
    background-color: var(--ch-bg);
    color: var(--ch-text);
    font-family: 'DM Sans', sans-serif;
    padding: 2rem;
    min-height: 100vh;
}

.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 100%;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chart-card {
    background: var(--ch-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--ch-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
    max-height: 300px;
}

.component-card {
    background: var(--ch-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--ch-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ch-text);
    margin: 0;
}

.chart-subtitle {
    font-size: 0.85rem;
    color: var(--ch-text-dim);
    margin-top: 0.25rem;
}

.chart-actions button {
    background: transparent;
    border: none;
    color: var(--ch-text-dim);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.chart-actions button:hover {
    color: var(--ch-text);
}

.preview-box {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
    max-height: 250px;
    overflow-y: auto;
    min-height: 120px;
}

/* =========================================================
   1. Analytics Dashboard Cards (Stat Cards)
   ========================================================= */
.stat-card-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .stat-card-container {
        grid-template-columns: 1fr;
    }
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--ch-border);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    margin: 0.5rem 0;
}

.stat-change {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive { color: var(--ch-green); }
.stat-change.negative { color: var(--ch-pink); }

.mini-sparkline {
    width: 100%;
    height: 30px;
    margin-top: 0.5rem;
}

/* =========================================================
   2. Modern Bar Chart
   ========================================================= */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 180px;
    padding-bottom: 20px;
    position: relative;
    border-bottom: 1px solid var(--ch-border);
}

.bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    position: relative;
}

.bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--ch-purple) 0%, rgba(139, 92, 246, 0.2) 100%);
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    position: relative;
}

.bar:hover {
    background: linear-gradient(180deg, var(--ch-cyan) 0%, rgba(6, 182, 212, 0.2) 100%);
    box-shadow: 0 0 15px var(--ch-cyan-glow);
}

.bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.75rem;
    color: var(--ch-text-dim);
}

.bar-tooltip {
    position: absolute;
    top: -35px;
    background: #1e293b;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s;
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
}

.bar:hover .bar-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   3. Pie / Donut Chart (Conic Gradient)
   ========================================================= */
.donut-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 200px;
}

.donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    /* The segments will be set via inline styles */
    background: conic-gradient(
        var(--ch-purple) 0% 45%,
        var(--ch-cyan) 45% 75%,
        var(--ch-pink) 75% 90%,
        var(--ch-orange) 90% 100%
    );
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.donut-chart:hover {
    transform: scale(1.05);
}

.donut-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110px;
    height: 110px;
    background: var(--ch-bg);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.donut-total {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
}

.donut-label {
    font-size: 0.7rem;
    color: var(--ch-text-dim);
}

.donut-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--ch-text-dim);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* =========================================================
   4. Progress Analytics Graph
   ========================================================= */
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.progress-item {
    width: 100%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { left: 200%; }
}

/* =========================================================
   5. Activity Tracking Graph (Heatmap)
   ========================================================= */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-top: 1rem;
}

.heatmap-cell {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    cursor: crosshair;
    transition: transform 0.2s, background 0.2s;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 2;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.heatmap-cell[data-level="1"] { background: rgba(6, 182, 212, 0.2); }
.heatmap-cell[data-level="2"] { background: rgba(6, 182, 212, 0.5); }
.heatmap-cell[data-level="3"] { background: rgba(6, 182, 212, 0.8); }
.heatmap-cell[data-level="4"] { background: var(--ch-cyan); box-shadow: 0 0 8px var(--ch-cyan-glow); }

/* =========================================================
   11. Revenue Split Bars
   ========================================================= */
.split-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.split-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.split-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 0.75rem;
}

.split-label,
.split-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ch-text-dim);
}

.split-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.split-fill {
    height: 100%;
    border-radius: inherit;
}

.split-cyan { background: linear-gradient(90deg, var(--ch-cyan), rgba(6, 182, 212, 0.35)); }
.split-purple { background: linear-gradient(90deg, var(--ch-purple), rgba(139, 92, 246, 0.35)); }
.split-green { background: linear-gradient(90deg, var(--ch-green), rgba(16, 185, 129, 0.35)); }
.split-orange { background: linear-gradient(90deg, var(--ch-orange), rgba(245, 158, 11, 0.35)); }

/* =========================================================
   12. Circular KPI Gauge
   ========================================================= */
.gauge-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.gauge-ring {
    width: 156px;
    height: 156px;
    padding: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.gauge-center {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.gauge-value {
    font-family: 'Syne', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--ch-text);
}

.gauge-label {
    font-size: 0.78rem;
    color: var(--ch-text-dim);
    font-weight: 600;
}

.gauge-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ch-text-dim);
    font-size: 0.82rem;
    margin-top: auto;
}

/* =========================================================
   13. Dual Trend Comparison
   ========================================================= */
.comparison-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.comparison-svg {
    width: 100%;
    height: 150px;
    overflow: visible;
}

.comparison-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--ch-text-dim);
}

.comparison-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.legend-swatch.cyan { background: var(--ch-cyan); }
.legend-swatch.purple { background: var(--ch-purple); }

/* =========================================================
   14. Funnel Conversion Flow
   ========================================================= */
.funnel-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.funnel-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.funnel-step {
    width: 100%;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.step-1 { width: 100%; background: linear-gradient(90deg, rgba(6, 182, 212, 0.95), rgba(6, 182, 212, 0.55)); }
.step-2 { width: 86%; background: linear-gradient(90deg, rgba(139, 92, 246, 0.95), rgba(139, 92, 246, 0.55)); }
.step-3 { width: 70%; background: linear-gradient(90deg, rgba(16, 185, 129, 0.95), rgba(16, 185, 129, 0.55)); }
.step-4 { width: 54%; background: linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(245, 158, 11, 0.55)); }

/* =========================================================
   15. Bubble Insight Matrix
   ========================================================= */
.bubble-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bubble-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: center;
    justify-items: center;
    min-height: 160px;
}

.bubble-node {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bubble-node.size-sm { width: 44px; height: 44px; font-size: 0.78rem; }
.bubble-node.size-md { width: 60px; height: 60px; font-size: 0.9rem; }
.bubble-node.size-lg { width: 78px; height: 78px; font-size: 1rem; }

.bubble-node.cyan { background: linear-gradient(135deg, var(--ch-cyan), rgba(6, 182, 212, 0.55)); }
.bubble-node.purple { background: linear-gradient(135deg, var(--ch-purple), rgba(139, 92, 246, 0.55)); }
.bubble-node.green { background: linear-gradient(135deg, var(--ch-green), rgba(16, 185, 129, 0.55)); }
.bubble-node.orange { background: linear-gradient(135deg, var(--ch-orange), rgba(245, 158, 11, 0.55)); }
.bubble-node.pink { background: linear-gradient(135deg, var(--ch-pink), rgba(236, 72, 153, 0.55)); }

/* SVG Line Chart styling inside Activity Graph */
.svg-line-chart {
    width: 100%;
    height: 120px;
    overflow: visible;
}

.svg-line {
    fill: none;
    stroke: var(--ch-pink);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0px 4px 6px rgba(236, 72, 153, 0.4));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s forwards ease-out;
}

.svg-area {
    fill: url(#pinkGradient);
    opacity: 0;
    animation: fadeIn 1s 1s forwards;
}

.svg-point {
    fill: var(--ch-bg);
    stroke: var(--ch-pink);
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s, fill 0.2s;
}

.svg-point:hover {
    r: 6;
    fill: var(--ch-pink);
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
    to { opacity: 0.5; }
}
/* ===== Chart Card Base ===== */
.chart-card {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.chart-header {
  margin-bottom: 1rem;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.chart-subtitle {
  font-size: 0.85rem;
  color: #666;
  margin: 0.25rem 0 0;
}

/* ===== Bar Chart Styles ===== */
.bar-grid {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.bar-node {
  width: 50px;
  border-radius: 6px;
  text-align: center;
  color: #fff;
  font-weight: 500;
  padding-top: 6px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bar-node:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Size Variants */
.bar-lg { height: 160px; }
.bar-md { height: 120px; }
.bar-sm { height: 80px; }

/* Color Variants with Gradients */
.red {
  background: linear-gradient(180deg,#ff5252,#d32f2f);
}
.blue {
  background: linear-gradient(180deg,#42a5f5,#1e88e5);
}
.green {
  background: linear-gradient(180deg,#66bb6a,#388e3c);
}
.orange {
  background: linear-gradient(180deg,#ffb74d,#f57c00);
}
.purple {
  background: linear-gradient(180deg,#ab47bc,#6a1b9a);
}
.cyan {
  background: linear-gradient(180deg,#26c6da,#00838f);
}
.pink {
  background: linear-gradient(180deg,#ec407a,#c2185b);
}

/* ===== Bubble Chart (reuse from component-15 style) ===== */
.bubble-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.bubble-node {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bubble-node:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Bubble Sizes */
.size-lg { width: 80px; height: 80px; }
.size-md { width: 60px; height: 60px; }
.size-sm { width: 40px; height: 40px; }
/* ===== 32. Line Chart ===== */
.line-chart {
  width: 100%;
  height: 150px;
}
.line-chart polyline {
  fill: none;
  stroke: #4caf50;
  stroke-width: 3;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: lineDraw 3s forwards;
}
@keyframes lineDraw {
  to { stroke-dashoffset: 0; }
}

/* ===== 33. Pie Chart ===== */
.pie-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#f44336 0% 40%, #2196f3 40% 70%, #ffeb3b 70% 100%);
  margin: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ===== 34. Donut Chart ===== */
.donut-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#673ab7 0% 60%, #03a9f4 60% 100%);
  mask: radial-gradient(circle, transparent 60%, black 61%);
  margin: auto;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

/* ===== 35. Radar Chart ===== */
.radar-chart {
  width: 200px;
  height: 200px;
}
.radar-chart polygon {
  fill: rgba(255,87,34,0.4);
  stroke: #ff5722;
  stroke-width: 2;
  transition: fill 0.3s ease;
}
.radar-chart polygon:hover {
  fill: rgba(255,87,34,0.6);
}

/* ===== 36. Progress Circle ===== */
.progress-circle {
  width: 100px;
  height: 100px;
}
.progress-circle circle {
  fill: none;
  stroke: #009688;
  stroke-width: 10;
  stroke-dasharray: 283;
  stroke-dashoffset: 85;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s ease;
}

/* ===== 37. Heatmap Grid ===== */
.heatmap {
  display: grid;
  grid-template-columns: repeat(4, 40px);
  gap: 5px;
  margin: auto;
}
.heatmap div {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--color);
  transition: transform 0.3s ease;
}
.heatmap div:hover {
  transform: scale(1.1);
}

/* ===== 38. Area Chart ===== */
.area-chart {
  width: 100%;
  height: 150px;
}
.area-chart polygon {
  fill: rgba(33,150,243,0.4);
  stroke: #2196f3;
  stroke-width: 2;
  transition: fill 0.3s ease;
}
.area-chart polygon:hover {
  fill: rgba(33,150,243,0.6);
}

/* ===== 39. Gauge Chart ===== */
.gauge {
  width: 120px;
  height: 60px;
  border-radius: 120px 120px 0 0;
  background: conic-gradient(#4caf50 0 120deg, #f44336 120deg 180deg);
  position: relative;
  margin: auto;
}
.gauge .needle {
  width: 2px;
  height: 60px;
  background: #000;
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: rotate(60deg);
  transform-origin: bottom;
  transition: transform 0.5s ease;
}

/* ===== 40. Bubble Variations ===== */
.bubble-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.bubble-node {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bubble-node:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
/* Bubble Sizes */
.size-lg { width: 80px; height: 80px; }
.size-md { width: 60px; height: 60px; }
.size-sm { width: 40px; height: 40px; }
/* Bubble Colors */
.cyan { background: linear-gradient(135deg,#26c6da,#00838f); }
.purple { background: linear-gradient(135deg,#ab47bc,#6a1b9a); }
.green { background: linear-gradient(135deg,#66bb6a,#388e3c); }
.orange { background: linear-gradient(135deg,#ffb74d,#f57c00); }
.pink { background: linear-gradient(135deg,#ec407a,#c2185b); }
.stacked-bar {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  color: #fff;
  font-weight: 500;
}
.segment {
  text-align: center;
  padding: 6px 0;
}
.polar-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#ff9800 0% 25%, #2196f3 25% 50%, #4caf50 50% 75%, #e91e63 75% 100%);
  margin: auto;
}
.sparkline polyline {
  fill: none;
  stroke: #03a9f4;
  stroke-width: 2;
}
.funnel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.funnel-step {
  text-align: center;
  color: #fff;
  padding: 8px;
  border-radius: 4px;
}
.step1 { width: 200px; background:#2196f3; }
.step2 { width: 150px; background:#4caf50; }
.step3 { width: 100px; background:#f44336; }

/* Container for displaying the component source code */
.code-snippet {
    display: none;
    background: #0f172a;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--ch-border);
    margin-top: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    font-family: monospace;
}

.code-snippet.show {
    display: block;
}

.code-snippet pre {
    margin: 0;
    color: #e2e8f0;
}

/* =========================================================================
   Layout & Global Theme Overrides (Resolve style.css conflicts)
   ========================================================================= */
:root {
    --sidebar-w: 240px;
    --sidebar-width: 240px;
}

html, body {
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    width: 100% !important;
}

.sidebar {
    width: var(--sidebar-w) !important;
}

.navbar {
    left: var(--sidebar-w) !important;
    width: calc(100% - var(--sidebar-w)) !important;
}

.main-home {
    margin-left: var(--sidebar-w) !important;
    width: calc(100% - var(--sidebar-w)) !important;
    padding: 40px !important;
    box-sizing: border-box !important;
    margin-top: 80px !important;
}

/* Fix global style.css dark-mode component-card lavender/purple override */
body.dark-mode .component-card,
.dark-mode .component-card {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.1) !important;
}

body.dark-mode .component-card .card-header h3,
.dark-mode .component-card .card-header h3 {
    color: #f8fafc !important;
}

body.dark-mode .component-card .card-header p,
.dark-mode .component-card .card-header p,
body.dark-mode .component-card .card-desc,
.dark-mode .component-card .card-desc {
    color: #94a3b8 !important;
}

/* Responsive adjustment */
@media (max-width: 1024px) {
    .component-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-home {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 20px !important;
    }
    .navbar {
        left: 0 !important;
        width: 100% !important;
    }
    .component-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .component-card {
        padding: 1.25rem;
    }
    .preview-box {
        max-height: 200px;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .component-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .component-card {
        padding: 1rem;
    }
    .preview-box {
        max-height: 150px;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    .card-header h3 {
        font-size: 1rem;
    }

    .split-row {
        grid-template-columns: 58px minmax(0, 1fr) 34px;
        gap: 0.5rem;
    }

    .gauge-ring {
        width: 138px;
        height: 138px;
    }

    .bubble-grid {
        gap: 10px;
        min-height: 140px;
    }
}

/* =========================================================
   6. Interactive Area Chart
   ========================================================= */
.interactive-area-chart {
    position: relative;
    overflow: visible;
}

.area-svg {
    width: 100%;
    height: 160px;
    overflow: visible;
}

.area-fill-path {
    transition: all 0.3s ease;
}

.area-line-path {
    filter: drop-shadow(0px 6px 12px rgba(6, 182, 212, 0.4));
}

.marker-line {
    position: absolute;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 1px;
    border-left: 1.5px dashed rgba(6, 182, 212, 0.45);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, left 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 5;
}

.area-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: #fff;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, left 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), top 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.tooltip-time {
    color: var(--ch-text-dim);
    font-weight: 500;
}

.tooltip-val {
    color: var(--ch-cyan);
    font-weight: 700;
    margin-top: 2px;
}

.tracker-node {
    fill: #0f172a;
    stroke: var(--ch-cyan);
    stroke-width: 2.5px;
    cursor: pointer;
    transition: r 0.2s, fill 0.2s;
}

.tracker-node:hover, .tracker-node.active {
    r: 7;
    fill: var(--ch-cyan);
}

/* =========================================================
   7. Glassmorphism Pie Chart
   ========================================================= */
.glass-pie-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pie-container {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-pie {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--ch-purple) 0% 45%,
        var(--ch-cyan) 45% 75%,
        var(--ch-pink) 75% 90%,
        var(--ch-orange) 90% 100%
    );
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.glass-pie-center {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

#pie-center-value {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    color: #fff;
}

#pie-center-label {
    font-size: 0.65rem;
    color: var(--ch-text-dim);
    font-weight: 500;
}

.glass-pie-legend {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pie-legend-tag {
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--ch-text-dim);
    transition: all 0.3s ease;
}

.pie-legend-tag:hover, .pie-legend-tag.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-width: 1.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* =========================================================
   8. Animated Radar Chart
   ========================================================= */
.radar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-selectors {
    display: flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.4);
    padding: 3px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--ch-border);
}

.profile-tab {
    background: transparent;
    border: none;
    color: var(--ch-text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.profile-tab.active {
    background: var(--ch-purple);
    color: #fff;
    box-shadow: 0 2px 8px var(--ch-purple-glow);
}

.radar-svg {
    width: 100%;
    max-width: 170px;
    height: auto;
    overflow: visible;
}

.radar-grid-bg {
    fill: rgba(255, 255, 255, 0.015);
    stroke: rgba(148, 163, 184, 0.15);
    stroke-width: 1px;
}

.radar-axis {
    stroke: rgba(148, 163, 184, 0.12);
    stroke-width: 1px;
    stroke-dasharray: 2 2;
}

.radar-poly {
    fill: rgba(139, 92, 246, 0.35);
    stroke: var(--ch-purple);
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 8px var(--ch-purple-glow));
    transition: points 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.radar-label {
    fill: var(--ch-text-dim);
    font-size: 8px;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    letter-spacing: 0.5px;
}

/* =========================================================
   9. Real-Time Analytics Graph
   ========================================================= */
.real-time-card {
    display: flex;
    flex-direction: column;
}

.real-time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.live-dot-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--ch-purple);
    letter-spacing: 1px;
    background: rgba(139, 92, 246, 0.12);
    padding: 3px 8px;
    border-radius: 99px;
}

.live-pulse {
    width: 6px;
    height: 6px;
    background: var(--ch-purple);
    border-radius: 50%;
    animation: livePulse 1.2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(139, 92, 246, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.real-time-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Syne', sans-serif;
}

.real-time-svg {
    width: 100%;
    height: 100px;
    overflow: visible;
}

.rt-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0px 3px 6px var(--ch-purple-glow));
    transition: d 0.15s linear;
}

.rt-area {
    transition: d 0.15s linear;
}

/* =========================================================
   10. Heatmap Activity Grid
   ========================================================= */
.annual-heatmap-card {
    display: flex;
    flex-direction: column;
}

.heatmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--ch-text-dim);
    margin-bottom: 12px;
}

.heatmap-key {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
}

.key-cell {
    width: 8px;
    height: 8px;
    border-radius: 1.5px;
}

.key-cell.level-0 { background: rgba(255,255,255,0.04); }
.key-cell.level-1 { background: rgba(6, 182, 212, 0.2); }
.key-cell.level-2 { background: rgba(6, 182, 212, 0.45); }
.key-cell.level-3 { background: rgba(6, 182, 212, 0.7); }
.key-cell.level-4 { background: var(--ch-cyan); }

.annual-grid {
    display: grid;
    grid-template-columns: repeat(52, 1fr);
    grid-auto-rows: 1fr;
    gap: 3px;
    margin-bottom: 12px;
    width: 100%;
}

.annual-cell {
    aspect-ratio: 1;
    border-radius: 1.5px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.annual-cell:hover {
    transform: scale(1.3);
    z-index: 5;
    box-shadow: 0 0 6px var(--ch-cyan-glow);
}

.annual-cell[data-level="1"] { background: rgba(6, 182, 212, 0.2); }
.annual-cell[data-level="2"] { background: rgba(6, 182, 212, 0.45); }
.annual-cell[data-level="3"] { background: rgba(6, 182, 212, 0.7); }
.annual-cell[data-level="4"] { background: var(--ch-cyan); }

.heatmap-detail-card {
    font-size: 0.75rem;
    color: var(--ch-text-dim);
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--ch-border);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* ===============================
   11. Candlestick Chart

.candlestick-chart{
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:1rem;
  height:220px;
  padding-top:2rem;
}

.candle{
  width:24px;
  border-radius:8px;
  position:relative;
  animation:floatUp .8s ease;
}

.candle .wick{
  position:absolute;
  width:2px;
  background:white;
  left:50%;
  transform:translateX(-50%);
  top:-25px;
  height:140%;
  opacity:.5;
}

.candle.positive{
  background:linear-gradient(180deg,#10b981,#34d399);
}

.candle.negative{
  background:linear-gradient(180deg,#ef4444,#f87171);
}

/* ===============================
   12. Radial KPI Ring

.radial-card{
  display:flex;
  align-items:center;
  justify-content:center;
}

.radial-progress{
  position:relative;
  width:180px;
  height:180px;
}

.radial-progress svg{
  width:100%;
  height:100%;
  transform:rotate(-90deg);
}

.ring-bg{
  fill:none;
  stroke:rgba(255,255,255,.08);
  stroke-width:10;
}

.ring-progress{
  fill:none;
  stroke:var(--ch-cyan);
  stroke-width:10;
  stroke-linecap:round;
}

.radial-center{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
}

.radial-center h2{
  font-size:2rem;
}

/* ===============================
   13. Floating Wave

.wave-card{
  overflow:hidden;
  position:relative;
  min-height:220px;
}

.wave-top{
  position:absolute;
  z-index:2;
  top:2rem;
  left:2rem;
}

.wave-svg{
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
}

.wave-path{
  fill:rgba(6,182,212,.35);
  animation:waveMove 6s linear infinite;
}

/* ===============================
   14. Neon Timeline

.neon-timeline-card{
  position:relative;
  display:flex;
  justify-content:space-between;
  align-items:center;
  min-height:160px;
  padding:2rem;
}

.timeline-line{
  position:absolute;
  left:5%;
  right:5%;
  height:4px;
  background:linear-gradient(90deg,
    var(--ch-purple),
    var(--ch-cyan));
  top:50%;
  transform:translateY(-50%);
}

.timeline-node{
  width:60px;
  height:60px;
  border-radius:50%;
  background:#181818;
  border:2px solid rgba(255,255,255,.1);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  z-index:2;
  transition:.4s;
}

.timeline-node.active{
  border-color:var(--ch-cyan);
  box-shadow:0 0 20px rgba(6,182,212,.7);
}

/* ===============================
   15. Split Revenue Chart

.split-chart-card{
  display:flex;
  justify-content:center;
  align-items:flex-end;
  gap:2rem;
  min-height:260px;
}

.split-bar-group{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1rem;
}

.split-bars{
  display:flex;
  align-items:flex-end;
  gap:.5rem;
}

.split-bar{
  width:26px;
  border-radius:12px 12px 0 0;
}

.split-bar.purple{
  background:linear-gradient(180deg,
  #8b5cf6,
  #6d28d9);
}

.split-bar.cyan{
  background:linear-gradient(180deg,
  #06b6d4,
  #0891b2);
}

/* ===============================
   Animations

@keyframes waveMove{
  0%{
    transform:translateX(0);
  }
  100%{
    transform:translateX(-20px);
  }
}

@keyframes floatUp{
  from{
    opacity:0;
    transform:translateY(20px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* =========================
   16. Stacked Area Chart
.stacked-area-card {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.stacked-area-svg {
  width: 100%;
  height: 160px;
  display: block;
  filter: drop-shadow(0 10px 25px rgba(0,0,0,0.4));
}

/* =========================
   17. Gauge Chart
.gauge-card {
  position: relative;
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.gauge-svg {
  width: 180px;
  height: 120px;
}

.gauge-center {
  position: absolute;
  bottom: 40px;
  text-align: center;
}

.gauge-center h2 {
  font-size: 2rem;
  color: var(--ch-green);
  margin: 0;
}

/* =========================
   18. Multi Ring KPI
.multi-ring-card {
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.multi-ring-card svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.multi-ring-card .ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 8;
}

.multi-ring-card .ring-progress {
  fill: none;
  stroke: var(--ch-purple);
  stroke-width: 8;
  stroke-linecap: round;
  transition: 0.5s ease;
}

.multi-ring-card .ring-progress.alt {
  stroke: var(--ch-cyan);
}

/* Center text */
.multi-ring-card .radial-center {
  position: absolute;
  text-align: center;
}

.multi-ring-card .radial-center h2 {
  margin: 0;
  font-size: 1.3rem;
}

/* =========================
   19. Benchmark Bars
.benchmark-card {
  padding: 10px;
}

.bench-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  gap: 10px;
}

.bench-row span {
  width: 70px;
  font-size: 0.85rem;
  color: #bbb;
}

.bench-bar {
  flex: 1;
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.bench-bar div {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--ch-purple), var(--ch-cyan));
  transition: width 0.6s ease;
}

/* =========================
   20. Calendar Heatmap
.calendar-heatmap-card {
  padding: 15px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  transition: 0.3s ease;
}

.day.low { background: rgba(6,182,212,0.15); }
.day.mid { background: rgba(6,182,212,0.35); }
.day.high { background: rgba(139,92,246,0.5); }
.day.max { background: rgba(236,72,153,0.7); }

.day:hover {
  transform: scale(1.1);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(139,92,246,0.5);
/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  background: #080808;
  color: #aaa;
  margin-top: 60px;
  overflow: hidden;
  z-index: 1;
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 2fr;
  gap: 50px;
  padding: 70px 60px 45px;
  align-items: flex-start;
}

/* Brand Section */
.footer-logo {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 18px;
}

.footer-col p {
  font-size: 15px;
  line-height: 1.8;
  color: #9a9a9a;
  margin-bottom: 20px;
  max-width: 320px;
}

/* Headings */
.footer-col h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Links */
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  position: relative;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
  display: inline-block;
}

/* Hover Animation */
.footer-col ul li a:hover {
  color: #ff7a3d;  
  transform: translateX(6px);
}

/* Animated Underline */
.footer-col ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: #ff7a3d;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.footer-col ul li a:hover::after {
  width: 100%;
}

/* Social Icons */
.socials {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #161616;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b5b5b5;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

/* Hover Animation */
.socials a:hover {
  background: #ff7a3d;
  color: #fff;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 18px rgba(255, 102, 0, 0.35);
}

/* Glow Effect */
.socials a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  transform: scale(0);
  transition: transform 0.35s ease;
}

.socials a:hover::before {
  transform: scale(1.6);
}


/* Newsletter */
.newsletter p {
  margin-bottom: 18px;
}

.newsletter-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.newsletter-form input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  background: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  min-width: 220px;
}

.newsletter-form input:focus {
  border-color: var(--accent);
}

.newsletter-form button {
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: #d45c28;
}

/* Bottom Bar */
.footer-bottom {
  border-top: 1px solid #1c1c1c;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: #aaa;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1200px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .newsletter {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .footer {
    margin-left: 0;
    width: 100%;
  }

  .footer-container {
    grid-template-columns: 1fr;
    padding: 50px 24px 35px;
    gap: 35px;
  }

  .newsletter {
    grid-column: span 1;
  }

  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-form button {
    width: 100%;
  }

  .footer-col p {
    max-width: 100%;
  }
}