/* ─────────────────────────────────────────────────────────────────────────
   Pro My Account — UI v5 (account panel)

   Loaded after every legacy account stylesheet. Owns the shell (top bar,
   floating sidebar, mobile dock), the overview, form fields and the shared
   component vocabulary used by every section.

   Language (shared with login, cart and checkout): soft 6–16px corners,
   hairline borders, white surfaces on a faint brand-tinted canvas, layered
   low-contrast shadows, one accent colour used sparingly, calm motion.
   Type: 14px body, 12–13px meta, never below 11px.

   Colours only come from the shared --pma-* tokens so seasonal themes keep
   working.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
.pma-ui {
  --pma-bg:          var(--pma-canvas, #f6f4f8);
  --pma-surface:     #ffffff;
  --pma-border:      #e8e3ec;
  --pma-border-soft: #f1edf4;
  --pma-text:        #1a1520;
  --pma-text-2:      #5c5563;
  --pma-text-3:      #8f8896;
  --pma-muted:       #faf8fb;
  --pma-field:       #fcfbfd;

  --u-r-xs: 4px;
  --u-r-sm: 6px;
  --u-r:    8px;
  --u-r-md: 10px;
  --u-r-lg: 12px;
  --u-r-xl: 16px;

  --u-topbar-h:  64px;
  --u-side-w:    264px;
  --u-gap:       20px;
  --u-ease:      cubic-bezier(.2, .8, .2, 1);
  --u-shadow-1:  0 1px 2px rgba(26,21,32, .04), 0 1px 1px rgba(26,21,32, .02);
  --u-shadow-2:  0 1px 2px rgba(26,21,32, .04), 0 10px 28px -14px rgba(26,21,32, .14);
  --u-shadow-3:  0 2px 6px rgba(26,21,32, .05), 0 28px 56px -24px rgba(26,21,32, .28);
  --u-admin:     var(--wp-admin--admin-bar--height, 0px);
}

/* Icons */
.pma-ui .pma-i,
.pma-ui-tabbar .pma-i { display: block; flex: none; }
.pma-ui .pma-i-d,
.pma-ui-tabbar .pma-i-d { opacity: .14; transition: opacity .2s; }
.pma-ltr .pma-i-dir,
[dir="ltr"] .pma-i-dir { transform: scaleX(-1); }

/* ── Shell ───────────────────────────────────────────────────────────────── */
.pma-dashboard.pma-ui {
  display: grid;
  grid-template-columns: calc(var(--u-side-w) + 24px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  padding: 0;
  background: var(--pma-bg);
  color: var(--pma-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.pma-dashboard.pma-ui > .pma-topbar { grid-column: 1 / -1; grid-row: 1; }
.pma-dashboard.pma-ui > .pma-sidebar { grid-column: 1; grid-row: 2; }
.pma-dashboard.pma-ui > .pma-main { grid-column: 2; grid-row: 2; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.pma-dashboard.pma-ui .pma-topbar {
  position: sticky;
  top: var(--u-admin);
  inset-inline: auto;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--u-topbar-h);
  margin: 0;
  padding: 0 24px;
  background: color-mix(in srgb, var(--pma-surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  backdrop-filter: saturate(170%) blur(14px);
  border: 0;
  border-bottom: 1px solid var(--pma-border);
  border-radius: 0;
  box-shadow: 0 1px 0 rgba(255,255,255, .6) inset;
}

.pma-dashboard.pma-ui .pma-topbar-start {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.pma-dashboard.pma-ui .pma-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--pma-text);
  text-decoration: none;
}

.pma-dashboard.pma-ui .pma-topbar-brand img {
  display: block;
  width: auto;
  max-width: 132px;
  height: auto;
  max-height: 34px;
  object-fit: contain;
}

.pma-dashboard.pma-ui .pma-topbar-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  color: var(--pma-on-brand, #fff);
  background: linear-gradient(145deg, var(--pma-brand), var(--pma-brand-dark, var(--pma-brand)));
  border-radius: var(--u-r-md);
  box-shadow: 0 6px 14px -8px var(--pma-brand), inset 0 1px 0 rgba(255,255,255, .22);
}

.pma-dashboard.pma-ui .pma-topbar-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pma-text);
}

.pma-ui-crumb {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pma-text-3);
  white-space: nowrap;
}

.pma-ui-crumb::before {
  content: "";
  width: 1px;
  height: 18px;
  background: var(--pma-border);
}

.pma-dashboard.pma-ui .pma-topbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pma-dashboard.pma-ui .pma-topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
  height: 40px;
  margin-inline-end: 8px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--pma-text-3);
  text-align: start;
  background: var(--pma-bg);
  border: 1px solid transparent;
  border-radius: var(--u-r-md);
  box-shadow: none;
  cursor: text;
  transition: border-color .2s, background-color .2s, box-shadow .25s var(--u-ease);
}

.pma-dashboard.pma-ui .pma-topbar-search:hover {
  background: var(--pma-surface);
  border-color: var(--pma-border);
  box-shadow: var(--u-shadow-1);
}

.pma-dashboard.pma-ui .pma-topbar-search svg { width: 18px; height: 18px; }
.pma-dashboard.pma-ui .pma-topbar-search-label { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.pma-dashboard.pma-ui .pma-topbar-kbd {
  flex: none;
  padding: 3px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--pma-text-3);
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-xs);
  box-shadow: 0 1px 0 var(--pma-border);
}

.pma-dashboard.pma-ui .pma-ui-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  color: var(--pma-text-2);
  background: transparent;
  border: 0;
  border-radius: var(--u-r-md);
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}

.pma-dashboard.pma-ui .pma-ui-icon-btn:hover {
  color: var(--pma-text);
  background: var(--pma-bg);
}

.pma-dashboard.pma-ui .pma-ui-icon-btn svg { width: 21px; height: 21px; }
.pma-dashboard.pma-ui .pma-ui-icon-btn:hover .pma-i-d { opacity: .24; }

.pma-dashboard.pma-ui .pma-bell-count {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
  border: 2px solid var(--pma-surface);
  border-radius: 5px;
  box-sizing: border-box;
  animation: pma-u-pop .4s var(--u-ease) both;
}

.pma-dashboard.pma-ui .pma-bell-count.is-hidden { display: none; }

.pma-ui-me {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  margin-inline-start: 6px;
  padding: 0 4px 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--pma-text);
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-md);
  cursor: pointer;
  transition: border-color .2s, box-shadow .25s var(--u-ease);
}

