/* ------------------------------------- KPI CARD -------------------------------------*/
/* Card shell */
.kpi-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 25px;
  min-height: 465px;
}

/* Card shell */
.kpi-card-prog {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 25px;
}


.kpi-indicator-text {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: .6px;
  text-align: center;
  min-height: 70px;
}

/* Header pill */
.kpi-header {
  color: #fff;
  font-weight: 700;
  text-align: center;
  align-items: center;
  padding: 5px 20px 20px 20px;
  font-size: 16px;
  height: 70px;
  border-radius: 14px 14px 0 0;
}

/* Body spacing */
.kpi-body { padding: 16px; }

/* Typography */
.kpi-label {
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: .6px;
  font-size: 12px;
  text-align: center;
}

.kpi-value {
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  margin-top: 2px;
}

.kpi-note {
  font-style: italic;
  color: #374151;
  text-align: center;
  margin-top: 4px;
}

.kpi-metric { margin-bottom: 12px; }

.kpi-percent {
  font-weight: 800;
  margin-bottom: 6px;
}

/* Rounded progress bar */
.kpi-progressbar.progress {
  background: #e5e7eb;
  height: 18px;
  border-radius: 9999px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
  overflow: hidden;
}

/* Animate from 0 to the value in --kpi-pct */
.kpi-progressbar .progress-bar {
  height: 18px;
  border-radius: 9999px;
  width: 0;                                        /* start at 0 */
  animation: kpiFill var(--kpi-dur, 900ms) ease-out forwards;
}

@keyframes kpiFill {
  to { width: var(--kpi-pct, 0%); }                /* end at target */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .kpi-progressbar .progress-bar {
    animation: none;
    width: var(--kpi-pct, 0%);
  }
}

/* Link */
.kpi-link { text-align: center; margin-top: 10px; }
.kpi-view-link { color: #1e40af; font-weight: 600; }
.kpi-view-link:hover, .kpi-view-link:focus { color: #0b3ea8; text-decoration: underline; }

/* ------------------------------------- OVERVIEW CARD -------------------------------------*/
/* Card shell */
.overview-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  overflow: hidden;
  margin-bottom: 25px;
}

/* Header pill */
.overview-header {
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 14px 14px 0 0;
}

/* Body spacing */
.overview-body { padding: 16px; }

/* Typography */
.overview-label {
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: .6px;
  font-size: 12px;
  text-align: center;
}

.overview-value {
  font-weight: 800;
  font-size: 20px;
  text-align: center;
  margin-top: 2px;
}

.overview-note {
  font-style: italic;
  color: #374151;
  text-align: center;
  margin-top: 4px;
}

.overview-metric { margin-bottom: 12px; }

.overview-percent {
  font-weight: 800;
  margin-bottom: 6px;
}

/* Rounded progress bar */
.overview-progressbar.progress {
  background: #e5e7eb;
  height: 18px;
  border-radius: 9999px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
  overflow: hidden;
}

/* Animate from 0 to the value in --overview-pct */
.overview-progressbar .progress-bar {
  height: 18px;
  border-radius: 9999px;
  width: 0;                                        /* start at 0 */
  animation: overviewFill var(--overview-dur, 900ms) ease-out forwards;
}

@keyframes overviewFill {
  to { width: var(--overview-pct, 0%); }                /* end at target */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .overview-progressbar .progress-bar {
    animation: none;
    width: var(--overview-pct, 0%);
  }
}


/* ------------------------------------- KPI BOX -------------------------------------*/
/* Shell */
.kpi-box {
  background: #fff;
  border: 2px solid #2ca02c;     /* colour overridden inline */
  border-radius: 8px;
  padding: 30px 45px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  min-height: 250px;
  margin-top: 0px;
}

/* Sections */
.kpi-box-section {
  text-align: center;
  padding: 10px 6px 6px 6px;
}

/* Labels and values */
.kpi-box-label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #111827;
  font-size: 16px;
  line-height: 1.25;
}

.kpi-box-value {
  font-weight: 800;
  font-size: 22px;
  margin-top: 2px;
}

.kpi-box-note {
  margin-top: 4px;
  font-style: italic;
  color: #374151;
}

/* Divider lines */
.kpi-box-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 12px 0 14px 0;
}

/* Progress bar */
.kpi-box-progress.progress {
  background: #eef2f7;
  height: 24px;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
  margin: 8px 0;
}

.kpi-box-progress .progress-bar {
  height: 24px;
  border-radius: 9999px;
}
/* Animate the KPI box progress from 0 to --kpi-pct */
.kpi-box-progress .progress-bar {
  width: 0;                                        /* start at 0 */
  animation: kpiFill var(--kpi-dur, 900ms) ease-out forwards;
  will-change: width;
}

/* shared keyframes used by all progress bars */
@keyframes kpiFill {
  to { width: var(--kpi-pct, 0%); }                /* end at target */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .kpi-box-progress .progress-bar {
    animation: none;
    width: var(--kpi-pct, 0%);
  }
}


/* YoY block */
.kpi-box-yoy {
  font-weight: 800;
  font-size: 22px;
}

/* ------------------------------------- Value BOX -------------------------------------*/

/* Container */
.vb-card {
  --vb-accent: #2ca02c;                 /* overridden inline */
  background: #fff;
  border: 2px solid var(--vb-accent);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  overflow: hidden;
}

/* Header */
.vb-header {
  padding: 14px 16px 10px 16px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--vb-accent) 14%, white),
    white 60%
  );
}
.vb-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vb-title {
  font-weight: 800;
  font-size: 20px;
  color: #1f2937; /* dark grey */
}
.vb-info {
  margin-left: auto;
  color: white;
}
/* in www/value-box.css */
.vb-info:hover { color: #374151; }

.vb-subtitle {
  margin-top: 4px;
  color: #374151;
  font-size: 15px;
}

/* Body */
.vb-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 14px 16px 16px 16px;
  align-items: center;
}
.vb-left svg { display: block; }

.vb-period {
  color: var(--vb-accent);
  font-weight: 700;
  letter-spacing: .4px;
  margin-bottom: 2px;
}
.vb-value {
  font-weight: 900;
  font-size: 30px;
  line-height: 1.1;
}
.vb-chip {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border: 2px solid var(--vb-accent);
  border-radius: 9999px;
  font-weight: 700;
  background: #fff;
}

/* Small screens */
@media (max-width: 576px) {
  .vb-body { grid-template-columns: 1fr; }
  .vb-left { order: 2; }
  .vb-right { order: 1; }
}

/* Animate bars growing from bottom */
.vb-bar {
  transform: scaleY(0);
  transform-origin: 50% 100%;   /* bottom centre */
  transform-box: fill-box;      /* make origin relative to the rect */
  animation: vbGrow var(--vb-dur, 800ms) ease-out forwards;
}

/* Keyframes */
@keyframes vbGrow {
  to { transform: scaleY(1); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .vb-bar { animation: none !important; transform: none !important; }
}

.cvb {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
  margin-bottom: 15px;
  padding-left: 15px;
  padding-right: 15px;
  min-height: 150px;
  flex-direction: column;
}

.cvb-left {
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.cvb-right {
  flex: 1;
  padding: 10px 12px;
  color: #333;
}

.cvb-sub {
  font-size: 16px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.cvb-value {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 768px) {
  .cvb-sub { font-size: 14px; }
  .cvb-value { font-size: 20px; }
}

@media (max-width: 480px) {
  .cvb-sub { font-size: 12px; }
  .cvb-value { font-size: 18px; }
}

/* ------------------------------------- INFO BOX -------------------------------------*/
