/**
 * Общая вёрстка операторских (зоотех) страниц: токены, шрифт, навбар, футер.
 * Подключать после wesp-zootech-shell.css и bootstrap.min.css.
 */

:root {
  --primary-color: #2196f3;
  --primary-rgb: 33, 150, 243;
  --primary: var(--primary-color);
  --gradient-border: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light),
    var(--primary-dark)
  );
  --primary-light: #42a5f5;
  --primary-dark: #1976d2;
  --primary-darker: #1565c0;
  --primary-blue: var(--primary-color);
  --light-blue: #42a5f5;
  --accent-blue: #1565c0;
  --secondary-color: #6c757d;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #0ea5e9;
  --bg-page: #f5f7fa;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --surface-muted: #f2f5f9;
  /* Слот логотипа: logo2.png 2222×1024; contain + left (обе темы — один файл) */
  --nav-logo-slot-h: 38px;
  --nav-logo-slot-w: 115px;
  --mobile-menu-logo-slot-h: 32px;
  --mobile-menu-logo-slot-w: 96px;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  --border-radius: 10px;
  --box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
  --box-shadow-hover: 0 8px 22px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  --shadow-soft: 0 4px 6px -1px rgb(15 23 42 / 0.08),
    0 2px 4px -2px rgb(15 23 42 / 0.06);
  --shadow-medium: 0 10px 20px -4px rgb(15 23 42 / 0.12);
  --gradient-blue: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  --transition: 0.22s ease;
  --zootech-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  --zootech-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --zootech-content-max: 1400px;
  --zootech-content-pad-x: clamp(0.75rem, 2.5vw, 1.25rem);
  --zootech-nav-pad-y: 0.875rem;
  /* Semantic aliases */
  --surface: var(--bg-white);
  --field: #ffffff;
  --text: var(--text-dark);
  --muted: var(--text-muted);
  /* Spacing (8px grid) */
  --zt-space-1: 8px;
  --zt-space-2: 12px;
  --zt-space-3: 16px;
  --zt-space-4: 24px;
  --zt-space-5: 32px;
  --zt-radius-sm: 8px;
  --zt-radius-md: 10px;
  --zt-radius-lg: 12px;
  --zt-font-caption: 0.8125rem;
  --zt-font-body: 0.9375rem;
  --zt-font-section: 1.125rem;
  --zt-font-page: 1.5rem;
  --zt-btn-height: 40px;
  --zt-btn-height-touch: 44px;
  --zt-focus-ring: 0 0 0 2px var(--bg-page), 0 0 0 4px rgba(var(--primary-rgb), 0.45);
}

html[data-theme="organic"] {
  --primary-color: #48816d;
  --primary-rgb: 72, 129, 109;
  --primary-light: #5a9a82;
  --primary-dark: #3a6b58;
  --primary-darker: #2f5748;
  --bg-page: #f6f6f4;
  --bg-light: #f6f6f4;
  --bg-white: #ffffff;
  --surface-muted: #eff4f2;
  --text-dark: #1a1e1c;
  --text-muted: #4a5a52;
  --border-light: #e8e8e2;
  --box-shadow: 0 2px 4px rgba(26, 30, 28, 0.04);
  --box-shadow-hover: 0 8px 22px rgba(26, 30, 28, 0.08),
    0 0 0 1px rgba(26, 30, 28, 0.03);
  --shadow-soft: 0 5px 20px rgba(0, 0, 0, 0.02);
  --shadow-medium: 0 10px 20px -4px rgba(26, 30, 28, 0.1);
  --surface: var(--bg-white);
  --field: #ffffff;
  --text: var(--text-dark);
  --muted: var(--text-muted);
  --zt-radius-lg: 24px;
  --zt-radius-md: 16px;
  --organic-logo-filter: brightness(0) saturate(100%) invert(43%) sepia(19%) saturate(747%)
    hue-rotate(118deg) brightness(92%) contrast(87%);
  --bs-primary: #48816d;
  --bs-primary-rgb: 72, 129, 109;
  --bs-link-color: #48816d;
  --bs-link-hover-color: #3a6b58;
}

