:root {
    --primary-color: #1565c0; /* Благородный синий */
    --primary-dark: #0d47a1;
    --primary-light: #e3f2fd;
    --accent-color: #0288d1;
    --text-color: #2d3748; /* Мягкий темно-графитовый цвет для идеального чтения */
    --text-muted: #718096;
    --light-bg: #f8fafc; /* Чистый воздушный фон */
    --white: #ffffff;
    --border-color: #edf2f7;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* --- Общие сбросы и стили --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    max-width: 100%;
}

body {
    font-family: var(--font-family);
    line-height: 1.65;
    color: var(--text-color);
    background-color: #eef2f6; /* Мягкий благородный фон вокруг карточки портала */
    -webkit-font-smoothing: antialiased;
}

/* Единая гармоничная композиция всего портала (Шапка + Тело + Футер) */
.site-wrapper {
    background-color: var(--white);
    max-width: 1220px;
    margin: 1.25rem auto 2.5rem auto;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
    border: 1px solid #e2e8f0;
    overflow: visible; /* Обязательно visible, чтобы дочерние элементы могли прилипать при скролле */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3.75rem);
}

@media (max-width: 1240px) {
    .site-wrapper {
        margin: 0.75rem 1rem 2rem 1rem;
    }
}

@media (max-width: 768px) {
    .site-wrapper {
        margin: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: 100vh;
    }
}

/* Контейнер-обертка основного контента внутри портала */
.content-wrapper {
    background-color: transparent;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    flex: 1 0 auto; /* Растягивает блок контента так, чтобы футер всегда был прижат к низу */
}

.container {
  max-width: 1140px;
  margin: 25px auto;
  padding: 0 24px;
}

h1, h2, h3, h4, h5, h6 {
  color: #1a202c;
  margin-bottom: 1rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

a:hover, a:focus {
  text-decoration: none;
  color: var(--primary-dark);
}

address {
    font-style: normal;
    line-height: 1.7;
}

/* --- Шапка сайта (Интегрирована в верхнюю часть site-wrapper) --- */
header {
  background: #ffffff;
  position: relative;
  z-index: 1000;
  overflow: visible;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.header-top {
  padding: 0.85rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  gap: 1.25rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  flex: 0 1 auto;
}

.header-brand:hover {
  text-decoration: none;
}

.header-brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
}

.header-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a365d;
  line-height: 1.2;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.header-brand:hover .header-brand-title {
  color: var(--primary-color);
}

.header-brand-desc {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}

/* Блок поиска и быстрых действий в шапке */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-search-form {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 9999px;
  height: 40px;
  width: 240px;
  padding: 0 4px 0 12px;
  box-sizing: border-box;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search-form:focus-within {
  width: 270px;
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-leading-icon {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-right: 8px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.header-search-form:focus-within .search-leading-icon {
  color: #3b82f6;
}

.search-input {
  border: none;
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  font-size: 0.88rem;
  font-family: inherit;
  color: #1e293b;
  padding: 0;
}

.search-input:focus {
  outline: none;
}

.search-input::placeholder {
  color: #94a3b8;
  font-size: 0.85rem;
}

.search-submit-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0;
  transition: all 0.2s ease;
}

.header-search-form:focus-within .search-submit-btn,
.search-submit-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  transform: translateX(1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  white-space: nowrap;
}

.header-action-btn i {
  font-size: 0.9rem;
  color: #64748b;
  transition: color 0.2s ease;
}

.header-action-btn:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.header-action-btn:hover i {
  color: var(--primary-color);
}

.header-action-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary-color);
}

.header-action-btn.active i {
  color: var(--primary-color);
}

/* Акцентная кнопка (Контакты/Обратная связь) */
.header-action-btn-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary-color);
}

.header-action-btn-primary i {
  color: var(--primary-color);
}

.header-action-btn-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.25);
}

.header-action-btn-primary:hover i {
  color: #ffffff;
}

@media (max-width: 1024px) {
  .header-action-btn .action-label {
    display: none;
  }
  .header-action-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .header-search-form {
    width: 200px;
  }
  .header-search-form:focus-within {
    width: 230px;
  }
}

@media (max-width: 640px) {
  .header-search-form {
    display: none; /* На ультра-узких мобильных поиск доступен в меню или по клику */
  }
}

/* Навигационная полоса — зафиксирована вверху при скролле */
.header-nav-wrap {
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin: 0;
  padding: 0;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
}

