/* ===== ОБЩИЕ СБРОСЫ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== ШАПКА ===== */
header {
    background: #0a1a3a;
    color: white;
    padding: 22px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 0;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
    flex-shrink: 0;
}

/* ===== МЕНЮ ===== */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
}

nav a {
    color: #e0e8f5;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 4px 10px;
    border-bottom: 2px solid transparent;
    border-radius: 4px;
    transition: border-bottom 0.25s, color 0.25s, background 0.25s;
    white-space: nowrap;
}

nav a:hover {
    background: rgba(106, 140, 255, 0.15);
    border-bottom-color: #6a8cff;
    color: white;
}

nav a.active {
    border-bottom-color: #6a8cff;
    color: white;
}

/* ===== СТАТУС ПОЛЬЗОВАТЕЛЯ ===== */
.user-status {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #e0e8f5;
    font-size: 15px;
    margin-left: 20px;
    flex-shrink: 0;
}

.user-status a {
    color: #a0b8f0;
    text-decoration: underline;
    cursor: pointer;
}

.user-status a:hover {
    color: white;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
main {
    flex: 1 0 auto;
    padding: 40px 0 60px;
}

/* ===== ПОДВАЛ ===== */
footer {
    background: #0a1a3a;
    color: #b0c4e8;
    text-align: center;
    padding: 20px 0;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: auto;
}

/* ===== ОСТАЛЬНЫЕ СТИЛИ ===== */
.section {
    display: none;
    animation: fade 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fade {
    from { opacity: 0.3; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

h1, h2 {
    color: #0a1a3a;
    margin-bottom: 20px;
}

h1 { font-size: 34px; }
h2 { font-size: 28px; }

/* ===== ПОДМЕНЮ ===== */
.submenu {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 30px;
    margin: 18px 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e6eefa;
}

.submenu a {
    color: #0a1a3a;
    text-decoration: none;
    font-weight: 600;
    font-size: 17px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}

.submenu a:hover {
    border-bottom-color: #6a8cff;
}

/* ===== ПЛАВНОЕ ПОЯВЛЕНИЕ ПОДРАЗДЕЛОВ ===== */
.sub-content {
    background: #f8faff;
    padding: 20px 24px;
    border-radius: 10px;
    border-left: 4px solid #6a8cff;
    margin-bottom: 20px;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sub-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ===== ПЛАВНОЕ РАСКРЫТИЕ АККОРДЕОНА ===== */
.sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f0f4ff;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 5px;
    font-weight: 600;
    color: #0a1a3a;
    user-select: none;
}

.sub-header:hover {
    background: #dce4f5;
}

.sub-header .toggle-icon {
    font-size: 18px;
    transition: transform 0.2s;
}

.sub-header .toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.sub-body {
    padding-left: 15px;
    border-left: 2px solid #b0c4e8;
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    padding: 0 0 0 15px;
}

.sub-body.open {
    max-height: 2000px;
    opacity: 1;
    padding: 10px 0 10px 15px;
}

/* ===== КНОПКИ ===== */
.btn {
    background: #0a1a3a;
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.btn:hover {
    background: #1e3a6a;
    transform: scale(1.02);
}

/* ===== FAQ ===== */
.faq-item {
    background: #f8faff;
    border: 1px solid #dce4f5;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 14px;
}

.faq-item h3 {
    color: #0a1a3a;
    margin-bottom: 6px;
    cursor: pointer;
}

.faq-item p {
    color: #1a1a1a;
    margin-top: 4px;
}

/* ===== ФОРМЫ ВХОДА ===== */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.auth-tab {
    background: #e6eefa;
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.auth-tab.active {
    background: #0a1a3a;
    color: white;
}

.auth-form {
    display: none;
    max-width: 400px;
    margin: 0 auto;
}

.auth-form.active {
    display: block;
}

.auth-form h3 {
    margin-bottom: 18px;
    color: #0a1a3a;
}

.auth-form label {
    display: block;
    margin: 12px 0 4px;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #b0c4e8;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-form .btn {
    margin-top: 18px;
    width: 100%;
    padding: 12px;
}

/* ===== СООБЩЕНИЯ ФОРМ (ВХОД) ===== */
#auth-message {
    display: none;
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

#auth-message.error {
    display: block;
    background: #fff0f0;
    border: 1px solid #b22234;
    color: #b22234;
}

#auth-message.success {
    display: block;
    background: #f0fff0;
    border: 1px solid #1e7e34;
    color: #1e7e34;
}

/* ===== ФОРУМ: ГОСТЕВОЙ БЛОК ===== */
.forum-guest {
    background: #f8faff;
    padding: 30px;
    border-radius: 12px;
    border: 1px dashed #6a8cff;
    text-align: center;
}

.forum-guest a {
    color: #0a1a3a;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.forum-guest a:hover {
    color: #6a8cff;
}

.forum-content {
    background: #f8faff;
    padding: 20px;
    border-radius: 12px;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
    padding-top: 60px;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px 40px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: #0a1a3a;
}

.modal-content h3 {
    margin-top: 0;
    color: #0a1a3a;
}

.modal-content label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 500;
}

.modal-content input[type="text"],
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #b0c4e8;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-content textarea {
    resize: vertical;
}

.modal-content input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.modal-content .btn {
    margin-top: 18px;
    width: 100%;
}

/* ===== СПИСОК ТЕМ В ФОРУМЕ ===== */
#forum-topics {
    margin-top: 30px;
}

.topic-item {
    background: #f8faff;
    border: 1px solid #dce4f5;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
}

.topic-category {
    font-size: 13px;
    font-weight: 600;
    color: #6a8cff;
    background: #e6eefa;
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    margin-bottom: 6px;
}

.topic-item h4 {
    color: #0a1a3a;
    margin-bottom: 4px;
}

.topic-item .topic-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.topic-item .topic-body {
    color: #1a1a1a;
}

.topic-item .private-badge {
    display: inline-block;
    background: #ffd966;
    color: #333;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 10px;
}

.topic-actions {
    margin: 12px 0 8px;
}

.topic-actions button {
    margin-right: 10px;
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #e6eefa;
    color: #0a1a3a;
    font-size: 14px;
    transition: 0.2s;
}

.topic-actions button:hover {
    background: #b0c8f0;
}

.reply-toggle-btn {
    background: #d4edda !important;
}

.reply-toggle-btn:hover {
    background: #b7dfc9 !important;
}

.replies-container {
    margin-top: 8px;
    padding-left: 12px;
    border-left: 3px solid #b0c4e8;
}

.reply-item {
    background: #f8faff;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #e6eefa;
}

.reply-item strong {
    color: #0a1a3a;
}

.reply-item p {
    margin: 4px 0 0;
    color: #1a1a1a;
}

.reply-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #b0c4e8;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.submit-reply-btn {
    background: #0a1a3a;
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 4px;
}