.pma-rtl .pma-ui-me { padding: 0 12px 0 4px; }
.pma-ui-me:hover { border-color: color-mix(in srgb, var(--pma-brand) 30%, var(--pma-border)); box-shadow: var(--u-shadow-1); }

.pma-ui-me img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: var(--u-r);
}

.pma-ui-me-name {
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pma-dashboard.pma-ui .pma-mobile-menu-btn { display: none !important; }

/* ── Sidebar (floating card) ─────────────────────────────────────────────── */
.pma-dashboard.pma-ui .pma-sidebar {
  position: sticky;
  top: calc(var(--u-topbar-h) + var(--u-admin) + 20px);
  display: flex;
  flex-direction: column;
  width: auto;
  height: auto;
  max-height: calc(100vh - var(--u-topbar-h) - var(--u-admin) - 40px);
  min-height: 0;
  margin: 20px 0 20px;
  margin-inline-start: 24px;
  padding: 0;
  overflow: hidden;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-xl);
  box-shadow: var(--u-shadow-2);
  align-self: start;
}

.pma-dashboard.pma-ui .pma-side-close { display: none; }

.pma-dashboard.pma-ui .pma-side-head {
  flex: none;
  margin: 0;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--pma-border-soft);
}

.pma-dashboard.pma-ui .pma-ui-id {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
}

.pma-dashboard.pma-ui .pma-ui-id::before,
.pma-dashboard.pma-ui .pma-ui-id::after { display: none; }

.pma-dashboard.pma-ui .pma-avatar-wrap {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
}

.pma-dashboard.pma-ui .pma-avatar {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 0;
  border-radius: var(--u-r-lg) !important;
  box-shadow: 0 0 0 1px var(--pma-border), 0 0 0 3px var(--pma-surface), 0 0 0 4px var(--pma-brand-dim);
}

.pma-dashboard.pma-ui .pma-avatar-edit,
.pma-dashboard.pma-ui .pma-avatar-remove {
  position: absolute;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--pma-surface);
  border-radius: 5px !important;
  cursor: pointer;
  transition: transform .2s var(--u-ease), opacity .2s;
}

.pma-dashboard.pma-ui .pma-avatar-edit {
  bottom: -4px;
  inset-inline-end: -4px;
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
}

.pma-dashboard.pma-ui .pma-avatar-edit:hover { transform: scale(1.08); }

.pma-dashboard.pma-ui .pma-avatar-remove {
  top: -4px;
  inset-inline-end: -4px;
  color: #fff;
  background: var(--pma-text);
  opacity: 0;
}

.pma-dashboard.pma-ui .pma-avatar-wrap:hover .pma-avatar-remove,
.pma-dashboard.pma-ui .pma-avatar-remove:focus-visible { opacity: 1; }
.pma-dashboard.pma-ui .pma-avatar-edit svg { width: 11px; height: 11px; }
.pma-dashboard.pma-ui .pma-avatar-remove svg { width: 9px; height: 9px; }
.pma-dashboard.pma-ui .pma-avatar-edit .pma-i-d { opacity: 0; }

.pma-ui-id-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pma-dashboard.pma-ui .pma-profile-name {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pma-text);
}

.pma-dashboard.pma-ui .pma-profile-email {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pma-text-3);
  text-align: start;
}

/* Nav */
.pma-dashboard.pma-ui .pma-nav {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 10px 10px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--pma-border) transparent;
}

.pma-dashboard.pma-ui .pma-nav-group {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
}

.pma-dashboard.pma-ui .pma-nav-group + .pma-nav-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--pma-border-soft);
}

.pma-dashboard.pma-ui .pma-nav-group-title {
  display: block;
  margin: 2px 0 4px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.6;
  color: var(--pma-text-3);
}

.pma-dashboard.pma-ui .pma-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  margin: 0;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pma-text-2);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: var(--u-r-md);
  box-shadow: none;
  transition: background-color .2s, color .2s;
}

.pma-dashboard.pma-ui .pma-nav-item::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  inset-inline-start: -10px;
  width: 3px;
  background: var(--pma-brand);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transform: scaleY(.4);
  transition: opacity .2s, transform .3s var(--u-ease);
}

.pma-rtl .pma-nav-item::before { border-radius: 3px 0 0 3px; }
.pma-dashboard.pma-ui .pma-nav-item::after { display: none; }

.pma-dashboard.pma-ui .pma-nav-item:hover {
  color: var(--pma-text);
  background: var(--pma-muted);
}

.pma-dashboard.pma-ui .pma-nav-item.active {
  color: var(--pma-brand);
  font-weight: 700;
  background: var(--pma-brand-dim);
}

.pma-dashboard.pma-ui .pma-nav-item.active::before { opacity: 1; transform: none; }

.pma-dashboard.pma-ui .pma-nav-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  margin: 0;
  color: var(--pma-text-3);
  background: var(--pma-muted);
  border: 1px solid var(--pma-border-soft);
  border-radius: var(--u-r);
  transition: color .2s, background-color .2s, border-color .2s;
}

.pma-dashboard.pma-ui .pma-nav-icon svg { width: 18px; height: 18px; color: inherit; stroke: currentColor; }
.pma-dashboard.pma-ui .pma-nav-item:hover .pma-nav-icon { color: var(--pma-text); background: var(--pma-surface); }

.pma-dashboard.pma-ui .pma-nav-item.active .pma-nav-icon {
  color: var(--pma-brand);
  background: var(--pma-surface);
  border-color: color-mix(in srgb, var(--pma-brand) 18%, transparent);
}

.pma-dashboard.pma-ui .pma-nav-item.active .pma-i-d { opacity: .22; }
.pma-dashboard.pma-ui .pma-nav-label { flex: 1; min-width: 0; color: inherit; }

.pma-dashboard.pma-ui .pma-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 20px;
  height: 20px;
  margin: 0;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
  border-radius: 5px !important;
  box-shadow: none;
}

.pma-dashboard.pma-ui .pma-badge.is-hidden { display: none; }

/* Sidebar foot */
.pma-dashboard.pma-ui .pma-side-foot {
  display: grid;
  gap: 4px;
  flex: none;
  margin: 0;
  padding: 10px;
  border-top: 1px solid var(--pma-border-soft);
}

.pma-ui-side-shop {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  color: var(--pma-text);
  text-decoration: none;
  background: linear-gradient(135deg, var(--pma-brand-dim), transparent 80%), var(--pma-muted);
  border: 1px solid var(--pma-border-soft);
  border-radius: var(--u-r-lg);
  transition: border-color .2s, box-shadow .25s var(--u-ease), transform .25s var(--u-ease);
}

