/* Базовые стили OSMTH — токены в tokens.css (подключать первым) */
/* Shell CSS: tokens.css + public-shell.css / internal-shell.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif);
    line-height: 1.6;
    color: var(--ink, #0a0a0a);
    background-color: var(--bg, #fafaf8);
}

header {
    background-color: #ffffff;
    color: #000000;
    padding: 1rem 0;
    text-align: center;
    border-bottom: 2px solid #8B0000;
}

.header-container {
    position: relative;
}

.header-logo {
    margin-bottom: 1rem;
}

.header-logo img {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.header-container h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #000000;
}

.header-container h1 span.red {
    color: #8B0000; /* Темно-красный для выделенных букв */
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-style: italic;
    color: #000000;
}

.subtitle span.red {
    color: #8B0000;
}

.patronage {
    font-size: 1rem;
    margin-top: 1rem;
    color: #000080; /* Темно-синий */
    font-weight: normal;
}

nav.main-menu {
    background-color: #f8f8f8;
    padding: 0;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    clear: both;
    display: block;
    visibility: visible;
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8B0000 #f8f8f8;
}

nav.main-menu::-webkit-scrollbar {
    height: 6px;
}

nav.main-menu::-webkit-scrollbar-track {
    background: #f8f8f8;
}

nav.main-menu::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 3px;
}

nav.main-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
    position: relative;
    visibility: visible;
    min-width: max-content;
}

nav.main-menu > ul > li {
    position: relative;
}

nav.main-menu > ul > li > a {
    color: #333;
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: block;
    transition: color 0.2s ease;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    position: relative;
    background: transparent;
}

nav.main-menu > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #8B0000;
    transition: width 0.3s ease;
}

nav.main-menu > ul > li > a:hover {
    color: #8B0000;
}

nav.main-menu > ul > li > a:hover::after {
    width: 100%;
}

nav.main-menu > ul > li.active > a {
    color: #8B0000;
    border-bottom-color: #8B0000;
}

nav.main-menu > ul > li.active > a::after {
    width: 100%;
}

/* Выпадающее подменю */
nav.main-menu .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 250px;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    border-top: 2px solid #8B0000;
    padding: 0.5rem 0;
    margin-top: 0;
}

nav.main-menu .submenu li {
    position: relative;
}

nav.main-menu .submenu a {
    color: #333;
    padding: 0.75rem 1.5rem;
    display: block;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

nav.main-menu .submenu a:hover {
    background-color: #f8f8f8;
    color: #8B0000;
    border-left-color: #8B0000;
}

/* Показываем подменю при наведении */
nav.main-menu > ul > li:hover > .submenu {
    display: flex;
}

/* Стрелка для пунктов с подменю */
nav.main-menu > ul > li:has(.submenu) > a::after {
    content: " ▼";
    font-size: 0.7em;
    margin-left: 0.3em;
    opacity: 0.7;
}

nav.main-menu > ul > li:hover > a::after {
    opacity: 1;
}

main.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    background-color: #ffffff;
    min-height: 60vh;
}

.page-content,
.section-content {
    background-color: #ffffff;
    padding: 1.5rem;
}

.page-content h1,
.section-content h1 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #34495e;
    padding-bottom: 0.5rem;
}

.breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.page-body,
.section-description {
    line-height: 1.8;
    margin-top: 1.5rem;
    min-height: 200px;
}

.about-content {
    padding: 2rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.rich-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.rich-text p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.rich-text p:last-child {
    margin-bottom: 0;
}

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #8B0000;
    font-weight: bold;
}

.rich-text h1 {
    font-size: 2rem;
    border-bottom: 2px solid #8B0000;
    padding-bottom: 0.5rem;
}

.rich-text h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.rich-text h3 {
    font-size: 1.3rem;
}

.rich-text ul,
.rich-text ol {
    margin: 1rem 0 1rem 2rem;
    line-height: 1.8;
}

.rich-text li {
    margin-bottom: 0.5rem;
}

.rich-text strong {
    font-weight: bold;
    color: #000;
}

.rich-text em {
    font-style: italic;
}

