* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  --bg: #0c1017;
  --bg2: #141a24;
  --card: rgba(20, 26, 36, .85);
  --border: rgba(124, 131, 255, .18);
  --t1: #f8fafc;
  --t2: #b0bec5;
  --t3: #78909c;
  --a1: #7c83ff;
  --a2: #a78bfa;
  --a3: #22d3ee;
  --a4: #fb923c;
  --a5: #34d399;
  --g1: linear-gradient(135deg, #7c83ff, #a5b4fc);
  --g2: linear-gradient(135deg, #22d3ee, #34d399);
  --g3: linear-gradient(135deg, #fb923c, #f87171);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  overflow-x: hidden
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, .07)0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, .05)0%, transparent 50%), radial-gradient(ellipse at 60% 80%, rgba(6, 182, 212, .04)0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bp 8s ease-in-out infinite alternate
}

@keyframes bp {
  0% {
    opacity: .5
  }

  100% {
    opacity: 1
  }
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 36px
}

.header {
  text-align: center;
  margin-bottom: 36px;
  animation: fd .8s ease-out
}

@keyframes fd {
  from {
    opacity: 0;
    transform: translateY(-30px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes fu {
  from {
    opacity: 0;
    transform: translateY(24px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #a5b4fc, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: -.5px
}

.header p {
  color: var(--t2);
  font-size: .95rem;
  font-weight: 300
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--t1);
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fu .7s ease-out both
}

.section-title small {
  color: var(--t3);
  font-weight: 400;
  font-size: .8rem
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--a1);
  display: inline-block
}

.dot2 {
  background: var(--a3)
}

.dot3 {
  background: var(--a4)
}

.dot4 {
  background: var(--a5)
}

.dot5 {
  background: var(--a2)
}

/* KPI Cards */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  animation: fu .8s ease-out .2s both
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  transition: all .35s ease
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  transition: opacity .3s
}

.kpi-card:nth-child(1)::before {
  background: var(--g1)
}

.kpi-card:nth-child(2)::before {
  background: var(--g2)
}

.kpi-card:nth-child(3)::before {
  background: var(--g3)
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, .35);
  box-shadow: 0 8px 32px rgba(99, 102, 241, .12)
}

.kpi-card:hover::before {
  opacity: 1
}

.kpi-label {
  font-size: .82rem;
  color: var(--t3);
  font-weight: 500;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px
}

.kpi-brands {
  display: flex;
  flex-direction: column;
  gap: 10px
}

.kpi-brand {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.kpi-brand-name {
  font-size: .88rem;
  color: var(--t2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px
}

.kpi-brand-name .bdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block
}

.kpi-val {
  font-size: 1.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums
}

.kpi-val.up {
  color: #34d399
}

.kpi-val.down {
  color: #f87171
}

.kpi-val.flat {
  color: var(--a4)
}

.kpi-arrow {
  font-size: .85rem;
  margin-right: 2px
}

/* Chart */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 8px;
  backdrop-filter: blur(20px);
  transition: all .4s ease;
  animation: fu .8s ease-out both;
  position: relative;
  overflow: hidden
}

.chart-card:hover {
  border-color: rgba(99, 102, 241, .35);
  box-shadow: 0 4px 28px rgba(99, 102, 241, .1);
  transform: translateY(-2px)
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px
}

.chart-title {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px
}

.icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem
}

.icon-1 {
  background: rgba(99, 102, 241, .15)
}

.icon-2 {
  background: rgba(6, 182, 212, .15)
}

.brand-filter {
  display: flex;
  gap: 6px
}

.brand-btn {
  background: rgba(30, 41, 59, .6);
  border: 1px solid rgba(99, 102, 241, .2);
  color: var(--t2);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: .8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all .25s
}

.brand-btn:hover {
  border-color: var(--a1);
  color: var(--t1)
}

.brand-btn.active {
  background: var(--g1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, .3)
}

.chart-container {
  width: 100%;
  height: 420px
}

/* Sales Cards */
.sales-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  animation: fu .8s ease-out .3s both
}

