.topbar {
  display: flex; align-items: center; gap: 20px; padding: 14px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { font-family: var(--font-heading); font-weight: 700; font-size: 16px; }
.tabbar { display: flex; gap: 6px; margin-left: auto; }
.tabbar a {
  display: flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; transition: background 150ms ease, color 150ms ease;
}
.tabbar a:hover { background: var(--bg); color: var(--text); }
.tabbar a.active { color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 15%, var(--surface)); }
.tabbar a svg { flex-shrink: 0; }

@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 12px 14px; }
  .topbar-brand { flex-shrink: 0; }
  .tabbar { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; flex-shrink: 1; gap: 4px; }
  .tabbar a { padding: 7px 10px; font-size: 13px; }
  .tabbar a span { display: none; }
  .account-content { padding: 24px 16px 48px; }
}

.account-content { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; min-height: 60vh; }
.account-content h1 { margin-bottom: 20px; }

.greeting-card {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 24px;
}
.greeting-hello { font-family: var(--font-heading); font-size: 19px; font-weight: 700; margin: 0 0 10px; }
.greeting-line { margin: 6px 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.greeting-line:first-of-type { font-style: italic; color: var(--muted); }

.spinner {
  width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 700ms linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.account-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }

/* Same small circular WhatsApp icon button as admin's Orders/Customers
   grids (see admin/css/admin.css's .wa-btn) - the icon graphic itself is
   already a chrome-bevelled circular button, so no extra styling needed
   beyond sizing it and a bit of hover/press feedback. */
.wa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  transition: transform 120ms ease, filter 120ms ease;
}
.wa-btn img { width: 100%; height: 100%; object-fit: contain; }
.wa-btn:hover { transform: translateY(-1px) scale(1.05); }
.wa-btn:active { transform: translateY(0) scale(.94); }

.wishlist-card { display: flex; align-items: center; gap: 14px; transition: background 150ms ease; }
.wishlist-card:hover { background: var(--bg); }
.wishlist-thumb { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--bg); flex-shrink: 0; }
.wishlist-info { flex: 1; min-width: 0; }
.wishlist-info p { margin: 4px 0 0; }
/* Deliberately tiny (not just .pill at a smaller font) - title + price +
   this row together have to fit inside the thumbnail's own 80px height, or
   the card grows past its original compact size. */
.wishlist-size-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.wishlist-size-pill {
  font-size: 10px; font-weight: 600; line-height: 1.4; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.wishlist-size-pill.active { background: var(--text); color: #fff; border-color: var(--text); }
.wishlist-size-pill.disabled, .wishlist-size-pill:disabled { color: var(--muted); text-decoration: line-through; cursor: not-allowed; opacity: .6; }
.wishlist-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.account-form { max-width: 380px; margin: 0 auto; }
.account-form .field { margin-bottom: 14px; }
.account-form-foot { text-align: center; margin-top: 16px; font-size: 14px; }

/* Profile page's header - avatar initials + name/join-date, same accent-
   tinted circle treatment as .orders-header-icon, then a couple of quick
   stat tiles pulled from data the Orders/Refer & Earn tabs already show. */
.profile-header { display: flex; align-items: center; gap: 14px; max-width: 380px; margin: 0 auto 16px; }
.profile-avatar {
  flex-shrink: 0; width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-dark);
  font-family: var(--font-heading); font-size: 20px; font-weight: 800;
}
.profile-header-name { margin: 0; font-family: var(--font-heading); font-size: 18px; font-weight: 700; }
.profile-header-since { margin: 2px 0 0; font-size: 13px; }

.profile-stats { display: flex; gap: 10px; max-width: 380px; margin: 0 auto 16px; }
.profile-stat { flex: 1; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 8px; }
.profile-stat-value { display: block; font-family: var(--font-heading); font-size: 20px; font-weight: 800; color: var(--accent-dark); }
.profile-stat-label { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

/* Profile page's read-only view (the default) - a saved profile should
   read like a profile, not sit permanently in edit mode. */
.profile-view { max-width: 380px; margin: 0 auto 14px; }
.profile-view-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.profile-view-row:last-of-type { border-bottom: none; }
.profile-view-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.profile-view-label svg { flex-shrink: 0; color: var(--accent); }
.profile-view-value { font-weight: 600; text-align: right; }

.order-row { display: flex; justify-content: space-between; align-items: center; }
.order-row .badge-status { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }

/* ─── Orders list ─────────────────────────────────────────────────────── */
.orders-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.orders-header h1 { margin: 0 0 2px; }
.orders-header-icon {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent);
}

/* Each status tier only sets these three variables - every color below
   (wash background, bold total, badge, button) derives from them, so a new
   tier is a three-line addition, not a rule rewritten per element. */
.order-card[data-tier="progress"] { --tier-color: var(--accent); --tier-color-dark: var(--accent-dark); }
.order-card[data-tier="success"] { --tier-color: var(--success); --tier-color-dark: var(--success); }
.order-card[data-tier="problem"] { --tier-color: var(--danger); --tier-color-dark: var(--danger); }

.order-card {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 16px; overflow: hidden;
}
.order-card-side {
  position: relative; flex: 0 0 220px; padding: 20px; overflow: hidden;
  background: color-mix(in srgb, var(--tier-color) 10%, var(--surface));
  display: flex; flex-direction: column; gap: 6px;
}
.order-card-leaf {
  position: absolute; right: -14px; bottom: -14px; color: var(--tier-color); opacity: .15; pointer-events: none;
}
.order-card-number { font-size: 15px; }
.order-card-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; margin: 0; }
.order-card-total { font-size: 26px; font-weight: 800; color: var(--tier-color-dark); margin: 2px 0; }
.order-status-badge {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  color: var(--tier-color-dark); background: color-mix(in srgb, var(--tier-color) 18%, var(--surface));
}
.order-card-body { flex: 1 1 260px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.order-item-row { display: flex; align-items: center; gap: 12px; }
.order-item-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg); flex-shrink: 0; }
.order-item-title { margin: 0; font-weight: 600; }
.order-item-qty { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.order-card-invoice-btn {
  flex-shrink: 0; align-self: center; margin: 16px 20px 16px 0;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tier-color); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; white-space: nowrap;
}
.order-card-invoice-btn:hover { background: var(--tier-color-dark); }

@media (max-width: 640px) {
  .order-card { flex-direction: column; }
  .order-card-side { flex-basis: auto; }
  .order-card-invoice-btn { align-self: stretch; justify-content: center; margin: 0 16px 16px; }
}
