/* frontend/css/dashboard.css */

/* Dashboard Layout */
.dashboard-container {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
  padding-block: 2rem;
  min-width: 0;
}

.navbar-nav button.nav-link {
  border: 0;
  background: transparent;
  font: inherit;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  margin: 0 0 0.5rem;
  color: #1a1a2e;
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.2;
}

.dashboard-header .welcome-text {
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
}

.account-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
  margin: 0;
}

.account-details dt {
  margin-bottom: 0.25rem;
  color: #666;
  font-size: 0.875rem;
}

.account-details dd {
  margin: 0;
  color: #1a1a2e;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.account-role {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: #e8f5e9;
  color: #206b31;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: capitalize;
}

.account-note {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.saved-games-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
}

.saved-game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #ececf0;
  border-radius: 8px;
}

.saved-game-card a {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.saved-game-remove {
  flex: 0 0 auto;
  border: 0;
  padding: 0.25rem;
  background: transparent;
  color: #842029;
  font: inherit;
  font-size: 0.875rem;
}

/* Statistics */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid #ececf0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
}

.stat-icon {
  display: flex;
  flex: 0 0 60px;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.5rem;
}

.stat-icon.balance {
  background: #e3f2fd;
  color: #1565c0;
}

.stat-icon.orders {
  background: #f3e5f5;
  color: #7b1fa2;
}

.stat-icon.success {
  background: #e8f5e9;
  color: #27813b;
}

.stat-content {
  min-width: 0;
}

.stat-content h3 {
  margin: 0 0 0.25rem;
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
}

.stat-content .value {
  color: #1a1a2e;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* General Sections */
.section {
  min-width: 0;
  margin-bottom: 2rem;
  padding: 1.5rem;
  border: 1px solid #ececf0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
  margin: 0;
  color: #1a1a2e;
  font-size: 1.25rem;
  line-height: 1.4;
}

/* Buttons */
.btn-primary,
.btn-view-order,
.btn-upload-avatar,
.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-primary {
  padding: 0.6rem 1rem;
  border: 1px solid #27813b;
  border-radius: 6px;
  background: #27813b;
  color: #fff;
}

.btn-primary:hover {
  border-color: #206b31;
  background: #206b31;
}

.btn-view-order {
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid #27813b;
  border-radius: 6px;
  background: transparent;
  color: #206b31;
}

.btn-view-order:hover {
  background: #27813b;
  color: #fff;
}

.btn-upload-avatar {
  padding: 0.5rem 1rem;
  border: 1px solid #d5d5dc;
  border-radius: 6px;
  background: #f5f5f7;
  color: #1a1a2e;
}

.btn-upload-avatar:hover {
  background: #e9e9ed;
}

.btn-save {
  padding: 0.75rem 2rem;
  border: 1px solid #27813b;
  border-radius: 8px;
  background: #27813b;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.btn-save:hover {
  border-color: #206b31;
  background: #206b31;
}

.btn-primary:disabled,
.btn-view-order:disabled,
.btn-upload-avatar:disabled,
.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary:focus-visible,
.btn-view-order:focus-visible,
.btn-upload-avatar:focus-visible,
.btn-save:focus-visible {
  outline: 3px solid rgb(39 129 59 / 35%);
  outline-offset: 3px;
}

/* Order List */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  transition: box-shadow 0.2s ease;
}

.order-item:hover {
  box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
}

.order-image {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5f5f5;
}

.order-details {
  min-width: 0;
}

