.profile-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.profile-page {
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-primary);
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--button-bg);
  color: var(--button-text);
}

.profile-avatar-icon {
  width: 60%;
  height: 60%;
  color: var(--button-text);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-img[hidden] {
  display: none;
}

.profile-head-info {
  flex: 1;
  min-width: 0;
}

.profile-head-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.profile-head-email {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin: 0.05rem 0 0;
}

.profile-edit-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.profile-edit-btn:hover {
  border-color: var(--text-tertiary);
}

.profile-edit-btn svg {
  flex-shrink: 0;
}

.profile-info-display {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.profile-info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-info-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.profile-info-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.profile-info-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-info-value {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 500;
}

.pf-form-actions {
  display: flex;
  gap: 0.75rem;
}

.pf-form-actions .pf-submit,
.pf-cancel {
  flex: 1;
  padding: 0.8rem 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
  box-sizing: border-box;
  border-radius: 10px;
}

.pf-cancel {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--border-color);
}

.pf-cancel:hover {
  background: var(--border-color);
}

.pf-form-actions .pf-submit {
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  margin-top: 0;
}

.pf-form-actions .pf-submit:hover {
  opacity: 0.9;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.order-card {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.order-card__id {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.order-card__status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid;
  flex-shrink: 0;
}

.order-card__status--pending {
  color: #a16207;
  border-color: #a16207;
}

.order-card__status--approved {
  color: #15803d;
  border-color: #15803d;
}

.order-card__status--rejected {
  color: #b91c1c;
  border-color: #b91c1c;
}

.order-card__date {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.order-card__items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.order-card__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-secondary);
  border-radius: 10px;
}

.order-card__item-img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.order-card__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.order-card__item-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-card__item-opt {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.order-card__item-qty {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.order-card__item-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.order-card__total {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 0.15rem;
}

.order-card__track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.1rem;
}

.order-card__track-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.order-card__track-status svg {
  flex-shrink: 0;
}

.order-card__track-status--preparing { color: #f59e0b; }
.order-card__track-status--packed { color: #3b82f6; }
.order-card__track-status--shipped { color: #8b5cf6; }
.order-card__track-status--delivered { color: #22c55e; }

.order-card__track-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  background: rgba(219, 39, 119, 0.08);
  transition: background 0.15s;
}

.order-card__track-btn:hover {
  background: rgba(219, 39, 119, 0.15);
}

.orders-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 2.5rem 1rem;
  font-size: 0.95rem;
}

.profile-pagination {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.profile-page-indicator {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 3rem;
  text-align: center;
}

.profile-pag-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.profile-pag-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-pag-btn:not(:disabled):hover {
  background: var(--border-color);
}

#profileForm {
  display: none !important;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-primary);
  border: none;
  border-radius: 14px;
  padding: 1.5rem;
}

.pf-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pf-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pf-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.pf-group input:hover {
  border-color: var(--text-tertiary);
}

.pf-group input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.pf-group input:disabled {
  opacity: 0.5;
}

.pf-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .pf-row--split {
    grid-template-columns: 1fr;
  }
}

.pf-submit {
  padding: 0.8rem 2rem;
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.pf-submit:hover {
  opacity: 0.9;
}

.pf-logout {
  padding: 0.8rem 2rem;
  background: #b91c1c;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.75rem;
}

.pf-logout:hover {
  opacity: 0.9;
}

.profile-balance {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.profile-balance-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent-color);
}

.profile-balance-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.profile-balance-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-balance-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.profile-referral {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
}

.profile-referral-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.85rem;
}

.profile-referral-body {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-referral-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-bottom: 0.2rem;
}

.profile-referral-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.profile-referral-count .profile-referral-value {
  color: var(--accent-color);
}

@media (max-width: 767px) {
  .profile-page {
    max-width: 100%;
    padding: 0 0.75rem;
  }

  .profile-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 0.3rem;
    border: 1px solid var(--border-color);
  }

  .profile-tab {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
  }

  .profile-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  .profile-tab:not(.active):hover {
    color: var(--text-primary);
  }

  .profile-panel {
    display: none;
  }

  .profile-panel.active {
    display: block;
  }

  .profile-main {
    padding: 1rem 0 5rem;
  }

  .profile-section-title {
    display: none;
  }

  .profile-header {
    border: none;
    padding: 0 0 1rem;
  }

  .profile-avatar {
    width: 48px;
    height: 48px;
  }

  .profile-avatar-initial {
    font-size: 0.85rem;
  }

  .profile-info-display {
    border: none;
    padding: 0.5rem 0;
    gap: 0.7rem;
  }

  .profile-balance {
    border: none;
    padding: 0.5rem 0;
    margin-top: 0.25rem;
  }

  .profile-balance-icon {
    width: 20px;
    height: 20px;
  }

  .profile-balance-value {
    font-size: 1rem;
  }

  .profile-referral {
    border: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
  }

  .profile-referral-body {
    gap: 1.5rem;
  }

  .pf-form-actions {
    flex-direction: column;
  }

  .pf-cancel {
    width: 100%;
  }

  .pf-submit {
    width: 100%;
  }

  .profile-edit-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
  }

  .profile-edit-overlay[hidden] {
    display: none;
  }

  .profile-edit-modal {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
  }

  .profile-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
  }

  .profile-edit-modal-header h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
  }

  .profile-edit-modal-close {
    background: none;
    border: none;
    padding: 0.35rem;
    cursor: pointer;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .profile-form--modal {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 0;
    gap: 0.85rem;
  }
}