.menu-item > a {
  color: #334155;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.94rem;
  height: 34px;
  line-height: 34px;
  padding: 0 0.95rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.menu-item > a:hover {
  color: var(--primary-color);
  background: rgba(21, 101, 192, 0.08);
  text-decoration: none;
}

.menu-item.has-children > a::after {
  content: ' ▾';
  font-size: 0.75rem;
  margin-left: 0.35rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.menu-item:hover.has-children > a::after {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.main-nav .menu-item > a.active {
  background: #e3f2fd;
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none;
}

/* Выпадающее меню с ВСЕГДА ВИДИМЫМ ярким скроллбаром */
.submenu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 320px;
  max-width: 440px;
  background: #ffffff;
  border: 2px solid #60a5fa;
  border-radius: 12px;
  box-shadow: 0 12px 30px -5px rgba(25, 118, 210, 0.22), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 4px;
  padding: 0.5rem 0.2rem 0.5rem 0.4rem;
  max-height: 380px;
  overflow-y: scroll !important;
  scrollbar-gutter: stable always;
  scrollbar-width: auto !important;
  scrollbar-color: #0284c7 #e2e8f0 !important;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  box-sizing: border-box;
}

.menu-item:hover > .submenu,
.menu-item:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

/* Кастомный классический скроллбар - ВСЕГДА ВИДЕН 100% времени (без автоскрытия) */
.submenu::-webkit-scrollbar {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  display: block !important;
}

.submenu::-webkit-scrollbar-track {
  background: #e2e8f0 !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  margin: 4px 2px !important;
  display: block !important;
}

.submenu::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%) !important;
  border-radius: 8px !important;
  border: 2px solid #ffffff !important;
  min-height: 48px !important;
  display: block !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

.submenu::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%) !important;
}

.submenu .menu-item {
  display: block;
  height: auto;
}

.submenu .menu-item a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.35;
  font-weight: 500;
  white-space: normal;
  border-radius: 6px;
  transition: all 0.15s ease;
  height: auto;
}

.submenu .menu-item a:hover {
  background: #f0f7ff;
  color: #1976d2;
  transform: translateX(2px);
}

.submenu .menu-item a.active {
  background: #e3f2fd;
  color: #1565c0;
  font-weight: 600;
}
@media (max-width: 900px) {
  .main-nav {
    gap: 0.5em;
    font-size: 0.98em;
    margin-left: 0.5em;
  }
  .menu-item {
    padding: 0.2em 0.3em;
  }
}
@media (max-width: 700px) {
  .main-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2em;
    margin-left: 0;
  }
  .menu-item {
    padding: 0.2em 0.2em;
  }
}

/* --- Карточки контента --- */
.card {
    background: var(--white);
    padding: 2.25rem;
    margin-bottom: 2rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
}

.feedback-card {
    /* Этот хак предотвращает "растягивание" страницы по горизонтали, 
       если встроенный виджет (например, Госуслуги) пытается стать шире родителя. */
    overflow: hidden;
}

/* --- Сайдбар и баннеры --- */
.sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

/* --- Списки --- */
.card ul {
  list-style: none;
  padding: 0;
}

.card ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.card ul li:last-child {
    border-bottom: none;
}