.rich-text a {
    color: #8B0000;
    text-decoration: underline;
}

.rich-text a:hover {
    color: #A00000;
}

.rich-text blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #8B0000;
    background-color: #f9f9f9;
    font-style: italic;
    color: #555;
}

.rich-text img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    display: block;
}

.page-body p,
.section-description p {
    margin-bottom: 1rem;
}

.page-body div,
.page-body #content {
    min-height: 200px;
}

.page-body .entry-content,
.page-body .hentry {
    margin: 1rem 0;
}

.page-body img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border: 1px solid #ddd;
    padding: 5px;
    background-color: #fff;
}

.images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.image-item {
    text-align: center;
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-item img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    padding: 5px;
    background-color: #fff;
}

.image-caption {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

.page-body img.wp-image,
.page-body img.attachment,
.page-body img {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    padding: 5px;
    background-color: #fff;
}

.page-body .wp-caption {
    max-width: 100%;
    margin: 1.5rem 0;
    text-align: center;
}

.page-body .wp-caption img {
    display: block;
    margin: 0 auto;
}

.page-body .wp-caption-text {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

.sections-list,
.pages-list-items,
.subsections-list {
    list-style: none;
    margin-top: 1rem;
}

.sections-list li,
.pages-list-items li,
.subsections-list li {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 4px solid #34495e;
}

.sections-list a,
.pages-list-items a,
.subsections-list a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.sections-list a:hover,
.pages-list-items a:hover,
.subsections-list a:hover {
    color: #3498db;
}

.section-description,
.page-excerpt {
    color: #333;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    line-height: 1.6;
}

.page-body p {
    text-align: justify;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.page-body strong {
    font-weight: bold;
}

.page-body a {
    color: #8B0000;
    text-decoration: underline;
}

.page-body a:hover {
    color: #A52A2A;
}

.page-meta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.original-url {
    font-size: 0.85rem;
    color: #95a5a6;
}

.original-url a {
    color: #3498db;
    text-decoration: none;
}

footer {
    background-color: #f8f8f8;
    color: #333;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
    border-top: 2px solid #8B0000;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-container p {
    margin: 0.5rem 0;
}

.motto {
    margin-top: 1rem;
    font-style: italic;
    font-size: 0.95rem;
    color: #333;
}

.footer-container .version {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #666;
    font-family: monospace;
}

.footer-container a {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-container a:hover {
    color: #333333;
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
    nav.main-menu {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #8B0000 #f8f8f8;
    }

    nav.main-menu::-webkit-scrollbar {
        height: 6px;
    }

    nav.main-menu::-webkit-scrollbar-track {
        background: #f8f8f8;
    }

    nav.main-menu::-webkit-scrollbar-thumb {
        background: #8B0000;
        border-radius: 3px;
    }

    nav.main-menu ul {
        flex-direction: row;
        justify-content: flex-start;
        flex-wrap: nowrap;
        padding: 0 15px;
        min-width: max-content;
    }
    
    nav.main-menu > ul > li {
        flex-shrink: 0;
        border-bottom: none;
        border-right: 1px solid #ddd;
        white-space: nowrap;
    }

    nav.main-menu > ul > li:last-child {
        border-right: none;
    }
    
    nav.main-menu > ul > li > a {
        padding: 12px 18px;
        text-align: center;
        font-size: 0.9em;
        white-space: nowrap;
    }
    
    nav.main-menu .submenu {
        position: absolute;
        top: 100%;
        left: 0;
        width: auto;
        min-width: 200px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        border: 1px solid #ddd;
        background-color: #ffffff;
    }

    nav.main-menu > ul > li:hover > .submenu {
        display: flex;
    }
    
    nav.main-menu .submenu a {
        padding: 0.75rem 1.5rem;
        padding-left: 1.5rem;
    }
    
    main.content {
        padding: 1rem;
    }

    header .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    footer {
        padding: 1rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .hero-image {
        margin: 1rem auto;
    }

    .hero-image img {
        width: 100%;
    }
}

/* Новые стили для главной страницы */
.hero-image {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 2rem;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.main-title {
    text-transform: uppercase;
    font-size: 2.5rem;
    margin: 2rem 0;
    text-align: center;
}

.main-title .word {
    display: inline-block;
}

.main-title .red {
    color: #8B0000;
}

.section-buttons {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #8B0000;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn:hover,
a.btn:hover {
    background-color: #A52A2A;
    color: #ffffff;
}

.btn-primary {
    background-color: #8B0000;
}

.btn-secondary {
    background-color: #666;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.home-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    text-align: center;
}

/* Стили для заголовков второстепенных страниц */
.page-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.page-header-image {
    flex-shrink: 0;
}

.page-header-image img {
    width: 200px;
    height: auto;
    display: block;
}

.page-header-title {
    flex: 1;
}

.page-title-small {
    text-transform: uppercase;
    font-size: 1.5rem;
    margin: 0;
    text-align: left;
}

.page-title-small .word {
    display: inline-block;
}

.page-title-small .red {
    color: #8B0000;
}

/* Унифицированные стили для всех content блоков */
.about-content,
.leadership-content,
.contact-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Стили для страницы руководства */
.leaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
    padding: 0;
}

.leader-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

.leader-card:nth-child(4) {
    animation-delay: 0.4s;
}

.leader-card:nth-child(n+5) {
    animation-delay: 0.5s;
}

.leader-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8B0000 0%, #A00000 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.leader-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(139, 0, 0, 0.15);
    border-color: #8B0000;
}

.leader-card:hover::before {
    opacity: 1;
}

.leader-card {
    grid-column: span 1;
}

.leader-photo {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.leader-photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 3px solid #8B0000;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: block;
}

.leader-card:hover .leader-photo img {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 0, 0, 0.3);
}

.leader-info {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.leader-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leader-position {
    font-size: 1.1rem;
    font-weight: 600;
    color: #8B0000;
    margin: 0 0 0.5rem 0;
    padding: 0.5rem 0;
    border-bottom: 2px solid #f0f0f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leader-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #666666;
    margin: 0 0 1rem 0;
    font-style: italic;
    line-height: 1.4;
}

.leader-text {
    margin-top: auto;
    padding-top: 1rem;
    color: #333333;
    line-height: 1.7;
    text-align: left;
    font-size: 0.95rem;
}

.leader-text p {
    margin-bottom: 0.75rem;
    text-align: justify;
}

.leader-text p:last-child {
    margin-bottom: 0;
}

.leader-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.leader-gallery:empty {
    display: none;
}

.leader-gallery:not(:has(img)) {
    display: none;
}

.leader-gallery img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.leader-gallery img:hover {
    transform: scale(1.05);
    border-color: #8B0000;
    box-shadow: 0 4px 8px rgba(139, 0, 0, 0.2);
}

/* Адаптивность для страницы руководства */
@media (max-width: 768px) {
    .leadership-content {
        padding: 1.5rem 1rem;
    }

    .leaders-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .leader-card:nth-child(1),
    .leader-card:nth-child(2) {
        grid-column: span 1;
    }

    .leader-photo {
        padding: 1.5rem 1.5rem 1rem;
    }

    .leader-photo img {
        max-width: 100%;
    }

    .leader-info {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    .leader-info h3 {
        font-size: 1.3rem;
    }

    .leader-position {
        font-size: 1rem;
    }

    .leader-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .leader-photo img {
        max-width: 100%;
    }

    .leader-info h3 {
        font-size: 1.2rem;
    }
}

/* Стили для внутренней части */
body.internal {
    background-color: #f5f5f5;
}

.internal-header {
    background-color: #fff;
    border-bottom: 2px solid #8B0000;
    padding: 1rem 0;
}

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

.internal-nav {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
}

.internal-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.internal-nav a {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}


.internal-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background-color: #fff;
    min-height: 60vh;
}

.internal-footer {
    text-align: center;
    padding: 1rem;
    background-color: #fff;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
}

/* Стили для форм */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

/* Стили для таблиц */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f8f8f8;
    font-weight: bold;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.badge-success {
    background-color: #28a745;
    color: #fff;
}

.badge-danger {
    background-color: #dc3545;
    color: #fff;
}

/* Стили для сообщений */
.messages {
    margin-bottom: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Стили для страницы контактов */
.contact-form {
    max-width: 600px;
    margin: 2rem auto;
}

/* Стили для матрикула */
.matricul-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.filters {
    background-color: #f8f8f8;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-form .form-group {
    flex: 1;
    min-width: 200px;
}

.pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

/* Стили для страницы настроек */
.settings-sections {
    display: grid;
    gap: 2rem;
}

.settings-section {
    background-color: #f8f8f8;
    padding: 1.5rem;
    border-radius: 4px;
}

.telegram-status {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.telegram-status.linked {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.telegram-status.not-linked {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

.link-code {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: 4px;
}

.link-code .code {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8B0000;
    font-family: monospace;
}

.help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================
   Утилитные классы для мобильной адаптации
   ============================================ */

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.mobile-stack {
    display: flex;
}

.mobile-full-width {
    width: auto;
}

/* ============================================
   Общие медиа-запросы для внутренних страниц
   ============================================ */

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

    .desktop-only {
        display: none;
    }

    .mobile-stack {
        flex-direction: column;
    }

    .mobile-full-width {
        width: 100%;
    }

    /* Адаптация таблиц - преобразование в карточки */
    .data-table,
    .matricul-table {
        display: block;
        width: 100%;
    }

    .data-table thead,
    .matricul-table thead {
        display: none;
    }

    .data-table tbody,
    .matricul-table tbody {
        display: block;
    }

    .data-table tr,
    .matricul-table tr {
        display: block;
        margin-bottom: 15px;
        border: 2px solid #000;
        background: #fff;
        padding: 15px;
        box-sizing: border-box;
    }

    .data-table td,
    .matricul-table td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #eee;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .data-table td:last-child,
    .matricul-table td:last-child {
        border-bottom: none;
    }

    .data-table td:before,
    .matricul-table td:before {
        content: attr(data-label) ": ";
        font-weight: 700;
        display: inline-block;
        min-width: 120px;
    }

    /* Специальная адаптация для info-table (блоки с данными) */
    .info-table {
        display: block;
        width: 100%;
    }

    .info-table thead {
        display: none;
    }

    .info-table tbody {
        display: block;
    }

    .info-table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 12px;
        padding: 12px 0;
        border-bottom: 1px solid #e5e5e5;
    }

    .info-table tr:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .info-table td {
        display: block;
        padding: 0;
        border: none;
        width: 100%;
        box-sizing: border-box;
    }

    .info-table .label-cell {
        width: 100%;
        font-weight: 700;
        color: #333;
        margin-bottom: 6px;
        padding: 0;
        font-size: 0.9em;
        line-height: 1.4;
        word-wrap: break-word;
    }

    .info-table .value-cell {
        width: 100%;
        padding: 0;
        color: #000;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .info-table .value-cell strong {
        font-weight: 600;
    }

    .info-table .value-cell a {
        color: #8B0000;
        text-decoration: none;
        word-break: break-all;
    }

    /* Адаптация форм */
    .form-group,
    .filter-group {
        width: 100%;
        margin-bottom: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .filter-group input,
    .filter-group select {
        width: 100%;
        box-sizing: border-box;
    }

    .form-actions,
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn,
    .header-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Адаптация заголовков страниц */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 1.5em;
    }

    /* Адаптация кнопок */
    .btn {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    /* Адаптация фильтров */
    .filter-form,
    .filters-bar {
        flex-direction: column;
    }

    .filter-form .filter-group {
        width: 100%;
    }

    /* Адаптация двухколоночных сеток */
    .member-main-info-layout,
    .member-content-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Адаптация карточек */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Адаптация секций с заголовками и кнопками */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Улучшение отображения блоков информации */
    .info-box {
        padding: 15px;
        margin-bottom: 20px;
    }

    .box-title {
        font-size: 1em;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .text-content {
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.6;
    }

    /* Улучшение отображения длинных текстов */
    .value-cell,
    .text-content,
    p {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

