/* Фирменные цвета Разборщика — переопределяем токены theme.css под стальную холодную палитру */
:root {
  --brand: #3b5673;
  --brand-2: #2c4255;
  --accent: #5a7fa0;
  --bg: #f8f9fb;
  --grad: linear-gradient(135deg, #3b5673 0%, #5a7fa0 100%);
}

/* === ПУБЛИЧНАЯ ЧАСТЬ === */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  margin: 0;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Шапка сайта */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  transition: opacity 0.15s var(--ease-out);
}
.brand:hover { opacity: 0.75; }
.brand svg { color: var(--brand); }

.nav-toggle-input { display: none; }
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
  margin: calc(-1 * var(--space-2));
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s var(--ease-out), opacity 0.2s;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.site-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--brand); }
.site-nav .nav-login { color: var(--muted); }

/* Герой */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}
.hero-content { max-width: 38rem; }
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-block: var(--space-3) var(--space-4);
  color: var(--brand-2);
}
.hero-lead {
  font-size: var(--step-1);
  color: var(--muted);
  margin-block-end: var(--space-6);
}
.hero-cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--border);
}

.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Секции */
.section {
  padding-block: clamp(3.5rem, 9vw, 6rem);
}
.section-inner { max-width: 72rem; margin-inline: auto; }
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-block-end: var(--space-7);
  color: var(--brand-2);
}

.section-how { background: var(--surface); }

/* Шаги */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--space-6);
}
.step-card {
  position: relative;
  padding: var(--space-6);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
}
.step-num {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: 50%;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand);
}
.step-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad);
  border-radius: var(--radius-2);
  color: white;
  margin-block-end: var(--space-4);
}
.step-title {
  font-size: var(--step-2);
  font-weight: 700;
  margin-block-end: var(--space-2);
  color: var(--brand-2);
}
.step-desc { color: var(--muted); }

/* Выгоды */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-5);
}
.benefit-card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.benefit-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.benefit-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: white;
  border-radius: var(--radius-2);
  margin-block-end: var(--space-3);
}
.benefit-title {
  font-size: var(--step-1);
  font-weight: 700;
  margin-block-end: var(--space-2);
  color: var(--brand-2);
}
.benefit-desc { color: var(--muted); font-size: 0.95rem; }

/* Отзывы */
.section-reviews { background: var(--surface); }
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--space-6);
}
.review-card {
  padding: var(--space-6);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-1);
}
.review-text {
  font-size: var(--step-0);
  line-height: 1.65;
  margin-block-end: var(--space-5);
  color: var(--text);
}
.review-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.review-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.review-name {
  font-weight: 700;
  color: var(--brand-2);
}
.review-position { font-size: 0.875rem; }