/* --- Лаконичный центрированный подвал (Интегрирован в основание site-wrapper) --- */
footer {
  padding: 2rem 1.5rem;
  margin-top: auto; /* Прижимает футер к низу site-wrapper */
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.footer-container {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.footer-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.footer-sub {
  color: #64748b;
  margin: 0;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.footer-meta {
  margin-top: 0.6rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.footer-copy {
  color: #94a3b8;
  font-size: 0.88rem;
  margin: 0;
}

.footer-dev {
  color: #94a3b8;
  font-size: 0.88rem;
  margin: 0;
}

.footer-dev a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.footer-dev a:hover {
  text-decoration: underline;
}

/* --- Адаптивность: кнопка-гамбургер --- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger, .hamburger::before, .hamburger::after {
    content: '';
    display: block;
    background-color: var(--primary-color);
    height: 3px;
    width: 25px;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger::before { transform: translateY(-8px); }
.hamburger::after { transform: translateY(8px); }

.nav-open .hamburger { background-color: transparent; }
.nav-open .hamburger::before { transform: rotate(45deg); }
.nav-open .hamburger::after { transform: rotate(-45deg); }

/* --- Основная сетка контента (с защитой от вылета сайдбара) --- */
.main-content-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    padding: 0 1.5rem 2.5rem 1.5rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content {
    min-width: 0;
    max-width: 100%;
}

.main-content-with-sidebar .sidebar .card {
    margin-bottom: 0;
    box-sizing: border-box;
    width: 100%;
}

/* На экранах до 992px сайдбар аккуратно переносится вниз */
@media (max-width: 992px) {
    .main-content-with-sidebar {
        grid-template-columns: 1fr;
        padding: 0 1rem 2rem 1rem;
        gap: 1.5rem;
    }
}

/* Медиа-запрос для экранов шире 768px (планшеты и десктопы) */
@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }

    .main-nav, .main-nav.active-mobile {
        display: flex;
        position: static;
        width: auto;
        background: none;
        box-shadow: none;
        flex-direction: row;
        gap: 0.5rem;
    }
}

/* Конец стилей навигации */


/* Делаем таблицы в контенте горизонтально-прокручиваемыми на мобильных */
@media (max-width: 768px) {
    .main-content table, .card table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* --- Кружок-админка (admin-fab) --- */
.admin-fab {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 24px;
  height: 24px;
  background: transparent;
  color: transparent;
  border-radius: 50%;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 2000;
  cursor: pointer;
  opacity: 0.1;
  transition: background 0.2s, opacity 0.2s, box-shadow 0.2s, color 0.2s;
  border: 1px solid transparent;
}
.admin-fab:hover, .admin-fab:focus {
  background: var(--primary-color);
  color: #fff;
  opacity: 0.7;
  box-shadow: 0 2px 8px rgba(33,150,243,0.18);
  border: 1px solid var(--primary-color);
}
.admin-fab::before {
  content: '';
}
@media (max-width: 600px) {
  .admin-fab {
    display: none;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  body {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .container {
    padding: 0 10px;
  }
  .card {
    padding: 1rem;
  }
  .main-content-with-sidebar {
    gap: 1rem;
  }
  .banners {
    grid-template-columns: repeat(2, 1fr);
  }
  .banners img {
    max-height: 60px;
  }
  .main-nav a, .menu-item .submenu a {
    padding: 0.8rem 1rem;
  }
  .nav-toggle {
    padding: 0.4rem;
  }
  h1, h2, h3 {
    font-size: 1.2rem;
  }
  .news-item {
    font-size: 1em;
    margin-bottom: 1em;
  }
  .feedback-card {
    padding: 0.7rem 0.5rem;
  }
  .banner-caption {
    font-size: 0.95em;
  }
  .main-content-with-sidebar,
  .main-content,
  .sidebar,
  .card,
  .banners,
  .feedback-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .hero h1 {
    font-size: 0.85rem;
    text-align: center;
    word-break: break-word;
  }
  .news-item, .news-title, .news-date, .news-text {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }
}

/* --- Режим доступности и виджет вынесены в accessibility.css --- */

/* --- Стили для ссылок на документы с кнопкой скачивания по наведению --- */
.doc-link-wrapper {
  position: relative;
  display: inline-block; /* Чтобы обертка была по размеру контента */
}

.doc-link-wrapper .download-btn {
  visibility: hidden;
  opacity: 0;
  margin-left: 15px;
  color: #388e3c;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s ease-in-out;
  white-space: nowrap; /* Чтобы кнопка не переносилась */
}

.doc-link-wrapper:hover .download-btn {
  visibility: visible;
  opacity: 1;
  text-decoration: none;
}


/* --- Современная форма поиска под логотипом (компактная) --- */
.site-search {
  width: 100%;
  max-width: 320px;
  margin: 0.5em 0 1em 0;
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 1.5em;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.07);
  border: 1.5px solid var(--border-color);
  padding: 1px 6px 1px 10px;
  transition: box-shadow 0.2s, border 0.2s;
}
.site-search:focus-within {
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.13);
  border-color: var(--primary-color);
}
.site-search input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.98em;
  padding: 0.5em 0.3em 0.5em 0;
  color: var(--text-color);
}
.site-search input[type="text"]::placeholder {
  color: #b0b8c1;
  opacity: 1;
}
.site-search button {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0 0.3em;
  display: flex;
  align-items: center;
  color: var(--primary-color);
  border-radius: 50%;
  transition: background 0.18s;
  font-size: 0.98em;
}
.site-search button:hover, .site-search button:focus {
  background: var(--light-bg);
}
/* --- Мобильная адаптивность (до 768px, включая 402x874) --- */
@media (max-width: 768px) {
  /* Шапка сайта */
  .header-top {
    padding: 0.6rem 0.85rem;
  }

  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: auto;
  }

  .header-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-brand-desc {
    display: none;
  }

  .header-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
  }

  /* Скрываем громоздкую форму поиска из шапки на смартфонах (доступна через /search) */
  .header-search-form {
    display: none !important;
  }

  /* Кнопки действий (Карта сайта, Контакты) */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .header-action-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .header-action-btn .action-label {
    display: none;
  }

  .header-action-btn i {
    font-size: 0.95rem;
  }

  /* Кнопка открытия меню */
  .nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    margin: 0;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
  }

  .nav-toggle .hamburger {
    position: relative;
    width: 20px;
    height: 2px;
    background-color: #1e293b;
    border-radius: 2px;
    transition: background-color 0.2s ease;
  }

  .nav-toggle .hamburger::before,
  .nav-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background-color: #1e293b;
    border-radius: 2px;
    transition: transform 0.25s ease-in-out, top 0.25s ease-in-out;
  }

  .nav-toggle .hamburger::before {
    top: -6px;
    transform: none;
  }

  .nav-toggle .hamburger::after {
    top: 6px;
    transform: none;
  }

  /* Идеальный симметричный крестик при открытии меню */
  .nav-open .nav-toggle .hamburger {
    background-color: transparent !important;
  }

  .nav-open .nav-toggle .hamburger::before {
    top: 0 !important;
    transform: rotate(45deg) !important;
    background-color: #0f172a !important;
  }

  .nav-open .nav-toggle .hamburger::after {
    top: 0 !important;
    transform: rotate(-45deg) !important;
    background-color: #0f172a !important;
  }

  /* Навигационная полоса */
  .header-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }

  .header-nav-wrap .header-container {
    padding: 0;
  }

  /* Выпадающее мобильное меню */
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    max-height: calc(85vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }

  .main-nav.active-mobile {
    display: flex;
  }

  .main-nav .menu-item {
    display: block;
    height: auto;
    border-bottom: 1px solid #f1f5f9;
  }

  .main-nav .menu-item > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    height: auto;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    border-radius: 0;
  }

  .main-nav .menu-item > a.active {
    background: #eff6ff;
    color: var(--primary-color);
  }

  /* Вложенные списки меню на мобильных */
  .main-nav .submenu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    border-left: 3px solid #3b82f6;
    background: #f8fafc;
    padding: 0.3rem 0.5rem 0.3rem 1rem;
    margin: 0;
    max-height: none;
    overflow: visible !important;
  }

  .main-nav .menu-item.submenu-open > .submenu {
    display: block;
  }

  .main-nav .submenu .menu-item {
    border-bottom: 1px solid #edf2f7;
  }

  .main-nav .submenu .menu-item:last-child {
    border-bottom: none;
  }

  .main-nav .submenu .menu-item a {
    padding: 0.6rem 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    border-radius: 6px;
  }

  .main-nav .submenu .menu-item a:hover,
  .main-nav .submenu .menu-item a.active {
    color: var(--primary-color);
    background: #e0f2fe;
  }
}

