:root {
  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --bg-sunken: #eff1f5;
  --bg-inset: #f8f9fb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101426;
  --text-muted: #667085;
  --text-faint: #98a2b3;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-contrast: #ffffff;
  --accent-soft: #eef0ff;
  --accent-ring: rgba(79, 70, 229, .18);
  --ok: #0b7a4b;
  --ok-soft: #e3f6ec;
  --warn: #92500e;
  --warn-soft: #fdf0dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --hero-a: #4f46e5;
  --hero-b: #9333ea;
  --hero-c: #0ea5e9;
  --hero-text: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .07), 0 12px 28px -12px rgba(16, 24, 40, .18);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, .08), 0 24px 48px -20px rgba(16, 24, 40, .28);
  --radius-xl: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1360px;
  --header-h: 66px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b10;
    --bg-elevated: #14161e;
    --bg-sunken: #1b1e28;
    --bg-inset: #10121a;
    --border: #232733;
    --border-strong: #333949;
    --text: #eceef4;
    --text-muted: #98a0b3;
    --text-faint: #6b7488;
    --accent: #8b87ff;
    --accent-hover: #a5a1ff;
    --accent-contrast: #0a0b10;
    --accent-soft: #1c1c3a;
    --accent-ring: rgba(139, 135, 255, .25);
    --ok: #4ade9b;
    --ok-soft: #10281e;
    --warn: #f0b979;
    --warn-soft: #2a2015;
    --danger: #ff8b82;
    --danger-soft: #2c1715;
    --hero-a: #4338ca;
    --hero-b: #7e22ce;
    --hero-c: #0369a1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 14px 32px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .55), 0 28px 56px -24px rgba(0, 0, 0, .8);
  }
}

:root[data-theme="dark"] {
  --bg: #0a0b10;
  --bg-elevated: #14161e;
  --bg-sunken: #1b1e28;
  --bg-inset: #10121a;
  --border: #232733;
  --border-strong: #333949;
  --text: #eceef4;
  --text-muted: #98a0b3;
  --text-faint: #6b7488;
  --accent: #8b87ff;
  --accent-hover: #a5a1ff;
  --accent-contrast: #0a0b10;
  --accent-soft: #1c1c3a;
  --accent-ring: rgba(139, 135, 255, .25);
  --ok: #4ade9b;
  --ok-soft: #10281e;
  --warn: #f0b979;
  --warn-soft: #2a2015;
  --danger: #ff8b82;
  --danger-soft: #2c1715;
  --hero-a: #4338ca;
  --hero-b: #7e22ce;
  --hero-c: #0369a1;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 14px 32px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .55), 0 28px 56px -24px rgba(0, 0, 0, .8);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.022em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent-ring); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Шапка ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner,
.footer__inner,
.page {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: 28px;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand__mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--hero-a), var(--hero-b) 55%, var(--hero-c));
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--hero-b) 60%, transparent);
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-bottom-color: transparent;
  border-right-color: transparent;
}

.brand__text { display: flex; flex-direction: column; min-width: 0; }

.brand__title {
  font-weight: 640;
  font-size: 15.5px;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__tagline {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ── Кнопки ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  color: var(--text);
  font: inherit;
  font-weight: 540;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease,
    transform .08s ease, box-shadow .16s ease;
}

.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 6px 16px -8px var(--accent);
}

.btn--primary:hover { background: var(--accent-hover); border-color: transparent; }

.btn--ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn--ghost:hover { background: var(--bg-sunken); color: var(--text); }

.btn--icon { width: 38px; padding: 0; font-size: 15px; }
.btn--wide { width: 100%; height: 42px; }
.btn--sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.is-disabled { opacity: .4; pointer-events: none; }

/* ── Hero ──────────────────────────────────────────────── */