.pma-ui-side-shop:hover {
  color: var(--pma-text);
  border-color: color-mix(in srgb, var(--pma-brand) 25%, var(--pma-border));
  box-shadow: var(--u-shadow-1);
}

.pma-ui-side-shop-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
  border-radius: var(--u-r);
  box-shadow: 0 6px 14px -8px var(--pma-brand);
}

.pma-ui-side-shop-icon svg { width: 18px; height: 18px; }
.pma-ui-side-shop-icon .pma-i-d { opacity: .3; }

.pma-ui-side-shop-text { display: grid; flex: 1; min-width: 0; line-height: 1.5; }
.pma-ui-side-shop-text strong { font-size: 13px; font-weight: 800; }
.pma-ui-side-shop-text small { font-size: 11.5px; color: var(--pma-text-3); }

.pma-ui-side-shop > svg {
  width: 16px;
  height: 16px;
  color: var(--pma-text-3);
  transition: transform .25s var(--u-ease), color .2s;
}

.pma-ui-side-shop:hover > svg { color: var(--pma-brand); transform: translateX(-3px); }
.pma-ltr .pma-ui-side-shop:hover > svg { transform: scaleX(-1) translateX(-3px); }

.pma-dashboard.pma-ui .pma-logout { min-height: 38px; color: var(--pma-text-3); }
.pma-dashboard.pma-ui .pma-logout .pma-nav-icon { background: transparent; border-color: transparent; }
.pma-dashboard.pma-ui .pma-logout:hover { color: #8f6d43; background: #fdf3f4; }
.pma-dashboard.pma-ui .pma-logout:hover .pma-nav-icon { color: #8f6d43; background: transparent; }

/* ── Main ────────────────────────────────────────────────────────────────── */
.pma-dashboard.pma-ui .pma-main {
  min-width: 0;
  margin: 0;
  padding: 24px clamp(16px, 2.6vw, 32px) 56px;
  overflow: visible;
  background: transparent;
}

.pma-dashboard.pma-ui .pma-section { max-width: 1100px; margin: 0 auto; }
.pma-dashboard.pma-ui .pma-section.active { display: block; animation: pma-u-in .45s var(--u-ease) both; }

/* Section headers — every section */
.pma-dashboard.pma-ui .pma-section-header:not(.pma-ui-hero) {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0 0 18px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.pma-dashboard.pma-ui .pma-section-header h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -.01em;
  color: var(--pma-text);
}

.pma-dashboard.pma-ui .pma-section-sub {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--pma-text-3);
}

.pma-dashboard.pma-ui .pma-section-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.pma-ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--u-r-md);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .25s var(--u-ease), transform .2s var(--u-ease);
}

.pma-ui-btn svg { width: 18px; height: 18px; }
.pma-ui-btn:hover { transform: translateY(-1px); }
.pma-ui-btn:active { transform: translateY(0) scale(.99); }
.pma-ui-btn:focus-visible { outline: 2px solid var(--pma-brand); outline-offset: 2px; }

.pma-ui .pma-ui-btn--primary {
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
  box-shadow: 0 1px 0 rgba(255,255,255, .16) inset, 0 10px 22px -14px var(--pma-brand);
}

.pma-ui .pma-ui-btn--primary:hover {
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand-dark, var(--pma-brand));
  box-shadow: 0 1px 0 rgba(255,255,255, .16) inset, 0 14px 26px -14px var(--pma-brand);
}

.pma-ui .pma-ui-btn--primary .pma-i-d { opacity: .3; }

.pma-ui .pma-ui-btn--ghost {
  color: var(--pma-text);
  background: var(--pma-surface);
  border-color: var(--pma-border);
}

.pma-ui .pma-ui-btn--ghost:hover {
  color: var(--pma-text);
  border-color: color-mix(in srgb, var(--pma-brand) 30%, var(--pma-border));
  box-shadow: var(--u-shadow-1);
}

.pma-ui .pma-ui-btn--dark { color: #fff; background: var(--pma-text); }
.pma-ui .pma-ui-btn--dark:hover { color: var(--pma-on-brand, #fff); background: var(--pma-brand); }
.pma-ui .pma-ui-btn--dark .pma-i-d { opacity: .25; }

.pma-ui-btn--sm { height: 36px; padding: 0 14px; font-size: 13px; }
.pma-ui-btn--block { width: 100%; }

.pma-ui-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
  border-radius: 5px;
}

.pma-ui-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--pma-text-2);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color .2s;
}

.pma-ui-link svg { width: 16px; height: 16px; transition: transform .25s var(--u-ease); }
.pma-ui-link:hover { color: var(--pma-brand); }
.pma-ui-link:hover svg { transform: translateX(-3px); }
.pma-ltr .pma-ui-link:hover svg { transform: scaleX(-1) translateX(-3px); }

/* Legacy buttons — same language, so every section reads as one product. */
.pma-dashboard.pma-ui .pma-btn-primary,
.pma-dashboard.pma-ui .pma-btn-primary-sm,
.pma-dashboard.pma-ui .pma-btn-sm,
.pma-dashboard.pma-ui .pma-btn-ghost,
.pma-dashboard.pma-ui .pma-btn-secondary,
.pma-dashboard.pma-ui .pma-btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--u-r-md) !important;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .25s var(--u-ease);
}

.pma-dashboard.pma-ui .pma-btn-primary,
.pma-dashboard.pma-ui .pma-btn-primary-sm {
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
  border: 1px solid var(--pma-brand);
  box-shadow: 0 10px 20px -14px var(--pma-brand);
}

.pma-dashboard.pma-ui .pma-btn-primary { min-height: 42px; padding: 0 18px; font-size: 13.5px; }
.pma-dashboard.pma-ui .pma-btn-lg { min-height: 44px; padding: 0 22px; font-size: 14px; }

.pma-dashboard.pma-ui .pma-btn-primary:hover,
.pma-dashboard.pma-ui .pma-btn-primary-sm:hover {
  background: var(--pma-brand-dark, var(--pma-brand));
  border-color: var(--pma-brand-dark, var(--pma-brand));
  transform: none;
}

.pma-dashboard.pma-ui .pma-btn-sm,
.pma-dashboard.pma-ui .pma-btn-ghost,
.pma-dashboard.pma-ui .pma-btn-secondary {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  color: var(--pma-text);
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  box-shadow: none;
}