/* --- Современные результаты поиска --- */
.search-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-list li {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.search-list li:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.08);
  transform: translateY(-2px);
}

.search-list a {
  color: #1e293b;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
}

.search-list a:hover, .search-list a:focus {
  color: var(--primary-color);
  text-decoration: none;
}

.search-snippet {
  color: #64748b;
  font-size: 0.94rem;
  margin-top: 0.5rem;
  line-height: 1.55;
  word-break: break-word;
}

.search-list mark {
  background: #fef08a;
  color: #854d0e;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 600;
}

.search-file-post {
  color: #64748b;
  font-size: 0.88rem;
  margin-left: 0.4rem;
  background: #f1f5f9;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Современные хлебные крошки */
.breadcrumbs {
    margin-bottom: 1.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.breadcrumbs a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 0.2rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

.breadcrumbs span:last-child {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
        padding: 0.5rem 0.8rem;
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================
   Компактный и эстетичный дизайн новостной ленты (/news)
   ========================================================== */
.news-list-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.news-item-compact {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.15rem 1.4rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.news-item-compact:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 18px rgba(21, 101, 192, 0.08);
    transform: translateY(-2px);
    background-color: #fafcff;
}

.news-header-compact {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.news-date-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.01em;
}

.news-date-pill i {
    color: #1565c0;
    font-size: 0.78rem;
}

.vk-post-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0077ff;
    background: #eaf3ff;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
}

.news-title-compact {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.4;
}

.news-title-compact a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.news-title-compact a:hover {
    color: var(--primary-color);
}

.news-text-compact {
    margin: 0;
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.55;
}

.news-action-compact {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.2rem;
}

.news-link-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: #f0f7ff;
    transition: all 0.2s ease;
}

.news-link-compact:hover {
    background: var(--primary-color);
    color: #ffffff;
    gap: 0.6rem;
}

@media (max-width: 640px) {
    .news-item-compact {
        padding: 1rem 1.1rem;
    }
    .news-title-compact {
        font-size: 1.05rem;
    }
}

/* ==========================================================
   Минималистичные стили страницы поиска (/search)
   ========================================================== */
.search-container {
    width: 100%;
    box-sizing: border-box;
}

.search-header-box {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.search-query-highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.search-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem 1.6rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.search-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.07);
    background: #fbfdff;
}

