.topbar-kpi[data-kpi-modal-trigger] {
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms ease, background 160ms ease;
}

.topbar-kpi[data-kpi-modal-trigger]:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.topbar-kpi[data-kpi-modal-trigger]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.35);
}

.kpi-details-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.kpi-details-modal .modal-header {
  justify-content: space-between;
  gap: 12px;
}

.kpi-details-modal .modal-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.kpi-details-modal .modal-body {
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 12px;
  scrollbar-width: thin;
}

.kpi-details-modal .modal-body::-webkit-scrollbar {
  width: 8px;
}

.kpi-details-modal .modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.kpi-details-modal__progress-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.kpi-details-modal__progress-body {
  display: grid;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.kpi-details-modal__charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kpi-details-modal__summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.kpi-details-modal__summary .topbar-kpi {
  min-width: 0;
  max-width: none;
  height: auto;
  gap: 4px;
  padding: 10px 12px;
}

.kpi-details-modal__summary .topbar-kpi-label {
  white-space: normal;
}

.kpi-details-modal__summary .topbar-kpi-value {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.kpi-details-modal__meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kpi-details-modal__meta-item,
.kpi-details-modal__progress-item,
.kpi-details-modal__chart,
.kpi-details-modal__note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.kpi-details-modal__meta-value {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.kpi-details-modal__notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kpi-details-modal .orders-bars {
  width: 100%;
  max-width: none;
  align-self: stretch;
}

.kpi-details-modal .orders-bars-track {
  min-width: 100%;
  justify-content: center;
}

@media (max-width: 900px) {
  .kpi-details-modal__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-details-modal__progress-grid,
  .kpi-details-modal__charts-grid,
  .kpi-details-modal__meta-grid,
  .kpi-details-modal__notes {
    grid-template-columns: 1fr;
  }
}
