/*
 * Shared Product Ops Board V2 surface.  The selector prefix prevents it from
 * inheriting legacy per-board loading and table rules during the migration.
 */
.product-ops-v2-shell,
.pobp-v2-detail-backdrop {
  --pobp-v2-surface: #101827;
  --pobp-v2-surface-raised: #182337;
  --pobp-v2-border: #2b3c57;
  --pobp-v2-text: #e7edf8;
  --pobp-v2-muted: #a4b0c2;
  --pobp-v2-brand: #4ac7b7;
  --pobp-v2-brand-soft: rgba(74, 199, 183, 0.16);
  --pobp-v2-blue: #79a9ff;
  --pobp-v2-danger: #ff8e98;
  --pobp-v2-warning: #f5c66c;
  --pobp-v2-shadow: rgba(1, 8, 20, 0.42);
}

.pobp-v2-board {
  position: relative;
  z-index: 0;
  min-width: 0;
  max-width: 100%;
  color: var(--pobp-v2-text);
}

.pobp-v2-board *,
.pobp-v2-detail-backdrop * {
  box-sizing: border-box;
}

.pobp-v2-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--pobp-v2-border);
  border-radius: 16px;
  background: var(--pobp-v2-surface);
  box-shadow: 0 18px 38px var(--pobp-v2-shadow);
}

.pobp-v2-loading-shell .pobp-v2-table-scroll,
.pobp-v2-warming-shell .pobp-v2-table-scroll {
  max-height: 430px;
}

.pobp-v2-table {
  width: 100%;
  min-width: 1460px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--pobp-v2-surface);
}

.pobp-v2-table th,
.pobp-v2-table td {
  border-bottom: 1px solid var(--pobp-v2-border);
  vertical-align: top;
  text-align: left;
}

.pobp-v2-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 13px 12px;
  background: #1b2940;
  color: #d5e4fa;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.2;
  white-space: normal;
}

.pobp-v2-table td {
  padding: 12px;
  color: var(--pobp-v2-text);
  font-size: 0.82rem;
  line-height: 1.38;
}

.pobp-v2-table tbody tr {
  transition: background-color 140ms ease;
}

.pobp-v2-table tbody tr:hover {
  background: rgba(121, 169, 255, 0.06);
}

.pobp-v2-table tbody tr:last-child td {
  border-bottom: 0;
}

.pobp-v2-col-product {
  width: 13%;
  min-width: 190px;
}

.pobp-v2-col-taxonomy {
  width: 10%;
  min-width: 140px;
}

.pobp-v2-col-trend {
  width: 13%;
  min-width: 178px;
}

.pobp-v2-col-status {
  width: 9%;
  min-width: 128px;
}

.pobp-v2-col-assets {
  width: 15%;
  min-width: 230px;
}

.pobp-v2-col-what_changed {
  width: 12%;
  min-width: 170px;
}

.pobp-v2-col-entity_spread {
  width: 9%;
  min-width: 130px;
}

.pobp-v2-col-similar_products {
  width: 11%;
  min-width: 160px;
}

.pobp-v2-col-action_priority {
  width: 12%;
  min-width: 175px;
}

.pobp-v2-board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--pobp-v2-border);
  border-radius: 12px;
  background: var(--pobp-v2-surface-raised);
  color: var(--pobp-v2-muted);
  font-size: 0.78rem;
}

.pobp-v2-board-meta-primary,
.pobp-v2-board-meta-secondary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.pobp-v2-board-meta-primary strong {
  color: var(--pobp-v2-text);
}

.pobp-v2-meta-separator {
  color: #60708a;
}

.pobp-v2-freshness,
.pobp-v2-refresh-badge,
.pobp-v2-confidence,
.pobp-v2-status-pill,
.pobp-v2-action-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 800;
  line-height: 1;
}

.pobp-v2-freshness {
  padding: 5px 8px;
  color: #99efe2;
  background: var(--pobp-v2-brand-soft);
}

.pobp-v2-freshness.is-lagging {
  color: #ffe0a1;
  background: rgba(245, 198, 108, 0.14);
}

.pobp-v2-refresh-badge {
  padding: 5px 8px;
  color: #b8d1ff;
  background: rgba(121, 169, 255, 0.14);
}

.pobp-v2-refresh-badge.is-stale {
  color: #ffe0a1;
  background: rgba(245, 198, 108, 0.14);
}