.submit-reply-btn:hover {
    background: #1e3a6a;
}

/* ===== ФАЙЛЫ ===== */
.files-container {
    margin: 10px 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e6eefa;
    transition: background 0.2s;
    cursor: default;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateX(-10px);
}

.file-item:hover {
    background: #e6eefa;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-item:nth-child(1) { animation-delay: 0.05s; }
.file-item:nth-child(2) { animation-delay: 0.1s; }
.file-item:nth-child(3) { animation-delay: 0.15s; }
.file-item:nth-child(4) { animation-delay: 0.2s; }
.file-item:nth-child(5) { animation-delay: 0.25s; }

.file-item .file-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 30px;
    text-align: center;
}

.file-item .file-name {
    flex: 1;
    color: #0a1a3a;
    text-decoration: none;
    font-weight: 500;
}

.file-item .file-name:hover {
    color: #6a8cff;
    text-decoration: underline;
}

.file-item .file-date {
    color: #888;
    font-size: 14px;
    margin-right: 15px;
}

.file-item .file-delete-btn {
    background: none;
    border: none;
    color: #b22234;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
    transition: 0.2s;
}

.file-item .file-delete-btn:hover {
    color: #ff0000;
}

/* ===== ОБЛАСТЬ ЗАГРУЗКИ ===== */
.upload-area {
    margin: 15px 0;
}

.upload-area .btn {
    background: #0a1a3a;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
}

.upload-area .btn:hover {
    background: #1e3a6a;
}

.upload-progress {
    margin-top: 8px;
}

.progress-bar {
    height: 8px;
    border-radius: 4px;
    width: 100%;
}

.progress-text {
    font-size: 14px;
    color: #0a1a3a;
    margin-left: 8px;
}

.upload-message {
    margin-top: 5px;
    font-weight: 500;
}

/* ===== НОВЫЕ СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ ===== */

/* Двухколоночный макет */
.home-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.home-sidebar {
    flex: 0 0 300px;
    max-width: 300px;
}

.home-content {
    flex: 1;
}

/* Виджеты */
.widget {
    background: #f8faff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.widget h3 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 2px solid #6a8cff;
    padding-bottom: 8px;
    margin-bottom: 12px;
    color: #0a1a3a;
}

.widget-news ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-news li {
    padding: 8px 0;
    border-bottom: 1px solid #e6eefa;
}

.widget-news li:last-child {
    border-bottom: none;
}

.widget-news li a {
    text-decoration: none;
    color: #0a1a3a;
    font-weight: 500;
    display: block;
}

.widget-news li a:hover {
    color: #6a8cff;
}

.widget-news .news-date {
    display: block;
    font-size: 12px;
    color: #888;
}

