/* KPI cards — Editorial Spotlight, ± без изменений */

.kpi-emp-grid {
  overflow: visible !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 16px;
}

@media (min-width: 640px) {
  .kpi-emp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .kpi-emp-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

.kpi-card {
  position: relative;
  z-index: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid hsl(20 6% 16%);
  background: hsl(20 8% 8%);
  box-shadow: none;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card::before {
  display: none;
}

.kpi-card--open {
  z-index: 30;
  overflow: visible;
}

.kpi-card-art {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: hsl(20 6% 12%);
}

.kpi-card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -48px 56px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 1;
}

.kpi-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.kpi-card-photo--fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--kpi-serif, "Playfair Display", Georgia, serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  color: hsl(30 5% 45%);
}

.kpi-card-lvl {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  font-size: 0.62rem;
  font-weight: 600;
  color: hsl(40 10% 92%);
}

.kpi-card-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  color: hsl(40 10% 94%);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.kpi-card-menu:hover {
  background: rgba(0, 0, 0, 0.65);
}

.kpi-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  z-index: 2;
  padding: 28px 10px 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
  text-align: center;
  pointer-events: none;
}

.kpi-card-overlay a {
  pointer-events: auto;
}

.kpi-card-name {
  display: block;
  font-family: var(--kpi-serif, "Playfair Display", Georgia, serif);
  font-weight: 600;
  font-size: clamp(0.75rem, 3vw, 0.9rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: hsl(40 10% 96%);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-card-name:hover {
  color: #fff;
}

.kpi-card-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.kpi-card-role {
  font-size: 0.58rem;
  line-height: 1.15;
  color: hsl(30 6% 68%);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-card-stats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid hsl(20 6% 16%);
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(8px);
}

.kpi-card-stats--solo {
  grid-template-columns: 1fr;
}

.kpi-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 2px;
}

.kpi-stat + .kpi-stat {
  border-left: 1px solid hsl(20 6% 16%);
}

.kpi-stat-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.kpi-stat-label {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(30 5% 50%);
}

.kpi-stat-score {
  font-family: var(--kpi-serif, "Playfair Display", Georgia, serif);
  font-size: clamp(1rem, 4.2vw, 1.25rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #c45c42;
}

.kpi-stat-score--low {
  color: #e09050;
}

/* − / + — не трогаем */
.kpi-stat-btn {
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: none;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.1s ease;
}

.kpi-stat-btn:active {
  transform: scale(0.96);
}

.kpi-stat-btn--minus {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.55), rgba(80, 15, 15, 0.75));
  color: #fca5a5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.kpi-stat-btn--minus:hover {
  background: linear-gradient(180deg, rgba(153, 27, 27, 0.65), rgba(100, 20, 20, 0.85));
}

.kpi-stat-btn--plus {
  background: linear-gradient(180deg, rgba(6, 95, 70, 0.55), rgba(4, 60, 45, 0.75));
  color: #6ee7b7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.kpi-stat-btn--plus:hover {
  background: linear-gradient(180deg, rgba(5, 120, 85, 0.65), rgba(4, 75, 55, 0.85));
}

.kpi-card-actions {
  position: absolute;
  top: 42px;
  right: 8px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-width: 9.5rem;
  border-radius: 12px;
  border: 1px solid hsl(20 6% 16%);
  background: hsl(20 8% 8%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.kpi-card-actions button {
  flex: none;
  width: 100%;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: hsl(40 10% 92%);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: left;
}

.kpi-card-actions button + button {
  border-top: 1px solid hsl(20 6% 16%);
}

.kpi-card-actions button:hover {
  background: var(--kpi-terracotta-dim, rgba(168, 68, 48, 0.12));
}

.kpi-card-actions button.danger {
  color: #f87171;
}

.kpi-hero-card {
  position: relative;
  z-index: 1;
  padding: 0 !important;
  overflow: visible;
}

.kpi-hero-card--photo {
  background-image: var(--kpi-hero-photo);
  background-size: cover;
  background-position: center top;
}

.kpi-hero-card__inner {
  position: relative;
  z-index: 1;
  padding: 16px 16px 18px;
}

.kpi-hero-card .absolute.right-0.top-full {
  z-index: 50 !important;
}

.kpi-card-score {
  font-family: var(--kpi-serif, "Playfair Display", Georgia, serif);
  font-weight: 700;
  color: #c45c42 !important;
}

.kpi-card-score--low {
  color: #e09050 !important;
}

.kpi-jira-block {
  display: block !important;
}

.kpi-jira-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kpi-jira-tokens button {
  min-height: 36px;
}

.kpi-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid hsl(var(--border));
}

.kpi-settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
