:root {
  --bx-bg-primary:       #191A1E;
  --bx-bg-surface:       #313447;
  --bx-accent-purple:    #A183E0;
  --bx-violet-primary:   #4E1FA3;
  --bx-violet-electric:  #661EB9;
  --bx-highlight-yellow: #F5D255;
  --bx-accent-cyan:      #36E7C4;
  --bx-white:            #FFFFFF;
  --bx-text-body:        rgba(210, 218, 235, 0.82);
  --bx-text-secondary:   rgba(214, 220, 235, 0.72);
  --bx-border-card:      rgba(161, 131, 224, 0.18);
  --bx-border-row:       rgba(161, 131, 224, 0.07);
  --bx-grad-text:        linear-gradient(90deg, #36E7C4 0%, #A183E0 50%, #661EB9 100%);
  --bx-grad-primary:     linear-gradient(135deg, #4E1FA3 0%, #661EB9 100%);
  --bx-grad-secondary:   linear-gradient(135deg, #F5D255 0%, #36E7C4 100%);
  --bx-font-primary:     'Exo 2', sans-serif;
  --bx-font-secondary:   'Epilogue', sans-serif;
}

/* ── TABLE WRAPPER ── */
.bx-table-wrap {
  background: rgba(49,52,71,0.32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--bx-border-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 48px rgba(102,30,185,0.13), 0 1px 4px rgba(0,0,0,0.45);
}
.bx-table-wrap::before {
  content: '';
  display: block;
  height: 2px;
  background: var(--bx-grad-secondary);
}

.bx-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.bx-table-wrap--center-outer { display: flex; justify-content: center; }
.bx-table-wrap--auto { display: inline-block; width: auto; min-width: min(100%, 720px); }

/* ── TABLE BASE ── */
.bx-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--bx-font-secondary);
  font-size: 0.875rem;
  table-layout: auto;
}

.bx-table thead tr {
  background: linear-gradient(135deg, rgba(78,31,163,0.55) 0%, rgba(102,30,185,0.45) 100%);
  border-bottom: 1px solid rgba(54,231,196,0.22);
}
.bx-table thead th {
  font-family: var(--bx-font-primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bx-white);
  padding: 18px 24px;
  text-align: left;
  border: none;
  white-space: nowrap;
}
.bx-table thead th:first-child { color: var(--bx-accent-cyan); }

.bx-table tbody tr {
  border-bottom: 1px solid var(--bx-border-row);
  transition: background 0.18s ease;
}
.bx-table tbody tr:last-child { border-bottom: none; }
.bx-table tbody tr:hover { background: rgba(161,131,224,0.055); }
.bx-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.016); }
.bx-table tbody tr:nth-child(even):hover { background: rgba(161,131,224,0.065); }

.bx-table tbody td {
  padding: 14px 24px;
  color: var(--bx-text-body);
  vertical-align: middle;
  border: none;
  line-height: 1.65;
  text-align: left;
}
.bx-table tbody td:first-child {
  font-family: var(--bx-font-primary);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bx-white);
  letter-spacing: 0.02em;
  border-right: 1px solid rgba(161,131,224,0.09);
  white-space: nowrap;
  vertical-align: middle;
}
.bx-table tbody td + td {
  border-left: 1px solid rgba(161,131,224,0.05);
}

/* ── ICON CELL ── */
.bx-cell-icon {
  display: flex;
  align-items: center;
  gap: 11px;
}
.bx-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.bx-icon--cyan {
  background: rgba(54,231,196,0.08);
  border: 1px solid rgba(54,231,196,0.18);
  color: var(--bx-accent-cyan);
}
.bx-icon--purple {
  background: rgba(161,131,224,0.08);
  border: 1px solid rgba(161,131,224,0.18);
  color: var(--bx-accent-purple);
}
.bx-icon--yellow {
  background: rgba(245,210,85,0.08);
  border: 1px solid rgba(245,210,85,0.18);
  color: var(--bx-highlight-yellow);
}
.bx-table tbody tr:hover .bx-icon--cyan  { background: rgba(54,231,196,0.14);  border-color: rgba(54,231,196,0.32); }
.bx-table tbody tr:hover .bx-icon--purple { background: rgba(161,131,224,0.14); border-color: rgba(161,131,224,0.32); }
.bx-table tbody tr:hover .bx-icon--yellow { background: rgba(245,210,85,0.14);  border-color: rgba(245,210,85,0.32); }