.sale-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: all .4s cubic-bezier(.25, .46, .45, .94);
  position: relative
}

.sale-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: .8;
  transition: opacity .3s, height .3s
}

.sale-card:nth-child(1)::before {
  background: linear-gradient(90deg, #7c83ff, #a5b4fc)
}

.sale-card:nth-child(2)::before {
  background: linear-gradient(90deg, #22d3ee, #34d399)
}

.sale-card:nth-child(3)::before {
  background: linear-gradient(90deg, #fb923c, #fbbf24)
}

.sale-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(99, 102, 241, .12);
  border-color: rgba(99, 102, 241, .35)
}

.sale-card:hover::before {
  opacity: 1;
  height: 4px
}

.sale-card-head {
  padding: 20px 26px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(99, 102, 241, .1)
}

.sale-brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor
}

.sale-brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.2px
}

.sale-card-body {
  padding: 20px 26px 24px
}

.sale-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(99, 102, 241, .07)
}

.sale-row:last-child {
  border: none;
  padding-bottom: 0
}

.sale-metric {
  font-size: .88rem;
  color: var(--t3);
  font-weight: 600;
  white-space: nowrap
}

.sale-vals {
  display: contents
}

.sale-val {
  color: var(--t2);
  text-align: right;
  white-space: nowrap;
  font-size: .88rem;
  font-variant-numeric: tabular-nums
}

.sale-val strong {
  color: var(--t1);
  font-weight: 700;
  font-size: .92rem
}

.sale-growth {
  font-weight: 700;
  font-size: .78rem;
  padding: 3px 8px;
  border-radius: 20px;
  min-width: 68px;
  text-align: center;
  font-variant-numeric: tabular-nums
}

.sale-growth.up {
  background: rgba(52, 211, 153, .12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, .2)
}

.sale-growth.down {
  background: rgba(248, 113, 113, .12);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, .2)
}

.sale-growth.flat {
  background: rgba(251, 191, 36, .1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, .2)
}

/* Quality Tables */
.quality-tables {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fu .8s ease-out .3s both
}

.quality-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(24px);
  transition: all .4s cubic-bezier(.25, .46, .45, .94);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .15)
}

.quality-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  opacity: .9;
  transition: height .3s, opacity .3s
}

.quality-card:nth-child(1)::before {
  background: linear-gradient(90deg, #7c83ff, #a5b4fc, #c4b5fd)
}

.quality-card:nth-child(2)::before {
  background: linear-gradient(90deg, #22d3ee, #34d399, #6ee7b7)
}

.quality-card:nth-child(3)::before {
  background: linear-gradient(90deg, #fb923c, #f97316, #fbbf24)
}

.quality-card::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  height: 80px;
  pointer-events: none;
  opacity: .4
}

.quality-card:nth-child(1)::after {
  background: linear-gradient(180deg, rgba(124, 131, 255, .08), transparent)
}

.quality-card:nth-child(2)::after {
  background: linear-gradient(180deg, rgba(34, 211, 238, .08), transparent)
}

.quality-card:nth-child(3)::after {
  background: linear-gradient(180deg, rgba(251, 146, 60, .08), transparent)
}

.quality-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(99, 102, 241, .12), 0 4px 12px rgba(0, 0, 0, .2);
  border-color: rgba(99, 102, 241, .4)
}

.quality-card:hover::before {
  height: 5px;
  opacity: 1
}

.quality-card-head {
  padding: 22px 30px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(99, 102, 241, .1);
  position: relative;
  z-index: 1
}

.quality-summary {
  margin-left: auto;
  font-size: .88rem;
  color: var(--t2);
  font-weight: 500;
  padding: 6px 14px;
  background: rgba(99, 102, 241, .06);
  border: 1px solid rgba(99, 102, 241, .12);
  border-radius: 20px
}

.quality-summary strong {
  color: var(--t1);
  font-weight: 700;
  font-size: .95rem
}

.quality-card-body {
  padding: 8px 30px 28px;
  overflow-x: auto;
  position: relative;
  z-index: 1
}

.quality-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
  font-variant-numeric: tabular-nums
}

