/* Customer Operations, loaded after the shared Marketplace styles. */
.layout:has(#customerView:not(.hidden)) > .content {
  max-width: none;
  padding-inline: clamp(12px, 2vw, 28px);
}

.content:has(> #customerView:not(.hidden)) > .page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.content:has(> #customerView:not(.hidden)) .page-heading :is(h1, .eyebrow) {
  color: #f5d778;
}

.content:has(> #customerView:not(.hidden)) .page-heading .subheading {
  color: #c6d2eb;
}

#customerView,
#marketplace-growth-admin {
  display: grid;
  gap: 16px;
  min-width: 0;
}

#marketplace-growth-admin {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

#customerView .panel {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: clamp(16px, 1.5vw, 20px);
  border: 1px solid #dbe2ee;
  border-radius: 12px;
  background: #fff;
  color: #101f39;
  box-shadow: 0 2px 8px rgba(16, 31, 57, .06);
}

#customerView h2,
#customerView h3 {
  margin: 0;
  color: #101f39;
  line-height: 1.3;
}

#customerView h2 { font-size: 18px; }
#customerView h3 { font-size: 15px; }

#customerView .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: end;
}

#customerView :is(.customer-campaigns, .customer-subsection > h3, .customer-actions) {
  grid-column: 1 / -1;
}

#customerView .customer-subsection + .customer-subsection {
  border-top: 1px solid #dbe2ee;
  padding-top: 16px;
}

#customerView .customer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 20rem) auto;
  justify-content: start;
  align-items: end;
  gap: 10px;
}

#customerView label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: #344265;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

#customerView :is(select, textarea, input:not([type="checkbox"])) {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #b9c6d9;
  border-radius: 8px;
  background: #f8faff;
  color: #101f39;
  font: 400 14px/1.4 Inter, Segoe UI, Arial, sans-serif;
}

#customerView textarea {
  min-height: 76px;
  resize: vertical;
}

#customerView label:has(> input[type="checkbox"]) {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  min-height: 32px;
  gap: 8px;
}

#customerView input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: #173b78;
}

#customerView .customer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#customerView button {
  justify-self: start;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #c7a956;
  border-radius: 8px;
  background: #fff8e9;
  color: #101f39;
  font: 700 14px/1.3 Inter, Segoe UI, Arial, sans-serif;
  cursor: pointer;
}

#customerView button.primary { background: #f0c86c; }
#customerView button:disabled { opacity: .65; cursor: default; }

#customerView :is([role="status"], #customerSupportList, .customer-results) {
  margin: 0;
  color: #344265;
  font-size: 14px;
  line-height: 1.5;
}

#customerView :is([role="status"], #customerSupportList, .customer-results):empty {
  display: none;
}

#customerView :is([role="status"], #customerSupportList):not(:has(> article)) {
  padding: 10px 12px;
  border: 1px solid #dbe2ee;
  border-radius: 8px;
  background: #f8faff;
}

#customerView :is(.customer-results, #customerSupportList:has(> article)) {
  display: grid;
  gap: 10px;
}

#customerView .customer-results {
  list-style: none;
  padding: 0;
}

#customerView .customer-results > li {
  padding: 10px 12px;
  background: #f8faff;
  border: 1px solid #dbe2ee;
  border-radius: 8px;
}

#customerView .customer-results p { margin: 0 0 8px; }
#customerView .customer-results button { margin: 0 6px 4px 0; }

#customerSupportPaging {
  justify-content: flex-end;
  align-items: center;
}

#customerSupportPaging output { color: #344265; }

@media (min-width: 901px) {
  .layout:has(#customerView:not(.hidden)) > .sidebar {
    position: sticky;
    top: 72px;
    align-self: start;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
  }

  .layout:has(#customerView:not(.hidden)) > .sidebar > * { flex: 0 0 auto; }
}

@media (max-width: 900px) {
  .layout:has(#customerView:not(.hidden)) > .sidebar {
    padding: 8px 12px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  }

  .layout:has(#customerView:not(.hidden)) > .sidebar .nav {
    font-size: 12px;
    line-height: 1.3;
    padding: 6px 8px;
  }

  .layout:has(#customerView:not(.hidden)) > .sidebar .nav span { display: none; }
}

@media (max-width: 700px) {
  #marketplace-growth-admin { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  #customerView :is(.form-grid, .customer-toolbar) {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .marketplace-fit:has(#customerView:not(.hidden)) #platformAccess { display: inline; }
}