html[data-theme="organic"] .nav-brand .logo.logo--light-theme,
html[data-theme="organic"] .mobile-brand .logo.logo--light-theme {
  filter: var(--organic-logo-filter) !important;
}

/* Усиленный контраст — все темы (ручной data-high-contrast или системный prefers-contrast) */
html[data-high-contrast="true"][data-theme="light"],
html[data-high-contrast="true"]:not([data-theme]) {
  --text-dark: #0f172a;
  --text-muted: #334155;
  --border-light: #94a3b8;
  --primary-color: #1565c0;
  --primary-rgb: 21, 101, 192;
  --primary-dark: #0d47a1;
  --primary-darker: #0a3d91;
  --box-shadow: none;
  --box-shadow-hover: 0 0 0 1px var(--border-light), 0 4px 12px rgba(15, 23, 42, 0.1);
  --zt-focus-ring: 0 0 0 2px var(--bg-white), 0 0 0 4px var(--text-dark);
}

html[data-high-contrast="true"][data-theme="organic"] {
  --primary-color: #2f6b57;
  --primary-rgb: 47, 107, 87;
  --primary-light: #3d8570;
  --primary-dark: #234a3d;
  --primary-darker: #1a3830;
  --text-dark: #0f1211;
  --text-muted: #2e3834;
  --border-light: #b0b8b2;
  --box-shadow: none;
  --box-shadow-hover: 0 0 0 1px var(--border-light), 0 4px 12px rgba(15, 18, 17, 0.08);
  --zt-focus-ring: 0 0 0 2px var(--bg-white), 0 0 0 4px var(--text-dark);
  --organic-logo-filter: brightness(0) saturate(100%) invert(28%) sepia(22%) saturate(900%)
    hue-rotate(118deg) brightness(88%) contrast(96%);
  --bs-primary: #2f6b57;
  --bs-primary-rgb: 47, 107, 87;
  --bs-link-color: #2f6b57;
  --bs-link-hover-color: #234a3d;
  --bs-success: #2f6b57;
  --bs-success-rgb: 47, 107, 87;
}

html[data-high-contrast="true"][data-theme="dark"] {
  --text-dark: #ffffff;
  --text-muted: #d1d9e0;
  --border-light: rgba(255, 255, 255, 0.28);
  --bg-white: #353d44;
  --field: #4a5259;
  --box-shadow: none;
  --box-shadow-hover: 0 0 0 1px var(--border-light);
  --zt-focus-ring: 0 0 0 2px var(--bg-page), 0 0 0 4px #ffffff;
}

@media (prefers-contrast: more) {
  html:not([data-high-contrast="false"])[data-theme="light"],
  html:not([data-high-contrast="false"]):not([data-theme]) {
    --text-dark: #0f172a;
    --text-muted: #334155;
    --border-light: #94a3b8;
    --primary-color: #1565c0;
    --primary-rgb: 21, 101, 192;
    --primary-dark: #0d47a1;
    --primary-darker: #0a3d91;
    --box-shadow: none;
    --box-shadow-hover: 0 0 0 1px var(--border-light), 0 4px 12px rgba(15, 23, 42, 0.1);
    --zt-focus-ring: 0 0 0 2px var(--bg-white), 0 0 0 4px var(--text-dark);
  }

  html:not([data-high-contrast="false"])[data-theme="organic"] {
    --primary-color: #2f6b57;
    --primary-rgb: 47, 107, 87;
    --primary-light: #3d8570;
    --primary-dark: #234a3d;
    --primary-darker: #1a3830;
    --text-dark: #0f1211;
    --text-muted: #2e3834;
    --border-light: #b0b8b2;
    --box-shadow: none;
    --box-shadow-hover: 0 0 0 1px var(--border-light), 0 4px 12px rgba(15, 18, 17, 0.08);
    --zt-focus-ring: 0 0 0 2px var(--bg-white), 0 0 0 4px var(--text-dark);
    --organic-logo-filter: brightness(0) saturate(100%) invert(28%) sepia(22%) saturate(900%)
      hue-rotate(118deg) brightness(88%) contrast(96%);
    --bs-primary: #2f6b57;
    --bs-primary-rgb: 47, 107, 87;
    --bs-link-color: #2f6b57;
    --bs-link-hover-color: #234a3d;
    --bs-success: #2f6b57;
    --bs-success-rgb: 47, 107, 87;
  }

  html:not([data-high-contrast="false"])[data-theme="dark"] {
    --text-dark: #ffffff;
    --text-muted: #d1d9e0;
    --border-light: rgba(255, 255, 255, 0.28);
    --bg-white: #353d44;
    --field: #4a525a;
    --box-shadow: none;
    --box-shadow-hover: 0 0 0 1px var(--border-light);
    --zt-focus-ring: 0 0 0 2px var(--bg-page), 0 0 0 4px #ffffff;
  }
}