/* CTA */
.section-cta {
  background: var(--grad);
  color: white;
}
.cta-box {
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
  padding-block: var(--space-7);
}
.cta-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-block-end: var(--space-3);
}
.cta-desc {
  font-size: var(--step-1);
  margin-block-end: var(--space-5);
  opacity: 0.95;
}
.cta-box .btn { background: white; color: var(--brand); }
.cta-box .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* Подвал */
.site-footer {
  background: var(--brand-2);
  color: rgba(255,255,255,0.85);
  padding-block: var(--space-8) var(--space-5);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-7);
  margin-block-end: var(--space-6);
}
.footer-brand .brand { color: white; }
.footer-brand p { margin-block-start: var(--space-3); font-size: 0.9rem; opacity: 0.75; }
.footer-col { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col-title {
  font-weight: 700;
  color: white;
  margin-block-end: var(--space-1);
}
.footer-col a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-block-start: var(--space-4);
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Служебные страницы */
.section-page { padding-block: var(--space-7); }
.page-narrow { max-width: 48rem; }
.legal h2 {
  font-size: var(--step-2);
  font-weight: 700;
  margin-block: var(--space-6) var(--space-3);
  color: var(--brand-2);
}
.legal h2:first-of-type { margin-block-start: var(--space-4); }
.legal p { margin-block-end: var(--space-3); }
.legal a { color: var(--brand); }

.form-contact { margin-block: var(--space-6); }
.contact-info {
  margin-block-start: var(--space-7);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
}
.contact-info h3 {
  font-size: var(--step-1);
  font-weight: 700;
  margin-block-end: var(--space-2);
  color: var(--brand-2);
}
.contact-info a { color: var(--brand); text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }

.lead { font-size: var(--step-1); color: var(--muted); margin-block-end: var(--space-5); }

/* === КАБИНЕТ === */
.app-body { background: var(--bg); min-height: 100vh; }

.app-shell {
  display: grid;
  grid-template-columns: 15rem 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  min-height: 100vh;
}
.app-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: white;
  border-bottom: 1px solid var(--border);
}
.app-sidebar {
  grid-area: sidebar;
  background: var(--brand-2);
  color: white;
  padding: var(--space-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.app-main {
  grid-area: main;
  padding: var(--space-6);
  overflow-x: hidden;
}

.app-burger { display: none; }
.app-nav-toggle-input { display: none; }
.app-nav-backdrop { display: none; }

.app-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
}
.app-logo-side {
  padding-inline: var(--space-4);
  color: white;
}

.app-topbar-user {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.app-topbar-name { font-weight: 600; color: var(--text); }

.app-nav {
  display: flex;
  flex-direction: column;
}
.app-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.app-nav-link:hover { background: rgba(255,255,255,0.08); color: white; }
.app-nav-link.is-active {
  background: rgba(255,255,255,0.12);
  color: white;
  border-left-color: var(--accent);
}
.app-nav-link-exit { margin-block-start: auto; opacity: 0.6; }
.app-nav-link-exit:hover { opacity: 1; background: rgba(255,255,255,0.05); }

.app-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-block-end: var(--space-5);
  flex-wrap: wrap;
}
.app-h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--brand-2);
  margin: 0;
}
.app-h2 {
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--brand-2);
  margin: 0;
}
.proj-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.proj-desc { margin-block-start: var(--space-2); max-width: 48rem; }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-end: var(--space-4);
  font-size: 0.9rem;
  color: var(--muted);
}
.breadcrumbs a { color: var(--brand); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.filter-bar {
  display: flex;
  gap: var(--space-2);
  margin-block-end: var(--space-5);
  flex-wrap: wrap;
}
.chip {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.chip:hover { background: var(--surface-2); border-color: var(--brand); }
.chip.is-active { background: var(--brand); color: white; border-color: var(--brand); }

/* Состояния */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
}
.empty-state-sm { padding: var(--space-5); }
.empty-icon {
  width: 4rem;
  height: 4rem;
  margin-inline: auto;
  margin-block-end: var(--space-4);
  color: var(--muted);
  opacity: 0.6;
}
.empty-state h3 {
  font-size: var(--step-2);
  font-weight: 700;
  margin-block-end: var(--space-2);
  color: var(--brand-2);
}
.empty-state p { margin-block-end: var(--space-5); max-width: 32rem; margin-inline: auto; }

/* Сетка проектов */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: var(--space-5);
}
.project-card {
  display: block;
  padding: var(--space-5);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}
