.dashboard-case {
  margin-top: 26px;
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-card);
}

.dashboard-case h2 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.dashboard-raw {
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid #e7e0d8;
  border-radius: 18px;
  background: #fcfbf9;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    max-height 0.5s ease;
}

.dashboard-raw.hidden {
  max-height: 0;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.dashboard-raw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid #e7e0d8;
  background: #f7f4ef;
}

.dashboard-raw-head strong {
  color: #3f3b37;
  font-size: 14px;
}

.dashboard-raw-head span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-family: var(--font-tech);
  font-size: 9px;
  font-weight: 700;
}

.dashboard-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.dashboard-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 10px 11px;
  border-right: 1px solid #eee8e0;
  border-bottom: 1px solid #eee8e0;
  text-align: left;
  white-space: nowrap;
}

.dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--green);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
}

.dashboard-table td {
  color: #57524d;
  font-family: var(--font-tech);
  font-size: 9px;
}
.dashboard-action {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.dashboard-build-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(53, 89, 75, 0.18);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.dashboard-build-button:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
}

.dashboard-build-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.dashboard-loader {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-secondary);
  font-size: 12px;
}

.dashboard-loader.active {
  display: flex;
}

.dashboard-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #cfe0d3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: dashboardSpin 0.8s linear infinite;
}

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

.dashboard-output {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease,
    max-height 0.8s ease;
}

.dashboard-output.visible {
  max-height: 1800px;
  opacity: 1;
  transform: translateY(0);
}

.dashboard-filters {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #e7e0d8;
  border-radius: 14px;
  background: #f8f7f4;
}

.dashboard-filter {
  padding: 9px 10px;
  border: 1px solid #e7e0d8;
  border-radius: 10px;
  background: #ffffff;
}

.dashboard-filter small {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 8px;
}

.dashboard-filter strong {
  color: #4b4641;
  font-size: 9px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-kpi {
  padding: 16px;
  border: 1px solid #e7e0d8;
  border-radius: 14px;
  background: #fcfbf9;
}

.dashboard-kpi:nth-child(1) {
  background: #f2f8f3;
  border-color: #d4e4d7;
}

.dashboard-kpi:nth-child(2) {
  background: #f2f7fb;
  border-color: #d9e5ee;
}

.dashboard-kpi:nth-child(3) {
  background: #fff8e9;
  border-color: #efdfb8;
}

.dashboard-kpi:nth-child(4) {
  background: #f7f3fb;
  border-color: #dfd8ed;
}
.dashboard-kpi span {
  display: block;
  color: var(--text-secondary);
  font-size: 9px;
}

.dashboard-kpi strong {
  display: block;
  margin: 7px 0 5px;
  color: #2f2c29;
  font-family: var(--font-tech);
  font-size: 20px;
  line-height: 1;
}

.dashboard-kpi em {
  color: #0f8a4b;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dashboard-chart {
  min-height: 260px;
  padding: 16px;
  border: 1px solid #e7e0d8;
  border-radius: 15px;
  background: #ffffff;
}

.dashboard-chart h3 {
  margin: 0 0 16px;
  color: #49443f;
  font-size: 12px;
}

.monthly-chart {
  position: relative;
  height: 185px;
  padding: 10px 6px 24px 32px;
  border-left: 1px solid #ddd6ce;
  border-bottom: 1px solid #ddd6ce;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 43px,
      #f0ece7 44px
    );
}

.monthly-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.months-row {
  position: absolute;
  left: 28px;
  right: 0;
  bottom: 2px;
  display: flex;
  justify-content: space-between;
  color: #8c857e;
  font-size: 7px;
}

.years-chart {
  height: 185px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 44px;
  padding: 20px 20px 0;
  border-bottom: 1px solid #ddd6ce;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 42px,
      #f0ece7 43px
    );
}

.year-column {
  width: 82px;
  text-align: center;
}

.year-column b {
  display: block;
  margin-bottom: 6px;
  color: #4b4641;
  font-size: 9px;
}

.year-column i {
  display: block;
  width: 100%;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(
      180deg,
      #7b73c8,
      #56519b
    );
  transform-origin: bottom;
  animation: growYear 0.9s ease both;
}

.year-column span {
  display: block;
  margin-top: 7px;
  color: #847d76;
  font-size: 8px;
}

@keyframes growYear {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}
.category-wrap {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 22px;
  min-height: 180px;
}

.category-donut {
  position: relative;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  background:
    conic-gradient(
      #3478e5 0 42%,
      #0f9d58 42% 69%,
      #f5aa20 69% 89%,
      #8854d0 89% 100%
    );
}

.category-donut::after {
  content: "100%";
  position: absolute;
  inset: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #4f4944;
  font-family: var(--font-tech);
  font-size: 14px;
  font-weight: 700;
}

.category-legend {
  display: grid;
  gap: 10px;
}

.category-legend div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #5c5651;
  font-size: 9px;
}

.category-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.category-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.products-bars {
  display: grid;
  gap: 12px;
}

.product-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 62px;
  align-items: center;
  gap: 9px;
}

.product-bar-row span {
  color: #5d5752;
  font-size: 8px;
}

.product-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece8e3;
}

.product-fill {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      #2f80ed,
      #64afff
    );
  transform-origin: left;
  animation: growProduct 0.9s ease both;
}

.product-value {
  text-align: right;
  font-family: var(--font-tech);
  font-weight: 700;
}

@keyframes growProduct {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@media (max-width: 760px) {
  .dashboard-case {
    margin-top: 18px;
    padding: 26px 16px;
    border-radius: 18px;
  }

  .dashboard-filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-filter:first-child {
    grid-column: 1 / -1;
  }

  .dashboard-kpis,
  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .category-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .category-legend {
    width: 100%;
  }

  .product-bar-row {
    grid-template-columns: 90px 1fr 52px;
  }
}
