/* ================================================================
   REZVIVO — спортивный дизайн
   ----------------------------------------------------------------
   Концепция: тёмный энергичный лендинг, светлая внутренняя часть.
   Палитра бренда: navy (#0d3b6e) и cyan-молния (#3eb8e8) с логотипа.
   Геометрические паттерны напоминают трек / контурные линии велогонок.

   Шрифты: системные стеки (без внешних зависимостей).
   ================================================================ */

/* ================================================================
   1. CSS-переменные: цвета, типографика, отступы
   ================================================================ */
:root {
  /* Основные цвета */
  --bg:           #ffffff;
  --bg-alt:       #f4f7fb;
  --bg-dark:      #071528;
  --bg-dark-alt:  #0c2240;

  /* Текст */
  --fg:           #0a1628;
  --fg-muted:     #5a6a7a;
  --fg-faint:     #9aa8b4;
  --fg-on-dark:   #f4f7fb;
  --fg-muted-on-dark: #8a9aab;

  /* Акценты — navy + cyan Z с логотипа REZVIVO */
  --accent:       #3eb8e8;
  --accent-dim:   #2499cc;
  --accent-fg:    #071528;
  --line:         #0c2240;

  /* Бордеры на светлом */
  --border:       #dce4ec;
  --border-strong:#0a1628;

  /* Семантика */
  --ok:           #2e7d3a;
  --warn:         #d97706;
  --err:          #c0322a;
  --info:         #1f5fbf;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(10,14,10,.04), 0 1px 1px rgba(10,14,10,.03);
  --shadow-md: 0 4px 12px rgba(10,14,10,.06), 0 2px 4px rgba(10,14,10,.04);
  --shadow-lg: 0 12px 32px rgba(10,14,10,.08), 0 4px 12px rgba(10,14,10,.05);
  --shadow-card: 0 1px 0 rgba(10,14,10,.04), 0 4px 16px rgba(10,14,10,.04);

  /* Типографика — системные стеки, без внешних зависимостей. */
  --font-display: -apple-system, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-body:    -apple-system, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", "Source Code Pro", "Roboto Mono", Consolas, "Courier New", monospace;

  /* Размеры */
  --maxw: 1200px;
  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  16px;
}

/* ================================================================
   2. Базовые сбросы и типографика
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--fg);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1em; }

a {
  color: var(--fg);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
a:hover { color: var(--accent-dim); text-decoration: underline; }

code, pre, .mono { font-family: var(--font-mono); }

::selection { background: var(--accent); color: var(--accent-fg); }

.muted { color: var(--fg-muted); }
.lead  {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 60ch;
  line-height: 1.6;
}

/* ================================================================
   3. Контейнеры, шапка, подвал
   ================================================================ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo img {
  height: 38px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--fg-muted);
  position: relative;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.nav a:hover { color: var(--fg); text-decoration: none; }
.nav a:hover::after { transform: scaleX(1); }

.nav-cta {
  background: var(--fg);
  color: var(--bg) !important;
  padding: .55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all .15s ease;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--accent); color: var(--accent-fg) !important; text-decoration: none; }

.nav-form { display: inline; margin: 0; }
.as-link {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
}

/* Подвал */
.site-footer {
  background: var(--bg-dark);
  color: var(--fg-muted-on-dark);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--fg-on-dark); }
.site-footer a:hover { color: var(--accent); }

.main-content {
  padding: 2rem 1.25rem 4rem;
  min-height: calc(100vh - 64px - 130px);
}

/* ================================================================
   4. Кнопки
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 4px 12px rgba(62, 184, 232), 0.3);
}
.btn-primary:hover {
  background: var(--accent-dim);
  color: var(--accent-fg);
  box-shadow: 0 8px 20px rgba(62, 184, 232), 0.45);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--fg);
  color: var(--bg);
}

.link-btn {
  background: none;
  border: 1px solid var(--border);
  padding: .35rem .75rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg-muted);
  transition: all .15s ease;
}
.link-btn:hover { border-color: var(--fg); color: var(--fg); }
.link-btn.danger:hover { border-color: var(--err); color: var(--err); }

/* ================================================================
   5. Hero (главная страница)
   ================================================================ */
