/* Sync customer pages: restrained dark surfaces around SellAuth's live data. */
body[class*="sa-tpl-customer-"] {
  --sa-account-bg: #0a0a0b;
  --sa-account-panel: #141517;
  --sa-account-panel-hover: #1a1b1e;
  --sa-account-line: #292b30;
  --sa-account-line-strong: #36383e;
  --sa-account-text: #f5f5f6;
  --sa-account-muted: #a4a6af;
  --sa-account-accent: #ff791a;
  background: var(--sa-account-bg);
}

html[data-scheme="light"] body[class*="sa-tpl-customer-"] {
  --sa-account-bg: #f7f7f8;
  --sa-account-panel: #fff;
  --sa-account-panel-hover: #f9f9fa;
  --sa-account-line: #e2e3e7;
  --sa-account-line-strong: #d2d3d9;
  --sa-account-text: #191a1e;
  --sa-account-muted: #676a73;
  --sa-account-accent: #dc5800;
}

body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] {
  padding-top: clamp(28px, 4vw, 52px);
  padding-bottom: clamp(70px, 7vw, 104px);
}

body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] > .wrap {
  max-width: 1260px;
}

body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(a, button, input, textarea, select):focus-visible,
.sa-customer-sidebar :is(a, button):focus-visible,
.sa-customer-login-modal :is(button, input):focus-visible,
:is(.sa-customer-password-modal, .sa-customer-tfa-modal, .sa-customer-discord-modal, .sa-customer-delete-modal) :is(button, input):focus-visible {
  outline: 2px solid #ff9a4d;
  outline-offset: 3px;
}

/* Account navigation */
.sa-customer-sidebar .sync-account-sidebar__card {
  overflow: visible;
  padding: 8px;
  border: 1px solid var(--sa-account-line);
  border-radius: 15px;
  background: var(--sa-account-panel);
  box-shadow: none;
}

.sa-customer-sidebar .sync-account-sidebar__profile {
  gap: 11px;
  padding: 13px 11px 16px;
}

.sa-customer-sidebar .sync-account-sidebar__avatar,
.sync-account-intro__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border: 1px solid #ff791a42;
  border-radius: 10px;
  background: #ff791a17;
  color: #ff9a4c;
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.sa-customer-sidebar .sync-account-sidebar__profile p:first-child { color: var(--sa-account-text); font-weight: 700; }
.sa-customer-sidebar .sync-account-sidebar__profile p:nth-child(2) { color: var(--sa-account-muted); font-size: 11px; }
.sa-customer-sidebar .sync-account-sidebar__card > .border-t { border-color: var(--sa-account-line); }

.sa-customer-sidebar .sync-account-sidebar__nav { gap: 2px; }
.sa-customer-sidebar .sync-account-sidebar__nav .sa-customer-sidebar-link {
  position: relative;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--sa-account-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: color .18s ease, background .18s ease;
}

.sa-customer-sidebar .sync-account-sidebar__nav .sa-customer-sidebar-link:hover {
  background: var(--sa-account-panel-hover);
  color: var(--sa-account-text);
}

.sa-customer-sidebar .sync-account-sidebar__nav .sa-customer-sidebar-link[aria-current="page"] {
  background: #ff791a16;
  color: #ff9948;
}
html[data-scheme="light"] .sa-customer-sidebar .sync-account-sidebar__nav .sa-customer-sidebar-link[aria-current="page"] { color: var(--sa-account-accent); }
html[data-scheme="light"] :is(.sa-customer-sidebar .sync-account-sidebar__avatar, .sync-account-intro__avatar) { color: var(--sa-account-accent); }

.sa-customer-sidebar .sync-account-sidebar__nav .sa-customer-sidebar-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--sa-account-accent);
}

.sa-customer-sidebar .sync-account-sidebar__nav .sa-customer-sidebar-link svg { width: 17px; height: 17px; }
.sa-customer-sidebar .sync-account-sidebar__logout { min-height: 42px; padding-inline: 11px; border-radius: 8px; font-size: 12.5px; }
.sa-customer-sidebar [x-show="menuOpen"] { border-color: var(--sa-account-line-strong); border-radius: 11px; background: var(--sa-account-panel-hover); }

