:root {
   --bg-dark: #0f0c29;
   --sidebar-width: 280px;
   --sidebar-bg: rgba(35, 20, 65, 0.98);
   --accent-glow: #5a3b8c;
   --accent-dim: #3a2a5a;
   --admin-gold: #ccaa66;
   --text-main: #e0e0e0;
   --text-bright: #ffffff;
   --border-color: rgba(255, 255, 255, 0.08);
   --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
   box-sizing: border-box;
}

html,
body {
   height: 100%;
   margin: 0;
   padding: 0;
}

body {
   background: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 100%);
   background-attachment: fixed;
   color: var(--text-main);
   font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
   display: flex;
}

/* Сайдбар */
#sidebar-wrapper {
   width: var(--sidebar-width);
   height: 100vh;
   background: var(--sidebar-bg);
   border-right: 1px solid var(--border-color);
   position: fixed;
   left: 0;
   top: 0;
   z-index: 1000;
   display: flex;
   flex-direction: column;
   box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

/* Основной контейнер справа от сайдбара */
.main-layout {
   flex: 1;
   margin-left: var(--sidebar-width);
   min-height: 100vh;
   display: flex;
   flex-direction: column;
}

/* Обёртка для контента и футера (горизонтальные отступы) */
.content-flex {
   flex: 1;
   display: flex;
   flex-direction: column;
   padding: 0 50px 0 50px;
}

/* Основная область страницы (растягивается) */
.main-content {
   flex: 1 0 auto;
   width: 100%;
}

/* Подвал */
.site-footer {
   flex-shrink: 0;
   background: rgba(15, 10, 25, 0.95);
   backdrop-filter: blur(5px);
   border-top: 2px solid #3a2a5a;
   padding: 30px 0 20px;
   margin-top: 40px;
   color: #b0a0c0;
   font-size: 0.9rem;
   width: 100%;
}

.footer-container {
   max-width: 100%;
   padding: 0 50px;
   margin: 0 auto;
}

.footer-title {
   color: #d0c0e0;
   font-size: 1.1rem;
   font-weight: 600;
   margin-bottom: 15px;
   letter-spacing: 1px;
   text-transform: uppercase;
   border-left: 3px solid #6b4f9f;
   padding-left: 10px;
}

.footer-text {
   color: #a090b0;
   line-height: 1.6;
}

.footer-links {
   list-style: none;
   padding: 0;
   margin: 0;
}

.footer-links li {
   margin-bottom: 8px;
}

.footer-links a {
   color: #b0a0c0;
   text-decoration: none;
   transition: color 0.2s;
   display: inline-block;
   padding-left: 5px;
}

.footer-links a:hover {
   color: #d0c0e0;
   border-left: 2px solid #8b6fc7;
   padding-left: 10px;
}

.footer-social {
   display: flex;
   gap: 15px;
   margin-top: 10px;
}

.footer-social a {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 36px;
   height: 36px;
   border-radius: 50%;
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid #5a4b7a;
   color: #b0a0c0;
   font-size: 18px;
   transition: all 0.2s;
}

.footer-social a:hover {
   background: #4a2c7a;
   border-color: #8b6fc7;
   color: #fff;
   transform: translateY(-2px);
}

.footer-copyright {
   color: #7a6a8a;
   font-size: 0.8rem;
   border-top: 1px solid #3a2a5a;
   padding-top: 12px;
   margin-top: 12px;
}

/* Кнопки меню в сайдбаре */
.list-group-item {
   background: transparent !important;
   color: var(--text-main) !important;
   border: none !important;
   margin: 4px 15px;
   padding: 12px 20px;
   border-radius: 12px !important;
   transition: var(--transition);
   text-decoration: none;
   display: block;
}

.list-group-item:hover {
   background: var(--accent-dim) !important;
   color: var(--text-bright) !important;
   padding-left: 30px;
}

.list-group-item i {
   margin-right: 10px;
   width: 22px;
   color: #8b6fc7;
}

.list-group-item:hover i {
   color: #fff;
}

.admin-link {
   color: var(--admin-gold) !important;
   font-weight: 500;
}

.admin-link:hover {
   background: rgba(255, 204, 51, 0.15) !important;
   color: #fff !important;
}

.list-group-item.active {
   background: #3a2a5a !important;
   border-left: 3px solid #8b6fc7 !important;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.admin-status-sidebar {
   margin-top: auto;
   padding: 25px 20px;
   background: rgba(0, 0, 0, 0.4);
   border-top: 1px solid var(--border-color);
}

