:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --panel: #ffffff;
  --panel-invert: #0f172a;
  --border: #e0e2e6;
  --border-strong: #cbd0d8;
  --text: #1f2430;
  --muted: #6b7280;
  --placeholder: #9ca3af;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --hover: #f0f1f4;
  --focus-ring: rgba(37, 99, 235, 0.15);
  --glass: rgba(255, 255, 255, 0.14);
  --glass-check: rgba(255, 255, 255, 0.16);
  --shadow-ring: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] {
  --bg: #0b0f1a;
  --card: #141a28;
  --panel: #141a28;
  --panel-invert: #ffffff;
  --border: #26304a;
  --border-strong: #37415c;
  --text: #e7eaf0;
  --muted: #8a93a8;
  --placeholder: #5b657d;
  --primary: #3b82f6;
  --primary-dark: #2f6fdf;
  --danger: #f87171;
  --hover: #1b2233;
  --focus-ring: rgba(59, 130, 246, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

.brand-accent {
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hidden { display: none !important; }

.screen { min-height: 100vh; }

/* ===== Переключатель темы ===== */
.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===== Авторизация ===== */
.auth-layout {
  display: flex;
  min-height: 100vh;
}

.auth-card-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: relative;
}

.theme-toggle--auth {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}

/* Левая брендинговая панель */
.brand-panel {
  flex: 1;
  max-width: 46%;
  background: radial-gradient(1200px 600px at 0% 0%, #3b82f6 0%, #2563eb 35%, #1e40af 75%, #172554 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.brand-panel::before {
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -140px;
}

.brand-panel::after {
  width: 260px;
  height: 260px;
  left: -90px;
  top: -90px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-panel__inner {
  max-width: 360px;
  position: relative;
  z-index: 1;
}

.brand-panel__logo {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  margin-bottom: 28px;
  box-shadow: 0 8px 24px var(--shadow-ring);
}

.brand-panel__logo svg { width: 30px; height: 30px; }

.brand-panel__title {
  font-family: "Unbounded", sans-serif;
  font-size: 32px;
  margin: 0 0 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-panel__text {
  margin: 0 0 32px;
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.85;
  color: #fff;
}

.brand-panel__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.brand-panel__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  opacity: 0.92;
}

.brand-panel__features li::before {
  content: "✓";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--glass-check);
  font-size: 12px;
}

/* Правая форма */
.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 40px 12%;
  background: var(--bg);
  max-width: none;
  width: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.card__head { margin-bottom: 4px; }

.card h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: "Unbounded", sans-serif;
  font-size: 24px;
}

.card__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input::placeholder { color: var(--placeholder); }

.input-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-wrap:focus-within .input-icon { color: var(--primary); }

.input-wrap input[type="password"] { padding-right: 44px; }

.eye {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.eye:hover { color: var(--text); background: var(--hover); }

.eye svg { width: 18px; height: 18px; }

.eye-closed { display: none; }

.eye.showing .eye-open { display: none; }
.eye.showing .eye-closed { display: block; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -6px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
}

.link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.link:hover { text-decoration: underline; }

#auth-submit {
  width: 100%;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s, transform 0.05s;
}

#auth-submit:hover { background: var(--primary-dark); }
#auth-submit:active { transform: scale(0.99); }

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 0;
  margin: 0;
  text-align: center;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-social {
  width: 100%;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-social:hover { background: var(--hover); }
.btn-social svg { width: 18px; height: 18px; }

.switch {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.switch a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.switch a:hover { text-decoration: underline; }

/* ===== Главная ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left, .user-info { display: flex; align-items: center; gap: 12px; }

.brand, .topbar-left .brand { font-weight: 800; font-family: "Unbounded", sans-serif; font-size: 14px; }

.main-nav { display: flex; gap: 4px; margin-left: 12px; }

/* Бургер */
.burger {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.burger__line {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.25s ease;
}

.burger.open .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open .burger__line:nth-child(2) { opacity: 0; }
.burger.open .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Окно бургер-меню */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 90;
}

.menu-overlay.open { opacity: 1; visibility: visible; }

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: var(--card);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu__panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.menu-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
}

.menu-close svg { width: 18px; height: 18px; }

.mobile-menu__nav {
  display: grid;
  gap: 6px;
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.15s;
}

.mobile-menu__link svg { width: 20px; height: 20px; color: var(--muted); }

.mobile-menu.open .mobile-menu__link {
  transform: translateX(0);
  opacity: 1;
}

.mobile-menu.open .mobile-menu__link:nth-child(1) { transition-delay: 0.08s; }
.mobile-menu.open .mobile-menu__link:nth-child(2) { transition-delay: 0.14s; }

.mobile-menu__link:hover { background: var(--hover); }
.mobile-menu__link.active { color: var(--primary); background: var(--focus-ring); }
.mobile-menu__link.active svg { color: var(--primary); }

.mobile-menu__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.main-nav-link {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.main-nav-link:hover { color: var(--text); background: var(--hover); }

.main-nav-link.active { color: var(--text); background: var(--hover); font-weight: 600; }

.user-info { font-size: 14px; color: var(--muted); }

.nav-cabinet-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.balance-chip::before {
  content: "₽";
  color: var(--primary);
  font-weight: 800;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.ghost:hover { background: var(--hover); }

.page { padding: 32px 20px; }

.page p { color: var(--muted); }

/* ===== Личный кабинет ===== */
.cabinet {
  display: flex;
  min-height: calc(100vh - 63px);
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
}

.sidebar-nav { display: grid; gap: 4px; }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding: 11px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--danger);
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-logout svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-logout:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-link:hover { background: var(--hover); color: var(--text); }

.sidebar-link.active {
  background: var(--primary);
  color: #fff;
}

.cabinet-content {
  flex: 1;
  padding: 32px;
  min-width: 0;
}

.cabinet-section { max-width: 640px; }

.cabinet-section h2 {
  margin: 0 0 20px;
  font-family: "Unbounded", sans-serif;
  font-size: 20px;
  font-weight: 600;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
}

.profile-head h2 { margin: 0 0 4px; font-size: 18px; }

.profile-meta { margin: 0; color: var(--muted); font-size: 13px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

[data-theme="dark"] .badge { color: #4ade80; }

.info-card--balance {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border: none;
  color: #fff;
}

.info-card--balance .info-label { color: rgba(255, 255, 255, 0.75); }

.info-card--balance .info-label svg { width: 14px; height: 14px; vertical-align: -2px; }

.balance-value { font-size: 22px; color: #fff; font-weight: 800; }

.topup-form { display: flex; gap: 8px; align-items: center; }

.topup-form input,
.topup-mode {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}

.topup-amount { width: 110px; }

.topup-mode { cursor: pointer; }

.topup-btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }

.topup-current { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Карточка пользователя */
.user-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.user-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-card__who { flex: 1; display: grid; gap: 4px; min-width: 0; }

.user-card__login {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.user-card__login:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }

.user-card__badge {
  align-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.role-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.role-switch input { display: none; }

.role-switch__track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.2s;
}

.role-switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.role-switch input:checked + .role-switch__track { background: var(--primary); }
.role-switch input:checked + .role-switch__track::after { transform: translateX(16px); }
.role-switch input:disabled + .role-switch__track { opacity: 0.5; cursor: not-allowed; }

.role-switch__label { font-size: 13px; font-weight: 600; color: var(--muted); }

.user-card__body { padding-top: 4px; }

.user-card__actions { display: flex; gap: 8px; }

.admin-subtitle {
  margin: 28px 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.section-title-row h2 { margin: 0; }

.muted { color: var(--muted); font-size: 13px; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
}

.empty-state svg { width: 40px; height: 40px; opacity: 0.5; margin-bottom: 12px; }

.empty-state p { margin: 0; }

.order-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.order-card__emoji {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 12px;
  background: var(--bg-soft);
  flex-shrink: 0;
}

.order-card__info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.order-card__price {
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0b7a4b;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast--error { background: #c62828; }

.toast--show { opacity: 1; transform: translateY(0); }

.toast--hide { opacity: 0; transform: translateY(-12px); }

[data-theme="dark"] .toast { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal {
  position: relative;
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal .menu-close { position: absolute; top: 12px; right: 12px; }

.modal__emoji {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border-radius: 16px;
  background: var(--bg-soft);
}

.modal__title { margin: 0 0 10px; font-size: 18px; }

.modal__product { font-weight: 700; margin-bottom: 14px; }

.modal__meta { display: grid; gap: 6px; text-align: left; }

.modal__line {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  font-size: 14px;
}

.modal__line span:first-child { color: var(--muted); }

.modal__line span:last-child { font-weight: 700; }

.modal__warn {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .modal__warn { color: #fca5a5; }

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.modal__actions .primary-btn { flex: 1; justify-content: center; }
.modal__actions .ghost { flex: 1; }

.settings-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.settings-form h3 { margin: 0 0 18px; font-size: 15px; }

.settings-form .field input { padding-left: 14px; }

.pw-msg {
  font-size: 13px;
  margin: 0 0 16px;
  min-height: 16px;
}

.error-text { color: var(--danger); }
.success-text { color: #16a34a; }
[data-theme="dark"] .success-text { color: #4ade80; }

.primary-btn {
  padding: 12px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.primary-btn:hover { background: var(--primary-dark); }
.primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Витрина магазина ===== */
.view { padding-bottom: 40px; }

.hero {
  background: radial-gradient(1200px 500px at 30% 0%, #2563eb 0%, #1e40af 60%, #172554 100%);
  color: #fff;
  padding: 64px 32px 56px;
}

[data-theme="dark"] .hero {
  background: radial-gradient(1200px 500px at 30% 0%, #1d4ed8 0%, #172c6b 60%, #0b1020 100%);
}

.hero__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  justify-items: start;
}

.hero__badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.hero__title {
  font-family: "Unbounded", sans-serif;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.15;
  margin: 0;
  max-width: 700px;
  font-weight: 700;
}

.hero__text {
  margin: 0;
  opacity: 0.85;
  font-size: 15px;
}

.hero .primary-btn { width: auto; padding: 13px 26px; }

.catalog {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 32px 0;
}

.catalog__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.catalog__head h2 {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: 20px;
  font-weight: 600;
}

.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.catalog-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.catalog-tab:hover { color: var(--text); border-color: var(--border-strong); }

.catalog-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 22px;
  border: none;
  border-radius: 16px;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 150px;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.section-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-card__img + .section-card__name,
.section-card__img + .section-card__name + .section-card__count {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.section-card__emojis {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.section-card__name {
  font-family: "Unbounded", sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.section-card__count {
  font-size: 13px;
  opacity: 0.9;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.product-card__visual {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, var(--pcolor), transparent 90%),
              var(--bg);
}

[data-theme="dark"] .product-card__visual {
  background: linear-gradient(135deg, color-mix(in srgb, var(--pcolor) 35%, transparent), transparent 90%),
              var(--card);
}

.product-card__emoji { font-size: 52px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.15)); }

.product-card__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.product-card__body { padding: 14px 16px 16px; display: grid; gap: 8px; }

.product-card__body h3 { margin: 0; font-size: 15px; }

.product-card__body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  min-height: 36px;
}

.product-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.product-card__price {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.product-card__old {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  text-decoration: line-through;
}

.product-card__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.product-card__btn:hover { background: var(--primary-dark); }
.product-card__btn svg { width: 15px; height: 15px; }

/* ===== Админка ===== */
.admin-section { max-width: 720px; }

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  overflow-x: auto;
}

.admin-tab {
  flex: 1;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.admin-tab:hover { color: var(--text); }

.admin-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .admin-tab.active { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }

.admin-panel.hidden { display: none; }

.admin-form { margin-bottom: 20px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-row--3 {
  grid-template-columns: 1fr 1fr auto;
}

.admin-form input[type="color"] {
  padding: 4px;
  height: 44px;
  cursor: pointer;
}

.admin-form__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.danger-ghost:hover { color: var(--danger); border-color: var(--danger); }

.admin-list { display: grid; gap: 10px; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.admin-row__emoji {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}

.admin-row__emoji img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-row__info { flex: 1; display: grid; gap: 2px; min-width: 0; }

.admin-row__info strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.admin-row__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== Адаптивность ===== */
@media (max-width: 1024px) {
  .brand-panel { max-width: 40%; }
  .card { padding: 40px 8%; }
}

@media (max-width: 900px) {
  .auth-layout { flex-direction: column; }
  .brand-panel {
    display: none;
  }
  .card { padding: 40px 10%; max-width: 480px; margin: 0 auto; }
  .hero { padding: 48px 20px 40px; }
  .catalog { padding: 28px 20px 0; }
}

@media (max-width: 820px) {
  .burger { display: flex; }
  .main-nav { display: none; }
  .nav-cabinet-link span:first-child { display: none; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar-left, .user-info { gap: 8px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 8px; display: flex; flex-direction: row; align-items: center; }
  .cabinet { min-height: 0; flex-direction: column; }
  .sidebar-nav { grid-auto-flow: column; gap: 4px; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-link { justify-content: center; padding: 9px 14px; white-space: nowrap; }
  .sidebar-logout { margin-top: 0; margin-left: 4px; padding: 9px 14px; width: auto; }
  .cabinet-content { padding: 20px 14px; }
  .profile-head { flex-direction: column; text-align: center; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .admin-row__actions { flex-wrap: wrap; }
  .user-card__head { flex-wrap: wrap; }
  .user-card__actions { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .brand-panel { display: none; }
  .auth-layout { display: block; }
  .card { padding: 28px 18px; max-width: 100%; min-height: 100vh; border-radius: 0; }
  .theme-toggle--auth { top: 14px; right: 14px; }
  .card h1 { font-size: 20px; }
  .hero { padding: 36px 16px 32px; }
  .hero__title { font-size: 22px; }
  .hero__text { font-size: 14px; }
  .catalog { padding: 22px 14px 0; }
  .products-grid { grid-template-columns: 1fr; gap: 14px; }
  .product-card__visual { height: 110px; }
  .topbar { padding: 8px 10px; }
  .balance-chip { padding: 5px 10px; font-size: 12px; gap: 4px; }
  .brand { font-size: 12px; }
  .mobile-menu { width: min(300px, 90vw); }
  .cabinet-content { padding: 16px 12px; }
  .section-title-row { flex-wrap: wrap; gap: 10px; }
  .avatar { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; }
  .info-grid { grid-template-columns: 1fr; }
  .topup-form { flex-wrap: wrap; }
  .topup-form .topup-amount { width: 100%; }
  .topup-mode { flex: 1; min-width: 0; }
  .topup-current { width: 100%; }
  .admin-form__actions { flex-wrap: wrap; }
  .settings-form { padding: 18px; }
  .hero .primary-btn { width: 100%; text-align: center; justify-content: center; }
  .toast-container { left: 50%; right: auto; transform: translateX(-50%); width: min(90vw, 320px); }
  .toast { max-width: 100%; }
}

@media (max-width: 360px) {
  .theme-toggle { width: 36px; height: 36px; }
  .avatar-sm { width: 30px; height: 30px; }
  .ghost { padding: 6px 10px; font-size: 13px; }
  .hero__title { font-size: 20px; }
  .product-card__row { flex-direction: column; align-items: stretch; }
  .product-card__btn { justify-content: center; }
}

/* Блокировка выхода за пределы экрана */
img, svg { max-width: 100%; }