/* Переменные с цветами */
:root {
  --primary-blue: #1e4f9e;
  --secondary-blue: #2261c7;
  --light-blue: #f5f6fa;
  --dark-blue: #163a75;
  --text-dark: #2c3e50;
  --text-light: #ffffff;
}

/* Основные стили */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
  animation: fadeInBody 0.8s ease-out;
}

@keyframes fadeInBody {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  flex: 1;
  background: linear-gradient(135deg, #f5f6fa 0%, #e8eaf6 100%);
  position: relative;
  overflow: hidden;
}

main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.3" fill="rgba(30,79,158,0.02)"/><circle cx="25" cy="25" r="0.2" fill="rgba(30,79,158,0.015)"/><circle cx="75" cy="75" r="0.25" fill="rgba(30,79,158,0.018)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

/* Стили навигации */
.navbar {
  padding: 0;
  background-color: transparent !important;
  position: relative;
  z-index: 10;
  overflow: visible !important;
}

.navbar .container-fluid,
.navbar .collapse,
.navbar-collapse {
  overflow: visible !important;
}

.nav-item.dropdown {
  position: relative;
  overflow: visible !important;
}

/* Обеспечиваем видимость dropdown */
.site-header .container {
  overflow: visible !important;
}

/* Fallback стили для dropdown если Bootstrap не загружается */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  background: linear-gradient(145deg, #1a3d6c 0%, #2261c7 100%);
  border: 2px solid #c4a962;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  z-index: 9999 !important;
  min-width: 250px;
  max-width: 400px;
  width: max-content;
  list-style: none;
  /* По умолчанию скрыто */
  display: none;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: visible !important;
}

.dropdown-menu.show {
  display: block !important;
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  visibility: visible !important;
}

/* Тестовый стиль для отладки */
.dropdown-menu.show {
  background: linear-gradient(145deg, #1a3d6c 0%, #2261c7 100%) !important;
}

/* Удаляем старую анимацию */
@keyframes dropdownSlide {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-toggle {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.dropdown-toggle:hover {
  border-color: #c4a962 !important;
  color: #c4a962 !important;
  background: rgba(196, 169, 98, 0.1) !important;
  transform: translateY(-1px);
}

.dropdown-toggle:focus {
  border-color: #c4a962 !important;
  color: #c4a962 !important;
  box-shadow: 0 0 0 0.25rem rgba(196, 169, 98, 0.25) !important;
}

.dropdown-toggle[aria-expanded="true"] {
  border-color: #c4a962 !important;
  color: #c4a962 !important;
  background: rgba(196, 169, 98, 0.15) !important;
}

/* Обеспечиваем корректное позиционирование */
.dropdown-menu {
  margin-top: 0.125rem;
}

.navbar .nav-link {
  color: #ffffff !important;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-radius: 8px;
  margin: 0 0.25rem;
  position: relative;
  overflow: hidden;
}

.navbar .nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(196, 169, 98, 0.2), transparent);
  transition: left 0.5s ease;
}

.navbar .nav-link:hover::before {
  left: 100%;
}

.navbar .nav-link i {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.navbar .nav-link:hover i {
  transform: scale(1.1) rotate(5deg);
}

.dropdown-menu {
  background: linear-gradient(145deg, #1a3d6c 0%, #2261c7 100%);
  border: 2px solid #c4a962;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  animation: dropdownSlide 0.3s ease-out;
}

@keyframes dropdownSlide {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-item {
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-radius: 8px;
  margin: 0 0.5rem;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(196, 169, 98, 0.2), transparent);
  transition: left 0.5s ease;
}

.dropdown-item:hover::before {
  left: 100%;
}

.dropdown-item i {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
}

.dropdown-item:hover i {
  transform: scale(1.1) rotate(10deg);
  color: #c4a962;
}

.dropdown-item:hover {
  background-color: rgba(196, 169, 98, 0.15);
  color: #c4a962;
  transform: translateX(5px);
}

.navbar .nav-link:hover {
  color: #c4a962 !important;
  background-color: rgba(196, 169, 98, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(196, 169, 98, 0.3);
}

.navbar-brand,
.nav-link {
  color: var(--text-light) !important;
}

.nav-link.active {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(30, 79, 158, 0.4);
}

/* Стили для иконок в навигации */
.navbar .nav-link i,
.dropdown-item i {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Стили для уведомлений */
.nav-link.position-relative .badge {
  font-size: 0.6rem;
  padding: 0.25rem 0.4rem;
}

/* Стили карточек */
.card {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: none;
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  border-radius: 12px 12px 0 0;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(30, 79, 158, 0.15);
}

.card-body {
  padding: 2rem;
  position: relative;
  z-index: 2;
}

.card-title {
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-text {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(30, 79, 158, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 79, 158, 0.4);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(30, 79, 158, 0.3);
}

/* Стили для jumbotron */
.jumbotron {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  padding: 3rem;
  border-radius: 16px;
  margin-bottom: 3rem;
  border-left: 6px solid var(--primary-blue);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.jumbotron::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(30, 79, 158, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.jumbotron .display-4 {
  position: relative;
  z-index: 2;
}

.jumbotron .lead {
  position: relative;
  z-index: 2;
  color: #6c757d;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Стили для footer */
.footer {
  background: linear-gradient(135deg, #1a3d6c 0%, #163a75 50%, #1e4f9e 100%) !important;
  color: white !important;
  padding: 3rem 0 2rem !important;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2) !important;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="25" cy="25" r="0.3" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="0.4" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
}

.footer .container {
  position: relative;
  z-index: 2;
}

.footer a {
  color: #c4a962;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #c4a962;
  transition: width 0.3s ease;
}

.footer a:hover {
  color: #ffffff;
  transform: translateX(5px);
}

.footer a:hover::after {
  width: 100%;
}

.footer h5 {
  color: white;
  border-bottom: 3px solid rgba(196, 169, 98, 0.6);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  position: relative;
}

.footer h5::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 40px;
  height: 3px;
  background: #c4a962;
  border-radius: 2px;
}

.footer p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.footer .text-center p:last-child {
  background: rgba(196, 169, 98, 0.15);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #c4a962;
  margin-top: 1rem;
}

/* Стили для списков */
.list-group-item {
  border: none;
  margin-bottom: 1rem;
  border-radius: 12px !important;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.list-group-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  transition: width 0.3s ease;
}

.list-group-item:hover::before {
  width: 8px;
}

.list-group-item img {
  max-width: 120px;
  margin-right: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.list-group-item:hover img {
  transform: scale(1.05);
}

.list-group-item:hover {
  background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
  color: var(--primary-blue);
  transform: translateY(-4px) translateX(5px);
  box-shadow: 0 12px 25px rgba(30, 79, 158, 0.15);
}

.list-group-item h5 {
  transition: color 0.3s ease;
  font-weight: 600;
}

.list-group-item:hover h5 {
  color: var(--secondary-blue);
}

.list-group-item .mb-1 {
  color: #6c757d;
  line-height: 1.6;
  transition: color 0.3s ease;
}

.list-group-item:hover .mb-1 {
  color: #495057;
}

/* Стили для заголовков */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary-blue);
}

.display-4 {
  color: var(--primary-blue);
  font-weight: 600;
}

/* Стили для документов */
.document-thumbnail {
  height: 200px;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.document-link:hover .document-thumbnail {
  opacity: 0.8;
}

/* Стили для lightbox */
.lb-data .lb-caption {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-light);
}

.lb-data .lb-details {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.8);
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
  opacity: 0.8;
}

.lb-nav a.lb-prev:hover,
.lb-nav a.lb-next:hover {
  opacity: 1;
}

/* Стили для бейджей */
.status-clarification {
  background-color: #e6ccff !important;
  color: #6600cc !important;
}

/* Дисклеймер */
.disclaimer {
  font-size: 0.9rem;
  /* Средний размер текста */
  color: #999999;
  /* Приглушённый цвет */
  margin-top: 10px;
  /* Отступ сверху */
  text-align: left;
  /* Выравнивание по левому краю */
}

/* Дополнительные стили для header с высокой специфичностью */
body .site-header,
header.site-header {
  background: linear-gradient(135deg, #1a3d6c 0%, #2261c7 50%, #1e4f9e 100%) !important;
  border-bottom: 4px solid #c4a962 !important;
  padding: 2rem 0 !important;
  color: white !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Дополнительные стили для footer с высокой специфичностью */
body .footer,
footer.footer {
  background: linear-gradient(135deg, #1a3d6c 0%, #163a75 50%, #1e4f9e 100%) !important;
  color: white !important;
  padding: 3rem 0 2rem !important;
  margin-top: 4rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2) !important;
}

.site-header {
  background: linear-gradient(135deg, #1a3d6c 0%, #2261c7 50%, #1e4f9e 100%) !important;
  border-bottom: 4px solid #c4a962 !important;
  padding: 2rem 0 !important;
  color: white !important;
  position: relative;
  overflow: visible !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="25" cy="25" r="0.3" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="0.4" fill="rgba(255,255,255,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  pointer-events: none;
}

.emblem-container {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.emblem-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 140px;
}

.emblem-fallback {
  display: none !important;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #c4a962;
  border: 2px solid rgba(196, 169, 98, 0.5);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.emblem-fallback.show {
  display: flex !important;
}

.emblem-container img {
  height: 120px !important;
  width: auto !important;
  max-width: 120px !important;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) brightness(1.1) contrast(1.2);
  transition: transform 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  display: block !important;
  visibility: visible !important;
  object-fit: contain;
  position: relative;
  z-index: 10;
}

.emblem-container img:hover {
  transform: scale(1.05);
}

.emblem-title {
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 700;
  text-align: left;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
  position: relative;
}

.emblem-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #c4a962 0%, transparent 100%);
  border-radius: 2px;
}

.badge.bg-danger-light {
  background-color: #f3e5f5 !important;
  color: #9c27b0 !important;
  border: 1px solid #e1bee7 !important;
}

#file-list {
  margin-top: 20px;
}

.file-item {
  margin-bottom: 10px;
}

input[type="hidden"] {
  display: none;
}

.nav-tabs .nav-link {
  color: #212529 !important; /* Чёрный текст по умолчанию */
}

.nav-tabs .nav-link.active {
  color: #0d6efd !important; /* Активная вкладка — синий */
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
  font-weight: 500;
}

body.dark-mode .nav-tabs .nav-link {
  color: #f8f9fa !important; /* Светлый текст для тёмной темы */
}

body.dark-mode .nav-tabs .nav-link.active {
  color: #0d6efd !important;
  background-color: #1f1f1f;
  border-color: #343a40 #343a40 #1f1f1f;
}

/* Дополнительные стили для responsive навигации */
@media (max-width: 991.98px) {
  .navbar-nav {
    padding-top: 1rem;
  }

  .navbar .nav-link {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar .nav-link:last-child {
    border-bottom: none;
  }

  .dropdown-menu {
    background-color: rgba(26, 61, 108, 0.95);
    margin-left: 1rem;
    border-radius: 0.375rem;
  }
}

/* Улучшенные стили для dropdown toggle */
.dropdown-toggle::after {
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Стили для активных элементов навигации */
.navbar-nav .nav-item.active .nav-link,
.navbar-nav .nav-link.active {
  background-color: rgba(196, 169, 98, 0.2);
  border-radius: 0.375rem;
  color: #c4a962 !important;
}

/* Стили для hover эффектов */
.navbar-nav .nav-item:hover .nav-link {
  transform: translateY(-1px);
  transition: all 0.3s ease;
}

/* Улучшенные стили для badge в уведомлениях */
.navbar .badge {
  animation: pulseGlow 2s infinite;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
  }
}

/* Анимация появления контента */
.container > .row {
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.container > .row:nth-child(2) {
  animation-delay: 0.1s;
}

.container > .row:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes slideInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Анимация для карточек */
.card {
  animation: fadeInScale 0.6s ease-out;
  animation-fill-mode: both;
}

.col-md-4:nth-child(1) .card {
  animation-delay: 0.1s;
}

.col-md-4:nth-child(2) .card {
  animation-delay: 0.2s;
}

.col-md-4:nth-child(3) .card {
  animation-delay: 0.3s;
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===================================
   АДАПТИВНЫЙ ДИЗАЙН ДЛЯ ШИРОКИХ ЭКРАНОВ
   =================================== */

/* Для экранов шире 1920px (2K, 4K мониторы) */
@media (min-width: 1920px) {
  /* Ограничиваем максимальную ширину контейнера */
  .container,
  .container-fluid {
    max-width: 1800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Исключение для header - растягиваем на всю ширину */
  .site-header .container,
  header.site-header .container {
    max-width: 100% !important;
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }

  /* Navbar внутри header также на всю ширину */
  .site-header .navbar .container-fluid {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Растягиваем navbar на всю ширину экрана с negative margins */
  .site-header .navbar {
    margin-left: -3rem;
    margin-right: -3rem;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  /* Увеличиваем размер текста для читаемости */
  body {
    font-size: 1.1rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 2rem;
  }

  h4 {
    font-size: 1.75rem;
  }

  /* Улучшаем карточки */
  .card {
    transition: all 0.4s ease;
  }

  .card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  }

  /* Увеличиваем кнопки для лучшей кликабельности */
  .btn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
  }

  .btn-sm {
    font-size: 0.95rem;
    padding: 0.5rem 1.5rem;
  }

  /* Улучшаем навигацию */
  .navbar .nav-link {
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem !important;
  }

  /* Dropdown меню */
  .dropdown-menu {
    min-width: 300px;
    font-size: 1.05rem;
  }

  .dropdown-item {
    padding: 0.75rem 1.5rem;
  }

  /* Увеличиваем отступы */
  .py-4 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .py-5 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  /* Хлебные крошки */
  .breadcrumb {
    font-size: 1.05rem;
  }

  /* Формы */
  .form-control,
  .form-select {
    font-size: 1.05rem;
    padding: 0.75rem 1rem;
  }

  /* Таблицы */
  .table {
    font-size: 1.05rem;
  }

  .table td,
  .table th {
    padding: 1rem;
  }
}

/* Для экранов шире 2560px (4K и ultra-wide) */
@media (min-width: 2560px) {
  /* Еще больше ограничиваем ширину для комфортного чтения */
  .container,
  .container-fluid {
    max-width: 2200px !important;
  }

  /* Header на всю ширину с увеличенными отступами */
  .site-header .container,
  header.site-header .container {
    max-width: 100% !important;
    padding-left: 5rem !important;
    padding-right: 5rem !important;
  }

  /* Navbar с соответствующими negative margins */
  .site-header .navbar {
    margin-left: -5rem;
    margin-right: -5rem;
    padding-left: 5rem;
    padding-right: 5rem;
  }

  /* Дополнительно увеличиваем размер текста */
  body {
    font-size: 1.2rem;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 3rem;
  }

  h3 {
    font-size: 2.25rem;
  }

  h4 {
    font-size: 2rem;
  }

  /* Увеличиваем отступы между колонками */
  .row {
    margin-left: -20px;
    margin-right: -20px;
  }

  .row > * {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Карточки */
  .card {
    margin-bottom: 2rem;
  }

  .card-body {
    padding: 2rem;
  }

  /* Навигация */
  .navbar .nav-link {
    font-size: 1.2rem;
    padding: 1rem 1.5rem !important;
  }

  /* Dropdown */
  .dropdown-menu {
    min-width: 350px;
    font-size: 1.1rem;
  }

  .dropdown-item {
    padding: 1rem 2rem;
  }

  /* Кнопки */
  .btn {
    font-size: 1.2rem;
    padding: 1rem 2.5rem;
  }

  .btn-sm {
    font-size: 1rem;
    padding: 0.65rem 1.75rem;
  }

  /* Формы */
  .form-control,
  .form-select {
    font-size: 1.1rem;
    padding: 0.875rem 1.25rem;
  }

  /* Таблицы */
  .table {
    font-size: 1.1rem;
  }

  .table td,
  .table th {
    padding: 1.25rem;
  }

  /* Увеличиваем максимальную ширину модальных окон */
  .modal-lg {
    max-width: 1200px;
  }

  .modal-xl {
    max-width: 1600px;
  }
}

/* Оптимизация для ультра-широких мониторов (21:9, 32:9) */
@media (min-width: 3440px) {
  .container,
  .container-fluid {
    max-width: 2800px !important;
  }

  /* Header с большими отступами для ультра-широких экранов */
  .site-header .container,
  header.site-header .container {
    max-width: 100% !important;
    padding-left: 8rem !important;
    padding-right: 8rem !important;
  }

  /* Navbar с большими negative margins */
  .site-header .navbar {
    margin-left: -8rem;
    margin-right: -8rem;
    padding-left: 8rem;
    padding-right: 8rem;
  }

  /* Используем CSS Grid для лучшего распределения контента */
  .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
  }

  .row > * {
    width: 100%;
    max-width: none;
  }
}

/* ===================================
   АДАПТИВНЫЕ СТИЛИ ДЛЯ HEADER И FOOTER
   =================================== */

/* Для больших экранов - центрируем эмблему и текст */
@media (min-width: 1920px) {
  .emblem-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
  }

  .emblem-container img {
    max-width: 120px;
    height: auto;
  }

  .site-header h1 {
    font-size: 2.5rem;
    margin: 0;
  }

  .site-header .lead {
    font-size: 1.3rem;
  }

  /* Footer на широких экранах */
  .footer .container {
    max-width: 1800px;
  }

  /* Footer на всю ширину как header */
  .footer .container,
  footer.footer .container {
    max-width: 100% !important;
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }

  .footer h5 {
    font-size: 1.4rem;
  }

  .footer p,
  .footer a,
  .footer li {
    font-size: 1.1rem;
  }
}

@media (min-width: 2560px) {
  .emblem-container {
    gap: 3rem;
  }

  .emblem-container img {
    max-width: 150px;
  }

  .site-header h1 {
    font-size: 3rem;
  }

  .site-header .lead {
    font-size: 1.5rem;
  }

  /* Footer на всю ширину с увеличенными отступами */
  .footer .container,
  footer.footer .container {
    max-width: 100% !important;
    padding-left: 5rem !important;
    padding-right: 5rem !important;
  }

  .footer h5 {
    font-size: 1.6rem;
  }

  .footer p,
  .footer a,
  .footer li {
    font-size: 1.2rem;
  }
}

/* Оптимизация сетки для широких экранов */
@media (min-width: 1920px) {
  /* Для страниц с карточками - делаем 4 колонки вместо 3 */
  .row-cols-md-3 {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* Для таблиц - увеличиваем ширину */
  .table-responsive {
    overflow-x: visible;
  }

  /* Модальные окна */
  .modal-dialog {
    max-width: 1000px;
  }
}

@media (min-width: 2560px) {
  /* На 4K можно показать еще больше контента */
  .row-cols-md-3 {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  .modal-dialog {
    max-width: 1200px;
  }
}

/* ===================================
   УЛУЧШЕНИЯ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ
   =================================== */

@media (min-width: 1920px) {
  /* Jumbotron на больших экранах */
  .jumbotron {
    padding: 4rem 5rem;
    margin-bottom: 4rem;
  }

  .jumbotron .display-4 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
  }

  .jumbotron .lead {
    font-size: 1.4rem;
    max-width: 90%;
    margin: 0 auto;
  }

  /* Карточки на главной */
  .card {
    height: 100%;
    min-height: 280px;
  }

  .card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
  }

  .card-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  .card-text {
    font-size: 1.1rem;
    flex-grow: 1;
    margin-bottom: 1.5rem;
  }

  /* List group для новостей */
  .list-group-item {
    padding: 1.5rem;
    font-size: 1.05rem;
  }

  .list-group-item h5 {
    font-size: 1.4rem;
  }

  /* Отступы между рядами */
  .row.mt-4 {
    margin-top: 3rem !important;
  }

  .col-md-4.mb-4 {
    margin-bottom: 2rem !important;
  }
}

@media (min-width: 2560px) {
  .jumbotron {
    padding: 5rem 6rem;
    margin-bottom: 5rem;
  }

  .jumbotron .display-4 {
    font-size: 4rem;
    margin-bottom: 2rem;
  }

  .jumbotron .lead {
    font-size: 1.6rem;
    max-width: 85%;
  }

  .card {
    min-height: 320px;
  }

  .card-body {
    padding: 2.5rem;
  }

  .card-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .card-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }

  .list-group-item {
    padding: 2rem;
    font-size: 1.15rem;
  }

  .list-group-item h5 {
    font-size: 1.6rem;
  }

  .row.mt-4 {
    margin-top: 4rem !important;
  }

  .col-md-4.mb-4 {
    margin-bottom: 3rem !important;
  }
}

/* Улучшение читаемости текста на больших экранах */
@media (min-width: 1920px) {
  p, li, .text-muted, .small {
    line-height: 1.8;
  }

  /* Ограничиваем ширину текстовых блоков для комфортного чтения */
  .card-text,
  .lead,
  .jumbotron p {
    max-width: 100%;
  }

  /* Отступы для секций */
  section {
    padding: 3rem 0;
  }

  /* Breadcrumbs */
  .breadcrumb {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }

  .breadcrumb-item + .breadcrumb-item::before {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

/* ===================================
   СТИЛИ ДЛЯ СТРАНИЦЫ PROCEDURE
   =================================== */

/* Карточки процедур */
.procedure-card {
  background: white;
  border: 2px solid #1e4f9e;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(30, 79, 158, 0.1);
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.procedure-card:hover {
  box-shadow: 0 8px 25px rgba(30, 79, 158, 0.2);
  transform: translateY(-2px);
}

.procedure-card-header {
  background: linear-gradient(135deg, #1e4f9e 0%, #2261c7 100%);
  color: white;
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 1.25rem 1.5rem;
}

.procedure-card-header h2,
.procedure-card-header h3,
.procedure-card-header h4,
.procedure-card-header h5 {
  color: white !important;
  margin: 0;
}

.procedure-card-body {
  padding: 2rem;
}

/* Нумерованные пункты */
.procedure-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #1e4f9e 0%, #2261c7 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Информационные блоки */
.procedure-info-box {
  background: linear-gradient(145deg, #f5f6fa 0%, #e8eaf6 100%);
  border-left: 4px solid #1e4f9e;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

/* Список требований */
.procedure-list {
  list-style: none;
  padding: 0;
}

.procedure-list li {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: #f8f9fa;
  border-left: 3px solid #2261c7;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.procedure-list li:hover {
  background: #e8eaf6;
  transform: translateX(5px);
}

/* Кнопка подачи обращения */
.procedure-submit-card {
  background: linear-gradient(135deg, #1e4f9e 0%, #2261c7 100%);
  border: none;
  border-radius: 12px;
  color: white;
}

.procedure-submit-card .card-body {
  padding: 2.5rem;
}

/* Сайдбар */
.procedure-sidebar .card {
  border: 2px solid #1e4f9e;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.procedure-sidebar .card-header {
  background: linear-gradient(135deg, #1e4f9e 0%, #2261c7 100%);
  color: white;
  border: none;
}

/* Sticky sidebar на больших экранах */
@media (min-width: 768px) {
  .procedure-sidebar {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
  
  .procedure-sidebar::-webkit-scrollbar {
    width: 6px;
  }
  
  .procedure-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
  }
  
  .procedure-sidebar::-webkit-scrollbar-thumb {
    background: #1e4f9e;
    border-radius: 10px;
  }
  
  .procedure-sidebar::-webkit-scrollbar-thumb:hover {
    background: #2261c7;
  }
}

/* Временная шкала */
.procedure-timeline-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.procedure-timeline-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.procedure-timeline-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #1e4f9e 0%, #2261c7 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-right: 1rem;
}

/* Основания для отказа */
.procedure-refusal-box {
  background: linear-gradient(145deg, #fff5f5 0%, #ffe5e5 100%);
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.procedure-refusal-box:hover {
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
  transform: translateY(-2px);
}

.procedure-refusal-box h6 {
  color: #dc3545;
  font-weight: 600;
}

/* Шаблон жалобы */
.procedure-template {
  background: #2d3748;
  color: #e2e8f0;
  border: 2px solid #1e4f9e;
  border-radius: 8px;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.8;
}

.procedure-template strong {
  color: #63b3ed;
}

/* Адаптивные стили */
@media (max-width: 991.98px) {
  .procedure-card-body {
    padding: 1.5rem;
  }

  .procedure-number {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
  }

  .procedure-timeline-icon {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}

/* ===================================
   ФИКСЫ ДЛЯ СТРАНИЦЫ ДОКУМЕНТОВ
   =================================== */

/* Исправление z-index для dropdown загрузки документов */
.dropdown {
  position: relative !important;
}

.dropdown-menu {
  z-index: 10000 !important;
  position: absolute !important;
}

/* Убедимся что статистика не перекрывает dropdown */
.stats-card {
  position: relative;
  z-index: 1 !important;
}

.stats-table {
  position: relative;
  z-index: 1 !important;
}

/* ===================================
   Кастомное модальное окно удаления пользователя
   =================================== */

/* Основные стили кастомного модального окна */
.custom-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 99999 !important;
  display: none !important; /* Изначально скрыто */
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

.custom-modal.show {
  display: flex !important; /* Показываем только когда есть класс show */
}

.custom-modal-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.6) !important;
  z-index: 99990 !important;
}

.custom-modal-content {
  position: relative !important;
  background: white !important;
  border-radius: 15px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
  max-width: 500px !important;
  width: 90% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  z-index: 99995 !important;
  pointer-events: auto !important;
  animation: modalSlideIn 0.3s ease-out !important;
}

@keyframes modalSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.custom-modal-header {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  color: white !important;
  padding: 1.5rem 2rem !important;
  border-radius: 15px 15px 0 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  position: relative !important;
  z-index: 99996 !important;
}

.custom-modal-title {
  margin: 0 !important;
  font-size: 1.25rem !important;
  font-weight: bold !important;
  flex: 1 !important;
}

.custom-modal-close {
  background: none !important;
  border: none !important;
  color: white !important;
  font-size: 1.2rem !important;
  cursor: pointer !important;
  padding: 0.5rem !important;
  border-radius: 50% !important;
  width: 2.5rem !important;
  height: 2.5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease !important;
  pointer-events: auto !important;
  z-index: 99997 !important;
  position: relative !important;
}

.custom-modal-close:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

.custom-modal-body {
  padding: 2rem !important;
  position: relative !important;
  z-index: 99996 !important;
}

.custom-modal-footer {
  padding: 1.5rem 2rem !important;
  border-top: 1px solid #dee2e6 !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 1rem !important;
  position: relative !important;
  z-index: 99996 !important;
}

.custom-modal-footer button {
  min-width: 120px !important;
  pointer-events: auto !important;
  z-index: 99997 !important;
  position: relative !important;
  cursor: pointer !important;
}

.custom-modal-footer form {
  display: inline !important;
  pointer-events: auto !important;
  z-index: 99997 !important;
  position: relative !important;
}

.custom-modal-footer .btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.custom-modal-footer .btn-danger:hover {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4) !important;
}

/* Убираем любые конфликтующие стили Bootstrap */
#deleteUserModal.custom-modal * {
  pointer-events: auto !important;
}

#deleteUserModal.custom-modal button {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#deleteUserModal.custom-modal form {
  pointer-events: auto !important;
}

/* ===================================
   Стили для модального окна создания пользователя
   =================================== */

/* Особые стили для модального окна создания пользователя */
.custom-modal-content.create-user-modal {
  max-width: 700px !important;
  width: 95% !important;
}

.create-user-modal .custom-modal-header {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.create-user-modal .custom-modal-body {
  padding: 2.5rem !important;
}

.create-user-modal .form-label {
  font-weight: 600 !important;
  color: #2c3e50 !important;
  margin-bottom: 0.5rem !important;
}

.create-user-modal .form-control,
.create-user-modal .form-select {
  border: 2px solid #e9ecef !important;
  border-radius: 8px !important;
  padding: 0.75rem 1rem !important;
  transition: all 0.3s ease !important;
}

.create-user-modal .form-control:focus,
.create-user-modal .form-select:focus {
  border-color: #28a745 !important;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.create-user-modal .btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  border: none !important;
  min-width: 180px !important;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3) !important;
  transition: all 0.3s ease !important;
}

.create-user-modal .btn-success:hover {
  background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
}

/* Стили для чекбокса */
.create-user-modal .form-check-input {
  width: 1.2rem !important;
  height: 1.2rem !important;
  border-radius: 4px !important;
  border: 2px solid #e9ecef !important;
}

.create-user-modal .form-check-input:checked {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
}

.create-user-modal .form-check-label {
  font-weight: 500 !important;
  color: #495057 !important;
  margin-left: 0.5rem !important;
}

/* Анимация появления для создания пользователя */
#createUserModal.show .custom-modal-content {
  animation: createModalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes createModalSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-100px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===================================
   Дополнительные стили для формы создания пользователя  
   =================================== */

/* Стили для input-group с кнопками пароля */
.create-user-modal .input-group {
  position: relative;
}

.create-user-modal .input-group .btn {
  border-left: none;
  z-index: 10;
}

.create-user-modal .input-group .btn-outline-secondary {
  background: #f8f9fa;
  border-color: #ced4da;
  color: #6c757d;
}

.create-user-modal .input-group .btn-outline-secondary:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #495057;
}

.create-user-modal .input-group .btn-outline-primary {
  background: linear-gradient(135deg, #1e4f9e 0%, #2261c7 100%);
  border-color: #1e4f9e;
  color: white;
}

.create-user-modal .input-group .btn-outline-primary:hover {
  background: linear-gradient(135deg, #163a75 0%, #1e4f9e 100%);
  border-color: #163a75;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 79, 158, 0.3);
}

/* Анимация уведомлений о генерации пароля */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