.pma-dashboard.pma-ui .pma-btn-sm:hover,
.pma-dashboard.pma-ui .pma-btn-ghost:hover,
.pma-dashboard.pma-ui .pma-btn-secondary:hover {
  color: var(--pma-text);
  background: var(--pma-surface);
  border-color: color-mix(in srgb, var(--pma-brand) 30%, var(--pma-border));
  box-shadow: var(--u-shadow-1);
  transform: none;
}

.pma-dashboard.pma-ui .pma-btn-primary svg,
.pma-dashboard.pma-ui .pma-btn-sm svg,
.pma-dashboard.pma-ui .pma-btn-ghost svg { width: 17px; height: 17px; }

/* Legacy surfaces: one card language across every section. */
.pma-dashboard.pma-ui .pma-card,
.pma-dashboard.pma-ui .pma-order-card,
.pma-dashboard.pma-ui .pma-course-card,
.pma-dashboard.pma-ui .pma-tickets-table,
.pma-dashboard.pma-ui .pma-chat-wrap,
.pma-dashboard.pma-ui .pma-order-detail-panel,
.pma-dashboard.pma-ui .pma-notification-widget,
.pma-dashboard.pma-ui .pma-new-ticket-card,
.pma-dashboard.pma-ui .pma-addr-card,
.pma-dashboard.pma-ui .pma-addr-editor-card,
.pma-dashboard.pma-ui .pma-complete-card,
.pma-dashboard.pma-ui .pma-reply-form,
.pma-dashboard.pma-ui .pma-empty-state,
.pma-dashboard.pma-ui .pma-panel {
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-lg) !important;
  box-shadow: var(--u-shadow-1);
}

.pma-dashboard.pma-ui .pma-order-card:hover,
.pma-dashboard.pma-ui .pma-course-card:hover,
.pma-dashboard.pma-ui .pma-addr-card:hover {
  border-color: color-mix(in srgb, var(--pma-brand) 18%, var(--pma-border));
  box-shadow: var(--u-shadow-2);
}

.pma-dashboard.pma-ui .pma-status-badge,
.pma-dashboard.pma-ui .pma-order-stage-badge,
.pma-dashboard.pma-ui .pma-priority-badge,
.pma-dashboard.pma-ui .pma-addr-flag,
.pma-dashboard.pma-ui .pma-filter-pill,
.pma-dashboard.pma-ui .pma-ticket-id,
.pma-dashboard.pma-ui .pma-ticket-code { border-radius: var(--u-r-sm) !important; }

.pma-dashboard.pma-ui .pma-notification-item { border-radius: var(--u-r-md) !important; }
.pma-dashboard.pma-ui .pma-chat-bubble { border-radius: var(--u-r-lg) !important; }
.pma-dashboard.pma-ui .pma-status-dot,
.pma-dashboard.pma-ui .pma-chat-avatar,
.pma-dashboard.pma-ui .pma-spinner,
.pma-dashboard.pma-ui .pma-switch-thumb,
.pma-dashboard.pma-ui .pma-switch-track { border-radius: 5px !important; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.pma-dashboard.pma-ui .pma-form-group,
.pma-dashboard.pma-ui .pma-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; }

.pma-dashboard.pma-ui .pma-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0 0 16px;
}

.pma-dashboard.pma-ui .pma-form-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.pma-dashboard.pma-ui .pma-form-group > label,
.pma-dashboard.pma-ui .pma-field > label,
.pma-dashboard.pma-ui .pma-section form label:not([class*="pma-switch"]):not([class*="check"]):not([class*="radio"]):not([class*="rating"]) {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--pma-text-2);
}

.pma-dashboard.pma-ui .req,
.pma-dashboard.pma-ui label .required { color: #8f6d43; text-decoration: none; }

.pma-dashboard.pma-ui .pma-input,
.pma-dashboard.pma-ui .pma-select,
.pma-dashboard.pma-ui .pma-textarea,
.pma-dashboard.pma-ui .pma-section input[type="text"],
.pma-dashboard.pma-ui .pma-section input[type="email"],
.pma-dashboard.pma-ui .pma-section input[type="tel"],
.pma-dashboard.pma-ui .pma-section input[type="password"],
.pma-dashboard.pma-ui .pma-section input[type="number"],
.pma-dashboard.pma-ui .pma-section input[type="date"],
.pma-dashboard.pma-ui .pma-section input[type="search"],
.pma-dashboard.pma-ui .pma-section select,
.pma-dashboard.pma-ui .pma-section textarea {
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--pma-text);
  background-color: var(--pma-field);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-md) !important;
  box-shadow: none;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s, box-shadow .25s var(--u-ease), background-color .2s;
}

.pma-dashboard.pma-ui .pma-textarea,
.pma-dashboard.pma-ui .pma-section textarea {
  height: auto;
  min-height: 112px;
  padding: 12px 14px;
  line-height: 1.9;
  resize: vertical;
}

.pma-dashboard.pma-ui .pma-select,
.pma-dashboard.pma-ui .pma-section select {
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8896' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: left 12px center;
  cursor: pointer;
}

.pma-ltr.pma-dashboard.pma-ui .pma-select,
.pma-ltr.pma-dashboard.pma-ui .pma-section select { background-position: right 12px center; }

.pma-dashboard.pma-ui .pma-input::placeholder,
.pma-dashboard.pma-ui .pma-textarea::placeholder,
.pma-dashboard.pma-ui .pma-section input::placeholder,
.pma-dashboard.pma-ui .pma-section textarea::placeholder { color: #b5aebb; opacity: 1; }

.pma-dashboard.pma-ui .pma-input:hover,
.pma-dashboard.pma-ui .pma-select:hover,
.pma-dashboard.pma-ui .pma-textarea:hover,
.pma-dashboard.pma-ui .pma-section input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
.pma-dashboard.pma-ui .pma-section select:hover,
.pma-dashboard.pma-ui .pma-section textarea:hover { border-color: #d7d0dd; }

.pma-dashboard.pma-ui .pma-input:focus,
.pma-dashboard.pma-ui .pma-select:focus,
.pma-dashboard.pma-ui .pma-textarea:focus,
.pma-dashboard.pma-ui .pma-section input:not([type="checkbox"]):not([type="radio"]):focus,
.pma-dashboard.pma-ui .pma-section select:focus,
.pma-dashboard.pma-ui .pma-section textarea:focus {
  background-color: var(--pma-surface);
  border-color: var(--pma-brand);
  box-shadow: 0 0 0 4px var(--pma-brand-ring);
  outline: 0;
}

.pma-dashboard.pma-ui .pma-input[aria-invalid="true"],
.pma-dashboard.pma-ui .pma-input.is-invalid { border-color: #d9c3a0; background-color: #fffafa; }

.pma-dashboard.pma-ui .pma-input:disabled,
.pma-dashboard.pma-ui .pma-input[readonly] { color: var(--pma-text-3); background-color: var(--pma-muted); cursor: not-allowed; }

.pma-dashboard.pma-ui .pma-file-input { height: auto; padding: 9px 12px; font-size: 13px; }

.pma-dashboard.pma-ui .pma-section input[type="checkbox"],
.pma-dashboard.pma-ui .pma-section input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pma-brand);
}

.pma-dashboard.pma-ui .pma-field-hint { font-size: 11.5px; line-height: 1.7; color: var(--pma-text-3); }
.pma-dashboard.pma-ui .pma-field-error { font-size: 12px; font-weight: 600; color: #8f6d43; }

.pma-dashboard.pma-ui .pma-form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 14px;
  padding: 0;
  border: 0;
}

.pma-dashboard.pma-ui .pma-form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pma-border-soft);
}