html[data-theme="dark"] {
  --bg-page: #12181b;
  --bg-light: #12181b;
  --bg-white: #2c3338;
  --text-dark: #f5f5f5;
  --text-muted: #a8b0b8;
  --border-light: rgba(255, 255, 255, 0.12);
  --shadow-soft: 0 4px 12px rgb(0 0 0 / 0.35);
  --shadow-medium: 0 12px 24px rgb(0 0 0 / 0.45);
  --box-shadow-hover: 0 8px 22px rgb(0 0 0 / 0.35);
  --surface: var(--bg-white);
  --field: #3e444a;
  --text: var(--text-dark);
  --muted: var(--text-muted);
}

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

body.zootech-app-body,
body:has(.mobile-navbar) {
  margin: 0;
  font-family: var(--zootech-font);
  font-size: 0.9375rem;
  color: var(--text-dark);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

.zootech-app-body .container,
body:has(.mobile-navbar) .container {
  max-width: var(--zootech-content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--zootech-content-pad-x);
  padding-right: var(--zootech-content-pad-x);
}

.app-footer {
  margin-top: auto;
  padding: 14px var(--zootech-content-pad-x) 20px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

html[data-theme="dark"] .app-footer,
html[data-theme="dark"] .app-footer .text-muted {
  color: var(--text-muted) !important;
}

.page-content {
  flex: 1 0 auto;
  width: 100%;
}

.main-content {
  flex: 1 1 auto;
  padding-bottom: 1.5rem;
}

/* —— Верхняя панель —— */
.mobile-navbar {
  background: var(--gradient-blue);
  padding: var(--zootech-nav-pad-y) 0;
  margin-bottom: 1.75rem;
  box-shadow: var(--box-shadow-hover);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.nav-brand i {
  font-size: 1.35rem;
  color: #ffd54f;
}

.nav-brand .nav-logo-link {
  position: relative;
  width: var(--nav-logo-slot-w);
  height: var(--nav-logo-slot-h);
  flex-shrink: 0;
  isolation: isolate;
}

/* Блик только по контуру букв (mask = тот же PNG, что и логотип) */
.nav-logo-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 280% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  -webkit-mask-image: url("/static/logo2.png");
  mask-image: url("/static/logo2.png");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: left center;
  mask-position: left center;
  mix-blend-mode: soft-light;
  will-change: background-position, opacity;
}

/* Блик после появления navbar (ready → done), иначе анимация обрывается */
html.wesp-page-enter-ready .nav-logo-link::after,
html.wesp-page-enter-done .nav-logo-link::after {
  animation: wesp-nav-logo-shimmer 3s cubic-bezier(0.42, 0, 0.18, 1) infinite;
  animation-delay: 0.35s;
}

@keyframes wesp-nav-logo-shimmer {
  0%,
  100% {
    background-position: 100% 0;
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  24% {
    background-position: 0% 0;
    opacity: 1;
  }
  32%,
  100% {
    background-position: 0% 0;
    opacity: 0;
  }
}

html[data-theme="dark"] .nav-logo-link::after {
  display: none;
}

html[data-theme="dark"] .nav-logo-link--canvas-shimmer .nav-logo__shimmer-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.mobile-brand .nav-logo-link {
  position: relative;
  width: var(--mobile-menu-logo-slot-w);
  height: var(--mobile-menu-logo-slot-h);
  flex-shrink: 0;
  isolation: isolate;
}

.nav-brand .logo,
.mobile-brand .logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.nav-brand .logo--dark-theme,
.mobile-brand .logo--dark-theme {
  display: none;
}

html[data-theme="dark"] .nav-brand .logo--light-theme,
html[data-theme="dark"] .mobile-brand .logo--light-theme {
  display: none;
}

html[data-theme="dark"] .nav-brand .logo--dark-theme,
html[data-theme="dark"] .mobile-brand .logo--dark-theme {
  display: block;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background var(--transition), transform var(--transition);
}

.hamburger-menu:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hamburger-line {
  width: 24px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.desktop-menu {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: nowrap;
}

.menu-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform var(--transition), background var(--transition),
    box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
  overflow: hidden;
}

.menu-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.menu-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.menu-btn i {
  font-size: 0.95rem;
  color: #fff;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info {
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffc9c9;
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
  font-weight: 500;
  font-size: 0.875rem;
}

.logout-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  color: #fff;
}

/* Мобильное меню */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

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

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(88vw, 340px);
  height: 100%;
  background: var(--gradient-blue);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  transition: right 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
}

.mobile-brand i {
  font-size: 1.35rem;
  color: #ffd54f;
}

.close-menu {
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  line-height: 1;
  transition: background var(--transition);
}

.close-menu:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-menu-items {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #fff;
  text-decoration: none;
  padding: 0.9rem 1.25rem;
  font-weight: 500;
  font-size: 0.9375rem;
  border-left: 3px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.mobile-menu-item:hover,
.mobile-menu-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #ffd54f;
  color: #fff;
}

.mobile-menu-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.mobile-menu-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-user-info {
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.85rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.mobile-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffc9c9;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-weight: 500;
  background: rgba(255, 107, 107, 0.12);
  transition: background var(--transition);
}

.mobile-logout-btn:hover {
  background: rgba(255, 107, 107, 0.22);
  color: #fff;
}

/* Светлая тема: навбар как заголовки таблиц (surface-muted), без синего градиента */
html:not([data-theme="dark"]) .mobile-navbar {
  background: var(--surface-muted);
  box-shadow: var(--box-shadow);
  border-bottom: 1px solid var(--border-light);
}

html:not([data-theme="dark"]) .nav-brand {
  color: var(--text-dark);
}

html:not([data-theme="dark"]) .nav-brand i {
  color: var(--primary-color);
}

html:not([data-theme="dark"]):not([data-theme="organic"]) .nav-brand .logo,
html:not([data-theme="dark"]):not([data-theme="organic"]) .mobile-brand .logo {
  filter: none;
}

html:not([data-theme="dark"]):not([data-theme="organic"]) .nav-brand .logo--dark-theme,
html:not([data-theme="dark"]):not([data-theme="organic"]) .mobile-brand .logo--dark-theme {
  display: none;
}

html:not([data-theme="dark"]) .hamburger-line {
  background: var(--text-dark);
}

html:not([data-theme="dark"]) .hamburger-menu:hover {
  background: rgba(15, 23, 42, 0.06);
}

html:not([data-theme="dark"]) .menu-btn {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  box-shadow: none;
}

html:not([data-theme="dark"]) .menu-btn:hover {
  background: var(--bg-white);
  border-color: var(--primary-color);
  color: var(--primary-darker);
  box-shadow: var(--box-shadow);
}

html:not([data-theme="dark"]) .menu-btn.active {
  background: rgba(var(--primary-rgb), 0.1);
  border-color: var(--primary-color);
  color: var(--primary-darker);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.12);
}