.pobp-v2-product-name,
.pobp-v2-detail-button,
.pobp-v2-status-pill,
.pobp-v2-action-pill,
.pobp-v2-trend-trigger,
.pobp-v2-metric {
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pobp-v2-product-name,
.pobp-v2-detail-button {
  padding: 0;
  text-decoration: none;
}

.pobp-v2-product-name {
  display: block;
  overflow: hidden;
  color: #f4f8ff;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pobp-v2-product-name:hover,
.pobp-v2-product-name:focus-visible,
.pobp-v2-detail-button:hover,
.pobp-v2-detail-button:focus-visible {
  color: #8edff3;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pobp-v2-detail-button {
  color: #dbe8fb;
}

.pobp-v2-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pobp-v2-primary-text {
  display: block;
  color: #f2f6ff;
  font-size: 0.82rem;
}

.pobp-v2-subtext {
  display: block;
  margin-top: 4px;
  color: var(--pobp-v2-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.pobp-v2-muted {
  color: #8b99ae;
  font-size: 0.76rem;
  font-style: italic;
}

.pobp-v2-confidence {
  margin-top: 5px;
  padding: 4px 6px;
  color: #a5d4ff;
  background: rgba(121, 169, 255, 0.13);
  text-transform: capitalize;
}

.pobp-v2-trend-trigger {
  display: grid;
  width: 100%;
  min-width: 126px;
  padding: 6px;
  border: 1px solid rgba(121, 169, 255, 0.24);
  border-radius: 9px;
  background: #132138;
  color: #cbdcf8;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.pobp-v2-trend-trigger:hover,
.pobp-v2-trend-trigger:focus-visible {
  border-color: #76b5f7;
  background: #172a46;
  outline: 0;
  transform: translateY(-1px);
}

.pobp-v2-trend-trigger.is-lagging {
  border-color: rgba(245, 198, 108, 0.62);
}

.pobp-v2-mini-trend-svg {
  display: block;
  width: 100%;
  height: 38px;
  overflow: visible;
}

.pobp-v2-mini-trend-baseline,
.pobp-v2-detail-chart-grid {
  fill: none;
  stroke: rgba(164, 176, 194, 0.3);
  stroke-width: 1;
}

.pobp-v2-mini-trend-observed,
.pobp-v2-detail-chart-observed {
  fill: none;
  stroke: var(--pobp-v2-brand);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pobp-v2-mini-trend-new,
.pobp-v2-detail-chart-new {
  fill: none;
  stroke: var(--pobp-v2-blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pobp-v2-mini-trend-observed-dot,
.pobp-v2-detail-chart-observed-dot {
  fill: var(--pobp-v2-brand);
  stroke: #0d1b2d;
  stroke-width: 1.2;
}

.pobp-v2-mini-trend-new-dot,
.pobp-v2-detail-chart-new-dot {
  fill: var(--pobp-v2-blue);
  stroke: #0d1b2d;
  stroke-width: 1;
}

.pobp-v2-trend-label {
  margin-top: 4px;
  color: #9faeca;
  font-size: 0.68rem;
  line-height: 1.25;
}

.pobp-v2-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 9px;
  color: var(--pobp-v2-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.pobp-v2-trend-legend-observed::before,
.pobp-v2-trend-legend-new::before {
  display: inline-block;
  width: 10px;
  height: 3px;
  margin-right: 5px;
  border-radius: 999px;
  content: "";
  vertical-align: middle;
}

.pobp-v2-trend-legend-observed::before { background: var(--pobp-v2-brand); }
.pobp-v2-trend-legend-new::before { background: var(--pobp-v2-blue); }

.pobp-v2-status-pill,
.pobp-v2-action-pill {
  max-width: 100%;
  padding: 6px 8px;
  color: #d7e7ff;
  background: rgba(121, 169, 255, 0.14);
  white-space: normal;
}

.pobp-v2-status-pill.is-critical,
.pobp-v2-status-pill.is-high {
  color: #ffd0d7;
  background: rgba(255, 142, 152, 0.17);
}

.pobp-v2-status-pill.is-medium,
.pobp-v2-status-pill.is-warning {
  color: #ffe2a7;
  background: rgba(245, 198, 108, 0.15);
}

.pobp-v2-core-assets {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.pobp-v2-core-assets-label {
  color: #8394ad;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pobp-v2-core-assets-value {
  color: #dce9fb;
  font-size: 0.72rem;
}

.pobp-v2-supplement-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.pobp-v2-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(96, 120, 151, 0.52);
  border-radius: 8px;
  background: #132038;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.pobp-v2-metric:hover,
.pobp-v2-metric:focus-visible {
  border-color: #76b5f7;
  background: #1a2c49;
  outline: 0;
}

.pobp-v2-metric-label {
  overflow: hidden;
  color: #91a4bf;
  font-size: 0.61rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pobp-v2-metric-value {
  color: #f0f6ff;
  font-size: 0.75rem;
}

.pobp-v2-metric.is-loading .pobp-v2-metric-value,
.pobp-v2-metric.is-unknown .pobp-v2-metric-value,
.pobp-v2-metric.is-unavailable .pobp-v2-metric-value {
  color: #f6ce84;
}

.pobp-v2-metric.is-not_applicable .pobp-v2-metric-value {
  color: #9ca9bc;
}

.pobp-v2-loading-shell,
.pobp-v2-state-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--pobp-v2-border);
  border-radius: 16px;
  background: #111c2e;
  box-shadow: 0 22px 56px var(--pobp-v2-shadow);
}

.pobp-v2-loading-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 15% 0%, rgba(74, 199, 183, 0.12), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(121, 169, 255, 0.13), transparent 38%);
}

.pobp-v2-loading-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #edf5ff;
}

.pobp-v2-loading-heading strong,
.pobp-v2-state-shell h3 {
  margin: 0;
  font-size: 0.98rem;
}

.pobp-v2-loading-copy,
.pobp-v2-state-shell > p {
  max-width: 700px;
  margin: 7px 0 16px;
  color: #aebbd0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.pobp-v2-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(121, 169, 255, 0.24);
  border-top-color: #82e2d5;
  border-radius: 50%;
  animation: pobp-v2-spin 0.75s linear infinite;
}

.pobp-v2-skeleton-table {
  min-width: 1460px;
  opacity: 1;
}

.pobp-v2-skeleton-table td {
  height: 42px;
}

.pobp-v2-skeleton-bar {
  display: block;
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, #24344e 18%, #334a69 46%, #24344e 72%);
  background-size: 250% 100%;
  animation: pobp-v2-shimmer 1.4s ease-in-out infinite;
}

.pobp-v2-skeleton-2 {
  width: 76%;
}

.pobp-v2-skeleton-3 {
  width: 58%;
}

.pobp-v2-skeleton-4 {
  width: 88%;
}

.pobp-v2-warming-shell {
  border-color: rgba(245, 198, 108, 0.55);
}

.pobp-v2-error-shell {
  border-color: rgba(255, 142, 152, 0.62);
}

.pobp-v2-empty-shell {
  border-color: rgba(121, 169, 255, 0.42);
}

.pobp-v2-state-meta,
.pobp-v2-detail-context,
.pobp-v2-detail-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.pobp-v2-kv {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(96, 120, 151, 0.42);
  border-radius: 8px;
  background: rgba(12, 23, 40, 0.56);
}

.pobp-v2-kv-label {
  display: block;
  overflow: hidden;
  color: #91a4bf;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}

.pobp-v2-kv-value {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #edf4ff;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pobp-v2-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #6b9ced;
  border-radius: 8px;
  background: #214d88;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pobp-v2-button:hover,
.pobp-v2-button:focus-visible {
  background: #2d63a8;
  outline: 2px solid #92c3ff;
  outline-offset: 2px;
}

.pobp-v2-toolbar {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--pobp-v2-border);
  border-radius: 14px;
  background: var(--pobp-v2-surface-raised);
  box-shadow: 0 12px 28px rgba(1, 8, 20, 0.2);
}

.pobp-v2-toolbar-tabs {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pobp-v2-toolbar-tab,
.pobp-v2-pager-button {
  min-height: 34px;
  border: 1px solid rgba(96, 120, 151, 0.65);
  border-radius: 8px;
  background: #15233a;
  color: #b9c8dd;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.pobp-v2-toolbar-tab {
  flex: 0 0 auto;
  padding: 7px 10px;
}

.pobp-v2-toolbar-tab:hover,
.pobp-v2-toolbar-tab:focus-visible,
.pobp-v2-toolbar-tab.is-active {
  border-color: #66cfc0;
  background: rgba(74, 199, 183, 0.15);
  color: #cbfff7;
  outline: 0;
}

.pobp-v2-toolbar-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 9px;
  min-width: 0;
}

.pobp-v2-toolbar-search {
  grid-column: span 2;
}

.pobp-v2-toolbar-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pobp-v2-toolbar-label {
  color: #a5b5cd;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pobp-v2-toolbar-select,
.pobp-v2-toolbar-input {
  width: 100%;
  min-height: 36px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #425c7f;
  border-radius: 8px;
  background: #111f34;
  color: #edf5ff;
  font: inherit;
  font-size: 0.8rem;
}

.pobp-v2-toolbar-select:focus-visible,
.pobp-v2-toolbar-input:focus-visible {
  border-color: #79a9ff;
  outline: 2px solid rgba(121, 169, 255, 0.45);
  outline-offset: 1px;
}

.pobp-v2-toolbar-input::placeholder {
  color: #7e90aa;
}

.pobp-v2-toolbar-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.pobp-v2-pager-button {
  padding: 7px 10px;
}

.pobp-v2-pager-button:hover:not(:disabled),
.pobp-v2-pager-button:focus-visible:not(:disabled) {
  border-color: #79a9ff;
  background: #203c65;
  color: #f4f8ff;
  outline: 0;
}

.pobp-v2-pager-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pobp-v2-pager-meta {
  color: #aebbd0;
  font-size: 0.74rem;
  text-align: center;
}

.pobp-v2-tooltip {
  position: fixed;
  z-index: 2147482000;
  right: 16px;
  bottom: 16px;
  display: none;
  max-width: min(300px, calc(100vw - 32px));
  padding: 9px 11px;
  border: 1px solid rgba(121, 169, 255, 0.55);
  border-radius: 9px;
  background: #0a1322;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  color: #e9f2ff;
  font-size: 0.75rem;
  line-height: 1.4;
  pointer-events: none;
}

.pobp-v2-tooltip.is-visible {
  display: block;
}

.pobp-v2-detail-backdrop {
  position: fixed;
  z-index: 2147481000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background: rgba(2, 8, 19, 0.78);
  backdrop-filter: blur(4px);
}

.pobp-v2-detail-backdrop[hidden] {
  display: none;
}

.pobp-v2-detail-modal {
  width: min(840px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid #3a5379;
  border-radius: 16px;
  background: #111d30;
  box-shadow: 0 30px 92px rgba(0, 0, 0, 0.6);
  color: var(--pobp-v2-text);
  outline: 0;
}

.pobp-v2-detail-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(96, 120, 151, 0.5);
  background: #182943;
}

.pobp-v2-detail-heading {
  min-width: 0;
}

.pobp-v2-detail-title {
  overflow: hidden;
  margin: 0;
  color: #f4f8ff;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pobp-v2-detail-meta {
  margin: 5px 0 0;
  color: #9eb1cd;
  font-size: 0.73rem;
}

.pobp-v2-detail-close {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #54739f;
  border-radius: 8px;
  background: #20395e;
  color: #f3f8ff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pobp-v2-detail-close:hover,
.pobp-v2-detail-close:focus-visible {
  background: #2d4e7f;
  outline: 2px solid #91beff;
  outline-offset: 2px;
}

.pobp-v2-detail-body {
  padding: 20px;
}

.pobp-v2-detail-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(96, 120, 151, 0.44);
  border-radius: 12px;
  background: #0e192b;
}

.pobp-v2-detail-section h3 {
  margin: 0 0 12px;
  color: #eaf3ff;
  font-size: 0.9rem;
}

.pobp-v2-detail-section p {
  margin: 0;
  color: #b7c5d9;
  line-height: 1.5;
}

.pobp-v2-detail-chart-host {
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(96, 120, 151, 0.42);
  border-radius: 10px;
  background: #101e32;
}

.pobp-v2-detail-chart-svg {
  display: block;
  width: 100%;
  height: 220px;
}

.pobp-v2-detail-note,
.pobp-v2-detail-loading {
  margin-top: 10px !important;
  color: #9fb0c9 !important;
  font-size: 0.78rem;
}

.pobp-v2-detail-loading.is-error {
  color: #ffb5bc !important;
}

body.pobp-v2-modal-open {
  overflow: hidden;
}

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

@keyframes pobp-v2-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 760px) {
  .pobp-v2-board-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .pobp-v2-loading-shell,
  .pobp-v2-state-shell {
    padding: 14px;
  }

  .pobp-v2-toolbar-filters {
    grid-template-columns: 1fr;
  }

  .pobp-v2-toolbar-search {
    grid-column: auto;
  }

  .pobp-v2-toolbar-pager {
    justify-content: space-between;
  }

  .pobp-v2-detail-backdrop {
    padding: 10px;
  }

  .pobp-v2-detail-modal {
    max-height: calc(100vh - 20px);
    border-radius: 12px;
  }

  .pobp-v2-detail-header,
  .pobp-v2-detail-body {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pobp-v2-spinner,
  .pobp-v2-skeleton-bar,
  .pobp-v2-table tbody tr,
  .pobp-v2-trend-trigger,
  .pobp-v2-metric {
    animation: none;
    transition: none;
  }
}