/* ── COST VALUE ── */
.bx-cost-val {
  font-family: var(--bx-font-primary);
  font-weight: 800;
  font-size: 0.88rem;
  background: var(--bx-grad-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* ── WEEK BADGE ── */
.bx-week-badge {
  display: inline-block;
  font-family: var(--bx-font-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--bx-accent-cyan);
  background: rgba(54,231,196,0.07);
  border: 1px solid rgba(54,231,196,0.2);
  border-radius: 100px;
  padding: 3px 12px;
  white-space: nowrap;
}

/* ── COMPARISON TABLE col headers ── */
.bx-table--compare thead th:nth-child(2) { color: var(--bx-accent-cyan); }
.bx-table--compare thead th:nth-child(3) { color: var(--bx-accent-purple); }
.bx-table--compare thead th:nth-child(4) { color: var(--bx-highlight-yellow); }
.bx-table--compare thead th:nth-child(5) { color: #f87171; }

/* ── LEVEL BADGES ── */
.bx-badge {
  display: inline-block;
  font-family: var(--bx-font-primary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 100px;
  padding: 2px 10px;
  white-space: nowrap;
}
.bx-badge--high   { background: rgba(54,231,196,0.1);  color: var(--bx-accent-cyan);      border: 1px solid rgba(54,231,196,0.22); }
.bx-badge--med    { background: rgba(161,131,224,0.1); color: var(--bx-accent-purple);    border: 1px solid rgba(161,131,224,0.22); }
.bx-badge--low    { background: rgba(245,210,85,0.08); color: var(--bx-highlight-yellow); border: 1px solid rgba(245,210,85,0.2); }
.bx-badge--vhigh  { background: rgba(102,30,185,0.18); color: #c8a8f5;                    border: 1px solid rgba(102,30,185,0.35); }
.bx-badge--danger { background: rgba(248,113,113,0.1); color: #f87171;                    border: 1px solid rgba(248,113,113,0.22); }

@media (max-width: 767.98px) {
  .bx-table { font-size: 0.78rem; }
  .bx-table thead th,
  .bx-table tbody td { padding: 11px 14px; }
  .bx-table tbody td:first-child { white-space: normal; }
  .bx-icon { width: 26px; height: 26px; }
  .bx-table-wrap--auto { min-width: 0; }
}

/* ── DONUT CHART ── */
.bx-chart-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 24px;
}
.bx-chart-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.bx-donut-container {
  position: relative;
  width: 360px;
  height: 360px;
  flex-shrink: 0;
}
.bx-donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.bx-donut-segment {
  fill: none;
  stroke-width: 48;
  cursor: pointer;
  transition: stroke-width 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s ease;
}
.bx-donut-segment:hover,
.bx-donut-segment.bx-active { stroke-width: 58; }
.bx-donut-segment.bx-dimmed { opacity: 0.22; }
.bx-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 16px;
}
.bx-donut-center__total-label {
  font-family: var(--bx-font-primary);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(161,131,224,0.55);
  margin-bottom: 4px;
}
.bx-donut-center__total {
  font-family: var(--bx-font-primary);
  font-size: 1.7rem;
  font-weight: 900;
  background: linear-gradient(90deg, #36E7C4 0%, #A183E0 50%, #661EB9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 4px;
}
.bx-donut-center__sub {
  font-family: var(--bx-font-secondary);
  font-size: 0.65rem;
  color: rgba(161,131,224,0.5);
  letter-spacing: 0.04em;
}
.bx-donut-center__name {
  font-family: var(--bx-font-primary);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 5px;
}
.bx-donut-center__budget {
  font-family: var(--bx-font-primary);
  font-size: 0.95rem;
  font-weight: 900;
  background: linear-gradient(135deg, #F5D255 0%, #36E7C4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 5px;
}
.bx-donut-center__purpose {
  font-family: var(--bx-font-secondary);
  font-size: 0.68rem;
  line-height: 1.5;
  color: rgba(210,218,235,0.82);
  max-width: 120px;
}

/* Legend */
.bx-chart-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bx-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.bx-legend-item:hover,
.bx-legend-item.bx-active {
  background: rgba(49,52,71,0.6);
  border-color: rgba(161,131,224,0.18);
  transform: translateX(4px);
}
.bx-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
}
.bx-legend-name {
  font-family: var(--bx-font-primary);
  font-size: 0.77rem;
  font-weight: 700;
  color: #fff;
  flex: 1;
  white-space: nowrap;
}
.bx-legend-budget {
  font-family: var(--bx-font-primary);
  font-size: 0.69rem;
  font-weight: 600;
  color: rgba(210,218,235,0.72);
  white-space: nowrap;
}
.bx-legend-pct {
  font-family: var(--bx-font-primary);
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 32px;
  text-align: right;
}

/* Tooltip */
.bx-chart-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(20,18,35,0.96);
  border: 1px solid rgba(161,131,224,0.18);
  border-radius: 12px;
  padding: 12px 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 220px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.bx-chart-tooltip.bx-show { opacity: 1; transform: translateY(0); }
.bx-tt-name {
  font-family: var(--bx-font-primary);
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}
.bx-tt-divider { width: 100%; height: 1px; background: rgba(161,131,224,0.18); margin: 6px 0; }
.bx-tt-purpose {
  font-family: var(--bx-font-secondary);
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(210,218,235,0.82);
  margin-bottom: 6px;
}
.bx-tt-budget {
  font-family: var(--bx-font-primary);
  font-size: 0.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #F5D255 0%, #36E7C4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 767.98px) {
  .bx-chart-layout { grid-template-columns: 1fr; justify-items: center; gap: 24px; }
  .bx-chart-wrap { width: 100%; display: flex; justify-content: center; }
  .bx-donut-container { width: min(100%, 320px); height: min(100%, 320px); max-width: 320px; }
  .bx-chart-legend { width: 100%; max-width: 420px; }
  .bx-legend-item { flex-wrap: wrap; gap: 8px 12px; }
  .bx-legend-name,
  .bx-legend-budget,
  .bx-legend-pct { white-space: normal; }
  .bx-donut-segment { stroke-width: 38; }
}

.bx-table.bx-table--visible-borders {
  border-collapse: collapse;
  border: 1px solid var(--bx-border-card);
}

.bx-table.bx-table--visible-borders th,
.bx-table.bx-table--visible-borders td {
  border: 1px solid var(--bx-border-card);
}

