/* Màn Tổng quan: tiền tố ov-. Chỉ animate transform/opacity (vòng tiến độ vẽ bằng stroke-dashoffset). */

.ov-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ---------- KPI ---------- */
.ov-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.ov-kpi {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: start;
  min-width: 0;
}
.ov-kpi-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.ov-kpi-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.ov-kpi-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.ov-kpi-sub {
  font-size: 12px;
}

/* ---------- Lưới khối ---------- */
.ov-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.ov-card-sub {
  margin: 2px 0 12px;
  font-size: 13px;
}
.ov-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

/* ---------- Mục tiêu tháng ---------- */
.ov-goal {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 20px;
}
.ov-ring-wrap {
  position: relative;
  flex: none;
  width: 128px;
  height: 128px;
}
.ov-ring {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
}
.ov-ring-track,
.ov-ring-arc {
  stroke-width: 12;
}
.ov-ring-track {
  stroke: var(--surface-2);
}
.ov-ring-arc {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--duration-enter) var(--ease-out);
}
.ov-ring-percent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 700;
}
.ov-goal-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ov-goal-amount {
  font-size: 18px;
  font-weight: 600;
}
.ov-goal-gap,
.ov-goal-who {
  font-size: 13px;
}
.ov-ring-arc.is-reached {
  stroke: var(--ok);
}

/* ---------- Chỉ tiêu tháng từng người ---------- */
.ov-q-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.ov-q-row {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition:
    background var(--duration-base),
    border-color var(--duration-base);
}
.ov-q-row.is-me {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ov-q-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ov-q-who {
  display: grid;
  flex: 1;
  min-width: 0;
}
.ov-q-name,
.ov-q-amount {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-q-name {
  font-weight: 500;
}
.ov-q-amount {
  font-size: 12px;
}
.ov-q-percent {
  flex: none;
  font-size: 18px;
  font-weight: 700;
}
.ov-q-row.is-reached .ov-q-percent {
  color: var(--ok);
}
/* Khung cắt vạch tiến độ: vạch là lớp rộng bằng thanh, dịch bằng translateX(%) nên không tràn ra ngoài thẻ. */
.ov-q-bar {
  position: relative;
  padding: 4px 0;
  overflow: hidden;
}
.ov-q-track {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.ov-q-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--duration-enter) var(--ease-out);
}
.ov-q-row.is-reached .ov-q-fill {
  background: var(--ok);
}
.ov-q-pace {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: transform var(--duration-enter) var(--ease-out) var(--duration-base);
}
.ov-q-pace[hidden] {
  display: none;
}
.ov-q-pace::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  border-radius: 1px;
  background: var(--text);
  opacity: 0.6;
}
.ov-q-status,
.ov-q-comm {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.ov-q-badge {
  transform-origin: left center;
}
.ov-q-badge .i {
  width: 14px;
  height: 14px;
}
.ov-q-badge.is-pop {
  animation: ov-pop var(--duration-slide) var(--ease-out);
}
.ov-q-foot {
  margin-top: 10px;
  font-size: 12px;
}

/* ---------- Hoạt động ---------- */
.ov-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}
.ov-act-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}
.ov-act-btn,
.ov-task-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  transition:
    background var(--duration-base),
    transform var(--duration-fast) var(--ease-out);
}
.ov-act-btn:active,
.ov-task-btn:active {
  transform: scale(0.99);
}
@media (hover: hover) {
  .ov-act-btn:hover,
  .ov-task-btn:hover {
    background: var(--surface-2);
  }
}
.ov-act-item.is-new {
  animation: ov-enter var(--duration-slide) var(--ease-out) backwards;
}
.ov-act-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.ov-act-email {
  background: var(--warn-soft);
  color: var(--warn);
}
.ov-act-note {
  background: var(--surface-2);
  color: var(--muted);
}
.ov-act-move,
.ov-act-won {
  background: var(--ok-soft);
  color: var(--ok);
}
.ov-act-body {
  display: grid;
  flex: 1;
  min-width: 0;
}
.ov-act-title,
.ov-act-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-act-text {
  font-size: 13px;
}
.ov-act-time {
  flex: none;
  font-size: 12px;
}

/* ---------- Việc hôm nay ---------- */
.ov-task-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}
.ov-task-time {
  flex: none;
  min-width: 44px;
  color: var(--accent);
  font-weight: 600;
}
.ov-task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ov-task-more {
  margin-top: 8px;
  font-size: 13px;
}

@keyframes ov-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  60% {
    opacity: 1;
    transform: scale(1.08);
  }
}
@keyframes ov-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 1100px) {
  .ov-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .ov-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .ov-kpi:first-child {
    grid-column: 1 / -1;
  }
  .ov-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ov-goal {
    flex-direction: column;
    align-items: flex-start;
  }
  .ov-head-tools {
    width: 100%;
  }
}
