/* ============================================================
   Vitrina — admin design tokens (МойСклад-style: бирюзово-голубой)
   ============================================================ */
:root {
  --bg: #f4f6f8;
  --bg-2: #fafbfc;
  --fg: #1a2733;
  --text: #1a2733;
  --text-2: #38495c;
  --muted: #6b7c8f;
  --muted-2: #97a5b3;
  --line: #e1e7ec;
  --line-2: #eef2f5;
  --accent: #3B6FD4;
  --accent-hover: #2F5BC0;
  --accent-dark: #274FA8;
  --accent-soft: #EAF1FB;
  --link: #2F5BC0;
  --danger: #e53935;
  --success: #00a96e;
  --warning: #f59e0b;
  --card: #ffffff;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --shadow-xs: 0 1px 0 rgba(26,39,51,0.03);
  --shadow-sm: 0 1px 2px rgba(26,39,51,0.05), 0 0 0 1px rgba(26,39,51,0.02);
  --shadow: 0 2px 6px rgba(26,39,51,0.06), 0 0 0 1px rgba(26,39,51,0.03);
  --shadow-lg: 0 8px 24px rgba(26,39,51,0.08);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --header-h: 56px;
  --container: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font); color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Шапка
   ============================================================ */
header.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
}
header.topbar .brand a {
  display: flex; align-items: center; gap: 8px;
  color: var(--fg); font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  white-space: nowrap;
}
header.topbar .brand a:hover { text-decoration: none; }
header.topbar .brand img { width: 22px; height: 22px; display: block; border-radius: 5px; }

header.topbar nav {
  display: flex; align-items: stretch;
  font-size: 14px; height: 100%;
  flex: 1; min-width: 0;
  justify-content: space-evenly;
  max-width: 720px; margin: 0 auto;
}
header.topbar nav a {
  position: relative;
  color: var(--text-2); padding: 0 10px;
  display: inline-flex; align-items: center;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 120ms, border-color 120ms;
  white-space: nowrap;
}
header.topbar nav a:hover { color: var(--accent); text-decoration: none; }
header.topbar nav a.active { color: var(--accent); border-bottom-color: var(--accent); }
header.topbar nav a.btn { align-self: center; height: 32px; padding: 0 14px; border-bottom: none; }
/* Гостевая шапка (Войти / Создать магазин) — прижата к правому краю */
header.topbar nav.guest {
  flex: 0 0 auto;
  max-width: none;
  margin: 0 0 0 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
/* «Создать магазин» в гостевой шапке: читаемый цветной шрифт
   вместо белого на голубом (низкий контраст). */
header.topbar nav.guest a.btn {
  background: #fff;
  color: var(--accent-dark) !important;
  border: 2px solid var(--accent);
  font-weight: 700;
}
header.topbar nav.guest a.btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-dark);
}
header.topbar .logout-link {
  color: var(--muted);
  display: inline-flex; align-items: center;
  font-weight: 500;
  white-space: nowrap;
}
header.topbar .logout-link:hover { color: var(--danger); text-decoration: none; }

/* Адаптив шапки */
@media (max-width: 900px) {
  header.topbar { padding: 0 16px; gap: 12px; }
  header.topbar nav { max-width: none; }
  header.topbar nav a { padding: 0 7px; font-size: 13px; }
}
@media (max-width: 640px) {
  :root { --header-h: auto; }
  header.topbar { flex-direction: column; align-items: stretch; padding: 10px 16px; }
  header.topbar nav { overflow-x: auto; gap: 0; padding-top: 6px; border-top: 1px solid var(--line-2); margin-top: 6px; }
  header.topbar nav a { padding: 8px 10px; border-bottom-width: 2px; }
  header.topbar nav.guest { justify-content: flex-end; gap: 10px; overflow: visible; }
}

/* ============================================================
   Контейнер + общие стили
   ============================================================ */
