.account-page { padding: 40px 20px 60px; max-width: 960px; }

/* Вход / регистрация */
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  margin: 0 auto;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.auth-tab.active { color: var(--navy); border-bottom-color: var(--accent); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none; }

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.checkbox-field input { margin-top: 3px; flex-shrink: 0; }

/* Личный кабинет */
.cabinet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.cabinet-header h1 { font-size: 22px; }

.cabinet-header__actions { display: flex; gap: 10px; align-items: center; }

.cabinet-logout {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.cabinet-logout:hover { background: var(--bg); }

.cabinet-order {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.cabinet-order__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 14px;
  flex-wrap: wrap;
}
.cabinet-order__summary:hover { background: var(--bg); }
.cabinet-order__toggle { color: var(--muted); font-size: 13px; margin-left: auto; }
.cabinet-order__items { padding: 0 20px 16px; }
.cabinet-order__total { font-weight: 700; white-space: nowrap; }

/* Вкладки "Текущие"/"Архив" и поиск по артикулу над списком заказов (см.
   account.js: loadOrderCounts/loadOrdersPage) — заказ считается архивным,
   когда ВСЕ его позиции получили статус "Выдан". */
.orders-subtabs { display: flex; gap: 8px; margin-bottom: 16px; }
.orders-subtab {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.orders-subtab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.orders-subtab__count { opacity: .7; font-weight: 400; }
.orders-subtab__count:empty { display: none; }

.orders-search { display: flex; gap: 8px; margin-bottom: 18px; max-width: 420px; }
.orders-search input {
  flex: 1;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.orders-search input:focus { border-color: var(--accent); }
.orders-search button { height: 38px; padding: 0 18px; }

.orders-more { text-align: center; margin-top: 8px; }
.orders-more[hidden] { display: none; }

/* Личный кабинет — боковая панель разделов */
.cabinet-layout { display: flex; gap: 32px; align-items: flex-start; }

.cabinet-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 200px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}
.cabinet-tab {
  background: none;
  border: none;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.cabinet-tab:hover { background: var(--bg); }
.cabinet-tab.active { color: var(--navy); background: var(--bg); }

.cabinet-main { flex: 1; min-width: 0; }
.cabinet-main .section__title:first-child { margin-top: 0; }
.cabinet-subtitle { font-size: 15px; margin: 4px 0 12px; }

.profile-form { display: flex; flex-direction: column; gap: 14px; max-width: 380px; }

.btn-secondary {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.btn-secondary:hover { background: var(--accent); }

.btn-outline-dark {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.btn-outline-dark:hover { background: var(--bg); }

.save-status-slot { font-size: 13px; color: #1c9d5b; font-weight: 600; }
.save-status-slot:empty { display: none; }

/* Финансы */
.finance-balance-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.finance-balance-card__label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.finance-balance-card__value { font-size: 26px; font-weight: 700; color: var(--navy); }
.finance-balance-card__hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.finance-op {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-top: 1px solid var(--border);
}
.finance-op:last-child { border-bottom: 1px solid var(--border); }
.finance-op__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.finance-op__icon--in { background: #e6f7ee; color: #1c9d5b; }
.finance-op__icon--out { background: #fbe9e9; color: #d33; }
.finance-op__body { flex: 1; min-width: 0; }
.finance-op__title { font-size: 14px; }
.finance-op__meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.finance-op__amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.finance-op__amount--in { color: #1c9d5b; }
.finance-op__amount--out { color: #d33; }

.finance-load-more { margin-top: 16px; }

/* Возвраты */
.return-request-items {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.return-request-items li {
  font-size: 14px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.return-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.return-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.return-card__id { font-weight: 700; color: var(--navy); font-size: 14px; }
.return-card__amount { font-weight: 700; color: var(--navy); margin-left: auto; }
.return-card__items { margin-top: 10px; font-size: 14px; }
.return-card__item { padding: 3px 0; }
.return-card__comment { margin-top: 8px; font-size: 13px; color: var(--muted); font-style: italic; }

/* Уведомления в MAX */
.max-prefs-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; max-width: 380px; }
.max-prefs-actions { display: flex; gap: 10px; margin-top: 4px; }
.max-link-code {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
.max-link-code__qr {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: #fff;
}
@media (max-width: 480px) {
  .max-link-code { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 720px) {
  .cabinet-layout { flex-direction: column; }
  .cabinet-tabs { flex-direction: row; width: 100%; overflow-x: auto; }
  .cabinet-tab { white-space: nowrap; }
}