/* Форма обратной связи в виджете */
.widget-feedback input,
.widget-feedback textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #b0c4e8;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.widget-feedback input:focus,
.widget-feedback textarea:focus {
    outline: none;
    border-color: #6a8cff;
}

.widget-feedback label {
    display: block;
    font-size: 13px;
    margin: 8px 0;
    color: #0a1a3a;
}

.widget-feedback .btn {
    width: 100%;
    margin-top: 5px;
}

#fb-message {
    margin-top: 10px;
    font-weight: 500;
}

/* Полезная информация */
.widget-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-links li {
    margin-bottom: 6px;
}

.widget-links li:last-child {
    margin-bottom: 0;
}

.widget-links a {
    color: #0a1a3a;
    text-decoration: none;
    font-weight: 500;
}

.widget-links a:hover {
    color: #6a8cff;
    text-decoration: underline;
}

/* Список проблем на главной */
#home-problems ul {
    list-style: disc;
    padding-left: 20px;
    margin: 15px 0;
}

#home-problems ul li {
    margin-bottom: 6px;
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-grid .gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.gallery-grid .gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 6px 10px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-grid .gallery-item:hover .gallery-caption {
    opacity: 1;
}

/* Кнопка удаления в галерее (админ) */
.gallery-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(178, 34, 52, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    opacity: 0;
}

.gallery-item:hover .gallery-delete-btn {
    opacity: 1;
}

.gallery-delete-btn:hover {
    background: #b22234;
    transform: scale(1.1);
}

/* Загрузка фото в галерее */
#gallery-upload-area {
    margin-top: 20px;
    padding: 15px;
    background: #f8faff;
    border-radius: 8px;
    border: 1px dashed #6a8cff;
}

#gallery-upload-area input[type="file"] {
    display: block;
    margin-bottom: 10px;
}

#gallery-upload-progress {
    margin-top: 10px;
}

#gallery-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
}

#gallery-upload-message {
    margin-top: 8px;
    font-weight: 500;
}

/* ===== АДМИН-ПАНЕЛЬ ===== */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-tab {
    background: #e6eefa;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: 0.2s;
}

.admin-tab:hover {
    background: #b0c8f0;
}

.admin-tab.active {
    background: #0a1a3a;
    color: white;
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

/* Редактор контента */
#content-editor {
    max-width: 800px;
}

#content-section-select {
    padding: 8px 14px;
    border: 1px solid #b0c4e8;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
    background: white;
}

#content-fields label {
    display: block;
    margin: 12px 0 4px;
    font-weight: 500;
    color: #0a1a3a;
}

#content-fields input,
#content-fields textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #b0c4e8;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

#content-fields textarea {
    min-height: 80px;
    resize: vertical;
}

#content-fields .array-field {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

#content-fields .array-field input {
    flex: 1;
}

#content-fields .array-field button {
    background: #b22234;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#content-fields .array-field button:hover {
    background: #8b1a1a;
}

#content-save-btn {
    margin-top: 15px;
}

#content-save-message {
    margin-top: 10px;
    font-weight: 500;
}

/* Список новостей в админке */
#news-list-admin .news-item {
    background: #f8faff;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #dce4f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#news-list-admin .news-item .news-content {
    flex: 1;
}

#news-list-admin .news-item .news-title {
    font-weight: 600;
    color: #0a1a3a;
}

#news-list-admin .news-item .news-date {
    font-size: 13px;
    color: #888;
}

#news-list-admin .news-item .news-actions button {
    margin-left: 6px;
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#news-list-admin .news-item .news-actions .edit-btn {
    background: #e6eefa;
    color: #0a1a3a;
}

#news-list-admin .news-item .news-actions .edit-btn:hover {
    background: #b0c8f0;
}

#news-list-admin .news-item .news-actions .delete-btn {
    background: #b22234;
    color: white;
}

#news-list-admin .news-item .news-actions .delete-btn:hover {
    background: #8b1a1a;
}

/* Галерея в админке */
#gallery-admin-list .gallery-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8faff;
    border-radius: 8px;
    border: 1px solid #dce4f5;
}

#gallery-admin-list .gallery-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

#gallery-admin-list .gallery-item .gallery-info {
    flex: 1;
}

#gallery-admin-list .gallery-item .gallery-info span {
    display: block;
    font-size: 14px;
    color: #0a1a3a;
}

#gallery-admin-list .gallery-item .gallery-actions button {
    background: #b22234;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
}

#gallery-admin-list .gallery-item .gallery-actions button:hover {
    background: #8b1a1a;
}

/* Обратная связь в админке */
#feedback-list-admin .feedback-item {
    background: #f8faff;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #dce4f5;
}

#feedback-list-admin .feedback-item .fb-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

#feedback-list-admin .feedback-item .fb-meta strong {
    color: #0a1a3a;
}