.search-card-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.search-card-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.15s;
    display: inline-block;
}

.search-card-title a:hover {
    color: var(--primary-color);
}

.search-snippet-box {
    background: #f8fafc;
    border-left: 3px solid #93c5fd;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.6;
    margin-top: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.search-files-section {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #e2e8f0;
}

.search-files-title {
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.search-files-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.search-file-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    box-sizing: border-box;
    width: 100%;
}

.search-file-pill:hover {
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-file-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1 1 auto;
}

.search-file-main a {
    color: #1e293b;
    text-decoration: none;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all; /* Гарантирует перенос сверхдлинных имен файлов без пробелов */
    font-weight: 500;
    line-height: 1.4;
}

.search-file-main a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.search-file-main i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.search-file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.search-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.search-btn-download:hover {
    background: #166534;
    color: #ffffff;
    border-color: #166534;
}

@media (max-width: 640px) {
    .search-card {
        padding: 1.1rem 1rem;
    }
    .search-file-pill {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        padding: 0.65rem 0.75rem;
    }
    .search-file-actions {
        width: 100%;
        justify-content: flex-end;
    }
}


/* ==========================================================
   Минималистичная страница обратной связи (/feedback)
   ========================================================== */
.feedback-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
    align-items: start;
}

.feedback-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.feedback-form-card .form-group {
    margin-bottom: 1.15rem;
}

.feedback-form-card .form-group:last-child {
    margin-bottom: 0;
}

.feedback-form-card label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.feedback-form-card input[type="text"],
.feedback-form-card input[type="email"],
.feedback-form-card input[type="tel"],
.feedback-form-card select,
.feedback-form-card textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    background-color: #ffffff;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.feedback-form-card input:focus,
.feedback-form-card select:focus,
.feedback-form-card textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.feedback-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.6rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.2);
    width: 100%;
}

.feedback-btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(21, 101, 192, 0.3);
}

.feedback-contacts-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feedback-contacts-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e2e8f0;
}

.contact-row {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.contact-row-icon {
    width: 36px;
    height: 36px;
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.contact-row-content {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.contact-row-content strong {
    display: block;
    color: #1e293b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.2rem;
}

.contact-row-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-row-content a:hover {
    text-decoration: underline;
}

.phones-table {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.phone-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    padding: 0.25rem 0;
    border-bottom: 1px dashed #e2e8f0;
}

.phone-entry:last-child {
    border-bottom: none;
}

.phone-role {
    color: #64748b;
}

.schedule-mini-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-top: 0.35rem;
}

.schedule-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.3rem 0;
}

.schedule-mini-row:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

.badge-weekday {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #1e293b;
}

.badge-weekend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #e11d48;
}

.schedule-time-blue {
    font-weight: 600;
    color: #1565c0;
}

.schedule-time-red {
    font-weight: 600;
    color: #e11d48;
}

@media (max-width: 860px) {
    .feedback-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}


/* Стильная постраничная навигация (Pagination) */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #edf2f7;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination-link,
.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.pagination-link {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.pagination-link:hover {
    background: #ffffff;
    border-color: #93c5fd;
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.pagination-current {
    background: var(--primary-color);
    color: #ffffff;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.25);
}

.pagination-ellipsis {
    color: #94a3b8;
    padding: 0 0.35rem;
    font-weight: 700;
}