.admin-status-sidebar .system-label {
   color: var(--admin-gold);
   font-weight: bold;
   letter-spacing: 1px;
   font-size: 0.85rem;
   margin-bottom: 8px;
   display: block;
}

.admin-status-sidebar .system-info {
   color: #ced4da !important;
   font-size: 0.75rem;
   line-height: 1.6;
}

/* Кнопки */
.btn-primary {
   background: #4a2c7a;
   border: 1px solid #6b4f9f;
   border-radius: 25px;
   padding: 10px 30px;
   font-weight: 600;
   color: #fff;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
   transition: var(--transition);
}

.btn-primary:hover {
   background: #5a3b8c;
   border-color: #8b6fc7;
   box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
   transform: translateY(-2px);
}

/* Навигация разделов */
.section-nav {
   display: flex;
   flex-wrap: wrap;
   gap: 12px;
   margin-bottom: 35px;
   position: relative;
   z-index: 1000;
   padding: 5px 0;
}

.section-link {
   background: rgba(20, 15, 40, 0.7);
   color: #fff !important;
   padding: 10px 24px;
   border-radius: 40px;
   text-decoration: none;
   border: 1px solid rgba(110, 69, 226, 0.3);
   backdrop-filter: blur(8px);
   transition: all 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
   white-space: nowrap;
   display: inline-block;
   font-weight: 500;
   letter-spacing: 0.3px;
   box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
   position: relative;
   overflow: hidden;
}

.section-link::before {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(110, 69, 226, 0.3), transparent);
   transition: left 0.5s;
}

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

.section-link:hover,
.section-link.active {
   background: #4a2c7a;
   border-color: #8b6fc7;
   box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
   transform: translateY(-3px);
}

.nav-group {
   position: relative;
   display: inline-block;
}

/* Ромбик только для ссылок с подразделами */
.section-link.has-children::after {
   content: '◆';
   display: inline-block;
   margin-left: 8px;
   font-size: 0.7rem;
   color: #8b6fc7;
   opacity: 0.8;
   transition: transform 0.3s;
}

.nav-group:hover .section-link.has-children::after {
   transform: rotate(180deg);
   color: #fff;
}

.sub-nav-container {
   position: absolute;
   top: calc(100% + 15px);
   left: 50%;
   transform: translateX(-50%) scale(0.95);
   min-width: 220px;
   background: rgba(25, 20, 45, 0.95);
   backdrop-filter: blur(20px);
   border: 1px solid rgba(255, 255, 255, 0.1);
   border-radius: 24px;
   padding: 12px 0;
   box-shadow: 0 25px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(110, 69, 226, 0.2) inset;
   opacity: 0;
   visibility: hidden;
   transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
   z-index: 1300;
   overflow: hidden;
}

.nav-group:hover .sub-nav-container {
   opacity: 1;
   visibility: visible;
   transform: translateX(-50%) scale(1);
}

.sub-nav-container::before {
   content: '';
   position: absolute;
   top: -8px;
   left: 50%;
   transform: translateX(-50%);
   width: 0;
   height: 0;
   border-left: 10px solid transparent;
   border-right: 10px solid transparent;
   border-bottom: 10px solid rgba(25, 20, 45, 0.95);
   filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.2));
}

.sub-nav-content {
   display: flex;
   flex-direction: column;
   gap: 4px;
}

.sub-section-link {
   color: rgba(255, 255, 255, 0.75);
   text-decoration: none;
   padding: 10px 24px;
   font-size: 0.95rem;
   transition: all 0.2s;
   white-space: nowrap;
   display: block;
   background: transparent;
   border-left: 3px solid transparent;
   font-weight: 400;
}

.sub-section-link:hover {
   background: rgba(74, 44, 122, 0.5);
   color: #fff;
   border-left-color: #8b6fc7;
   padding-left: 30px;
}

.sub-section-link.active {
   background: rgba(74, 44, 122, 0.7);
   color: #fff;
   border-left-color: #8b6fc7;
   font-weight: 500;
}

/* Панель поиска */
.search-panel {
   background: rgba(255, 255, 255, 0.03) !important;
   border: 1px solid rgba(255, 255, 255, 0.1) !important;
   backdrop-filter: blur(15px);
   position: relative;
   z-index: 10;
}

.search-input-group {
   position: relative;
   display: flex;
   align-items: center;
}

.glass-icon {
   position: absolute;
   left: 15px;
   color: var(--accent-glow);
   font-size: 1rem;
   z-index: 5;
}

