:root {
  --pfm-pink: #dd326d;
  --pfm-ink: #171719;
  --pfm-muted: #74747b;
  --pfm-line: #d9d9dd;
  --pfm-soft: #f6f6f7;
  --pfm-red: #c92942;
  --pfm-orange: #c86b12;
  --pfm-yellow: #9d8400;
  --pfm-green: #27764c;
  --ids__accent: var(--pfm-pink);
  --ids__link: #2859b8;
  --ids__hover: var(--pfm-pink);
  --ids__surface: var(--pfm-soft);
  --ids__background: #fff;
}

body {
  min-height: 100vh;
  color: var(--pfm-ink);
  background: var(--ids__background);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: 0;
  background: rgb(255 255 255 / 96%);
}

.app-header__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 3.5rem;
  gap: 1.25rem;
}

.ids .app-brand {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 0.65rem;
  color: var(--pfm-ink);
  font-weight: 520;
  text-decoration: none;
}

.ids .app-brand:hover {
  color: var(--pfm-ink);
}

.app-brand__mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--pfm-ink);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.app-nav,
.app-user,
.page-heading,
.filter-bar,
.recommendation-actions,
.status-line {
  display: flex;
  align-items: center;
}

.app-nav {
  gap: 0;
  padding: 0.16rem;
  border: 1px solid var(--pfm-line);
  border-radius: 0.35rem;
}

.ids .app-nav a {
  display: flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 0.22rem;
  color: var(--pfm-muted);
  text-decoration: none;
}

.ids .app-nav a:hover {
  color: var(--pfm-ink);
  background: var(--pfm-soft);
}

.ids .app-nav a.is-active {
  color: var(--pfm-ink);
  background: var(--pfm-soft);
}

.app-user {
  justify-self: end;
  gap: 1rem;
  color: var(--pfm-muted);
  font-size: 0.9rem;
}

.app-user form {
  margin: 0;
}

.app-user button {
  padding: 0;
  border: 0;
  color: var(--pfm-muted);
  background: transparent;
  cursor: pointer;
}

.app-user button:hover {
  color: var(--pfm-ink);
}

.app-main {
  padding: 1.75rem 0 3.5rem;
}

.page-heading {
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.ids h1.XS {
  margin-bottom: 0.2em;
  font-size: clamp(1.85rem, 2.6vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.ids h1.S {
  margin-bottom: 0.15em;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 580;
  letter-spacing: -0.035em;
}

.ids h2.XS {
  font-size: 1.35rem;
  font-weight: 580;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--pfm-muted);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--pfm-muted);
  font-size: 0.75rem;
  font-weight: 520;
  letter-spacing: 0.03em;
}

.sync-pill,
.priority-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--pfm-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.sync-pill::before {
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--pfm-green);
  content: "";
}

.sync-pill.is-demo::before {
  background: var(--pfm-orange);
}

.metric-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.9rem;
  min-height: 5.2rem;
  padding-top: 0.35rem;
}

.metric-card__number {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  margin: 0;
  color: currentColor;
  font-size: clamp(2.75rem, 4vw, 3.7rem);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.metric-card__label {
  grid-column: 2;
  align-self: end;
  color: var(--pfm-ink);
  font-size: 0.78rem;
}

.metric-card__number + .metric-card__label {
  align-self: start;
  color: var(--pfm-muted);
}

.metric-card.red {
  color: var(--pfm-red);
}

.metric-card.orange {
  color: var(--pfm-orange);
}

.metric-card.yellow {
  color: var(--pfm-yellow);
}

.metric-card.green {
  color: var(--pfm-green);
}

.filter-bar {
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.45rem 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cfcfd4;
  border-radius: 0.25rem;
  color: var(--pfm-ink);
  background: white;
  font-weight: 400;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #a9a9b0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ids__link);
  outline: 1px solid var(--ids__link);
  outline-offset: 0;
}

.filter-bar input {
  flex: 2 1 18rem;
}

.filter-bar select {
  flex: 1 1 11rem;
}

.ids .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--pfm-ink);
  border-radius: 0.25rem;
  color: white;
  background: var(--pfm-ink);
  cursor: pointer;
  font-weight: 480;
  line-height: 1;
  text-decoration: none;
}

.ids .button:hover {
  border-color: #3c3c40;
  color: white;
  background: #3c3c40;
}

.ids .button.secondary {
  color: var(--pfm-ink);
  background: white;
}

.ids .button.secondary:hover {
  border-color: var(--pfm-ink);
  color: var(--pfm-ink);
  background: var(--pfm-soft);
}

.ids .button.danger {
  border-color: var(--pfm-red);
  color: var(--pfm-red);
  background: white;
}

.ids .button.danger:hover {
  color: white;
  background: var(--pfm-red);
}

.table-shell {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 64rem;
  table-layout: fixed;
  border-collapse: collapse;
}

.data-table .col-product {
  width: 25%;
}

.data-table .col-number {
  width: 8%;
}

.data-table .col-sales {
  width: 12%;
}

.data-table .col-age {
  width: 7%;
}

.data-table .col-action {
  width: 18%;
}

.data-table .col-status {
  width: 14%;
}

.data-table th,
.data-table td {
  padding: 0.72rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--pfm-line) 80%, transparent);
  text-align: left;
  vertical-align: middle;
}

.data-table th:first-child,
.data-table td:first-child {
  padding-left: 1rem;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 1rem;
}

.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom-color: var(--pfm-ink);
  color: var(--pfm-muted);
  background: white;
  font-size: 0.73rem;
  font-weight: 520;
  line-height: 1.2;
}

.data-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table tbody .priority-row {
  --row-color: var(--pfm-line);
  background: color-mix(in srgb, var(--row-color) 5%, white);
}