/* Header shared by orders, subscriptions, tickets, balance and partner pages. */
.sa-customer-header { align-items: flex-end; gap: 18px; margin-bottom: 26px; }
.sync-account-header__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--sa-account-accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}
.sync-account-header__label span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sa-customer-header .sa-customer-header-title {
  color: var(--sa-account-text);
  font-size: clamp(29px, 3.4vw, 42px);
  font-weight: 750;
  letter-spacing: -.043em;
  line-height: 1.12;
}
.sa-customer-header .sa-customer-header-subtitle {
  max-width: 610px;
  margin-top: 9px;
  color: var(--sa-account-muted);
  font-size: 13px;
  line-height: 1.65;
}
.sa-customer-header .sa-customer-header-link {
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid #ff791a;
  border-radius: 9px;
  background: #ff791a;
  box-shadow: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.sa-customer-header .sa-customer-header-link:hover { border-color: #ff903e; background: #ff903e; color: #fff; }

/* Dashboard introduction and live stats */
.sync-account-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  min-width: 0;
  margin-bottom: 25px;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--sa-account-line);
}
.sync-account-intro__copy { flex: 1; min-width: 0; }
.sync-account-intro .sa-customer-header { display: block; margin: 0; }
.sync-account-intro .sa-customer-header-link { display: inline-flex; margin-top: 17px; }
.sync-account-intro__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(245px, 34%);
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--sa-account-line);
  border-radius: 11px;
  background: var(--sa-account-panel);
}
.sync-account-intro__identity-copy { display: flex; flex-direction: column; min-width: 0; }
.sync-account-intro__identity-copy span { color: var(--sa-account-muted); font-size: 10px; }
.sync-account-intro__identity-copy strong { overflow: hidden; color: var(--sa-account-text); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.sa-page-customer-dashboard .sa-page-customer-dashboard-items { gap: 12px; }
.sa-page-customer-dashboard .sa-page-customer-dashboard-item {
  min-width: 0;
  min-height: 126px;
  padding: 15px;
  border: 1px solid var(--sa-account-line);
  border-radius: 13px;
  background: var(--sa-account-panel);
  box-shadow: none;
}
.sa-page-customer-dashboard .sa-page-customer-dashboard-item > span:first-child,
.sa-page-customer-dashboard .sa-page-customer-dashboard-item > div:first-child > span:first-child {
  width: 32px;
  height: 32px;
  border: 1px solid #ff791a33;
  border-radius: 8px;
  background: #ff791a12;
  color: var(--sa-account-accent);
}
.sa-page-customer-dashboard .sa-page-customer-dashboard-item p.text-2xl {
  margin-top: 11px;
  color: var(--sa-account-text);
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 750;
  letter-spacing: -.034em;
}
.sa-page-customer-dashboard .sa-page-customer-dashboard-item p.text-sm { color: var(--sa-account-muted); font-size: 11px; }
.sa-page-customer-dashboard .sa-page-customer-dashboard-item:nth-child(3) p.text-2xl { overflow: visible; font-size: 18px; line-height: 1.3; text-overflow: clip; white-space: normal; }

/* The recent order is primary; account actions are a compact list beside it. */
.sync-account-dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(255px, .9fr);
  gap: 13px;
  align-items: stretch;
  margin-top: 14px;
}
.sync-account-dashboard-lower > :only-child { grid-column: 1 / -1; }
.sa-page-customer-dashboard .sync-account-latest,
.sync-account-quick-actions {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--sa-account-line);
  border-radius: 13px;
  background: var(--sa-account-panel);
  box-shadow: none;
}
.sa-page-customer-dashboard .sync-account-latest { grid-column: 1; grid-row: 1; overflow: hidden; }
.sync-account-quick-actions { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; padding: 0 17px 5px; }
.sync-account-quick-actions__title,
.sa-page-customer-dashboard .sync-account-latest h2 {
  color: var(--sa-account-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.sync-account-quick-actions__title { padding: 16px 0 14px; }
.sa-page-customer-dashboard .sync-account-latest > div:first-child { min-height: 50px; padding: 15px 19px; border-color: var(--sa-account-line); }
.sa-page-customer-dashboard .sync-account-latest .sa-page-customer-dashboard-link { color: var(--sa-account-accent); font-size: 11px; }
.sync-account-quick-action {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 51px;
  padding: 8px 1px;
  border: 0;
  border-top: 1px solid var(--sa-account-line);
  border-radius: 0;
  background: transparent;
  color: var(--sa-account-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s ease;
}
.sync-account-quick-action:hover { color: var(--sa-account-accent); }
.sync-account-quick-action__icon { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border-radius: 7px; background: #ff791a12; color: var(--sa-account-accent); }
.sync-account-quick-action__icon svg { width: 16px; height: 16px; }
.sync-account-quick-action > span:nth-child(2) { flex: 1; min-width: 0; }
.sync-account-quick-action strong { overflow: hidden; display: block; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sync-account-quick-action__arrow { width: 14px; height: 14px; flex: none; color: var(--sa-account-muted); }
.sync-account-quick-action:hover .sync-account-quick-action__arrow { color: var(--sa-account-accent); }

.sync-account-latest__body { display: flex; align-items: center; min-height: 141px; }
.sync-account-latest__order { display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0; }
.sync-account-latest__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--sa-account-line-strong); border-radius: 10px; color: var(--sa-account-accent); }
.sync-account-latest__icon svg { width: 20px; height: 20px; }
.sync-account-latest__details { flex: 1; }
.sync-account-latest__details > p:first-child { color: var(--sa-account-text); font-size: 13px; font-weight: 700; }
.sync-account-latest__details > p:nth-child(2) { margin-top: 4px; color: var(--sa-account-muted); line-height: 1.55; }
.sync-account-latest__actions { display: flex; align-items: flex-end; flex-direction: column; gap: 9px; flex: none; }
.sync-account-latest__status { padding: 4px 8px; border: 1px solid var(--sa-account-line-strong); border-radius: 6px; color: var(--sa-account-muted); font-size: 10px; font-weight: 650; text-transform: capitalize; }
.sync-account-latest__status[data-status="completed"] { border-color: #1faa6570; background: #1faa6514; color: #61d997; }
.sync-account-latest__view { border-color: var(--sa-account-line-strong); border-radius: 7px; color: var(--sa-account-text); }
.sync-account-latest__view:hover { border-color: #ff791a70; color: var(--sa-account-accent); }
.sync-account-latest__empty { display: flex; align-items: center; gap: 11px; width: 100%; color: var(--sa-account-muted); font-size: 12px; }
.sync-account-latest__empty > span { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid var(--sa-account-line); border-radius: 9px; }
.sync-account-latest__empty svg { width: 18px; height: 18px; }
.sync-account-latest__empty p { flex: 1; }
.sync-account-latest__empty a { color: var(--sa-account-accent); font-size: 11px; font-weight: 700; text-decoration: none; }

/* Shared native customer panels. Status colours remain managed by SellAuth. */
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .rounded-card.border.border-theme.bg-surface {
  border-color: var(--sa-account-line);
  border-radius: 13px;
  background: var(--sa-account-panel);
  box-shadow: none;
}
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-items, .sa-page-customer-tickets-items, .sa-page-customer-balance-items) { overflow: hidden; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .sa-page-customer-subscriptions-items { overflow-x: auto; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-item, .sa-page-customer-tickets-item) { padding: 20px 22px; transition: background .18s ease; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-item, .sa-page-customer-tickets-item):hover { background: var(--sa-account-panel-hover); }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-title, .sa-page-customer-tickets-title) { font-size: 14px; font-weight: 700; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-actions, .sa-page-customer-tickets-item > .flex + .flex) { margin-top: 14px; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-actions, .sa-page-customer-tickets-item) a.rounded-btn,
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .sa-page-customer-invoices-actions button { min-height: 30px; border-radius: 7px; }

body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-subscriptions-items, .sa-page-customer-balance-items) table { min-width: 630px; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-subscriptions-items, .sa-page-customer-balance-items) th { color: var(--sa-account-muted); font-size: 10px; font-weight: 750; letter-spacing: .1em; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-subscriptions-items, .sa-page-customer-balance-items) td { color: var(--sa-account-text); font-size: 12px; line-height: 1.55; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-subscriptions-items, .sa-page-customer-balance-items) tr { border-color: var(--sa-account-line); }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .sa-page-customer-subscriptions-item:hover { background: var(--sa-account-panel-hover); }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-badge, .sa-page-customer-subscriptions-badge, .sa-page-customer-tickets-badge) { border-radius: 6px; font-size: 10px; font-weight: 700; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .sa-page-customer-balance-actions button { min-height: 43px; border-radius: 8px; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .sa-page-customer-balance-submit { min-height: 45px; border-radius: 8px; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .rounded-card.border.border-theme.bg-surface.p-10.text-center { padding: 42px 25px; }
body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] .rounded-card.border.border-theme.bg-surface.p-10.text-center > span:first-child { border: 1px solid #ff791a30; border-radius: 9px; background: #ff791a10; color: var(--sa-account-accent); }

.sa-page-customer-ticket .sa-page-customer-ticket-title {
  color: var(--sa-account-text);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.2;
}
.sa-page-customer-ticket .sa-page-customer-ticket-items { background: #101113; }
.sa-page-customer-ticket .sa-page-customer-ticket-item > div:last-child { border-radius: 10px; }
.sa-page-customer-ticket .sa-page-customer-ticket-items + div { border-color: var(--sa-account-line); background: var(--sa-account-panel); }
.sa-page-customer-ticket textarea.input { border-radius: 8px; }
html[data-scheme="light"] .sa-page-customer-ticket .sa-page-customer-ticket-items { background: #fafafb; }

/* Sign-in and account security keep their native forms and handlers. */
:is(.sa-customer-login-modal, .sa-customer-password-modal, .sa-customer-tfa-modal, .sa-customer-discord-modal, .sa-customer-delete-modal) > div > div:last-child {
  border: 1px solid #3a342f;
  border-radius: 16px;
  background: #17181a;
  box-shadow: 0 28px 75px #0008;
}
.sync-account-login-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sync-account-login-heading__brand { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid #ff791a42; border-radius: 9px; background: #ff791a13; }
.sync-account-login-heading__brand img { width: 27px; height: 27px; object-fit: contain; }
.sync-account-login-heading__eyebrow { color: #ff9948; font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.sa-customer-login-modal h3 { color: #fff; font-size: 22px; font-weight: 750; letter-spacing: -.03em; }
:is(.sa-customer-login-modal, .sa-customer-password-modal, .sa-customer-tfa-modal, .sa-customer-discord-modal, .sa-customer-delete-modal) .input { min-height: 43px; border-radius: 8px; }
:is(.sa-customer-login-modal, .sa-customer-password-modal, .sa-customer-tfa-modal, .sa-customer-discord-modal, .sa-customer-delete-modal) button[type="submit"] { min-height: 44px; border-radius: 8px; }
html[data-scheme="light"] :is(.sa-customer-login-modal, .sa-customer-password-modal, .sa-customer-tfa-modal, .sa-customer-discord-modal, .sa-customer-delete-modal) > div > div:last-child { border-color: #e0e1e5; background: #fff; box-shadow: 0 28px 75px #0003; }
html[data-scheme="light"] .sa-customer-login-modal h3 { color: #191a1e; }

@media (min-width: 1024px) {
  body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] > .wrap > .grid { grid-template-columns: 242px minmax(0, 1fr); gap: 33px; }
  .sa-customer-sidebar .sync-account-sidebar__desktop { top: 110px; }
}

@media (max-width: 1120px) {
  .sync-account-dashboard-lower { grid-template-columns: minmax(0, 1fr); }
  .sa-page-customer-dashboard .sync-account-latest,
  .sync-account-quick-actions { grid-column: 1; grid-row: auto; }
}

@media (max-width: 1023px) {
  .sa-customer-sidebar .sync-account-sidebar__mobile { margin-bottom: 3px; }
  .sa-customer-sidebar .sync-account-sidebar__mobile .sa-customer-sidebar-link {
    min-height: 37px;
    border: 1px solid var(--sa-account-line);
    border-radius: 8px;
    background: var(--sa-account-panel);
    color: var(--sa-account-muted);
    font-size: 11px;
  }
  .sa-customer-sidebar .sync-account-sidebar__mobile .sa-customer-sidebar-link[aria-current="page"] { border-color: #ff791a69; background: #ff791a14; color: var(--sa-account-accent); }
  .sa-customer-sidebar .sync-account-sidebar__mobile .sa-customer-sidebar-link[aria-current="page"]::before { display: none; }
}

@media (max-width: 640px) {
  body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] { padding-top: 24px; padding-bottom: 62px; }
  .sa-customer-header { margin-bottom: 22px; }
  .sa-customer-header .sa-customer-header-title { font-size: 30px; }
  .sa-customer-header .sa-customer-header-link { width: 100%; }
  .sync-account-intro { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 18px; padding-bottom: 20px; }
  .sync-account-intro__identity { width: 100%; max-width: 360px; }
  .sync-account-intro .sa-customer-header-link { margin-top: 16px; }
  .sa-page-customer-dashboard .sa-page-customer-dashboard-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .sa-page-customer-dashboard .sa-page-customer-dashboard-items > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sa-page-customer-dashboard .sa-page-customer-dashboard-item { min-height: 118px; padding: 13px; }
  .sa-page-customer-dashboard .sa-page-customer-dashboard-item p.text-2xl { margin-top: 10px; font-size: 19px; }
  .sync-account-latest__body { min-height: 116px; }
  .sync-account-latest__order { flex-wrap: wrap; gap: 11px; }
  .sync-account-latest__details { flex-basis: calc(100% - 56px); }
  .sync-account-latest__actions { align-items: center; flex-direction: row; justify-content: space-between; width: 100%; padding-top: 12px; border-top: 1px solid var(--sa-account-line); }
  .sync-account-latest__empty { flex-wrap: wrap; }
  .sync-account-latest__empty a { margin-left: 48px; }
  body[class*="sa-tpl-customer-"] .component[class*="sa-page-customer-"] :is(.sa-page-customer-invoices-item, .sa-page-customer-tickets-item) { padding: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .sa-customer-sidebar .sync-account-sidebar__nav .sa-customer-sidebar-link,
  .sync-account-quick-action { transition: none; }
}
