/* Operations Dashboard page: the interactive example dashboard. */
.od {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.od__noscript {
  margin: 0;
  color: var(--fg-2);
}

.od__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.od__title {
  display: flex;
  align-items: baseline;
  gap: 4px 12px;
  flex-wrap: wrap;
}

.od__industry {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--brand-navy);
}

.od__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}

.od__range {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--cream-100);
  border: 1px solid var(--cream-200);
}

.od__range button {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  background: transparent;
  border: 0;
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
}

.od__range button:hover {
  color: var(--brand-navy);
}

.od__range button[aria-pressed="true"] {
  background: var(--white);
  color: var(--brand-navy);
  box-shadow: 0 1px 2px rgba(8, 32, 72, 0.1);
}

.od__controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.od__refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-blue);
  background: var(--brand-blue-50);
  border: 1px solid var(--brand-blue-100);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(8, 32, 72, 0.06);
}

.od__refresh:hover {
  background: var(--brand-blue-100);
}

.od__refresh svg {
  display: block;
  width: 13px;
  height: 13px;
}

.od__refresh.is-busy svg {
  animation: od-spin 500ms ease-out;
}

@keyframes od-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .od__refresh.is-busy svg {
    animation: none;
  }
}

.od__range button:focus-visible,
.od__refresh:focus-visible,
.od-tile:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Metric cards */
.od__tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.od-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-sans);
  background: var(--white);
  border: 1px solid var(--cream-200);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 120ms ease-out, background 120ms ease-out, box-shadow 120ms ease-out;
}

.od-tile:hover {
  border-color: var(--brand-blue-300);
}

.od-tile[aria-pressed="true"] {
  background: var(--brand-blue-50);
  border-color: var(--brand-blue);
  box-shadow: inset 0 0 0 1px var(--brand-blue);
}

.od-tile__label {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-3);
}

.od-tile__value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
  font-variant-numeric: tabular-nums;
}

.od-tile__change {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}

.od-tile__change.is-good {
  color: var(--success);
}

.od-tile__change.is-watch {
  color: var(--warning);
}

.od-status {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.od-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.od-status--good {
  color: var(--success);
  background: rgba(18, 138, 92, 0.1);
}

.od-status--watch {
  color: var(--warning);
  background: rgba(181, 115, 28, 0.12);
}

.od-status--steady {
  color: var(--fg-2);
  background: var(--ink-100);
}

/* Chart and alerts */
.od__lower {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 14px;
}

.od__panel {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--cream-200);
  border-radius: 14px;
}

.od__panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.od__panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-navy);
}

.od__panel-note {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}

.od__readout {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--brand-navy);
  font-variant-numeric: tabular-nums;
}

.od-chart {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: 210px 26px;
  margin-top: 16px;
}

.od-chart__y {
  position: relative;
}

.od-chart__y span {
  position: absolute;
  right: 10px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
  color: var(--fg-3);
}

.od-chart__plot {
  position: relative;
  cursor: crosshair;
  touch-action: pan-y;
}

.od-chart__plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.od-chart__grid {
  stroke: var(--cream-200);
  stroke-width: 1;
}

.od-chart__bar {
  fill: var(--brand-blue-100);
  transition: fill 120ms ease-out;
}

.od-chart__bar.is-latest {
  fill: var(--brand-blue);
}

.od-chart__bar.is-hover {
  fill: var(--brand-blue-300);
}

.od-chart__bar.is-latest.is-hover {
  fill: var(--brand-blue-700);
}

/* Net change: losses sit below the zero line in red */
.od-chart__bar.is-negative {
  fill: rgba(192, 57, 43, 0.22);
}

.od-chart__bar.is-negative.is-hover {
  fill: rgba(192, 57, 43, 0.4);
}

.od-chart__bar.is-negative.is-latest {
  fill: var(--danger);
}

.od-chart__zero {
  stroke: var(--ink-400);
  stroke-width: 1;
}

.od-chart__line {
  fill: none;
  stroke: var(--brand-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.od-chart__area {
  fill: url(#od-fill);
}

.od-chart__stop {
  stop-color: var(--brand-blue);
}

.od-chart__target-line {
  stroke: var(--brand-navy);
  stroke-width: 1.25;
  stroke-dasharray: 5 5;
  opacity: 0.5;
}

.od-chart__target {
  position: absolute;
  right: 0;
  transform: translateY(calc(-100% - 4px));
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-navy);
  background: var(--white);
}

.od-chart__guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--cream-300);
  opacity: 0;
  pointer-events: none;
}

.od-chart__dot {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border: 2.5px solid var(--brand-blue);
  border-radius: 50%;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
}

.od-chart--line .od-chart__plot.is-hovering .od-chart__guide,
.od-chart--line .od-chart__plot.is-hovering .od-chart__dot {
  opacity: 1;
}

.od-chart__x {
  position: relative;
  grid-column: 2;
}

.od-chart__x span {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
  color: var(--fg-3);
}

.od__alerts {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.od__alert {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--cream-200);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--fg-1);
}

.od__alert:first-child {
  padding-top: 2px;
  border-top: 0;
}

.od__sev {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
}

.od__sev--danger {
  background: var(--danger);
}

.od__sev--warning {
  background: var(--warning);
}

.od__sev--success {
  background: var(--success);
}

@media (max-width: 1040px) {
  .od__tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .od {
    padding: 18px 16px 20px;
  }

  .od__tiles {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 58%;
    padding-bottom: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .od-tile {
    scroll-snap-align: start;
  }

  .od-chart {
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-rows: 180px 26px;
  }

  .od__range button {
    padding: 7px 11px;
  }
}
