/* Analytics & Readiness "What Analytics & Readiness delivers" panel visuals. Section shell, cards and
   panel surfaces come from platform-capabilities.css; variables are the shared --cap-* set. */

.platform-cap {
  --an-high: #22c55e;
  --an-average: #0e7490;
  --an-risk: #f59e0b;
  --an-critical: #ef4444;
  --an-none: #6b7280;
  --an-red: #dc2626;
  --an-amber: #b45309;
  --an-cyan: #0ea5e9;
}

.analytics-band--high { --an-band: var(--an-high); }
.analytics-band--average { --an-band: var(--an-average); }
.analytics-band--risk { --an-band: var(--an-risk); }
.analytics-band--critical { --an-band: var(--an-critical); }
.analytics-band--none { --an-band: var(--an-none); }

.analytics-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.analytics-chip--risk {
  background: rgba(245, 158, 11, 0.14);
  color: var(--an-amber);
}

.analytics-chip--critical {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.analytics-chip--below {
  border-color: rgba(185, 28, 28, 0.25);
  background: rgba(239, 68, 68, 0.06);
  color: #b91c1c;
}

/* Certification cell: lessons complete toward a machine's certification */
.analytics-cell {
  display: block;
  padding: 7px 0;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.analytics-cell--full { background: #16a34a; }
.analytics-cell--partial { background: #f59e0b; }
.analytics-cell--low { background: #ef4444; }
.analytics-cell--empty { background: #eef0f3; }

.analytics-cell--empty::before {
  content: "\00a0";
}

/* =========================================================
   Card 1 — Certification grid: each machine column in turn
   ========================================================= */
.analytics-grid__summary {
  display: grid;
  justify-items: end;
}

.analytics-grid__summary span {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.analytics-grid__body {
  display: grid;
  gap: 18px;
}

.analytics-grid__table {
  border-collapse: separate;
  border-spacing: 6px 5px;
  table-layout: fixed;
  margin: -5px -6px;
  width: calc(100% + 12px);
}

.analytics-grid__table th {
  overflow: hidden;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--cap-muted);
}

.analytics-grid__table thead th {
  padding-bottom: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cap-faint);
  transition: color 0.3s ease;
}

.analytics-grid__table thead th:first-child {
  width: 28%;
}

.analytics-grid__table td {
  padding: 0;
  border-radius: 8px;
  transition: box-shadow 0.35s ease, opacity 0.35s ease;
}

.analytics-grid__table tfoot th,
.analytics-grid__table tfoot td {
  padding-top: 8px;
  border-top: 1px solid var(--cap-line);
  border-radius: 0;
}

.analytics-grid__table tfoot th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cap-faint);
}

.analytics-grid__count {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--cap-teal);
}

.analytics-grid__count.is-thin {
  color: var(--an-amber);
}

.analytics-grid__count.is-thin::after {
  content: " only";
  font-size: 11px;
  font-weight: 600;
}

/* Active column: outlined, others recede slightly */
.analytics-grid[data-col="1"] tbody td:not([data-c="1"]),
.analytics-grid[data-col="2"] tbody td:not([data-c="2"]),
.analytics-grid[data-col="3"] tbody td:not([data-c="3"]),
.analytics-grid[data-col="4"] tbody td:not([data-c="4"]) {
  opacity: 0.45;
}

.analytics-grid[data-col="1"] tbody td[data-c="1"],
.analytics-grid[data-col="2"] tbody td[data-c="2"],
.analytics-grid[data-col="3"] tbody td[data-c="3"],
.analytics-grid[data-col="4"] tbody td[data-c="4"] {
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.5);
}

.analytics-grid[data-col="1"] thead th[data-c="1"],
.analytics-grid[data-col="2"] thead th[data-c="2"],
.analytics-grid[data-col="3"] thead th[data-c="3"],
.analytics-grid[data-col="4"] thead th[data-c="4"] {
  color: var(--cap-cyan-deep);
}

.analytics-grid[data-col="1"] .analytics-grid__summary [data-c="1"],
.analytics-grid[data-col="2"] .analytics-grid__summary [data-c="2"],
.analytics-grid[data-col="3"] .analytics-grid__summary [data-c="3"],
.analytics-grid[data-col="4"] .analytics-grid__summary [data-c="4"] {
  opacity: 1;
  transform: none;
}

.analytics-grid__covers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  border: 1px solid var(--cap-line);
  border-radius: 12px;
  background: #fff;
}

.analytics-grid__covers-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--cap-faint);
}

.analytics-grid__covers ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-grid__covers li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.analytics-grid__covers-note {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--cap-muted);
}

.analytics-grid__covers li span {
  padding: 1px 8px;
  border-radius: 999px;
  background: #1b2230;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}

@container (max-width: 560px) {
  .analytics-grid__table th {
    font-size: 12px;
  }

  .analytics-grid__table thead th {
    font-size: 10.5px;
  }

  .analytics-cell {
    font-size: 11px;
  }

  .analytics-grid__count.is-thin::after {
    content: none;
  }
}

.analytics-grid__short {
  display: none;
}

@container (max-width: 420px) {
  .analytics-grid__long {
    display: none;
  }

  .analytics-grid__short {
    display: inline;
  }

  .analytics-grid__table thead th:first-child {
    width: 22%;
  }
}

/* =========================================================
   Card 2 — Readiness score
   ========================================================= */
.analytics-score__top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.analytics-score__gauge {
  width: 100%;
  max-width: 240px;
  overflow: visible;
}

.analytics-score__track,
.analytics-score__value {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.analytics-score__track {
  stroke: rgba(23, 34, 53, 0.08);
}

.analytics-score__value {
  stroke: var(--an-high);
  stroke-dasharray: calc(var(--v) * 1px) 100px;
}

.analytics-score__tick {
  stroke: var(--cap-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.analytics-score__num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  fill: var(--cap-ink);
}

.analytics-score__cap {
  font-size: 7.5px;
  font-weight: 500;
  fill: var(--cap-faint);
}

.analytics-score__split {
  display: grid;
  gap: 8px;
}

.analytics-score__split p {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f4f6f9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--cap-muted);
}

.analytics-score__split b {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cap-ink);
}

.analytics-score__split .is-below b {
  color: var(--an-red);
}

.analytics-score__bands {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.analytics-score__stack {
  display: flex;
  gap: 2px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
}

.analytics-score__stack i {
  flex: var(--share) 1 0;
  background: var(--an-band);
}

.analytics-score__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-score__legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--cap-muted);
}