.glass-control {
   width: 100%;
   background: rgba(0, 0, 0, 0.2) !important;
   border: 1px solid rgba(255, 255, 255, 0.1) !important;
   border-radius: 12px !important;
   padding: 10px 15px 10px 45px !important;
   color: white !important;
   transition: var(--transition);
}

.glass-control:focus {
   border-color: var(--accent-glow) !important;
   box-shadow: 0 0 15px rgba(110, 69, 226, 0.2) !important;
}

.search-panel .form-control::placeholder {
   color: rgba(255, 255, 255, 0.4) !important;
}

select.glass-control {
   appearance: none;
   cursor: pointer;
}

/* Кастомный селект */
.custom-select-container {
   position: relative;
   width: 100%;
}

.custom-select {
   position: relative;
   width: 100%;
   cursor: pointer;
}

.custom-select__selected {
   width: 100%;
   background: rgba(0, 0, 0, 0.2) !important;
   border: 1px solid rgba(255, 255, 255, 0.1) !important;
   border-radius: 12px !important;
   padding: 10px 15px 10px 45px !important;
   color: white !important;
   transition: var(--transition);
   line-height: 1.5;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.custom-select__selected:hover {
   border-color: var(--accent-glow) !important;
   box-shadow: 0 0 15px rgba(110, 69, 226, 0.2) !important;
}

.custom-select__options {
   position: absolute;
   top: calc(100% + 5px);
   left: 0;
   width: 100%;
   background: rgba(20, 15, 30, 0.95);
   backdrop-filter: blur(10px);
   border: 1px solid #5a4b7a;
   border-radius: 12px;
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
   z-index: 1200;
   display: none;
   overflow: hidden;
}

.custom-select__options.show {
   display: block;
}

.custom-select__option {
   padding: 10px 15px;
   color: #e0d0e0;
   transition: all 0.2s;
   border-left: 3px solid transparent;
   font-size: 0.95rem;
}

.custom-select__option:hover {
   background: rgba(74, 44, 122, 0.5);
   color: #fff;
   border-left-color: #8b6fc7;
   padding-left: 20px;
}

.custom-select__option.selected {
   background: rgba(74, 44, 122, 0.7);
   color: #fff;
   border-left-color: #8b6fc7;
   font-weight: 500;
}

/* Карточки */
.card {
   background: rgba(20, 15, 30, 0.9);
   backdrop-filter: blur(8px);
   border-radius: 20px;
   border: 1px solid rgba(255, 255, 255, 0.03) !important;
   transition: all 0.3s ease;
   cursor: pointer;
   position: relative;
   overflow: hidden;
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.card:hover {
   transform: translateY(-6px);
   background: rgba(30, 20, 45, 0.95) !important;
   border-color: #5a3b8c !important;
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.card .top-line {
   height: 4px;
   width: 100%;
   background: linear-gradient(90deg, #6e45e2, #8631ff);
   transition: all 0.4s ease;
   opacity: 0.2;
}

.card:hover .top-line {
   opacity: 1;
   filter: brightness(1.3);
}

.card:hover .read-more-link {
   color: #d0c0e0 !important;
   letter-spacing: 2px;
}

.author-highlight {
   color: #b0a0c0 !important;
   font-weight: 600;
   text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.read-more-link {
   color: #b0a0c0 !important;
   font-weight: bold;
   text-transform: uppercase;
   font-size: 0.75rem;
   letter-spacing: 1px;
   text-decoration: none;
   transition: var(--transition);
}

/* Анимированный фон */
body::after {
   content: '';
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   pointer-events: none;
   background-image: url('/assets/images/fon.gif');
   background-size: cover;
   background-position: center;
   background-repeat: no-repeat;
   opacity: 0.25;
   z-index: -1;
   mix-blend-mode: overlay;
}

/* Музыкальный плеер */
.music-player {
   position: fixed;
   bottom: 20px;
   right: 20px;
   z-index: 1001;
}

.music-toggle {
   width: 50px;
   height: 50px;
   border-radius: 50%;
   background: #2a1f3a;
   border: 2px solid #5a4b7a;
   color: #c0b0d0;
   font-size: 22px;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
   transition: all 0.3s;
   outline: none;
}

.music-toggle:hover {
   background: #3a2a5a;
   border-color: #8b6fc7;
   color: #fff;
   transform: scale(1.05);
}

.music-controls {
   position: absolute;
   bottom: 60px;
   right: 0;
   width: 260px;
   max-height: calc(100vh - 120px);
   overflow-y: auto;
   background: rgba(20, 15, 30, 0.95);
   backdrop-filter: blur(10px);
   border: 1px solid #5a4b7a;
   border-radius: 16px;
   padding: 15px;
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
   display: none;
   color: #e0d0e0;
}

.music-controls.show {
   display: block;
}

.music-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 15px;
   border-bottom: 1px solid #5a4b7a;
   padding-bottom: 8px;
}

.music-title {
   font-weight: 600;
   letter-spacing: 1px;
   color: #b0a0c0;
}

.music-close {
   background: none;
   border: none;
   color: #b0a0c0;
   font-size: 20px;
   cursor: pointer;
   padding: 0;
   line-height: 1;
}

.music-close:hover {
   color: #fff;
}

.music-body {
   display: flex;
   flex-direction: column;
   gap: 15px;
}

.music-track {
   font-size: 14px;
   color: #cfc3e0;
   text-align: center;
   padding: 6px 10px;
   background: rgba(90, 75, 122, 0.2);
   border: 1px solid rgba(90, 75, 122, 0.6);
   border-radius: 10px;
}

.music-controls-row {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 10px;
}

.music-skip {
   width: 38px;
   height: 38px;
   border-radius: 50%;
   background: #2a1f3a;
   border: 2px solid #5a4b7a;
   color: #d0c0e0;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   transition: all 0.2s;
}

.music-skip:hover {
   background: #3a2a5a;
   border-color: #8b6fc7;
   color: #fff;
}

.music-skip:active,
.music-skip.is-pressed {
   transform: scale(0.94);
}

.music-skip:disabled {
   opacity: 0.5;
   cursor: not-allowed;
}

.music-play-pause {
   width: 50px;
   height: 50px;
   border-radius: 50%;
   background: #3a2a5a;
   border: 2px solid #6b4f9f;
   color: #fff;
   font-size: 24px;
   display: flex;
   align-items: center;
   justify-content: center;
   margin: 0 auto;
   cursor: pointer;
   transition: all 0.2s;
}

.music-play-pause:hover {
   background: #4a3a6a;
   border-color: #8b6fc7;
   transform: scale(1.05);
}

.music-play-pause.active {
   background: #6b4f9f;
   border-color: #d5b6ff;
   box-shadow: 0 0 0 1px rgba(213, 182, 255, 0.35), 0 0 14px rgba(153, 102, 255, 0.35);
}

.music-play-pause:active,
.music-play-pause.is-pressed {
   transform: scale(0.95);
}

.music-volume {
   display: flex;
   align-items: center;
   gap: 10px;
   color: #b0a0c0;
}

.music-volume i {
   font-size: 20px;
   width: 24px;
}

.music-volume input {
   flex: 1;
   height: 5px;
   -webkit-appearance: none;
   appearance: none;
   background: #3a2a5a;
   border-radius: 5px;
   outline: none;
}

.music-volume input::-webkit-slider-thumb {
   -webkit-appearance: none;
   appearance: none;
   width: 15px;
   height: 15px;
   border-radius: 50%;
   background: #b0a0c0;
   cursor: pointer;
   border: 2px solid #6b4f9f;
}

.music-volume input::-moz-range-thumb {
   width: 15px;
   height: 15px;
   border-radius: 50%;
   background: #b0a0c0;
   cursor: pointer;
   border: 2px solid #6b4f9f;
}

.music-loop {
   background: none;
   border: 2px solid #5a4b7a;
   border-radius: 30px;
   padding: 8px 15px;
   color: #b0a0c0;
   font-size: 14px;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   cursor: pointer;
   transition: all 0.2s;
   width: fit-content;
   margin: 0 auto;
}

.music-loop.active {
   background: #4a2c7a;
   border-color: #8b6fc7;
   color: #fff;
}

.music-loop:disabled {
   opacity: 0.45;
   cursor: not-allowed;
   filter: grayscale(0.2);
}

.music-loop:active,
.music-loop.is-pressed {
   transform: scale(0.97);
}

.music-loop i {
   font-size: 18px;
}

/* ===== НОВЫЙ СТИЛЬ САЙДБАРА С ПРОФИЛЕМ ===== */
.sidebar-header {
   border-bottom: 1px solid #3a2a5a;
   padding: 20px;
}

.site-title {
   font-size: 1.8rem;
   font-weight: 700;
   letter-spacing: 3px;
   text-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
   color: #fff;
   margin: 0;
}

/* Блок пользователя */


.user-avatar {
   width: 48px;
   height: 48px;
   border-radius: 50%;
   object-fit: cover;
   border: 2px solid #6b4f9f;
   background: #2a1f3a;
}

.user-info {
   flex: 1;
}

.user-name {
   font-weight: 600;
   color: #d0c0e0;
   margin-bottom: 2px;
}

.user-role {
   font-size: 0.75rem;
   color: #8b6fc7;
   text-transform: uppercase;
}

/* Выпадающее меню пользователя (троеточие справа) */
/* ===== НОВЫЙ БЛОК ПОЛЬЗОВАТЕЛЯ (расширяющийся с анимацией) ===== */
.user-section {
   padding: 0;
   border-bottom: 1px solid #3a2a5a;
   background: rgba(0, 0, 0, 0.2);
   width: 100%;
   transition: background-color 0.2s;
}

.user-profile-clickable {
   display: flex;
   align-items: center;
   gap: 12px;
   cursor: pointer;
   padding: 20px;
   transition: background 0.2s;
}

.user-profile-clickable:hover {
   background: rgba(74, 44, 122, 0.3);
}

.user-avatar {
   width: 48px;
   height: 48px;
   border-radius: 50%;
   object-fit: cover;
   border: 2px solid #6b4f9f;
   background: #2a1f3a;
   flex-shrink: 0;
}

.user-info {
   flex: 1;
   min-width: 0;
}

.user-name {
   font-weight: 600;
   color: #d0c0e0;
   margin-bottom: 2px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.user-role {
   font-size: 0.75rem;
   color: #8b6fc7;
   text-transform: uppercase;
}

.user-chevron {
   margin-left: auto;
   color: #b0a0c0;
   font-size: 1.2rem;
   transition: transform 0.3s;
}

.user-section.expanded .user-chevron {
   transform: rotate(180deg);
}

/* Выдвижное меню с плавной анимацией */
.user-expandable-menu {
   max-height: 0;
   opacity: 0;
   overflow: hidden;
   padding: 0 20px;
   transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
   border-top: 1px solid transparent;
}

.user-section.expanded .user-expandable-menu {
   max-height: 300px;
   /* достаточно большое значение для вмещения всех пунктов */
   opacity: 1;
   padding: 0 20px 20px 20px;
   border-top-color: #3a2a5a;
}

.user-menu-item {
   display: block;
   padding: 14px 16px;
   color: #b0a0c0;
   text-decoration: none;
   transition: all 0.2s;
   border-radius: 6px;
   margin-bottom: 2px;
   font-size: 0.95rem;
   background: transparent;
}

.user-menu-item:hover {
   background: rgba(74, 44, 122, 0.5);
   color: #fff;
   padding-left: 24px;
}

.user-menu-divider {
   height: 1px;
   background: linear-gradient(90deg, transparent, #5a4b7a, transparent);
   margin: 8px 0;
}

/* Гостевые кнопки */
.guest-buttons {
   display: flex;
   flex-direction: column;
   gap: 10px;
   padding: 20px;
}

.btn-sidebar {
   display: block;
   width: 100%;
   text-align: center;
   padding: 10px;
   border-radius: 30px;
   font-weight: 600;
   text-decoration: none;
   transition: var(--transition);
}

.btn-sidebar-login {
   background: transparent;
   border: 2px solid #5a4b7a;
   color: #b0a0c0;
}

.btn-sidebar-login:hover {
   background: #3a2a5a;
   border-color: #8b6fc7;
   color: #fff;
}

.btn-sidebar-register {
   background: #4a2c7a;
   border: 2px solid #6b4f9f;
   color: #fff;
}

.btn-sidebar-register:hover {
   background: #5a3b8c;
   border-color: #8b6fc7;
   transform: translateY(-2px);
   box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

/* Кнопки для гостей */
.guest-buttons {
   display: flex;
   flex-direction: column;
   gap: 10px;
   width: 100%;
}

.btn-sidebar {
   display: block;
   width: 100%;
   text-align: center;
   padding: 10px;
   border-radius: 30px;
   font-weight: 600;
   text-decoration: none;
   transition: var(--transition);
}

.btn-sidebar-login {
   background: transparent;
   border: 2px solid #5a4b7a;
   color: #b0a0c0;
}

.btn-sidebar-login:hover {
   background: #3a2a5a;
   border-color: #8b6fc7;
   color: #fff;
}

.btn-sidebar-register {
   background: #4a2c7a;
   border: 2px solid #6b4f9f;
   color: #fff;
}

.btn-sidebar-register:hover {
   background: #5a3b8c;
   border-color: #8b6fc7;
   transform: translateY(-2px);
   box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

/* Список меню */
.sidebar-menu {
   flex: 1;

   padding: 10px 0;
}

.sidebar-menu .list-group-item {
   margin: 4px 10px;
   border-radius: 10px !important;
}

.menu-section-title {
   font-size: 0.7rem;
   text-transform: uppercase;
   letter-spacing: 1px;
   color: #7a6a8a;
   margin: 15px 15px 5px;
}

/* Убираем старые стили для top-auth-bar, теперь они не нужны */
.top-auth-bar {
   display: none;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
.menu-toggle {
   display: none;
   position: fixed;
   top: 10px;
   left: 10px;
   z-index: 1060;
   background: #6e45e2;
   border: none;
   color: white;
   font-size: 1.8rem;
   padding: 8px 15px;
   border-radius: 8px;
   cursor: pointer;
   box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Затемнение фона при открытом меню */
body.sidebar-visible::before {
   content: '';
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.7);
   z-index: 1040;
   pointer-events: none;
}

body.sidebar-visible {
   overflow: hidden;
   /* запрещаем прокрутку основного контента */
}

/* Отключаем горизонтальный скролл на весь сайт */
html,
body {
   overflow-x: hidden;
   max-width: 100%;
}

@media (max-width: 768px) {
   .menu-toggle {
      display: block;
   }

   #sidebar-wrapper {
      position: fixed;
      left: 0;
      top: 0;
      width: 280px;
      /* фиксированная ширина */
      max-width: 100%;
      /* но не шире экрана */
      height: 100vh;
      transform: translateX(-100%);
      transition: transform 0.3s ease;
      z-index: 1050;
      overflow-y: auto;
      padding-bottom: 30px;
   }

   body.sidebar-visible #sidebar-wrapper {
      transform: translateX(0);
   }

   /* Убираем отступ слева у основного контента */
   .main-layout {
      margin-left: 0 !important;
      width: 100%;
   }

   .content-flex {
      padding: 0 15px;
      padding-top: 70px;
   }

   .footer-container {
      padding: 0 15px;
   }

   /* Главная страница */
   .row.align-items-center {
      min-height: 40vh !important;
      text-align: center;
   }

   .display-2 {
      font-size: 2.5rem;
   }

   .lead {
      font-size: 1.2rem;
   }

   .d-flex.gap-3 {
      flex-direction: column;
      gap: 10px !important;
   }

   .btn-lg {
      width: 100%;
   }

   /* Архив – навигация по разделам */
   .section-nav {
      gap: 8px;
   }

   .section-link {
      padding: 8px 18px;
      font-size: 0.9rem;
   }

   .sub-nav-container {
      left: 0;
      transform: translateX(0) scale(0.95);
   }

   .nav-group:hover .sub-nav-container {
      transform: translateX(0) scale(1);
   }

   .sub-nav-container::before {
      left: 20px;
   }

   /* Карточки архива */
   .card-img-top-wrap {
      height: 150px !important;
   }

   .card-title {
      font-size: 1rem;
      height: 2.5em;
   }

   .fragment-preview {
      font-size: 0.85rem;
      min-height: 4em;
   }

   /* Скрываем системную информацию на мобильных */
   .admin-status-sidebar {
      display: none;
   }

   /* Блок пользователя на мобильных */


   .user-avatar {
      width: 40px;
      height: 40px;
   }

   .user-info {
      min-width: 0;
   }

   .user-name {
      font-size: 0.9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 120px;
   }



   .guest-buttons {
      flex-direction: row;
   }

   /* Уменьшаем отступы в меню, чтобы больше помещалось */
   .sidebar-menu .list-group-item {
      margin: 2px 10px;
      padding: 10px 15px;
      font-size: 0.9rem;
   }

   .menu-section-title {
      margin: 10px 15px 2px;
   }
}

@media (max-width: 480px) {
   .menu-toggle {
      font-size: 1.5rem;
      padding: 6px 12px;
   }

   #sidebar-wrapper {
      width: 100%;
      /* на совсем узких сайдбар на всю ширину */
   }

   .display-2 {
      font-size: 2rem;
   }

   .lead {
      font-size: 1rem;
   }

   .user-name {
      max-width: 100px;
   }
}
@media (max-width: 768px) {
   :root {
      --no-sidebar-padding: 5px;
   }
}