.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: var(--space-3);
}
.project-progress-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
}
.project-card-title {
  font-size: var(--step-1);
  font-weight: 700;
  margin-block-end: var(--space-2);
  color: var(--brand-2);
}
.project-card-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-block-end: var(--space-4);
  line-height: 1.5;
}
.project-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-3);
  margin-block-start: var(--space-4);
  padding-block-start: var(--space-4);
  border-top: 1px solid var(--border);
}
.meta-item { display: flex; flex-direction: column; gap: var(--space-1); }
.meta-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.meta-val { font-weight: 600; color: var(--text); }
.meta-negative { color: #c0392b; }

.status-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.st-active { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.st-paused { background: color-mix(in srgb, orange 15%, transparent); color: #d97706; }
.st-completed { background: color-mix(in srgb, green 15%, transparent); color: #059669; }

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-block: var(--space-3);
}
.progress-track-lg { height: 10px; }
.progress-fill {
  height: 100%;
  background: var(--grad);
  border-radius: var(--radius-pill);
  transition: width 0.3s var(--ease-out);
}

/* Статистика проекта */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: var(--space-4);
  margin-block-end: var(--space-6);
}
.stat-card {
  padding: var(--space-5);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
}
.stat-card-warn { border-color: #f59e0b; background: #fffbeb; }
.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-block-end: var(--space-2);
}
.stat-big {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--brand-2);
}
.stat-of { font-size: var(--step-0); font-weight: 400; color: var(--muted); }
.stat-sub { font-size: 0.9rem; margin-block-start: var(--space-1); }

/* График */
.chart-card {
  padding: var(--space-5);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  margin-block-end: var(--space-6);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: var(--space-5);
  flex-wrap: wrap;
  gap: var(--space-3);
}
.chart-head h3 {
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--brand-2);
  margin: 0;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: 12rem;
  padding: var(--space-3);
  background: var(--surface);
  border-radius: var(--radius-1);
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}
.chart-bar {
  width: 100%;
  background: var(--brand);
  border-radius: var(--radius-1) var(--radius-1) 0 0;
  transition: background 0.2s;
}
.chart-bar-done { background: var(--accent); opacity: 0.6; }
.chart-bar-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  word-break: break-word;
  hyphens: auto;
}

/* Задачи */
.tasks-section { margin-block-start: var(--space-6); }
.tasks-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}
.task-filters {
  display: flex;
  gap: var(--space-4);
  margin-block-end: var(--space-4);
  flex-wrap: wrap;
}
.filter-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: white;
}
.tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.tasks-table thead {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tasks-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tasks-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.tasks-table tbody tr:last-child td { border-bottom: none; }
.tasks-table tbody tr { transition: background 0.15s; }
.tasks-table tbody tr:hover { background: var(--surface); }
.task-done { opacity: 0.5; }
.task-done .col-title { text-decoration: line-through; }

.col-check { width: 3rem; }
.col-cost { text-align: right; white-space: nowrap; }
.col-actions { width: 6rem; text-align: right; white-space: nowrap; }

.task-check {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-1);
  background: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.task-check:hover { border-color: var(--brand); }
.task-check.checked {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.cell-overdue { color: #c0392b; }
.badge-overdue {
  display: inline-block;
  margin-inline-start: var(--space-2);
  padding: 2px var(--space-2);
  background: #fee;
  color: #c0392b;
  border-radius: var(--radius-1);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-1);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn-danger:hover { background: #fee; color: #c0392b; }

.inline-form { display: inline; }

/* Профиль */
.profile-wrap {
  max-width: 48rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.profile-stats {
  padding: var(--space-5);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
}
.profile-stats h3 {
  font-size: var(--step-1);
  font-weight: 700;
  margin-block-end: var(--space-4);
  color: var(--brand-2);
}
.stats-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-4);
}
.stats-item { text-align: center; }
.stats-val {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  margin-block-end: var(--space-1);
}
.stats-label { font-size: 0.85rem; }

.profile-section {
  padding: var(--space-6);
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
}
.profile-section h3 {
  font-size: var(--step-1);
  font-weight: 700;
  margin-block-end: var(--space-4);
  color: var(--brand-2);
}
.form-profile { max-width: 28rem; }

/* Формы */
.form { display: flex; flex-direction: column; gap: var(--space-4); }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: var(--space-4);
}
.field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.req { color: #c0392b; }
.input {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-1);
  font-family: inherit;
  font-size: 1rem;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
.input-sm { padding: var(--space-2); font-size: 0.9rem; }
textarea.input { resize: vertical; min-height: 5rem; }

.checkbox-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
  cursor: pointer;
}
.checkbox-field input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: var(--brand);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-block-start: var(--space-2);
}

.alert {
  padding: var(--space-4);
  border-radius: var(--radius-2);
  font-weight: 500;
  margin-block-end: var(--space-4);
}
.alert-ok { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-5);
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-2);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.btn-sm { padding: var(--space-2) var(--space-4); font-size: 0.9rem; }
.btn-lg { padding: var(--space-4) var(--space-6); font-size: var(--step-1); }
.btn-ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); box-shadow: none; }
.btn-danger {
  background: #c0392b;
}
.btn-danger:hover { background: #a02622; }
.btn-danger-ghost {
  background: transparent;
  color: #c0392b;
  border: 1px solid var(--border);
}
.btn-danger-ghost:hover { background: #fee; box-shadow: none; }

.cluster { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* Модалки */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: var(--radius-3);
  box-shadow: var(--shadow-3);
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card-sm { max-width: 24rem; }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--brand-2);
  margin: 0;
}
.modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-1);
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface); color: var(--text); }
.modal-card .form { padding: var(--space-5); }
.modal-text { padding-inline: var(--space-5); margin-block: var(--space-3); }

