@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #151922;
  --muted: #5f6b7a;
  --line: #d9dfe7;
  --soft-line: #edf0f4;
  --brand: #0050d8;
  --brand-dark: #003fa8;
  --accent: #0050d8;
  --success: #0f766e;
  --warning: #a16207;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.embedded-admin body {
  background: #fff;
}

button,
input,
select {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  min-width: 104px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 0 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.08s ease, box-shadow 0.16s ease;
}

button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.primary-link {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* Keeps the wholesale access action compact inside customer table rows. */
.customer-access-button {
  min-height: 32px;
  min-width: auto;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  min-width: 104px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 600;
  justify-content: center;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  border-color: #9bb7f0;
  background: #f8fbff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

button:active,
.button-link:active {
  transform: translateY(1px);
  box-shadow: none;
}

button.primary:hover,
.primary-link:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.embedded-admin .shell {
  width: min(1120px, calc(100% - 48px));
  /* Keeps the app header clear of the Nuvemshop administrator chrome. */
  padding: 36px 0;
}

.topbar,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.embedded-admin .topbar {
  /* Separates the action buttons from the status card rendered immediately below. */
  margin-bottom: 16px;
}

.tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0 16px;
}

.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: auto;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 0 0 12px;
  min-height: 36px;
  box-shadow: none;
}

.tabs button:hover {
  background: transparent;
  border-color: transparent;
  border-bottom-color: #9bb7f0;
  box-shadow: none;
}