.page { flex: 1; padding-block: 26px 40px; }
.page--narrow { max-width: 460px; display: flex; align-items: center; padding-block: 60px; }
.page--admin { max-width: 1120px; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 30px 32px;
  color: var(--hero-text);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--hero-c) 85%, transparent) 0%, transparent 55%),
    radial-gradient(100% 130% at 0% 100%, color-mix(in srgb, var(--hero-b) 80%, transparent) 0%, transparent 60%),
    linear-gradient(125deg, var(--hero-a), var(--hero-b));
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero__inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; }

.hero__title {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 680;
  letter-spacing: -.03em;
}

.hero__lead {
  max-width: 60ch;
  font-size: 15px;
  color: rgba(255, 255, 255, .82);
}

.hero__stats { display: flex; flex-wrap: wrap; gap: 10px; }

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 132px;
  padding: 11px 15px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
}

.stat__value {
  font-size: 20px;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.stat__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255, 255, 255, .68);
}

.hero__alert {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .18);
}

.hero__alert::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, .25);
}

/* ── Курсы ─────────────────────────────────────────────── */

.ticker { display: flex; flex-direction: column; gap: 10px; }

.ticker__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .68);
}

.ticker__rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.ticker__rail::-webkit-scrollbar { height: 5px; }
.ticker__rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .28); border-radius: 999px; }

.rate {
  flex: none;
  min-width: 152px;
  padding: 10px 13px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
}

.rate__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 1px 0;
}

.rate__key {
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.rate__value {
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  overflow-wrap: anywhere;
  text-align: right;
}

.ticker__empty { font-size: 13px; color: rgba(255, 255, 255, .7); }

/* ── Панель поиска ─────────────────────────────────────── */

.toolbar {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0 20px;
  padding: 9px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.toolbar__search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid transparent;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.toolbar__search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.toolbar__icon { width: 17px; height: 17px; flex: none; color: var(--text-faint); }

.toolbar__search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: 0;
}

.toolbar__search input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.5); }

.select {
  height: 40px;
  max-width: 190px;
  padding: 0 32px 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-inset);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.select option { background: var(--bg-elevated); color: var(--text); }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: color .16s ease, border-color .16s ease;
}

.switch:hover { color: var(--text); border-color: var(--border-strong); }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.switch:has(input:checked) { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ── Раскладка ─────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 74px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - var(--header-h) - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 2px;
}

.facet {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.facet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 10px;
}

.facet__title {
  font-size: 11.5px;
  font-weight: 620;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
}

.facet__count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-sunken);
}

.facet__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  transition: background .14s ease, color .14s ease;
}

.facet__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facet__item:hover { background: var(--bg-sunken); color: var(--text); }

.facet__item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 590;
}

.facet__item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  translate: -1px -50%;
  width: 3px;
  height: 17px;
  border-radius: 999px;
  background: var(--accent);
}

.facet__item em {
  font-style: normal;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  flex: none;
}

.facet__nested { margin-left: 11px; padding-left: 5px; border-left: 1px solid var(--border); }
.facet__item--sub { font-size: 13.5px; }
.facet__item--sub2 { font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 2px; }

.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 520;
  color: var(--text-muted);
  transition: all .14s ease;
}

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

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

/* ── Результаты ────────────────────────────────────────── */

.results { min-width: 0; }

.results__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 32px;
}

.results__count { font-size: 13.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.results__count strong { color: var(--text); font-weight: 600; }

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 17px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s ease,
    border-color .18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, hsl(var(--hue) 76% 58%), hsl(calc(var(--hue) + 42) 76% 52%));
  opacity: 0;
  transition: opacity .18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card:hover::before { opacity: 1; }
.card--out { opacity: .68; }

.card__top { display: flex; align-items: flex-start; gap: 12px; }

.card__avatar {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 660;
  color: #fff;
  background: linear-gradient(140deg, hsl(var(--hue) 72% 56%), hsl(calc(var(--hue) + 42) 70% 44%));
  box-shadow: 0 5px 14px -6px hsl(var(--hue) 70% 45%);
}