#feedback-list-admin .feedback-item .fb-problem {
    margin: 4px 0;
    color: #1a1a1a;
}

#feedback-list-admin .feedback-item .fb-status {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

#feedback-list-admin .feedback-item .fb-status.new {
    background: #fff3cd;
    color: #856404;
}

#feedback-list-admin .feedback-item .fb-status.processed {
    background: #d4edda;
    color: #155724;
}

/* Модалка редактирования новости */
#news-edit-modal .modal-content {
    max-width: 600px;
}

#news-edit-modal input,
#news-edit-modal textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #b0c4e8;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    margin-bottom: 10px;
}

#news-edit-modal textarea {
    min-height: 100px;
    resize: vertical;
}

/* =================================================================== */
/* ===== НОВЫЕ СТИЛИ ДЛЯ ВЕРТИКАЛЬНЫХ ПОДРАЗДЕЛОВ И ПОЛЕЗНОЙ ИНФОРМАЦИИ ===== */
/* =================================================================== */

/* Вертикальное меню подразделов на главной */
.submenu-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.submenu-vertical a {
    padding: 8px 14px;
    background: #f0f4ff;
    border-radius: 8px;
    text-decoration: none;
    color: #0a1a3a;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    border: 1px solid #dce4f5;
}
.submenu-vertical a:hover {
    background: #dce4f5;
    color: #000;
}

/* Горизонтальные ссылки полезной информации */
.useful-links-horiz {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}
.useful-links-horiz a {
    padding: 5px 14px;
    background: #e6eefa;
    border-radius: 20px;
    text-decoration: none;
    color: #0a1a3a;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    border: 1px solid #dce4f5;
}
.useful-links-horiz a:hover {
    background: #b0c8f0;
}

/* Форма обратной связи в подразделе */
#sub-feedback-form form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
}
#sub-feedback-form input,
#sub-feedback-form textarea {
    padding: 10px 12px;
    border: 1px solid #b0c4e8;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}
#sub-feedback-form input:focus,
#sub-feedback-form textarea:focus {
    outline: none;
    border-color: #6a8cff;
}
#sub-feedback-form textarea {
    min-height: 120px;
    resize: vertical;
}
#sub-feedback-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #0a1a3a;
    cursor: pointer;
}
#sub-feedback-form label input[type="checkbox"] {
    width: auto;
    margin: 0;
}
#sub-feedback-form .btn {
    align-self: flex-start;
    width: auto;
    min-width: 150px;
}

/* Подсветка полей с ошибками */
.error-field {
    border: 2px solid #b22234 !important;
    background-color: #fff0f0 !important;
    outline: none;
}

/* Сообщения об ошибках в подразделе */
#fb-message-sub {
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 500;
}

/* Контейнер для текста подразделов */
.sub-content p {
    margin: 0 0 10px;
    line-height: 1.6;
}

/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    nav {
        justify-content: center;
        gap: 6px 12px;
    }
    nav a {
        font-size: 14px;
        padding: 4px 8px;
    }
    .logo {
        font-size: 22px;
        text-align: center;
    }
    .user-status {
        justify-content: center;
        margin-left: 0;
        margin-top: 8px;
    }
    h1 { font-size: 26px; }
    h2 { font-size: 22px; }
    .submenu {
        flex-direction: column;
        gap: 6px;
    }
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    .file-item {
        flex-wrap: wrap;
        gap: 4px;
    }
    .file-item .file-date {
        width: 100%;
        margin-left: 42px;
        font-size: 12px;
    }

    /* Адаптация главной */
    .home-layout {
        flex-direction: column;
    }
    .home-sidebar {
        flex: 1;
        max-width: 100%;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .admin-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-tab {
        text-align: center;
    }
    #news-list-admin .news-item {
        flex-direction: column;
        align-items: stretch;
    }
    #news-list-admin .news-item .news-actions {
        display: flex;
        gap: 6px;
        margin-top: 6px;
    }

    /* --- ДОПОЛНИТЕЛЬНАЯ АДАПТАЦИЯ ДЛЯ НОВЫХ ЭЛЕМЕНТОВ --- */
    .submenu-vertical a {
        font-size: 14px;
        padding: 6px 12px;
    }
    .useful-links-horiz a {
        font-size: 13px;
        padding: 4px 12px;
    }
    #sub-feedback-form form {
        max-width: 100%;
    }
    #sub-feedback-form .btn {
        width: 100%;
        align-self: center;
    }
}

/* Модалка для увеличения изображений */
#imageModal .modal-content {
    text-align: center;
    padding: 20px;
    max-width: 800px;
}
#imageModal img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

/* Скрываем регистрацию и вкладки, если они остались в HTML */
#section-registration,
#auth-register,
.auth-tabs,
nav a[data-section="registration"] {
    display: none !important;
}

/* Убираем лишние отступы у формы входа, если они были завязаны на табы */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
}