.hero {
  position: relative;
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  padding: 6rem 1.25rem 7rem;
  margin: -2rem -1.25rem 4rem;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(62, 184, 232), .15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(62, 184, 232), .08), transparent 50%);
  z-index: -2;
}
.hero::after {
  /* Decoративные диагональные линии — намёк на трек */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(115deg, transparent 49.5%, rgba(62, 184, 232), .04) 50%, transparent 50.5%),
    linear-gradient(115deg, transparent 39.5%, rgba(62, 184, 232), .03) 40%, transparent 40.5%);
  background-size: 80px 80px, 60px 60px;
  z-index: -1;
}
.hero h1 {
  color: var(--fg-on-dark);
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  max-width: 16ch;
  margin-bottom: 1.25rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.hero p, .hero .lead {
  color: var(--fg-muted-on-dark);
  font-size: 1.2rem;
  max-width: 50ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.cta-row .btn-secondary {
  background: transparent;
  color: var(--fg-on-dark);
  border-color: rgba(245,245,244,.3);
}
.cta-row .btn-secondary:hover {
  background: var(--fg-on-dark);
  color: var(--fg);
  border-color: var(--fg-on-dark);
}

/* Features blocks под hero */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 4rem 0;
}
.feature {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 32px; height: 4px;
  background: var(--accent);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--fg);
  box-shadow: var(--shadow-lg);
}
.feature h3 {
  font-size: 1.1rem;
  margin-bottom: .5rem;
}
.feature p {
  font-size: .95rem;
  color: var(--fg-muted);
  margin: 0;
}

/* ================================================================
   6. Карточки (универсальные)
   ================================================================ */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-md); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ================================================================
   7. Формы
   ================================================================ */
.form, .form-wide {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}
.form-wide { max-width: 720px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-grid > .form-row.full { grid-column: span 2; }

.form-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}
.form-row label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--fg-muted);
}
.form-row input, .form-row select, .form-row textarea {
  font: inherit;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--fg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 0;
  border-color: var(--fg);
  box-shadow: 0 0 0 3px rgba(10,14,10,.06);
}

.form-row.checkbox, .form-check {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
}
.form-row.checkbox label, .form-check label {
  margin: 0;
  font-size: .95rem;
  color: var(--fg);
  cursor: pointer;
}