.card__ident { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }

.card__title {
  font-size: 15.5px;
  font-weight: 630;
  overflow-wrap: anywhere;
}

.card__path {
  font-size: 12px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

.tag {
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: .03em;
  background: var(--accent-soft);
  color: var(--accent);
}

.tag--muted { background: var(--bg-sunken); color: var(--text-muted); }

.noms {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  overflow: hidden;
}

.nom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  transition: background .14s ease;
}

.nom:first-child { border-top: 0; }
.nom:hover { background: var(--bg-sunken); }
.nom--out .nom__price { color: var(--text-faint); text-decoration: line-through; }

.nom__label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nom__title { font-size: 13.5px; overflow-wrap: anywhere; }
.nom__badges { display: flex; flex-wrap: wrap; gap: 4px; }

.nom__price {
  flex: none;
  font-size: 14.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
  white-space: nowrap;
}

.badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: .01em;
}

.badge--out { background: var(--danger-soft); color: var(--danger); }
.badge--long { background: var(--warn-soft); color: var(--warn); }
.badge--stock { background: var(--ok-soft); color: var(--ok); }

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.card__from {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-sunken);
}

.card__from em { font-style: normal; font-size: 11px; color: var(--text-faint); }

.card__from b {
  font-size: 14px;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.card__stock { font-variant-numeric: tabular-nums; }
.card__empty { font-size: 13px; color: var(--text-faint); }

/* ── Пагинация и пустое состояние ──────────────────────── */

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 28px 0 6px; }
.pager__info { font-size: 13.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 64px 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--bg-elevated);
  text-align: center;
}

.empty__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bg-sunken);
  color: var(--text-faint);
}

.empty__title { font-size: 16px; font-weight: 630; }
.empty__text { font-size: 14px; color: var(--text-muted); }

/* ── Панели и админка ──────────────────────────────────── */

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.panel__title { font-size: 21px; font-weight: 670; }
.panel__subtitle { font-size: 15px; font-weight: 640; }
.panel__hint { font-size: 13.5px; color: var(--text-muted); }

.admin__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin-bottom: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 540; color: var(--text-muted); }

.field__input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text);
  font: inherit;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.field__input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.field__group { display: flex; align-items: center; gap: 9px; }
.field__suffix { font-weight: 620; color: var(--text-muted); }

.login { gap: 18px; padding: 28px; box-shadow: var(--shadow-lg); }
.markup { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.markup .field { width: 100%; max-width: 220px; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--ok { background: var(--ok-soft); color: var(--ok); }

.stats { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.stats__row { display: flex; gap: 16px; justify-content: space-between; align-items: baseline; }
.stats__row dt { font-size: 13.5px; color: var(--text-muted); }
.stats__row dd { margin: 0; font-size: 13.5px; text-align: right; }
.stats__meta { font-size: 12.5px; color: var(--text-faint); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}

.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }

.code {
  margin: 0;
  padding: 15px;
  max-height: 60vh;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
}

/* ── Подвал ────────────────────────────────────────────── */

.footer { margin-top: 40px; border-top: 1px solid var(--border); }

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ── Состояния ─────────────────────────────────────────── */

.is-loading { position: relative; opacity: .5; transition: opacity .14s ease; }
.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent-ring), transparent);
  animation: shimmer 1.1s linear infinite;
  pointer-events: none;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .card:hover { transform: none; }
}

/* ── Адаптив ───────────────────────────────────────────── */

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .toolbar { position: static; }
}

@media (max-width: 640px) {
  .topbar__inner, .footer__inner, .page { padding-inline: 16px; }
  .hero { padding: 24px 20px; border-radius: var(--radius); }
  .grid { grid-template-columns: 1fr; }
  .stat { flex: 1; min-width: 104px; }
  .brand__tagline { display: none; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 4px; }
}