.container { max-width: var(--container); margin: 0 auto; padding: 32px 28px 64px; }
@media (max-width: 900px) { .container { padding: 20px 16px 48px; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; font-weight: 600; line-height: 1.2; color: var(--fg); }
h2 { font-size: 18px; margin: 32px 0 14px; letter-spacing: -0.005em; font-weight: 600; color: var(--fg); }
h3 { font-size: 15px; margin: 16px 0 8px; font-weight: 600; color: var(--fg); }
p { margin: 0 0 12px; }
p.muted, .muted { color: var(--muted); }
p.muted { margin: 0 0 20px; }

/* ============================================================
   Формы
   ============================================================ */
form .field { margin-bottom: 18px; }
form label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="url"],
form input[type="tel"], form input[type="number"], form textarea, form select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 14px; font-family: inherit; background: white; color: var(--fg);
  transition: border-color 120ms, box-shadow 120ms;
}
form input:focus, form textarea:focus, form select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,168,216,0.16);
}
.help { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.5; }
.errors { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 16px; height: 36px;
  background: var(--accent); color: white !important;
  border-radius: 7px; border: 1px solid var(--accent);
  font-size: 14px; font-weight: 500; cursor: pointer;
  text-decoration: none !important;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { background: var(--accent-dark); }
.btn.ghost {
  background: white; color: var(--text) !important;
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent) !important; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #c62828; border-color: #c62828; }
.btn.success { background: var(--success); border-color: var(--success); }
.btn.success:hover { background: #008c5e; border-color: #008c5e; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 15px; border-radius: 8px; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }

/* ============================================================
   Сообщения, бэйджи, code
   ============================================================ */
.messages { margin-bottom: 16px; }
.msg { padding: 12px 16px; border-radius: 7px; margin-bottom: 8px; font-size: 13px; border: 1px solid; border-left-width: 4px; }
.msg.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; border-left-color: var(--success); }
.msg.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; border-left-color: var(--danger); }
.msg.info { background: var(--accent-soft); color: var(--accent-dark); border-color: #C9DCF7; border-left-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 1.4; }
.badge.ok { background: #ecfdf5; color: #047857; }
.badge.no { background: #fef2f2; color: #b91c1c; }
.badge.warn { background: #fffbeb; color: #b45309; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

code { background: var(--accent-soft); padding: 1px 7px; border-radius: 4px; font-size: 12px; font-family: "SF Mono", Consolas, monospace; color: var(--accent-dark); }

/* ============================================================
   Page header — общий шапки страниц
   ============================================================ */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 4px; }
.page-head__sub { color: var(--muted); font-size: 13px; margin: 0; }
.page-head__actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ============================================================
   Hero (для лендинга)
   ============================================================ */
.hero { padding: 96px 24px; text-align: center; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 46px; margin-bottom: 16px; letter-spacing: -0.03em; line-height: 1.05; }
.hero p { font-size: 17px; color: var(--muted); margin: 0 0 32px; line-height: 1.55; }
@media (max-width: 640px) { .hero { padding: 64px 16px; } .hero h1 { font-size: 32px; } .hero p { font-size: 15px; } }

/* ============================================================
   KPI plate — статистика в дашборде
   ============================================================ */
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 36px; }
.kpi .item {
  background: var(--card);
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: block;
  position: relative;
  box-shadow: var(--shadow-xs);
}
.kpi .item--link { text-decoration: none; color: inherit; cursor: pointer; transition: border-color 120ms, box-shadow 120ms; }
.kpi .item--link:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 600; margin-top: 6px; letter-spacing: -0.015em; color: var(--fg); }
.kpi .item__icon { display: none; }

/* ============================================================
   Onboarding steps — нумерованный список шагов
   ============================================================ */
.onboard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.onboard__hd {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 24px; border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}
.onboard__hd-l { min-width: 0; }
.onboard__hd-title { font-size: 15px; font-weight: 600; margin: 0; }
.onboard__hd-sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.onboard__progress {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.onboard__progress-bar {
  width: 120px; height: 6px; background: var(--line);
  border-radius: 999px; overflow: hidden;
}
.onboard__progress-bar > i {
  display: block; height: 100%; background: var(--accent);
  border-radius: 999px; transition: width 220ms;
}

.onboard__list { display: flex; flex-direction: column; }
.onboard__row {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 18px;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid var(--line-2);
}
.onboard__row:first-child { border-top: none; }
.onboard__row:hover { background: var(--bg-2); }

.onboard__num {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  background: white; color: var(--accent-dark);
  border: 1.5px solid var(--accent);
  flex-shrink: 0;
}
.onboard__num.done { background: var(--success); color: white; border-color: var(--success); }
.onboard__num.todo { background: var(--bg); color: var(--muted); border-color: var(--line); }

.onboard__body { min-width: 0; }
.onboard__title { font-size: 15px; font-weight: 600; color: var(--fg); margin: 0 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.onboard__desc { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

.onboard__actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 720px) {
  .onboard__row { grid-template-columns: 30px 1fr; gap: 12px; padding: 14px 16px; }
  .onboard__actions { grid-column: 1 / -1; padding-left: 42px; }
  .onboard__hd { padding: 14px 16px; flex-direction: column; align-items: flex-start; }
  .onboard__progress { width: 100%; justify-content: space-between; }
  .onboard__progress-bar { flex: 1; }
}

/* ============================================================
   Settings hub — секции и карточки
   ============================================================ */
.page-subtitle { color: var(--muted); font-size: 14px; margin-top: 4px; }

.section-block { margin-bottom: 36px; }
.section-block:last-child { margin-bottom: 0; }
.section-head { margin-bottom: 16px; }
.section-title {
  font-size: 17px; font-weight: 600; margin: 0 0 4px;
  color: var(--fg); letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
}
.section-subtitle { color: var(--muted); font-size: 13px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.settings-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none !important;
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms, box-shadow 140ms, transform 140ms;
}
.settings-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.settings-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.settings-card:hover .settings-icon { background: var(--accent); color: white; }

.settings-title { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 2px; }
.settings-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.settings-meta { margin-top: 8px; }
.settings-meta .badge { font-size: 11px; }

@media (max-width: 640px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Блокировка по окончании пробного периода
   ============================================================ */
.sub-lock-banner {
  background: var(--danger); color: #fff;
  text-align: center; padding: 10px 16px;
  font-size: 14px; font-weight: 500;
}
.sub-lock-banner a {
  color: #fff; text-decoration: underline; font-weight: 700;
  margin-left: 8px; white-space: nowrap;
}
/* Контент кабинета — серый и недоступный для редактирования,
   кроме раздела «Подписка» (там оплата должна работать). */
.sub-greyed {
  filter: grayscale(1);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}
