/* Production customers: domain-specific layout only. Core colors, cards, buttons and forms come from the global v2 UI. */
.prod-customers-show {
  color: var(--color-text);
}

.prod-customer-feedback-columns {
  display: grid;
  gap: 1.5rem;
}

.prod-customer-feedback-section {
  min-width: 0;
}

.prod-customer-feedback-sidebar {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.prod-customer-feedback-list {
  display: grid;
  gap: 1rem;
}

.prod-customer-feedback-empty {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 1rem;
  color: var(--color-text-muted);
  padding: 1.5rem;
}

.prod-customer-feedback-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 1rem;
  box-shadow: 0 12px 34px rgb(30 45 34 / 0.06);
  min-width: 0;
  padding: 1.35rem 1.5rem 1.15rem;
}

.prod-customer-feedback-header {
  display: grid;
  gap: 0.45rem;
}

.prod-customer-feedback-card-top {
  align-items: flex-start;
  display: flex;
  gap: 0.85rem;
  justify-content: space-between;
}

.prod-customer-feedback-title {
  color: var(--color-text);
  font-size: 1.125rem;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.prod-customer-feedback-identity-copy {
  min-width: 0;
}

.prod-customer-feedback-identity-copy strong,
.prod-customer-feedback-reply strong {
  color: var(--color-text);
  display: block;
  font-size: 0.875rem;
  line-height: 1.25;
}

.prod-customer-feedback-identity-copy time,
.prod-customer-feedback-reply time {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.prod-customer-feedback-avatar {
  align-items: center;
  background: #dcd9ca;
  border-radius: 50%;
  color: #343a2a;
  display: inline-flex;
  flex: 0 0 2.75rem;
  font-size: 1rem;
  font-weight: 700;
  height: 2.75rem;
  justify-content: center;
  overflow: hidden;
  width: 2.75rem;
}

.prod-customer-feedback-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.prod-customer-feedback-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.prod-customer-feedback-tags span {
  background: #eeeee9;
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 0.3rem 0.7rem;
}

.prod-customer-feedback-pill {
  align-items: center;
  background: #e8eee3;
  border-radius: 999px;
  color: #34422f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.8rem;
  line-height: 1;
  min-height: 1.9rem;
  padding: 0.25rem 0.95rem;
}

.prod-customer-feedback-pill-red {
  background: #f7e8e4;
  color: #823e35;
}

.prod-customer-feedback-pill-amber {
  background: #f5ecd9;
  color: #735524;
}

.prod-customer-feedback-main {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 0 0.9rem;
}

.prod-customer-feedback-content {
  align-items: flex-start;
  background: linear-gradient(115deg, #fbf7ed, #f0e4c9);
  border-radius: 0.75rem;
  display: flex;
  gap: 0.8rem;
  justify-self: start;
  max-width: min(75%, 40rem);
  min-width: 0;
  padding: 0.8rem 1rem;
}

.prod-customer-feedback-content .prod-customer-feedback-identity-copy,
.prod-customer-feedback-reply > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.prod-customer-feedback-content .prod-customer-feedback-avatar {
  flex-basis: 2.25rem;
  font-size: 0.85rem;
  height: 2.25rem;
  width: 2.25rem;
}

.prod-customer-feedback-content p {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-top: 0.35rem;
  white-space: pre-line;
}

.prod-customer-feedback-replies {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.prod-customer-feedback-reply {
  align-items: flex-start;
  background: linear-gradient(115deg, #f0f4ed, #e7eee4);
  border-radius: 0.75rem;
  display: flex;
  gap: 0.8rem;
  max-width: min(75%, 40rem);
  padding: 0.8rem 1rem;
}

.prod-customer-feedback-legacy-reason {
  justify-self: end;
}

.prod-customer-feedback-reply-avatar {
  background: #8d9474;
  color: #fff;
  flex-basis: 2.25rem;
  font-size: 0.85rem;
  height: 2.25rem;
  width: 2.25rem;
}

.prod-customer-feedback-reply p {
  color: var(--color-text);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-top: 0.35rem;
  white-space: pre-line;
}

.prod-customer-feedback-form {
  align-items: end;
  border-top: 1px solid var(--color-border-subtle);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(8rem, 10rem) minmax(0, 1fr) auto;
  padding-top: 1rem;
}

.prod-customer-feedback-field {
  min-width: 0;
}

.prod-customer-feedback-field label {
  color: var(--color-text-secondary);
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.35rem;
}

.prod-customer-feedback-field .form-control {
  background: var(--color-surface);
  display: block;
  height: 3rem;
  min-height: 3rem;
  width: 100%;
}

.prod-customer-feedback-message textarea {
  resize: vertical;
}

.prod-customer-feedback-submit {
  background: #353b2b;
  border-color: #353b2b;
  color: #fff;
  height: 3rem;
  min-height: 3rem;
  white-space: nowrap;
}

.prod-customer-feedback-submit:hover {
  background: #252b1f;
  border-color: #252b1f;
}

.prod-customer-feedback-history {
  min-width: 0;
}

.prod-customer-feedback-history-summary {
  cursor: pointer;
  list-style: none;
}

.prod-customer-feedback-history-summary .section-title,
.prod-customer-feedback-history-summary .section-description {
  display: block;
}

.prod-customer-feedback-history-summary::-webkit-details-marker {
  display: none;
}

.prod-customer-feedback-history:not([open]) .prod-customer-feedback-history-summary {
  border-bottom: 0;
}

.prod-customer-feedback-history-chevron {
  display: inline-flex;
  transition: transform 0.2s ease;
}

.prod-customer-feedback-history[open] .prod-customer-feedback-history-chevron {
  transform: rotate(180deg);
}

@media (min-width: 1100px) {
  .prod-customer-feedback-columns {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prod-customer-feedback-columns .prod-customer-feedback-content,
  .prod-customer-feedback-columns .prod-customer-feedback-reply {
    max-width: 90%;
  }

  .prod-customer-feedback-columns .prod-customer-feedback-form {
    grid-template-columns: minmax(7rem, 8rem) minmax(0, 1fr);
  }

  .prod-customer-feedback-columns .prod-customer-feedback-submit {
    grid-column: 2;
    justify-self: end;
  }
}

.prod-customer-feedback-admin-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.2rem;
}

.prod-customer-feedback-edit summary,
.prod-customer-feedback-delete {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 0.35rem;
  padding: 0.2rem 0;
}

.prod-customer-feedback-edit summary {
  list-style: none;
}

.prod-customer-feedback-edit summary::-webkit-details-marker {
  display: none;
}

.prod-customer-feedback-delete:hover {
  color: #9a3f35;
}

.prod-customer-feedback-edit[open] {
  flex-basis: 100%;
}

.prod-customer-feedback-edit-form {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 1rem;
}

.prod-customer-feedback-edit-form label {
  color: var(--color-text-secondary);
  display: grid;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 0.35rem;
}

.prod-customer-feedback-edit-form button {
  justify-self: start;
}

.prod-customer-compose-summary {
  align-items: center;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  font-size: 0.875rem;
  font-weight: 700;
  gap: 0.5rem;
  list-style: none;
  padding: 0.875rem 1rem;
}

.prod-customer-compose-summary::-webkit-details-marker {
  display: none;
}

.prod-customer-compose[open] .prod-customer-compose-summary {
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 700px) {
  .prod-customer-feedback-content,
  .prod-customer-feedback-reply {
    max-width: 90%;
  }

  .prod-customer-feedback-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .prod-customer-feedback-message {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .prod-customer-feedback-submit {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 430px) {
  .prod-customer-feedback-card {
    padding: 1rem;
  }

  .prod-customer-feedback-form {
    grid-template-columns: 1fr;
  }

  .prod-customer-feedback-message,
  .prod-customer-feedback-submit {
    grid-column: 1;
    grid-row: auto;
  }

  .prod-customer-feedback-submit {
    justify-self: end;
  }
}

.prod-customers-page .page-content > .kpi-grid {
  gap: 0.875rem;
}

.prod-board,
.prod-customer-profile-grid {
  display: grid;
  gap: 0.875rem;
}

.prod-board > .section-card {
  min-width: 0;
}

.prod-board-side {
  background: linear-gradient(145deg, var(--color-surface) 0%, var(--color-amber-soft) 100%);
  border-color: color-mix(in srgb, var(--color-amber) 36%, var(--color-border));
}

.prod-subcard {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  min-height: 4.75rem;
  padding: 0.75rem;
}

.prod-stat-value {
  color: var(--color-text);
  font-size: 1.875rem;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 0.25rem;
}

.prod-action-item {
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.prod-action-item:hover {
  border-color: color-mix(in srgb, var(--color-brand) 22%, var(--color-border));
  box-shadow: var(--shadow-card);
}

.prod-customer-contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 5px 16px rgb(30 45 34 / 0.05);
  display: flex;
  flex-direction: column;
  min-height: 11rem;
  padding: 1rem;
}

.prod-customer-contact-card.is-muted {
  background: var(--color-surface-muted);
  opacity: 0.78;
}

.prod-customer-avatar {
  align-items: center;
  background: var(--color-brand-soft);
  border: 1px solid #d8ddc7;
  border-radius: var(--radius-control);
  color: var(--color-brand-dark);
  display: flex;
  flex: 0 0 auto;
  font-size: 0.875rem;
  font-weight: 800;
  height: 2.75rem;
  justify-content: center;
  width: 2.75rem;
}

.prod-health-dot {
  border-radius: 999px;
  flex: 0 0 auto;
  height: 0.65rem;
  margin-top: 0.25rem;
  width: 0.65rem;
}

.prod-health-green {
  background: var(--color-brand);
}

.prod-icon-button {
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  color: var(--color-text-muted);
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  width: 2.25rem;
}

.prod-icon-button:hover {
  background: var(--color-surface-muted);
  border-color: color-mix(in srgb, var(--color-brand) 25%, var(--color-border));
}

.prod-customer-script-workspace {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  display: grid;
  min-height: 28rem;
  overflow: hidden;
}

.prod-customer-script-list {
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem;
}

.prod-customer-script-list button {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  flex: 0 0 min(18rem, 82vw);
  padding: 0.75rem;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.prod-customer-script-list button:hover,
.prod-customer-script-list button.is-active {
  border-color: color-mix(in srgb, var(--color-info) 45%, var(--color-border));
  box-shadow: var(--shadow-card);
}

.prod-customer-script-list button.is-active {
  background: var(--color-info-soft);
}

.prod-customer-script-preview {
  background: var(--color-surface);
  min-width: 0;
  padding: 1rem;
}

.prod-customer-script-preview [data-script-panel] {
  max-height: 42rem;
  overflow: auto;
  padding-right: 0.35rem;
}

.prod-customer-script-preview [hidden] {
  display: none !important;
}

.prod-script-public-switch {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  gap: 0.55rem;
}

.prod-script-public-switch input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.prod-script-public-switch span {
  background: var(--color-border);
  border-radius: 999px;
  display: inline-block;
  height: 1.45rem;
  position: relative;
  transition: background-color 0.15s ease;
  width: 2.65rem;
}

.prod-script-public-switch span::after {
  background: var(--color-surface);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgb(15 23 42 / 0.25);
  content: "";
  height: 1.05rem;
  left: 0.2rem;
  position: absolute;
  top: 0.2rem;
  transition: transform 0.15s ease;
  width: 1.05rem;
}

.prod-script-public-switch input:checked + span {
  background: var(--color-brand);
}

.prod-script-public-switch input:checked + span::after {
  transform: translateX(1.2rem);
}

.prod-script-public-switch input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--color-info) 35%, transparent);
  outline-offset: 2px;
}

.prod-script-public-switch strong {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 800;
}

.prod-resource-workspace-header {
  align-items: start;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 1rem;
}

.prod-resource-workspace-header h2 {
  color: var(--color-text);
  font-size: 1.125rem;
  font-weight: 900;
}

.prod-resource-workspace-header p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

.prod-resource-workspace-header > span {
  background: var(--color-brand-soft);
  border-radius: 999px;
  color: var(--color-brand-dark);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.prod-resource-create-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.prod-resource-create-grid details,
.prod-resource-columns > section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  min-width: 0;
  padding: 0.85rem;
}

.prod-resource-create-grid summary {
  color: var(--color-brand-dark);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 900;
}

.prod-resource-create-grid form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.prod-resource-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.prod-resource-columns h3 {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  display: flex;
  font-size: 0.9rem;
  font-weight: 900;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.65rem;
}

.prod-resource-library-row {
  align-items: center;
  border-top: 1px solid var(--color-border);
  color: inherit;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  padding: 0.65rem 0.45rem;
}

.prod-resource-library-row:first-of-type {
  border-top: 0;
}

.prod-resource-library-row:hover {
  background: var(--color-surface-muted);
}

.prod-resource-library-row > a,
.prod-resource-library-row > span {
  min-width: 0;
}

.prod-resource-library-row strong,
.prod-resource-library-row small {
  display: block;
}

.prod-resource-library-row strong {
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-resource-library-row small {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  margin-top: 0.1rem;
}

.prod-resource-empty {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  padding: 0.75rem 0;
}

@media (min-width: 900px) {
  .prod-customer-script-workspace {
    grid-template-columns: minmax(16rem, 0.34fr) minmax(0, 1fr);
  }

  .prod-customer-script-list {
    border-bottom: 0;
    border-right: 1px solid var(--color-border);
    display: block;
    max-height: 42rem;
    overflow: auto;
  }

  .prod-customer-script-list button {
    display: block;
    width: 100%;
  }

  .prod-customer-script-list button + button {
    margin-top: 0.5rem;
  }
}

@media (min-width: 1024px) {
  .prod-board {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .prod-board-main {
    grid-column: span 8 / span 8;
  }

  .prod-board-side {
    grid-column: span 4 / span 4;
  }
}

@media (max-width: 950px) {
  .prod-resource-create-grid,
  .prod-resource-columns {
    grid-template-columns: 1fr;
  }
}