.quality-table thead th {
  color: var(--t3);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 14px 16px;
  text-align: center;
  background: rgba(99, 102, 241, .04);
  border-bottom: 2px solid rgba(99, 102, 241, .1);
  white-space: nowrap
}

.quality-table thead th:first-child {
  text-align: left;
  border-radius: 10px 0 0 0
}

.quality-table thead th:last-child {
  text-align: left;
  border-radius: 0 10px 0 0
}

.quality-table tbody td {
  padding: 13px 16px;
  color: var(--t2);
  border-bottom: 1px solid rgba(99, 102, 241, .05);
  text-align: center;
  transition: background .2s
}

.quality-table tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--t1);
  font-size: .85rem
}

.quality-table tbody td:last-child {
  text-align: left;
  max-width: 320px;
  color: var(--t3);
  font-size: .82rem;
  white-space: normal;
  line-height: 1.5
}

.quality-table tbody td:nth-child(4) {
  font-weight: 600;
  color: var(--a5)
}

.quality-table tbody tr {
  transition: all .2s
}

.quality-table tbody tr:nth-child(even) {
  background: rgba(99, 102, 241, .02)
}

.quality-table tbody tr:hover {
  background: rgba(99, 102, 241, .06)
}

.quality-table tbody tr:hover td:first-child {
  color: var(--a1)
}

.quality-table tbody tr.total-row {
  background: rgba(99, 102, 241, .08)
}

.quality-table tbody tr.total-row td {
  font-weight: 700;
  color: var(--t1);
  border-bottom: none;
  padding: 16px;
  font-size: .92rem
}

.quality-table tbody tr.total-row td:nth-child(4) {
  color: var(--a3);
  font-size: .95rem
}

/* Notes */
.notes-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  backdrop-filter: blur(20px);
  animation: fu .8s ease-out .4s both
}

.note-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(99, 102, 241, .06);
  align-items: flex-start
}

.note-item:last-child {
  border: none
}

.note-num {
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(99, 102, 241, .12);
  color: var(--a1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px
}

.note-item p {
  color: var(--t2);
  font-size: .88rem;
  line-height: 1.7
}

.note-item p strong {
  color: var(--t1)
}

.note-item p em {
  color: var(--a3);
  font-style: normal;
  font-weight: 600
}

.note-item.warn .note-num {
  background: rgba(245, 158, 11, .15);
  color: var(--a4)
}

.note-item.good .note-num {
  background: rgba(16, 185, 129, .15);
  color: var(--a5)
}

.note-item.danger .note-num {
  background: rgba(239, 68, 68, .15);
  color: #ef4444
}

.highlight-red {
  color: #f87171 !important
}

.highlight-green {
  color: #34d399 !important
}

.footer {
  text-align: center;
  color: var(--t3);
  font-size: .78rem;
  padding: 40px 0 20px;
  font-weight: 300
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .6s, visibility .6s
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(99, 102, 241, .2);
  border-top-color: var(--a1);
  border-radius: 50%;
  animation: spin .8s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px
}

::-webkit-scrollbar-track {
  background: var(--bg)
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .25);
  border-radius: 3px
}

@media(max-width:900px) {

  .kpi-row,
  .sales-cards {
    grid-template-columns: 1fr
  }

  .container {
    padding: 16px
  }

  .chart-container {
    height: 320px
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start
  }

  .quality-card-head {
    padding: 16px 18px 12px;
    flex-wrap: wrap;
    gap: 8px
  }

  .quality-summary {
    padding: 4px 10px;
    font-size: .78rem
  }

  .quality-card-body {
    padding: 4px 12px 16px
  }

  .quality-table {
    font-size: .78rem
  }

  .quality-table thead th {
    padding: 10px 8px;
    font-size: .7rem
  }

  .quality-table tbody td {
    padding: 8px;
    font-size: .78rem
  }

  .quality-table tbody td:last-child {
    max-width: 120px;
    font-size: .72rem;
    line-height: 1.4
  }

  .quality-table tbody tr.total-row td {
    padding: 10px 8px;
    font-size: .8rem
  }
}