.order-details h4 {
  margin: 0 0 0.5rem;
  color: #1a1a2e;
  font-size: 1.1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Order Statuses */
.order-status {
  display: inline-block;
  max-width: 100%;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.order-status.pending {
  background: #fff3cd;
  color: #795900;
}

.order-status.paid {
  background: #d4edda;
  color: #155724;
}

.order-status.fulfilled {
  background: #d1ecf1;
  color: #0c5460;
}

.order-status.cancelled {
  background: #f8d7da;
  color: #842029;
}

.order-status.refunded {
  background: #e9e2f5;
  color: #563d7c;
}

/* Order Price */
.order-price {
  min-width: 100px;
  text-align: right;
}

.order-price .amount {
  display: block;
  color: #1a1a2e;
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.order-price .date {
  display: block;
  margin-top: 0.25rem;
  color: #777;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Empty State */
.empty-state {
  padding: 3rem 1rem;
  color: #666;
  text-align: center;
}

.empty-state i {
  display: block;
  margin-bottom: 1rem;
  color: #999;
  font-size: 3rem;
}

.empty-state p {
  margin: 0;
  line-height: 1.6;
}

/* Profile */
.profile-section {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: start;
  gap: 2rem;
}

.profile-avatar {
  min-width: 0;
  text-align: center;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(150px, 100%);
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #e8e8ec;
  color: #666;
  font-size: 3rem;
  overflow: hidden;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.profile-form {
  min-width: 0;
}

.profile-form .form-group {
  margin-bottom: 1.5rem;
}

.profile-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: #1a1a2e;
  font-weight: 500;
}

.profile-form input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem;
  border: 1px solid #d5d5dc;
  border-radius: 8px;
  background: #fff;
  color: #1a1a2e;
  font: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.profile-form input:focus {
  outline: none;
  border-color: #27813b;
  box-shadow: 0 0 0 3px rgb(39 129 59 / 12%);
}

.profile-form input[readonly] {
  background: #f3f3f5;
  color: #666;
  cursor: default;
}

.profile-form input[aria-invalid="true"] {
  border-color: #b42318;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-container {
    width: min(100% - 1.5rem, 1200px);
    padding-block: 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .order-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.75rem;
  }

  .order-image {
    width: 64px;
    height: 64px;
  }

  .order-price {
    grid-column: 2;
    min-width: 0;
    margin-top: 0.25rem;
    text-align: left;
  }

  .profile-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .profile-avatar {
    justify-self: center;
  }

  .avatar {
    width: 120px;
  }
}

@media (max-width: 480px) {
  .dashboard-container {
    width: min(100% - 1rem, 1200px);
    padding-block: 1rem;
  }

  .section {
    padding: 1rem;
    margin-bottom: 1.25rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .section-header {
    align-items: stretch;
  }

  .section-header .btn-primary {
    width: 100%;
  }

  .order-item {
    padding: 0.75rem;
  }

  .order-details h4 {
    font-size: 1rem;
  }

  .btn-save {
    width: 100%;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .order-item,
  .btn-primary,
  .btn-view-order,
  .btn-upload-avatar,
  .btn-save,
  .profile-form input {
    transition: none;
  }
}

/* VaultBar account workspace */
body:has(.dashboard-container) {
  background: #f1f5f7;
}

.navbar {
  border-bottom: 1px solid #22354a;
  background: #102238;
  box-shadow: 0 5px 18px rgb(16 34 56 / 10%);
}

.navbar-brand,
.navbar .nav-link {
  color: #eef5f8;
}

.navbar-brand:hover,
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #77e0c0;
}

.dashboard-container {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  width: min(100% - 3rem, 1380px);
  max-width: 1380px;
  padding-block: 2rem 4rem;
}

.account-sidebar {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #e1e9ed;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgb(20 47 68 / 6%);
}

.sidebar-profile {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0 1.25rem;
}

.profile-avatar-mark {
  display: grid;
  width: 50px;
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 16px;
  background: linear-gradient(145deg, #0d8c73, #20b98f);
  box-shadow: 0 5px 14px rgb(13 140 115 / 20%);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.sidebar-identity {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.sidebar-identity strong,
.sidebar-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-identity strong {
  color: #142f44;
  font-size: 0.95rem;
}

.sidebar-identity span {
  color: #748493;
  font-size: 0.75rem;
}

.account-role {
  grid-column: 2;
  justify-self: start;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e5f7f1;
  color: #087a62;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.sidebar-balance {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #d8eee7;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 100% 0%, rgb(105 222 184 / 20%), transparent 55%),
    #f2faf7;
}

.sidebar-balance > span {
  color: #62776f;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-balance strong {
  color: #123b35;
  font-size: 1.45rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sidebar-balance a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.25rem;
  color: #087a62;
  font-size: 0.78rem;
  font-weight: 650;
}

.sidebar-label {
  margin: 0 0 0.5rem;
  color: #93a0aa;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.account-menu {
  display: grid;
  gap: 0.3rem;
}

.account-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  color: #536575;
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.account-menu-link:hover,
.account-menu-link.active {
  background: #eaf7f3;
  color: #087a62;
  text-decoration: none;
}

.account-menu-link.active {
  box-shadow: inset 3px 0 #12a981;
  font-weight: 700;
}

.menu-icon {
  display: grid;
  width: 1.35rem;
  place-items: center;
  color: #78908b;
  font-size: 1.1rem;
}

.account-menu-link.active .menu-icon,
.account-menu-link:hover .menu-icon {
  color: #0b9b77;
}

.sidebar-bottom {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #edf1f3;
}

.sidebar-browse,
.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #526778;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  text-decoration: none;
}

.sidebar-browse {
  background: #102b3d;
  color: #fff;
  font-weight: 650;
}

.sidebar-browse:hover {
  background: #174a4a;
  color: #fff;
  text-decoration: none;
}

.sidebar-logout:hover {
  background: #fff1ee;
  color: #b44e3d;
}

.dashboard-main {
  min-width: 0;
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 0 1.5rem;
  padding: 0.5rem 0 0.25rem;
}

.dashboard-kicker,
.section-eyebrow {
  margin: 0 0 0.45rem;
  color: #0b9274;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.dashboard-header h1 {
  margin-bottom: 0.45rem;
  color: #142f44;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.045em;
}

.dashboard-header .welcome-text {
  max-width: 570px;
  margin: 0;
  color: #71808c;
  font-size: 0.92rem;
}

.header-browse-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border: 1px solid #c8e8dd;
  border-radius: 10px;
  background: #f7fcfa;
  color: #087a62;
  font-size: 0.85rem;
  font-weight: 700;
}

.header-browse-link:hover {
  border-color: #79cdb4;
  background: #eaf7f3;
  text-decoration: none;
}

.dashboard-main > .section,
.dashboard-main > #dashboard-error {
  margin-bottom: 1.25rem;
}

.dashboard-main .section {
  padding: clamp(1.15rem, 2.5vw, 1.7rem);
  border: 1px solid #e1e9ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(20 47 68 / 4%);
  scroll-margin-top: 90px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.section-heading h2 {
  margin: 0;
  color: #173449;
  font-size: 1.2rem;
  letter-spacing: -0.025em;
}

.section-heading .section-eyebrow {
  margin-bottom: 0.25rem;
  color: #8b9a9f;
  font-size: 0.62rem;
}

.section-description {
  margin: 0.3rem 0 0;
  color: #7a8992;
  font-size: 0.84rem;
}

.read-only-label {
  padding: 0.35rem 0.65rem;
  border: 1px solid #e0eeea;
  border-radius: 999px;
  background: #f5faf8;
  color: #57736c;
  font-size: 0.72rem;
  font-weight: 650;
}

.account-details {
  display: block;
  margin-top: 1rem;
}

.account-details > div {
  display: grid;
  grid-template-columns: minmax(130px, 0.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  padding: 0.75rem 0;
  border-bottom: 1px solid #edf1f3;
}

.account-details > div:last-child {
  border-bottom: 0;
}

.account-details dt {
  margin: 0;
  color: #7d8a94;
  font-size: 0.86rem;
}

.account-details dd {
  color: #173449;
  font-size: 0.9rem;
  font-weight: 600;
}

.account-note {
  margin: 0.5rem 0 0;
  color: #87949c;
  font-size: 0.78rem;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin: 0 0 1.25rem;
  scroll-margin-top: 90px;
}

.dashboard-main .stat-card {
  position: relative;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid #e1e9ed;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 100% 0%, rgb(20 169 130 / 8%), transparent 56%),
    #fff;
  box-shadow: 0 12px 32px rgb(20 47 68 / 4%);
}

.dashboard-main .stat-icon {
  flex-basis: 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #e6f7f1;
  color: #078469;
  font-size: 1.2rem;
  font-weight: 750;
}

.dashboard-main .stat-icon.orders {
  background: #edf1ff;
  color: #5265b4;
}

.stat-label {
  margin: 0 0 0.2rem;
  color: #778791;
  font-size: 0.78rem;
}

.dashboard-main .stat-content .value {
  color: #173449;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.stat-accent {
  align-self: flex-start;
  margin-left: auto;
  color: #8bb8aa;
  font-size: 1rem;
}

.dashboard-main .saved-games-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  margin-top: 1.25rem;
}

.dashboard-main .saved-game-card {
  border-color: #e7edef;
  border-radius: 12px;
  background: #fbfdfd;
}

.dashboard-main .saved-game-card a {
  color: #146b5a;
}

.dashboard-main .order-list {
  margin-top: 1.2rem;
}

.order-filters {
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 2rem);
  margin: 1.25rem 0 0;
  padding: 0 0.2rem;
  overflow-x: auto;
  border-bottom: 1px solid #e8edef;
  scrollbar-width: thin;
}

.order-filter {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.55rem 0.15rem;
  border: 0;
  background: transparent;
  color: #74828c;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 550;
  text-transform: capitalize;
}

.order-filter::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  content: "";
}

.order-filter:hover,
.order-filter.active {
  color: #173449;
}

.order-filter.active {
  font-weight: 750;
}

.order-filter.active::after {
  background: #11a77f;
}

.order-filter-count {
  display: inline-grid;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: 0.3rem;
  place-items: center;
  border-radius: 999px;
  background: #f0f4f5;
  color: #74828c;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.order-filter.active .order-filter-count {
  background: #e5f6f0;
  color: #087a62;
}

.dashboard-main .order-list {
  display: grid;
  gap: 0.85rem;
}

.purchase-card {
  min-width: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid #e6edef;
  border-radius: 13px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.purchase-card:hover {
  border-color: #d3e7e1;
  box-shadow: 0 8px 22px rgb(20 47 68 / 5%);
}

.purchase-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #edf1f3;
}

.purchase-order-identity {
  min-width: 0;
}

.purchase-order-meta {
  margin: 0 0 0.3rem;
  color: #81909a;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.purchase-game-name {
  margin: 0;
  color: #173449;
  font-size: 0.98rem;
  font-weight: 700;
}

.purchase-status {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #f0f4f5;
  color: #61727f;
  font-size: 0.7rem;
  font-weight: 700;
}

.purchase-status.pending {
  background: #fff5dd;
  color: #976d13;
}

.purchase-status.paid {
  background: #eaf1ff;
  color: #4966aa;
}

.purchase-status.delivered,
.purchase-status.fulfilled {
  background: #e5f6f0;
  color: #087a62;
}

.purchase-status.refunded,
.purchase-status.cancelled {
  background: #fcebea;
  color: #a04e4a;
}

.purchase-card-details {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.9rem;
}

.purchase-package-mark {
  display: grid;
  width: 48px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #e1eee9;
  border-radius: 12px;
  background: linear-gradient(145deg, #f0fbf7, #e2f4ed);
  color: #13846b;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.purchase-package-details {
  min-width: 0;
}

.purchase-package-details h4 {
  margin: 0 0 0.2rem;
  color: #294354;
  font-size: 0.88rem;
}

.purchase-package-details p {
  margin: 0;
  color: #81909a;
  font-size: 0.77rem;
}

.purchase-total {
  color: #173449;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.order-empty {
  display: grid;
  min-height: 210px;
  padding: 2rem 1rem;
  place-content: center;
  justify-items: center;
  gap: 0.65rem;
  border: 1px solid #edf1f3;
  border-radius: 13px;
  background: #fcfdfd;
  color: #82909a;
  text-align: center;
}

.order-empty-icon {
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 14px;
  background: #f0f5f5;
  color: #92a6a5;
  font-size: 1.35rem;
}

.order-empty p {
  margin: 0;
  font-size: 0.86rem;
}

.dashboard-main .order-row:last-child {
  border-bottom: 0;
}

@media (max-width: 920px) {
  .dashboard-container {
    grid-template-columns: minmax(0, 1fr);
    width: min(100% - 2rem, 760px);
  }

  .account-sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 0.8fr);
    align-items: center;
    gap: 0 1.25rem;
  }

  .sidebar-profile {
    grid-column: 1;
    grid-row: 1;
  }

  .sidebar-balance {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
  }

  .sidebar-label {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    margin-top: 0.5rem;
  }

  .account-menu {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0.5rem;
  }

  .account-menu-link {
    justify-content: center;
    padding-inline: 0.45rem;
    font-size: 0.8rem;
  }

  .sidebar-bottom {
    grid-column: 1 / -1;
    grid-row: 4;
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 600px) {
  .dashboard-container {
    width: min(100% - 1rem, 520px);
    gap: 1rem;
    padding-block: 1rem 2rem;
  }

  .account-sidebar {
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }

  .sidebar-profile,
  .sidebar-label,
  .sidebar-balance,
  .account-menu,
  .sidebar-bottom {
    grid-column: 1;
    grid-row: auto;
  }

  .sidebar-balance {
    margin-bottom: 0.5rem;
  }

  .account-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-menu-link {
    justify-content: flex-start;
  }

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .dashboard-main .section {
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .dashboard-main .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .account-details > div {
    grid-template-columns: minmax(95px, 0.35fr) minmax(0, 1fr);
    gap: 0.75rem;
  }

  .section-heading {
    align-items: flex-start;
  }

  .read-only-label {
    display: none;
  }

  .purchase-card {
    padding: 0.9rem;
  }

  .purchase-card-header {
    gap: 0.5rem;
  }

  .purchase-card-details {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 0.65rem;
  }

  .purchase-package-mark {
    width: 42px;
    border-radius: 10px;
  }

  .purchase-total {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-menu-link {
    transition: none;
  }
}