.form-error {
  background: #fef2f0;
  border: 1px solid #f5c2bc;
  color: var(--err);
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.form-ok {
  background: #effaf0;
  border: 1px solid #b7e3bc;
  color: var(--ok);
  padding: .75rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.form-aux {
  margin-top: 1rem;
  font-size: .9rem;
  text-align: center;
  color: var(--fg-muted);
}

/* ================================================================
   8. Таблицы
   ================================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}
th, td {
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border);
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--bg-alt); }

.row-link { cursor: pointer; }
.row-current { background: rgba(62, 184, 232), .12) !important; }
.row-current td { font-weight: 600; }

td.cell-ua { font-family: var(--font-mono); font-size: .85rem; }

/* Numeric cells (mono) */
.rides-table td:nth-child(2),
.rides-table td:nth-child(3),
.rides-table td:nth-child(4),
.rides-table td:nth-child(5),
.sessions-table td:nth-child(3) {
  font-family: var(--font-mono);
  font-size: .9rem;
}

/* ================================================================
   9. Бэйджи, badges, статусы
   ================================================================ */
.badge {
  display: inline-block;
  padding: .15rem .55rem;
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
}
.badge-ok   { background: #effaf0; color: var(--ok);   border-color: #b7e3bc; }
.badge-info { background: #eaf2fc; color: var(--info); border-color: #c2d6ec; }
.badge-err  { background: #fef2f0; color: var(--err);  border-color: #f5c2bc; }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fg-muted);
  margin-right: .35rem;
  vertical-align: middle;
}

/* ================================================================
   10. Flash-уведомления и баннеры
   ================================================================ */
.flash {
  padding: .85rem 1.25rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: .95rem;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.flash::before {
  content: '●';
  font-size: 1.2rem;
  line-height: 0;
}
.flash-success { background: #effaf0; color: var(--ok);   border-color: #b7e3bc; }
.flash-error   { background: #fef2f0; color: var(--err);  border-color: #f5c2bc; }
.flash-info    { background: #eaf2fc; color: var(--info); border-color: #c2d6ec; }

.banner {
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
  font-size: .95rem;
  border-left: 3px solid;
}
.banner-info {
  background: #eaf2fc;
  border-left-color: var(--info);
  color: #163a73;
}
.banner-warn {
  background: #fef6e7;
  border-left-color: var(--warn);
  color: #7a4500;
}

/* ================================================================
   11. Дашборд / профиль
   ================================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-head h1, .page-head h2 { margin: 0; }

.dashboard, .profile-page, .security-page, .rides-page, .events-page, .pricing-page, .auth-page, .admin-page, .leaderboard-page, .live-page, .ride-detail, .event-detail {
  max-width: var(--maxw);
}

.summary, .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.summary-block {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.summary-block::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 60px; height: 60px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.15;
}
.summary-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted-on-dark);
  margin-bottom: .35rem;
}
.summary .summary-block strong,
.summary-block strong {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  display: block;
  color: var(--accent);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.metric {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  text-align: center;
}
.m-label {
  font-size: .75rem;
  color: var(--fg-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: .35rem;
}
.m-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
}

/* ================================================================
   12. Тарифы (Pricing)
   ================================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.plan-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan-card h3 {
  font-size: 1.5rem;
  margin: 0;
}
.plan-card .price {
  display: flex;
  align-items: baseline;
  gap: .35rem;
}
.plan-card .amount {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.plan-card .period {
  font-size: 1rem;
  color: var(--fg-muted);
}
.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plan-card li {
  padding: .5rem 0;
  border-top: 1px dashed var(--border);
  font-size: .95rem;
}
.plan-card li:first-child { border-top: 0; }
.plan-card li::before {
  content: '→';
  color: var(--accent-dim);
  font-weight: 700;
  margin-right: .5rem;
}
.plan-card .btn { margin-top: auto; }

/* Highlight middle/recommended plan */
.plan-card:nth-child(2) {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  border-color: var(--bg-dark);
  transform: scale(1.02);
}
.plan-card:nth-child(2) h3,
.plan-card:nth-child(2) .amount { color: var(--fg-on-dark); }
.plan-card:nth-child(2) .period { color: var(--fg-muted-on-dark); }
.plan-card:nth-child(2) li { border-color: rgba(245,245,244,.15); }
.plan-card:nth-child(2) .btn-secondary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.plan-card:nth-child(2) .btn-secondary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--accent-fg);
}

.pricing-info {
  margin-top: 2rem;
  font-size: .9rem;
  color: var(--fg-muted);
  max-width: 60ch;
}

/* ================================================================
   13. События (Events)
   ================================================================ */
.event-list {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}
.event-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.event-card:hover { border-color: var(--fg); box-shadow: var(--shadow-md); transform: translateX(2px); }

.event-when {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .9rem;
  background: var(--accent);
  color: var(--accent-fg);
  padding: .5rem .85rem;
  border-radius: var(--r-md);
  white-space: nowrap;
}
.event-card h3 {
  margin: 0 0 .25rem;
  font-size: 1.15rem;
}
.event-meta {
  font-size: .85rem;
  color: var(--fg-muted);
}

.event-detail {
  margin: 2rem 0;
}

/* ================================================================
   14. Лидерборды
   ================================================================ */
.leaderboard-page table tbody tr:nth-child(1) td:first-child::before { content: '🥇 '; }
.leaderboard-page table tbody tr:nth-child(2) td:first-child::before { content: '🥈 '; }
.leaderboard-page table tbody tr:nth-child(3) td:first-child::before { content: '🥉 '; }

/* ================================================================
   15. Realtime / Live
   ================================================================ */
.live-page {
  margin: 2rem 0;
}
.live-counter {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  background: var(--bg-alt);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .9rem;
}
.live-counter::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--err);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(0.8); }
}
.live-empty {
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
}

/* ================================================================
   16. Уведомления
   ================================================================ */
.notif-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.notif-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin-bottom: .5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: border-color .15s ease;
}
.notif-item:hover { border-color: var(--fg); }
.notif-item.unread { border-left: 3px solid var(--accent-dim); background: #f0f8fd; }
.notif-title { font-weight: 600; }
.notif-body { font-size: .9rem; color: var(--fg-muted); }
.notif-meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--fg-faint);
}
.notif-link {
  color: var(--accent-dim);
  font-weight: 500;
  font-size: .85rem;
  margin-top: .25rem;
}

/* ================================================================
   17. Лента активности (feed)
   ================================================================ */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.feed-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
}
.feed-meta {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--fg-faint);
  margin-bottom: .35rem;
}