.analytics-score__legend li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--an-band);
}

.analytics-score__legend span {
  flex: 1;
  min-width: 0;
}

.analytics-score__legend b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cap-ink);
}

@container (max-width: 420px) {
  .analytics-score__top {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .analytics-score__split {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .analytics-score__legend {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =========================================================
   Card 3 — At risk
   ========================================================= */
.analytics-risk__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-risk__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(48px, 110px) 70px 26px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--cap-line);
  border-radius: 10px;
  background: #fff;
}

.analytics-risk__name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.analytics-risk__meter {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(23, 34, 53, 0.08);
}

.analytics-risk__meter::after {
  content: "";
  position: absolute;
  left: 60%;
  top: -3px;
  bottom: -3px;
  border-left: 1.5px dashed rgba(23, 34, 53, 0.35);
}

.analytics-risk__meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--an-red);
  transform: scaleX(var(--v));
  transform-origin: left center;
}

.analytics-risk__row .analytics-chip {
  justify-self: start;
}

.analytics-risk__score {
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--an-red);
}

.analytics-risk__overdue {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--cap-line);
}

.analytics-risk__sub {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cap-faint);
}

.analytics-risk__overdue ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.analytics-risk__overdue li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
}

.analytics-risk__overdue li > span:first-child {
  flex: 1;
  min-width: 0;
}

.analytics-risk__due {
  font-size: 12px;
  color: var(--an-amber);
}

.analytics-risk__overdue b {
  width: 3.2ch;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@container (max-width: 420px) {
  .analytics-risk__row {
    grid-template-columns: minmax(0, 1fr) auto 26px;
    row-gap: 8px;
  }

  .analytics-risk__meter {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* =========================================================
   Card 4 — Pilot scorecard
   ========================================================= */
.analytics-scorecard__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-scorecard__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 96px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--cap-line);
  border-radius: 10px;
  background: #fff;
}

.analytics-scorecard__row.is-below {
  border-color: rgba(185, 28, 28, 0.22);
  background: rgba(239, 68, 68, 0.04);
}

.analytics-scorecard__name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.analytics-scorecard__value {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analytics-scorecard__row .platform-cap__chip {
  justify-self: end;
}

/* =========================================================
   Card 5 — Unlock more KPIs
   ========================================================= */
.analytics-unlock__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-unlock__tile {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  border: 1px solid var(--cap-line);
  border-radius: 12px;
  background: #fff;
}

.analytics-unlock__preview {
  position: relative;
  height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background: #f4f6f9;
}

/* Blurred sample chart behind the lock, as in the product */
.analytics-unlock__preview::before {
  content: "";
  position: absolute;
  inset: 10px 10px 0;
  filter: blur(2.5px);
  opacity: 0.55;
}

.analytics-unlock__preview--bars::before {
  background: repeating-linear-gradient(90deg, #9aa3af 0 7px, transparent 7px 12px);
  clip-path: polygon(0 40%, 12% 40%, 12% 10%, 24% 10%, 24% 55%, 36% 55%, 36% 25%, 48% 25%, 48% 0, 60% 0, 60% 45%, 72% 45%, 72% 20%, 84% 20%, 84% 35%, 100% 35%, 100% 100%, 0 100%);
}

.analytics-unlock__preview--line::before {
  background: linear-gradient(160deg, transparent 45%, #9aa3af 45% 52%, transparent 52%);
}

.analytics-unlock__preview--area::before {
  background: #b7bec8;
  clip-path: polygon(0 70%, 15% 50%, 30% 60%, 45% 30%, 60% 45%, 75% 20%, 90% 35%, 100% 25%, 100% 100%, 0 100%);
}

.analytics-unlock__lock {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 6px;
  border: 1px solid var(--cap-line);
  border-radius: 999px;
  background: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--cap-muted);
}

.analytics-unlock__lock::before {
  content: "";
  width: 7px;
  height: 6px;
  margin-top: 2px;
  border-radius: 1.5px;
  background: currentColor;
}

.analytics-unlock__title {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.analytics-unlock__needs {
  margin-top: auto;
  padding-top: 6px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--cap-faint);
}

/* Meters grow in once their panel is in view */
.platform-cap.is-enhanced :is(.analytics-risk__meter i) {
  transform: scaleX(0);
  transition: transform 1.1s var(--cap-ease) 0.45s;
}

.platform-cap.is-enhanced .is-inview :is(.analytics-risk__meter i) {
  transform: scaleX(var(--v));
}

.platform-cap.is-enhanced .analytics-score__value {
  stroke-dasharray: 0 100px;
  transition: stroke-dasharray 1.3s var(--cap-ease) 0.3s;
}

.platform-cap.is-enhanced .is-inview .analytics-score__value {
  stroke-dasharray: calc(var(--v) * 1px) 100px;
}