@media (min-width: 768px) {
  .profile-page {
    max-width: 1200px;
    padding: 0 2rem;
  }

  .profile-tabs {
    display: none;
  }

  .profile-panels {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2.5rem;
    align-items: start;
  }

  .profile-panel {
    display: block !important;
  }

  .profile-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
  }

  .profile-header {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.75rem;
  }

  .profile-avatar {
    width: 64px;
    height: 64px;
  }

  .profile-avatar-initial {
    font-size: 1.15rem;
  }

  .profile-head-name {
    font-size: 1.15rem;
  }

  .profile-head-email {
    font-size: 0.85rem;
  }

  .profile-edit-btn {
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
  }

  .profile-info-display {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    gap: 1rem;
  }

  .profile-balance {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.1rem 1.5rem;
    margin-top: 1.25rem;
  }

  .profile-balance-value {
    font-size: 1.2rem;
  }

  .profile-referral {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    margin-top: 1.25rem;
  }

  .profile-referral-title {
    font-size: 0.78rem;
  }

  .profile-referral-value {
    font-size: 1.1rem;
  }

  .profile-info-label {
    font-size: 0.75rem;
  }

  .profile-info-value {
    font-size: 0.95rem;
  }

  #profileForm {
    display: none !important;
  }

  .profile-form {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .pf-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .pf-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .pf-group input:hover {
    border-color: var(--text-tertiary);
  }

  .pf-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
  }

  .pf-group input:disabled {
    opacity: 0.5;
  }

  .pf-submit {
    padding: 0.8rem 2rem;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.25rem;
  }

  .pf-submit:hover {
    opacity: 0.88;
  }

  .pf-logout {
    padding: 0.8rem 2rem;
    background: #b91c1c;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.75rem;
  }

  .pf-logout:hover {
    opacity: 0.88;
  }

  .order-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .profile-pagination {
    margin-top: 1.25rem;
  }

  .profile-pag-btn {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }

  .profile-pag-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .profile-pag-btn:not(:disabled):hover {
    background: var(--border-color);
  }

  .orders-empty {
    padding: 3rem 1rem;
  }

  .profile-edit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
  }

  .profile-edit-overlay[hidden] {
    display: none;
  }

  .profile-edit-modal {
    background: var(--bg-primary);
    border-radius: 18px;
    width: 440px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.75rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  }

  .profile-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
  }

  .profile-edit-modal-header h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
  }

  .profile-edit-modal-close {
    background: none;
    border: none;
    padding: 0.35rem;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .profile-edit-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
  }

  .profile-form--modal {
    border: none !important;
    padding: 0 !important;
    gap: 0.85rem !important;
  }
}