.pma-dashboard.pma-ui .pma-form-section-title h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--pma-text);
}

.pma-dashboard.pma-ui .pma-form-section-title + .pma-form-row { margin-top: 0; }
.pma-dashboard.pma-ui .pma-form-row + .pma-form-section-title { margin-top: 22px; }

.pma-dashboard.pma-ui .pma-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--pma-border-soft);
}

.pma-dashboard.pma-ui .pma-card-body { padding: 22px; }

/* Profile completion inside the profile section stays compact. */
.pma-dashboard.pma-ui .pma-complete-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  padding: 14px 18px;
}

.pma-dashboard.pma-ui .pma-complete-bar,
.pma-dashboard.pma-ui .pma-complete-bar i,
.pma-dashboard.pma-ui .pma-strength-bar,
.pma-dashboard.pma-ui .pma-strength-bar i { border-radius: 5px !important; }

/* ── Overview: hero ──────────────────────────────────────────────────────── */
.pma-ui-hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  margin: 0 0 var(--u-gap);
  padding: 24px 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--pma-brand-dim), transparent 55%),
    var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-xl);
  box-shadow: var(--u-shadow-1);
}

.pma-rtl .pma-ui-hero {
  background:
    radial-gradient(120% 140% at 0% 100%, var(--pma-brand-dim), transparent 55%),
    var(--pma-surface);
}

/* Fine dotted texture fading out across the hero. */
.pma-ui-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(color-mix(in srgb, var(--pma-brand) 22%, transparent) 1px, transparent 1.3px) 0 0 / 16px 16px;
  -webkit-mask-image: linear-gradient(to right, #000, transparent 45%);
  mask-image: linear-gradient(to right, #000, transparent 45%);
  opacity: .5;
  pointer-events: none;
}

.pma-rtl .pma-ui-hero::before {
  -webkit-mask-image: linear-gradient(to left, transparent 55%, #000);
  mask-image: linear-gradient(to left, transparent 55%, #000);
}

.pma-ui-hero::after { display: none; }

.pma-ui-hero-text { position: relative; flex: 1 1 340px; min-width: 0; }

.pma-ui-eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--pma-text-3);
}

.pma-dashboard.pma-ui .pma-ui-hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -.015em;
  color: var(--pma-text);
}

.pma-ui-hero-title span { color: var(--pma-brand); }

.pma-ui-hero-sub {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--pma-text-2);
}

.pma-ui-hero-actions { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Overview: live order tracker ────────────────────────────────────────── */
.pma-ui-track {
  margin: 0 0 var(--u-gap);
  overflow: hidden;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-xl);
  box-shadow: var(--u-shadow-2);
}

.pma-ui-track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 0;
}

.pma-dashboard.pma-ui .pma-ui-track-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--pma-text); }

.pma-ui-track-head p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--pma-text-3);
}

.pma-ui-track-head .pma-ui-eyebrow { color: var(--pma-brand); }
.pma-ui-track-thumbs { display: flex; flex: none; }

.pma-ui-track-thumbs img {
  display: block;
  width: 46px !important;
  height: 46px !important;
  margin: 0;
  object-fit: cover;
  background: var(--pma-muted);
  border: 2px solid var(--pma-surface);
  border-radius: var(--u-r-md);
  box-shadow: 0 0 0 1px var(--pma-border);
}

.pma-ui-track-thumbs img + img { margin-inline-start: -12px; }

.pma-ui-steps {
  --pma-step: 1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 22px 22px 6px;
  list-style: none;
}

.pma-ui-steps::before,
.pma-ui-steps::after {
  content: "";
  position: absolute;
  top: calc(22px + 16px);
  inset-inline-start: calc(22px + 12.5%);
  height: 2px;
  background: var(--pma-border);
  border-radius: 2px;
}

.pma-ui-steps::before { inset-inline-end: calc(22px + 12.5%); }

.pma-ui-steps::after {
  width: calc((100% - 44px) * (var(--pma-step) - 1) / 4);
  background: var(--pma-brand);
  transition: width 1s var(--u-ease);
}

.pma-ui-steps li {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-align: center;
}

.pma-ui-step-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--pma-text-3);
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-md);
  transition: all .3s var(--u-ease);
}

.pma-ui-step-dot svg { width: 17px; height: 17px; }
.pma-ui-step-label { font-size: 12px; font-weight: 600; color: var(--pma-text-3); }

.pma-ui-steps li.is-done .pma-ui-step-dot {
  color: var(--pma-on-brand, #fff);
  background: var(--pma-brand);
  border-color: var(--pma-brand);
}

.pma-ui-steps li.is-done .pma-ui-step-dot svg { stroke-width: 2; }

.pma-ui-steps li.is-current .pma-ui-step-dot {
  color: var(--pma-brand);
  border-color: var(--pma-brand);
  box-shadow: 0 0 0 4px var(--pma-brand-dim);
  animation: pma-u-pulse 2.4s ease-in-out infinite;
}

.pma-ui-steps li.is-current .pma-i-d { opacity: .25; }
.pma-ui-steps li.is-done .pma-ui-step-label,
.pma-ui-steps li.is-current .pma-ui-step-label { font-weight: 700; color: var(--pma-text); }

.pma-ui-track-note { margin: 8px 22px 0; font-size: 12.5px; color: var(--pma-text-2); text-align: center; }

.pma-ui-track-pay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin: 16px 22px 0;
  padding: 14px 16px;
  background: #fff8ec;
  border: 1px solid #e9dec8;
  border-radius: var(--u-r-lg);
}