.data-table tbody .priority-row.red {
  --row-color: var(--pfm-red);
}

.data-table tbody .priority-row.orange {
  --row-color: var(--pfm-orange);
}

.data-table tbody .priority-row.yellow {
  --row-color: var(--pfm-yellow);
}

.data-table tbody .priority-row.green {
  --row-color: var(--pfm-green);
}

.data-table tbody .priority-row:hover {
  background: color-mix(in srgb, var(--row-color) 9%, white);
}

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

.ids .product-link {
  display: block;
  color: var(--pfm-ink);
  font-weight: 540;
  text-decoration-color: transparent;
}

.ids .product-link:hover {
  color: var(--ids__link);
  text-decoration-color: color-mix(in srgb, var(--ids__link) 25%, transparent);
}

.product-meta {
  margin-top: 0.15rem;
  color: var(--pfm-muted);
  font-size: 0.76rem;
}

.status-pill {
  color: var(--pfm-muted);
}

.priority-pill {
  gap: 0.4rem;
  color: var(--priority-color);
  font-weight: 520;
}

.priority-pill::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.priority-pill.red,
.recommendation-card.red {
  --priority-color: var(--pfm-red);
}

.priority-pill.orange,
.recommendation-card.orange {
  --priority-color: var(--pfm-orange);
}

.priority-pill.yellow,
.recommendation-card.yellow {
  --priority-color: var(--pfm-yellow);
}

.priority-pill.green,
.recommendation-card.green {
  --priority-color: var(--pfm-green);
}

.empty-state {
  padding: 3rem 0;
}

.panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.recommendation-card {
  padding: 0;
  background: transparent;
}

.recommendation-card .eyebrow {
  color: var(--priority-color, var(--pfm-muted));
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(9rem, 0.75fr) minmax(12rem, 1.4fr);
  margin: 0;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  padding: 0.44rem 0;
}

.detail-list dt {
  color: var(--pfm-muted);
}

.detail-list dd {
  text-align: right;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.recommendation-actions,
.status-line {
  flex-wrap: wrap;
  gap: 0.65rem;
}

.recommendation-actions {
  margin-top: 1rem;
}

.recommendation-actions form {
  margin: 0;
}

.work-assignment {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.work-assignment > span {
  display: grid;
  gap: 0.1rem;
}

.work-assignment strong {
  font-weight: 520;
}

.work-assignment small {
  color: var(--pfm-muted);
}

.message {
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.25rem;
  background: var(--pfm-soft);
}

.message.success {
  color: var(--pfm-green);
  background: color-mix(in srgb, var(--pfm-green) 7%, white);
}

.settings-form label {
  display: block;
  margin-bottom: 0.32rem;
  font-size: 0.86rem;
  font-weight: 500;
}

.settings-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(2rem, 4vw, 4.5rem);
}

.settings-group {
  display: grid;
  align-content: start;
  gap: 1.05rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-group legend {
  margin-bottom: 1rem;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 580;
}

.setting-field {
  min-height: 0;
}

.setting-field input:not([type="checkbox"]),
.setting-field select {
  width: min(100%, 13rem);
}

.setting-field.checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 22rem;
  min-height: 2rem;
}

.setting-field input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  accent-color: var(--pfm-ink);
}

.setting-field.checkbox label {
  margin: 0;
}

.settings-actions {
  margin-top: 1.75rem;
}

.settings-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: clamp(2rem, 5vw, 5rem);
}

.settings-secondary-content {
  margin-top: 1rem;
}

.data-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.data-status > div {
  display: grid;
  align-content: start;
  gap: 0.3rem;
}

.data-status strong {
  font-weight: 520;
}

.form-errors {
  margin-top: 0.35rem;
  color: var(--pfm-red);
  font-size: 0.8rem;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(100%, 24rem);
  padding-top: 1.2rem;
  border-top: 2px solid var(--pfm-ink);
}

.login-card form {
  display: grid;
  gap: 0.85rem;
}

.login-card label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.86rem;
}

.login-card .button {
  width: 100%;
}

.issue-list {
  display: grid;
}

.issue-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.issue-row strong {
  font-weight: 520;
}

details.reject {
  width: fit-content;
  margin-top: 1rem;
  padding: 0;
  border: 0;
}

details.reject[open] {
  width: min(100%, 28rem);
}

details.reject summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #b8b8be;
  border-radius: 0.25rem;
  color: var(--pfm-muted);
  cursor: pointer;
  font-weight: 480;
  line-height: 1;
  list-style: none;
}

details.reject summary::-webkit-details-marker {
  display: none;
}

details.reject summary:hover {
  border-color: var(--pfm-red);
  color: var(--pfm-red);
}

details.reject form {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.75rem;
}

@media (width < 768px) {
  .app-header {
    position: static;
  }

  .app-header__row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 3.25rem;
  }

  .app-brand {
    min-width: 0;
  }

  .app-brand > :last-child,
  .app-user__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-around;
    min-width: 0;
  }

  .ids .app-nav a {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 2.8rem;
  }

  .app-user {
    grid-column: 2;
    grid-row: 1;
  }

  .app-user__name {
    display: none;
  }

  .app-main {
    padding-top: 1.35rem;
    padding-bottom: 3rem;
  }

  .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .metric-card {
    min-height: 4.5rem;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-bar input,
  .filter-bar select,
  .filter-bar .button {
    width: 100%;
  }

  .table-shell {
    overscroll-behavior-inline: contain;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list dt {
    padding-bottom: 0.1rem;
    border-bottom: 0;
  }

  .detail-list dd {
    padding-top: 0;
    text-align: left;
  }

  .data-status {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .work-assignment {
    align-items: flex-start;
    flex-direction: column;
  }
}