html:not([data-theme="dark"]) .menu-btn i {
  color: var(--primary-color);
}

html:not([data-theme="dark"]) .user-info {
  color: var(--text-dark);
}

html:not([data-theme="dark"]) .logout-btn {
  color: var(--danger-color);
}

html:not([data-theme="dark"]) .logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger-color);
}

html:not([data-theme="dark"]) .mobile-menu {
  background: var(--bg-white);
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
}

html:not([data-theme="dark"]) .mobile-menu-header {
  background: var(--surface-muted);
  border-bottom-color: var(--border-light);
}

html:not([data-theme="dark"]) .mobile-brand {
  color: var(--text-dark);
}

html:not([data-theme="dark"]) .mobile-brand i {
  color: var(--primary-color);
}

html:not([data-theme="dark"]) .close-menu {
  color: var(--text-muted);
}

html:not([data-theme="dark"]) .close-menu:hover {
  background: rgba(15, 23, 42, 0.06);
}

html:not([data-theme="dark"]) .mobile-menu-item {
  color: var(--text-dark);
}

html:not([data-theme="dark"]) .mobile-menu-item:hover,
html:not([data-theme="dark"]) .mobile-menu-item.active {
  background: rgba(var(--primary-rgb), 0.08);
  border-left-color: var(--primary-color);
  color: var(--primary-darker);
}