.pma-ui-track-pay p { flex: 1 1 240px; margin: 0; font-size: 13px; line-height: 1.9; color: #6b5332; }

.pma-ui-track-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding: 12px 22px;
  background: var(--pma-muted);
  border-top: 1px solid var(--pma-border-soft);
}

/* ── Overview: KPI strip ─────────────────────────────────────────────────── */
.pma-dashboard.pma-ui .pma-ui-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 var(--u-gap);
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.pma-dashboard.pma-ui .pma-ui-kpi {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  min-height: 0;
  margin: 0;
  padding: 14px 16px;
  font: inherit;
  text-align: start;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-lg) !important;
  box-shadow: var(--u-shadow-1);
  cursor: pointer;
  transform: none;
  transition: border-color .2s, box-shadow .25s var(--u-ease), transform .25s var(--u-ease);
}

.pma-dashboard.pma-ui .pma-ui-kpi:hover {
  border-color: color-mix(in srgb, var(--pma-brand) 22%, var(--pma-border));
  box-shadow: var(--u-shadow-2);
  transform: translateY(-2px);
}

.pma-dashboard.pma-ui .pma-ui-kpi::before,
.pma-dashboard.pma-ui .pma-ui-kpi::after { display: none; }

.pma-ui-kpi-icon {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--pma-brand);
  background: var(--pma-brand-dim);
  border-radius: var(--u-r-md);
}

.pma-ui-kpi-icon svg { width: 20px; height: 20px; }
.pma-ui-kpi-icon .pma-i-d { opacity: .22; }
.pma-ui-kpi-value { font-size: 20px; font-weight: 800; line-height: 1.3; color: var(--pma-text); }
.pma-ui-kpi-label { font-size: 12px; color: var(--pma-text-3); }

/* ── Overview: nudge ─────────────────────────────────────────────────────── */
.pma-ui-nudge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 var(--u-gap);
  padding: 12px 14px;
  background: linear-gradient(90deg, #fffaf0, var(--pma-surface) 60%);
  border: 1px solid #efe6d6;
  border-radius: var(--u-r-lg);
}

.pma-ui-nudge-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  color: #8f6d43;
  background: #f6efe5;
  border-radius: var(--u-r-md);
}

.pma-ui-nudge-icon svg { width: 19px; height: 19px; }
.pma-ui-nudge-icon .pma-i-d { opacity: .35; }
.pma-ui-nudge p { flex: 1; margin: 0; font-size: 13px; line-height: 1.8; color: var(--pma-text-2); }
.pma-ui-nudge strong { display: block; color: var(--pma-text); }

/* ── Overview: cards ─────────────────────────────────────────────────────── */
.pma-ui-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--u-gap);
  align-items: start;
}

.pma-ui-aside { display: grid; gap: var(--u-gap); }

.pma-dashboard.pma-ui .pma-ui-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--pma-surface);
  border: 1px solid var(--pma-border);
  border-radius: var(--u-r-xl) !important;
  box-shadow: var(--u-shadow-1);
}

.pma-ui-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid var(--pma-border-soft);
}

.pma-dashboard.pma-ui .pma-ui-card-head h3 { margin: 0; font-size: 14.5px; font-weight: 800; color: var(--pma-text); }

/* Recent orders */
.pma-ui-orders { margin: 0; padding: 6px; list-style: none; }
.pma-ui-orders li { margin: 0; }

.pma-ui-order {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--u-r-lg);
  transition: background-color .2s;
}

.pma-ui-order:hover { background: var(--pma-muted); }

.pma-ui-order-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  background: var(--pma-muted);
  border: 1px solid var(--pma-border-soft);
  border-radius: var(--u-r-md);
}

.pma-ui-order-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.pma-ui-order-thumb em {
  position: absolute;
  bottom: -4px;
  inset-inline-end: -4px;
  padding: 1px 5px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  color: #fff;
  background: var(--pma-text);
  border: 2px solid var(--pma-surface);
  border-radius: 5px;
}

.pma-ui-order-main { display: grid; gap: 3px; min-width: 0; }

.pma-ui-order-main strong {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--pma-text);
}

.pma-ui-order-main small { display: flex; gap: 6px; font-size: 12px; color: var(--pma-text-3); }
.pma-ui-order-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pma-ui-order-total { font-size: 13.5px; font-weight: 800; white-space: nowrap; color: var(--pma-text); }
.pma-ui-order-go { width: 16px; height: 16px; color: var(--pma-text-3); transition: transform .25s var(--u-ease), color .2s; }
.pma-ui-order:hover .pma-ui-order-go { color: var(--pma-brand); transform: translateX(-3px); }
.pma-ltr .pma-ui-order:hover .pma-ui-order-go { transform: scaleX(-1) translateX(-3px); }

/* Status pill */
.pma-ui-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--pma-text-2);
  background: var(--pma-muted);
  border-radius: var(--u-r-sm);
}

.pma-ui-status::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.pma-ui-status.is-pending,
.pma-ui-status.is-failed    { color: #8f6d43; background: #fff6e0; }
.pma-ui-status.is-review    { color: #7c1695; background: #eef3fe; }
.pma-ui-status.is-packing   { color: #7c1695; background: #f3edfc; }
.pma-ui-status.is-shipped   { color: #5f0f74; background: #e9f6fb; }
.pma-ui-status.is-delivered { color: #7c1695; background: #ebf7f1; }
.pma-ui-status.is-cancelled,
.pma-ui-status.is-refunded  { color: #7a7380; background: #f4f3f5; }

/* Empty state */
.pma-ui-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px 32px;
  text-align: center;
}

.pma-ui-empty-art { display: block; width: 104px; margin-bottom: 12px; color: var(--pma-brand); }
.pma-ui-empty-art svg { display: block; width: 100%; height: auto; }
.pma-dashboard.pma-ui .pma-ui-empty h4 { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: var(--pma-text); }
.pma-ui-empty p { max-width: 34em; margin: 0 0 18px; font-size: 13px; line-height: 1.9; color: var(--pma-text-3); }

/* Quick links */
.pma-ui-quick { margin: 0; padding: 6px; list-style: none; }
.pma-ui-quick li { margin: 0; }

.pma-ui-quick button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pma-text);
  text-align: start;
  background: transparent;
  border: 0;
  border-radius: var(--u-r-md);
  cursor: pointer;
  transition: background-color .2s;
}

.pma-ui-quick button > span:not(.pma-ui-quick-icon) { flex: 1; }
.pma-ui-quick button:hover { background: var(--pma-muted); }
.pma-ui-quick button > svg { width: 16px; height: 16px; color: var(--pma-text-3); transition: transform .25s var(--u-ease); }
.pma-ui-quick button:hover > svg { transform: translateX(-3px); }

.pma-ui-quick-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--pma-text-2);
  background: var(--pma-muted);
  border: 1px solid var(--pma-border-soft);
  border-radius: var(--u-r);
  transition: color .2s;
}

.pma-ui-quick-icon svg { width: 17px; height: 17px; }
.pma-ui-quick button:hover .pma-ui-quick-icon { color: var(--pma-brand); }

/* Help card */
.pma-dashboard.pma-ui .pma-ui-help {
  position: relative;
  display: block;
  margin: 0;
  padding: 20px 18px 18px;
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 100% 0%, var(--pma-brand-dim), transparent 70%),
    var(--pma-surface);
}