.tabs button.active {
  color: var(--text);
  border-bottom-color: var(--brand);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip[data-mode="ready"] {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.status-chip[data-mode="loading"] {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.status-chip[data-mode="warning"] {
  border-color: #fde68a;
  color: #92400e;
  background: #fffbeb;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.embedded-admin .eyebrow {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

.embedded-admin h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.panel-title p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.status-grid,
.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.status-grid article,
.summary-strip article,
.panel,
.products-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-grid article,
.summary-strip article {
  padding: 16px;
}

.status-grid span,
.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.status-grid strong,
.summary-strip strong {
  display: block;
  font-size: 16px;
}

.panel {
  padding: 18px;
  margin-top: 16px;
}

.products-section {
  padding: 0;
  margin-top: 16px;
  overflow: hidden;
}

.embedded-admin .products-section,
.embedded-admin .panel,
.embedded-admin .status-grid article,
.embedded-admin .summary-strip article {
  box-shadow: none;
}

.products-section > .panel-title,
.products-heading {
  padding: 18px;
}

.products-section > .import-form {
  padding: 0 18px 18px;
}

.products-section > .form-grid {
  padding: 0 18px 18px;
}

.products-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.products-heading p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.bulk-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.bulk-box input {
  width: 130px;
}

.form-grid,
.rule-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rule-form,
.customer-form,
.import-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.rule-form {
  grid-template-columns: 0.8fr 1.4fr repeat(2, 0.8fr) auto;
  align-items: end;
}

.products-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 0 18px 12px;
  margin-top: 0;
}

.admin-feedback {
  margin: 0 0 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.sync-status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
}

.sync-status-panel strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.sync-status-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.sync-progress {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.sync-progress progress {
  width: 220px;
  height: 8px;
  accent-color: var(--primary);
}

.connection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.connection-banner h2 {
  margin-bottom: 4px;
  font-size: 16px;
}

.connection-banner p {
  color: #1d4ed8;
  font-size: 14px;
}

.count-line {
  color: var(--muted);
  font-size: 14px;
  padding: 0 18px 12px;
  margin: 0;
}

.customer-form {
  grid-template-columns: 1.2fr 1.2fr 0.8fr 0.7fr auto;
}

.import-form {
  grid-template-columns: minmax(0, 1fr) 176px;
  align-items: stretch;
}

.import-form .primary {
  min-width: 176px;
  padding: 0 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.file-picker {
  position: relative;
  display: flex;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  overflow: hidden;
}

.file-picker:focus-within {
  outline: 2px solid rgba(0, 80, 216, 0.18);
  border-color: var(--brand);
}

.file-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 174px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  font-weight: 700;
}

.file-icon {
  position: relative;
  width: 16px;
  height: 18px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.file-icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  background: #f8fafc;
}

.file-picker-name {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input:focus,
select:focus {
  outline: 2px solid rgba(0, 80, 216, 0.18);
  border-color: var(--brand);
}

select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.wide-field {
  grid-column: span 2;
}

.readonly-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: #f8fafc;
  overflow: hidden;
}

.readonly-field span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.products-section .table-wrap {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

.table-load-more {
  display: flex;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--soft-line);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

.embedded-admin table {
  min-width: 1080px;
}

th,
td {
  border-bottom: 1px solid var(--soft-line);
  padding: 12px;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
  background: #f8fafc;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

/* Identifies customers who retain their account but no longer receive wholesale pricing. */
.pill-retail {
  background: #f1f5f9;
  color: #475569;
}

.notice,
.empty-state {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 14px;
}

.notice code {
  display: block;
  width: 100%;
  margin-top: 10px;
  overflow-x: auto;
  color: var(--text);
  font-size: 12px;
}

/* Keeps the native price-table controls readable inside the app settings panel. */
.price-table-field {
  max-width: 560px;
  margin-top: 12px;
}

.price-table-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}

.price-table-summary span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
}

.price-table-summary strong {
  color: var(--text);
}

.notice-warning {
  border-color: #fde68a;
  color: #92400e;
  background: #fffbeb;
}

/* Highlights the intentional replacement of an older native price-table link. */
.price-table-migration p {
  margin: 8px 0 12px;
}

.button-danger {
  border-color: #b91c1c;
  color: #fff;
  background: #b91c1c;
}

.button-danger:hover:not(:disabled) {
  border-color: #991b1b;
  background: #991b1b;
}

.price-table-sync-panel {
  margin: 0 18px 18px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.approval-mode-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 0 18px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.approval-mode-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.approval-mode-card p {
  color: var(--muted);
  font-size: 13px;
}

.segmented-control {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented-control button {
  min-width: 158px;
  border: 0;
  background: transparent;
}

.segmented-control button.active {
  background: var(--brand);
  color: #fff;
}

.empty-state {
  text-align: center;
  padding: 36px 18px;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
}

.empty-state p {
  margin-bottom: 16px;
}

.signup-shell,
.signup-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f7f9 42%, #eef2f7 100%);
}

.signup-panel,
.signup-card {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.signup-card {
  display: grid;
  gap: 22px;
}

.signup-brand {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.signup-brand strong {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.signup-panel h1,
.signup-card h1 {
  margin-bottom: 8px;
}

.signup-panel > p:not(.eyebrow),
.signup-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.signup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 0;
}

.signup-form button,
.signup-form label:last-of-type,
.signup-form .wide {
  grid-column: span 2;
}

.form-feedback {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 600;
}

.form-feedback[data-type="success"] {
  border-color: #99f6e4;
  color: var(--success);
  background: #f0fdfa;
}

.form-feedback[data-type="error"] {
  border-color: #fecaca;
  color: var(--danger);
  background: #fef2f2;
}

.form-feedback[data-type="loading"] {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.products-table th:first-child,
.products-table td:first-child {
  width: 44px;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}

.product-cell img,
.image-empty {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f1f5f9;
  object-fit: cover;
}

.table-input {
  width: 112px;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.table-input:focus {
  background: #f8fbff;
}

pre {
  min-height: 96px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
}

.embedded-admin pre {
  display: none;
}

.private-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.private-panel {
  width: min(520px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.private-panel h1 {
  margin-bottom: 8px;
  font-size: 24px;
}

.private-panel p {
  color: var(--muted);
}

@media (max-width: 920px) {
  .status-grid,
  .form-grid,
  .rule-form,
  .products-toolbar,
  .import-form {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: span 1;
  }

  .topbar,
  .panel-title,
  .approval-mode-card,
  .connection-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .signup-page,
  .signup-shell {
    align-items: start;
    padding: 16px;
  }

  .signup-card,
  .signup-panel {
    padding: 20px;
  }

  .signup-form {
    grid-template-columns: 1fr;
  }

  .signup-form button,
  .signup-form label:last-of-type,
  .signup-form .wide {
    grid-column: span 1;
  }
}