html:not([data-theme="dark"]) .mobile-menu-item i {
  color: var(--primary-color);
}

html:not([data-theme="dark"]) .mobile-menu-footer {
  border-top-color: var(--border-light);
}

html:not([data-theme="dark"]) .mobile-user-info {
  color: var(--text-dark);
  background: var(--surface-muted);
}

html:not([data-theme="dark"]) .mobile-logout-btn {
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.08);
}

html:not([data-theme="dark"]) .mobile-logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger-color);
}

/* Заголовок раздела (общий паттерн) */
.page-header {
  background: var(--bg-white);
  border-radius: var(--border-radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 1200px) {
  .desktop-menu {
    gap: 0.35rem;
  }
  .menu-btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 992px) {
  .desktop-menu {
    display: none;
  }
}

@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
  }
  .user-section {
    display: none;
  }
  :root {
    --nav-logo-slot-h: 32px;
    --nav-logo-slot-w: 96px;
    --mobile-menu-logo-slot-h: 28px;
    --mobile-menu-logo-slot-w: 84px;
  }
  .page-header {
    padding: 1.15rem 1.25rem;
  }
  .page-title {
    font-size: 1.3rem;
  }
}

/* —— Page enter (navbar → main → blocks), только opacity — без translate (иначе «дёргается») —— */
:root {
  --wesp-enter-duration: 350ms;
  --wesp-enter-duration-fast: 350ms;
  --wesp-enter-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wesp-enter-stagger: 55ms;
  --wesp-enter-nav-delay: 0ms;
  --wesp-enter-items-base-delay: 80ms;
}

@keyframes wesp-enter-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

html.wesp-page-enter-pending .mobile-navbar {
  opacity: 0;
}

html.wesp-page-enter-ready .mobile-navbar {
  animation: wesp-enter-fade var(--wesp-enter-duration-fast) var(--wesp-enter-ease) both;
  animation-delay: var(--wesp-enter-nav-delay);
}

html.wesp-page-enter-pending .wesp-page-main {
  opacity: 0;
}

html.wesp-page-enter-grid-page.wesp-page-enter-pending .wesp-page-main,
html.wesp-page-enter-grid-page.wesp-page-enter-ready .wesp-page-main {
  opacity: 1;
}

html.wesp-page-enter-ready .wesp-page-main {
  opacity: 1;
}

html.wesp-page-enter-pending .wesp-page-enter-item {
  opacity: 0;
}

html.wesp-page-enter-ready .wesp-page-enter-item {
  animation: wesp-enter-fade var(--wesp-enter-duration) var(--wesp-enter-ease) both;
  animation-delay: calc(
    var(--wesp-enter-items-base-delay) + var(--wesp-enter-i, 0) * var(--wesp-enter-stagger)
  );
}

html.wesp-page-enter-done .mobile-navbar,
html.wesp-page-enter-done .wesp-page-main,
html.wesp-page-enter-done .wesp-page-enter-item {
  animation: none !important;
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  html.wesp-page-enter-pending .mobile-navbar,
  html.wesp-page-enter-pending .wesp-page-main,
  html.wesp-page-enter-pending .wesp-page-enter-item {
    opacity: 1 !important;
  }

  html.wesp-page-enter-ready .mobile-navbar,
  html.wesp-page-enter-ready .wesp-page-main,
  html.wesp-page-enter-ready .wesp-page-enter-item {
    animation: none !important;
  }

  .nav-logo-link::after {
    animation: none !important;
    display: none;
  }
}