/* ================================================================
   18. Интеграции
   ================================================================ */
.integrations-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.integration-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.integration-card h3 { margin: 0; font-size: 1.1rem; }

/* ================================================================
   19. Чарты — простые столбцы (если есть)
   ================================================================ */
.charts {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}
.chart-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  gap: 1rem;
  align-items: center;
  padding: .5rem 0;
}
.chart-row .bar {
  background: var(--bg-alt);
  border-radius: var(--r-sm);
  height: 24px;
  overflow: hidden;
  position: relative;
}
.chart-row .bar-fill {
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  height: 100%;
}

/* ================================================================
   20. 404, ошибки
   ================================================================ */
.error-page {
  text-align: center;
  padding: 5rem 1rem;
}
.error-page h1 {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  margin-bottom: 0;
  background: linear-gradient(135deg, var(--fg), var(--accent-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.error-page h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

/* ================================================================
   21. Аутентификация
   ================================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px - 200px);
  padding: 2rem 1.25rem;
}
.auth-page .form { width: 100%; max-width: 380px; }

/* ================================================================
   22. Пагинация
   ================================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: .35rem;
  margin: 2rem 0;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .5rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: .9rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-family: var(--font-mono);
}
.pagination a:hover { border-color: var(--fg); color: var(--fg); }
.pagination .current,
.pagination span.current {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ================================================================
   23. Inline блоки (детали заезда и т.п.)
   ================================================================ */
.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

/* ================================================================
   24. Адаптивность
   ================================================================ */
@media (max-width: 768px) {
  .header-inner { height: 56px; }
  .logo img { height: 30px; }
  .nav { gap: 1rem; }
  .nav a:not(.nav-cta) { display: none; }

  .hero { padding: 4rem 1rem 5rem; margin: -2rem -1.25rem 3rem; }
  .hero h1 { font-size: clamp(2rem, 8vw, 3rem); }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .form-row.full { grid-column: span 1; }

  .event-card { grid-template-columns: 1fr; }
  .event-card .btn { width: 100%; }

  .plan-card:nth-child(2) { transform: none; }

  table { font-size: .85rem; }
  th, td { padding: .65rem .5rem; }

  .summary, .summary-grid { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .summary, .summary-grid, .metrics { grid-template-columns: 1fr; }
}

/* ================================================================
   25. Reduced motion
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================
   26. Селектор языка в шапке
   ================================================================ */
.lang-switcher {
    position: relative;
    display: inline-block;
}
.lang-current {
    background: transparent;
    border: 1px solid var(--border);
    padding: .4rem .65rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    color: var(--fg-muted);
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: border-color .15s ease, color .15s ease;
}
.lang-current:hover { border-color: var(--fg); color: var(--fg); }
.lang-caret { font-size: .7em; opacity: .7; }

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: .35rem;
    margin: 0;
    list-style: none;
    min-width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    z-index: 100;
}
.lang-switcher.open .lang-menu { display: block; }

.lang-form { margin: 0; }

.lang-option {
    width: 100%;
    background: transparent;
    border: 0;
    padding: .5rem .65rem;
    text-align: left;
    cursor: pointer;
    font: inherit;
    border-radius: var(--r-sm);
    color: var(--fg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    transition: background .12s ease;
}
.lang-option:hover { background: var(--bg-alt); }
.lang-option-active {
    background: var(--bg-alt);
    font-weight: 600;
}
.lang-option-active::after {
    content: '✓';
    color: var(--accent-dim);
    font-weight: 700;
}
.lang-native {
    font-weight: 500;
}
.lang-name {
    font-size: .8rem;
    color: var(--fg-muted);
}

/* RTL поддержка */
[dir="rtl"] .lang-menu { left: 0; right: auto; }
[dir="rtl"] .nav { flex-direction: row-reverse; }
[dir="rtl"] .lang-option { text-align: right; }