/* Адаптив: планшет */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .app-shell { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .app-sidebar { display: none; }
  .app-burger {
    display: flex;
    cursor: pointer;
  }
  .app-nav-toggle-input:checked ~ .app-sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 150;
    width: 15rem;
    box-shadow: var(--shadow-3);
  }
  .app-nav-toggle-input:checked ~ .app-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(0,0,0,0.4);
  }
  .app-nav-toggle-input:checked ~ .app-topbar .app-burger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  .app-nav-toggle-input:checked ~ .app-topbar .app-burger span:nth-child(2) {
    opacity: 0;
  }
  .app-nav-toggle-input:checked ~ .app-topbar .app-burger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}

/* Адаптив: телефон */
@media (max-width: 640px) {
  .site-header-inner { padding-block: var(--space-2); }
  .nav-burger { display: flex; }
  .site-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(16rem, 75vw);
    background: white;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-5);
    gap: var(--space-4);
    box-shadow: var(--shadow-3);
    transform: translateX(100%);
    transition: transform 0.25s var(--ease-out);
    z-index: 110;
  }
  .nav-toggle-input:checked ~ .site-nav { transform: translateX(0); }
  .nav-toggle-input:checked ~ .nav-burger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  .nav-toggle-input:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle-input:checked ~ .nav-burger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .hero { padding-block: var(--space-6); }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .section { padding-block: var(--space-6); }
  .app-main { padding: var(--space-4); }
  .app-head { flex-direction: column; align-items: stretch; }
  .app-head .btn, .app-head .cluster { width: 100%; justify-content: stretch; }
  .stats-row { grid-template-columns: 1fr; }
  .chart-bars { height: 10rem; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Недостающие дизайн-токены (значения из theme.css платформы) --- */
:root{
  --text: #14141c;
  --font-sans: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1160px;
  --space-4: 16px;
  --border: #e7e7ef;
  --space-3: 12px;
  --space-2: 8px;
  --step-1: clamp(1.2rem, 1.1rem + .5vw, 1.45rem);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --space-5: 24px;
  --muted: #6a6a7b;
  --space-8: 64px;
  --space-6: 32px;
  --radius-3: 22px;
  --shadow-2: 0 1px 2px rgba(20, 20, 40, .06), 0 10px 24px rgba(20, 20, 40, .08);
  --space-1: 4px;
  --surface: #ffffff;
  --radius-pill: 999px;
  --space-7: 48px;
  --shadow-1: 0 1px 2px rgba(20, 20, 40, .06);
  --radius-2: 16px;
  --step-2: clamp(1.45rem, 1.3rem + .9vw, 1.9rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.125rem);
  --surface-2: #f1f1f7;
  --radius-1: 10px;
  --shadow-3: 0 2px 4px rgba(20, 20, 40, .06), 0 24px 60px rgba(20, 20, 40, .14);
}