.pma-ui-help::after { display: none; }

.pma-ui-help-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  color: var(--pma-brand);
  background: var(--pma-surface);
  border: 1px solid color-mix(in srgb, var(--pma-brand) 16%, var(--pma-border));
  border-radius: var(--u-r-md);
}

.pma-ui-help-icon svg { width: 20px; height: 20px; }
.pma-ui-help-icon .pma-i-d { opacity: .25; }
.pma-dashboard.pma-ui .pma-ui-help h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--pma-text); }
.pma-ui-help p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.9; color: var(--pma-text-2); }

/* ── Mobile dock ─────────────────────────────────────────────────────────── */
.pma-mobile-nav.pma-ui-tabbar { display: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .pma-ui-split { grid-template-columns: minmax(0, 1fr); }
  .pma-ui-aside { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .pma-dashboard.pma-ui .pma-topbar-search { width: 220px; }
}

@media (max-width: 900px) {
  .pma-ui { --u-topbar-h: 56px; --u-gap: 14px; }

  .pma-dashboard.pma-ui { grid-template-columns: minmax(0, 1fr); }
  .pma-dashboard.pma-ui > .pma-main { grid-column: 1; }

  /* Header: brand + page name on one side, three quiet tools on the other. */
  .pma-dashboard.pma-ui .pma-topbar { gap: 8px; padding: 0 12px; }
  .pma-dashboard.pma-ui .pma-topbar-start { gap: 10px; }
  .pma-dashboard.pma-ui .pma-topbar-name { display: none; }
  .pma-dashboard.pma-ui .pma-topbar-mark { width: 32px; height: 32px; font-size: 14px; border-radius: 5px; }
  .pma-dashboard.pma-ui .pma-topbar-brand img { max-width: 96px; max-height: 28px; }
  .pma-ui-crumb { gap: 10px; font-size: 14px; font-weight: 800; color: var(--pma-text); }
  .pma-ui-crumb::before { height: 16px; }

  .pma-ui-me-name,
  .pma-dashboard.pma-ui .pma-topbar-search-label,
  .pma-dashboard.pma-ui .pma-topbar-kbd { display: none; }

  .pma-dashboard.pma-ui .pma-topbar-tools { gap: 2px; }

  .pma-dashboard.pma-ui .pma-topbar-search {
    justify-content: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    color: var(--pma-text-2);
    background: transparent;
    border-color: transparent;
  }

  .pma-dashboard.pma-ui .pma-ui-icon-btn { width: 38px; height: 38px; }
  .pma-dashboard.pma-ui .pma-ui-icon-btn svg,
  .pma-dashboard.pma-ui .pma-topbar-search svg { width: 20px; height: 20px; }
  .pma-dashboard.pma-ui .pma-bell-count { top: 2px; left: 2px; }

  .pma-ui-me,
  .pma-rtl .pma-ui-me { width: 38px; height: 38px; margin-inline-start: 4px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .pma-ui-me img { width: 32px; height: 32px; box-shadow: 0 0 0 1px var(--pma-border); }

  /* Drawer */
  .pma-dashboard.pma-ui .pma-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    z-index: 100002;
    width: min(320px, 86vw);
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    border-start-end-radius: var(--u-r-xl);
    border-end-end-radius: var(--u-r-xl);
    box-shadow: var(--u-shadow-3);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform .4s var(--u-ease), visibility 0s linear .4s;
  }

  .pma-rtl.pma-dashboard.pma-ui .pma-sidebar { transform: translateX(100%); }

  .pma-dashboard.pma-ui .pma-sidebar.open,
  .pma-rtl.pma-dashboard.pma-ui .pma-sidebar.open {
    visibility: visible;
    transform: none;
    transition: transform .4s var(--u-ease), visibility 0s;
  }

  .pma-dashboard.pma-ui .pma-side-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    color: var(--pma-text-2);
    background: var(--pma-muted);
    border: 1px solid var(--pma-border-soft);
    border-radius: var(--u-r-md);
    cursor: pointer;
  }

  .pma-dashboard.pma-ui .pma-side-close svg { width: 18px; height: 18px; }
  .pma-dashboard.pma-ui .pma-side-head { padding: 18px 16px 14px; padding-inline-end: 60px; }
  .pma-dashboard.pma-ui .pma-side-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .pma-dashboard.pma-ui .pma-nav-item { min-height: 44px; }

  body .pma-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: block;
    background: rgba(20,14,24, .4);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--u-ease, ease), visibility 0s linear .3s;
    animation: none;
  }

  body .pma-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s var(--u-ease, ease), visibility 0s;
  }

  .pma-dashboard.pma-ui .pma-main { padding: 16px 14px calc(92px + env(safe-area-inset-bottom, 0px)); }

  /* Dock: a calm bar of five equal targets; the active one gets a soft pill. */
  .pma-mobile-nav.pma-ui-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 2px;
    height: auto;
    margin: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, #fff 92%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border: 0;
    border-top: 1px solid var(--pma-border, #e8e3ec);
    border-radius: 0;
    box-shadow: 0 -8px 24px -18px rgba(26,21,32, .28);
  }

  .pma-ui-tabbar .pma-mob-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    min-width: 0;
    margin: 0;
    padding: 0 2px 2px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pma-text-3, #8f8896);
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s;
  }

  .pma-ui-tabbar .pma-mob-item > span:not([class]),
  .pma-ui-tabbar .pma-mob-item > span:last-child:not(.pma-badge) { white-space: nowrap; }

  /* Icon sits inside a 48×30 pill-shaped lane; ::before is the pill. */
  .pma-ui-tabbar .pma-mob-item > svg {
    width: 48px;
    height: 30px;
    padding: 5px 13px;
    border-radius: 5px;
    transition: background-color .25s var(--u-ease, ease), color .2s, transform .25s var(--u-ease, ease);
  }

  .pma-ui-tabbar .pma-mob-item:hover { color: var(--pma-text, #1a1520); background: transparent; }
  .pma-ui-tabbar .pma-mob-item:active > svg { transform: scale(.94); }
  .pma-ui-tabbar .pma-mob-item::before,
  .pma-ui-tabbar .pma-mob-item::after { display: none; }

  .pma-ui-tabbar .pma-mob-item.active {
    color: var(--pma-brand);
    font-weight: 800;
    background: transparent;
  }

  .pma-ui-tabbar .pma-mob-item.active > svg { background: var(--pma-brand-dim); }
  .pma-ui-tabbar .pma-mob-item.active .pma-i-d { opacity: .28; }

  .pma-ui-tabbar .pma-badge {
    position: absolute;
    top: -3px;
    left: calc(50% + 4px);
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1;
    color: var(--pma-on-brand, #fff);
    background: var(--pma-brand);
    border: 2px solid #fff;
    border-radius: 5px;
    box-sizing: border-box;
  }

  .pma-ui-tabbar .pma-badge.is-hidden { display: none; }

  /* Shop: same lane, filled with the brand — distinct but not shouting. */
  .pma-ui-tabbar .pma-ui-tab-shop { color: var(--pma-text, #1a1520); font-weight: 700; }

  .pma-ui-tab-shop-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 30px;
    color: var(--pma-on-brand, #fff);
    background: linear-gradient(145deg, var(--pma-brand), var(--pma-brand-dark, var(--pma-brand)));
    border-radius: 5px;
    box-shadow: 0 6px 14px -8px var(--pma-brand), inset 0 1px 0 rgba(255,255,255, .2);
    transition: transform .25s var(--u-ease, ease);
  }

  .pma-ui-tab-shop:active .pma-ui-tab-shop-mark { transform: scale(.94); }
  .pma-ui-tab-shop-mark svg { width: 19px; height: 19px; }
  .pma-ui-tab-shop-mark .pma-i-d { opacity: .3; }

  /* Overview */
  .pma-ui-hero { padding: 18px 16px; border-radius: var(--u-r-lg); }
  .pma-dashboard.pma-ui .pma-ui-hero-title { font-size: 20px; }
  .pma-ui-hero-sub { font-size: 13px; }
  .pma-ui-hero-actions { width: 100%; }
  .pma-ui-hero-actions .pma-ui-btn { flex: 1; }

  .pma-dashboard.pma-ui .pma-ui-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pma-dashboard.pma-ui .pma-ui-kpi { padding: 12px; column-gap: 10px; }
  .pma-ui-kpi-icon { width: 36px; height: 36px; }
  .pma-ui-kpi-value { font-size: 18px; }

  .pma-ui-track,
  .pma-dashboard.pma-ui .pma-ui-card { border-radius: var(--u-r-lg) !important; }
  .pma-ui-track-head { padding: 16px 14px 0; }
  .pma-ui-steps { padding: 20px 6px 4px; }
  .pma-ui-steps::before,
  .pma-ui-steps::after { top: calc(20px + 16px); inset-inline-start: calc(6px + 12.5%); }
  .pma-ui-steps::before { inset-inline-end: calc(6px + 12.5%); }
  .pma-ui-steps::after { width: calc((100% - 12px) * (var(--pma-step) - 1) / 4); }
  .pma-ui-step-label { font-size: 11.5px; }
  .pma-ui-track-pay { margin: 14px 14px 0; }
  .pma-ui-track-pay .pma-ui-btn { width: 100%; }
  .pma-ui-track-foot { padding: 11px 14px; }

  .pma-ui-order { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; padding: 10px 8px; }
  .pma-ui-order-thumb { width: 46px; height: 46px; }
  .pma-ui .pma-ui-order-go { display: none; }
  .pma-ui-card-head { padding: 0 14px; }

  .pma-dashboard.pma-ui .pma-section-header h2 { font-size: 18px; }
  .pma-dashboard.pma-ui .pma-card-body { padding: 16px; }
}

@media (max-width: 640px) {
  .pma-dashboard.pma-ui .pma-form-row-2 { grid-template-columns: minmax(0, 1fr); }
  .pma-dashboard.pma-ui .pma-form-actions .pma-btn-primary,
  .pma-dashboard.pma-ui .pma-form-actions .pma-btn-lg { width: 100%; }
  .pma-dashboard.pma-ui .pma-complete-card { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .pma-ui-track-thumbs img:nth-child(n+2) { display: none; }
  .pma-ui-nudge { flex-wrap: wrap; }
  .pma-ui-nudge .pma-ui-btn { width: 100%; }
  .pma-ui-order-main strong { font-size: 13px; }
}

@media (max-width: 360px) {
  .pma-ui-tabbar .pma-mob-item { font-size: 10.5px; }
  .pma-ui-tabbar .pma-mob-item > svg,
  .pma-ui-tab-shop-mark { width: 42px; }
}

/* ── Motion ──────────────────────────────────────────────────────────────── */
@keyframes pma-u-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes pma-u-pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@keyframes pma-u-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--pma-brand-dim); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}

/* Overview blocks rise in sequence on first paint. */
.pma-section.active > .pma-ui-hero,
.pma-section.active > .pma-ui-track,
.pma-section.active > .pma-ui-kpis,
.pma-section.active > .pma-ui-nudge,
.pma-section.active > .pma-ui-split { animation: pma-u-in .5s var(--u-ease) both; }
.pma-section.active > .pma-ui-track { animation-delay: .05s; }
.pma-section.active > .pma-ui-kpis  { animation-delay: .1s; }
.pma-section.active > .pma-ui-nudge { animation-delay: .14s; }
.pma-section.active > .pma-ui-split { animation-delay: .18s; }

.pma-no-anim .pma-section.active,
.pma-no-anim .pma-section.active > *,
.pma-no-anim .pma-ui-steps li.is-current .pma-ui-step-dot { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .pma-ui *,
  .pma-ui-tabbar * { animation: none !important; transition: none !important; }
}
