/* ==========================================================================
   Мир «Грид» — Стили экономики волн (Economy & Tokens) /overview
   WCAG 2.2 AAA Compliant
   ========================================================================== */

.economy-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.economy-summary-badges {
  display: flex;
  gap: var(--sp-2);
}

.economy-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.eco-summary-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.eco-metric-box {
  padding: var(--sp-4);
  background: var(--card2);
  border: var(--sp-px) solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
}

.eco-metric-label {
  font-size: var(--fs-sm);
  color: var(--tx3);
  margin-bottom: var(--sp-1);
  display: flex;
  justify-content: space-between;
}

.eco-metric-val {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--tx);
  line-height: 1;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum" 1;
  font-feature-settings: "tnum" 1;
}

.eco-metric-val.money {
  color: var(--green-light);
}

.eco-metric-sub-row {
  font-size: var(--fs-xs);
  color: var(--tx3);
  margin-top: var(--sp-2);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.eco-rework-box {
  padding: var(--sp-4);
  background: linear-gradient(135deg, var(--red-alpha-12), var(--card2));
  border: var(--sp-px) solid var(--red-alpha-30);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
}

.eco-waste-val {
  color: var(--accent-red);
  font-weight: 700;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  -webkit-font-feature-settings: "tnum" 1;
  font-feature-settings: "tnum" 1;
}

.eco-progress-bar {
  height: var(--sp-1-5);
  background: var(--black-alpha-15);
  border-radius: var(--r-full);
  margin: var(--sp-2) 0;
  overflow: hidden;
}

.eco-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-red);
  border-radius: var(--r-full);
  transition: width var(--dur-normal) var(--ease-spring);
}

.eco-citizens-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.eco-list-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: var(--sp-px) solid var(--line);
}

.eco-list-header-title {
  font-size: var(--fs-sm);
  color: var(--tx2);
  font-weight: 600;
}

.eco-mode-chips {
  display: inline-flex;
  gap: var(--sp-1);
}

.eco-citizens-list,
.eco-tasks-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1-5);
  max-height: 380px;
  overflow-y: auto;
  padding-right: var(--sp-1);
}

/* Стили скроллбара для списков */
.eco-citizens-list::-webkit-scrollbar,
.eco-tasks-list::-webkit-scrollbar {
  width: var(--sp-1);
}
.eco-citizens-list::-webkit-scrollbar-track,
.eco-tasks-list::-webkit-scrollbar-track {
  background: transparent;
}
.eco-citizens-list::-webkit-scrollbar-thumb,
.eco-tasks-list::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--r-full);
}
.eco-citizens-list::-webkit-scrollbar-thumb:hover,
.eco-tasks-list::-webkit-scrollbar-thumb:hover {
  background: var(--tx3);
}

.eco-citizen-row,
.eco-task-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--card2);
  border: var(--sp-px) solid var(--line);
  border-radius: var(--r-sm);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.eco-citizen-row:hover,
.eco-task-row:hover {
  background: var(--surface-1);
  border-color: var(--violet-alpha-30);
}

.eco-task-badge {
  padding: var(--sp-0-5) var(--sp-1-5);
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--r-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.eco-task-badge.done {
  background: var(--green-alpha-15);
  color: var(--green-light);
  border: var(--sp-px) solid var(--green-alpha-30);
}

.eco-task-badge.failed {
  background: var(--red-alpha-15);
  color: var(--accent-red);
  border: var(--sp-px) solid var(--red-alpha-30);
}

.eco-task-badge.running {
  background: var(--blue-alpha-15);
  color: var(--blue-light);
  border: var(--sp-px) solid var(--blue-alpha-30);
}

.eco-citizen-ava {
  width: var(--sp-8);
  height: var(--sp-8);
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
}

.eco-citizen-info,
.eco-task-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-0-5);
}

.eco-citizen-name,
.eco-task-pkg {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eco-citizen-stats,
.eco-task-stats {
  font-size: var(--fs-xs);
  color: var(--tx3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.eco-citizen-cost,
.eco-task-cost {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--green-light);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .economy-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eco-progress-fill,
  .eco-citizen-row,
  .eco-task-row {
    transition: none !important;
    animation: none !important;
  }
}
