/* =========================================================
   BASE & TYPOGRAPHY
   ========================================================= */
* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    background: #f4f6fa;
    color: #0f172a;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
h1, h2, h3 { margin-top: 0; }
small { color: #64748b; }

.container {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
    flex: 1 0 auto;
    width: 100%;
}
.card { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* =========================================================
   FORMS, BUTTONS & TABLES
   ========================================================= */
input, textarea, select { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
textarea { resize: vertical; }
label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; color: #334155; }
.form-row { margin-bottom: 14px; }
input[type="file"] { padding: 6px; background: #f8fafc; }

button, .btn { background: #0d7377; color: #fff; border: 0; padding: 10px 18px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; font-size: 14px; font-weight: 500; font-family: inherit; line-height: 1.2; }
button:hover, .btn:hover { background: #0a5a5d; }
.btn-danger { background: #dc2626; } .btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: #e2e8f0; color: #0f172a; } .btn-secondary:hover { background: #cbd5e1; }
.btn-outline { background: transparent; border: 1.5px solid #0d7377; color: #0d7377; }
.btn-outline:hover { background: #0d7377; color: #fff; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; background: #dbeafe; color: #1e40af; }
.flash.error { background: #fee2e2; color: #991b1b; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
th { background: #f8fafc; font-weight: 600; font-size: 13px; color: #475569; text-transform: uppercase; }
.inline-form { display: inline; }

.empty { color: #94a3b8; font-size: 14px; padding: 24px; text-align: center; background: #f8fafc; border-radius: 12px; border: 1.5px dashed #cbd5e1; }

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */
.site-header { display: flex; align-items: center; gap: 32px; background: #fff; padding: 12px 32px; border-bottom: 1px solid #eef2f7; position: sticky; top: 0; z-index: 50; }
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.site-logo img, .site-logo-mark { height: 48px; width: auto; display: block; }
.site-logo-text { display: flex; flex-direction: column; line-height: 1.45; color: #013e46; font-weight: 700; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; }
.site-logo-text > span { display: block; white-space: nowrap; }

.site-nav { display: flex; gap: 36px; align-items: center; flex: 1; justify-content: center; }
.site-nav a { display: inline-flex; align-items: center; gap: 8px; color: #013e46; font-weight: 700; text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 8px; transition: background .15s, color .15s; }
.site-nav a:hover { background: #e6f2f3; color: #013e46; }
.site-nav .badge { background: #dc2626; color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; margin-left: 4px; font-weight: 700; }
.nav-icon { width: 20px; height: 20px; display: block; object-fit: contain; filter: brightness(0) saturate(100%) invert(16%) sepia(38%) saturate(2172%) hue-rotate(160deg) brightness(94%) contrast(101%); }

.site-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.icon-btn { background: transparent; border: 0; padding: 6px; cursor: pointer; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: background .15s; position: relative; }
.icon-btn:hover { background: #e6f2f3; }
.icon-btn img { width: 22px; height: 22px; display: block; object-fit: contain; filter: brightness(0) saturate(100%) invert(16%) sepia(38%) saturate(2172%) hue-rotate(160deg) brightness(94%) contrast(101%); }

.notif-badge { position: absolute; top: 0; right: 0; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 10px; min-width: 16px; text-align: center; line-height: 1; border: 2px solid #fff; transform: translate(25%, -25%); }

.user-chip { display: inline-block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid #e2e8f0; flex-shrink: 0; }
.user-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Выпадающее меню профиля */
.user-menu { position: relative; }
.user-menu-btn { padding: 0; border: 0; background: transparent; cursor: pointer; }
.user-menu-list { display: none; position: absolute; top: calc(100% + 10px); right: 0; min-width: 220px; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.15); overflow: hidden; z-index: 60; padding: 6px 0; }
.user-menu.open .user-menu-list { display: block; }
.user-menu-list::before { content: ''; position: absolute; top: -6px; right: 18px; width: 12px; height: 12px; background: #fff; transform: rotate(45deg); box-shadow: -2px -2px 6px rgba(15,23,42,.05); }
.user-menu-header { padding: 10px 16px 12px; border-bottom: 1px solid #eef2f7; margin-bottom: 4px; }
.user-menu-name { font-weight: 600; color: #013e46; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.user-menu-role { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.user-menu-item { display: block; padding: 9px 16px; color: #0f172a; text-decoration: none; font-size: 14px; font-weight: 500; transition: background .12s; }
.user-menu-item:hover { background: #f1f5f9; }
.user-menu-sep { height: 1px; background: #eef2f7; margin: 6px 0; }
.user-menu-logout { color: #dc2626; }
.user-menu-logout:hover { background: #fee2e2; }

/* Скрываем нижнее меню на ПК */
.mobile-bottom-nav { display: none !important; }

/* =========================================================
   AUTH PAGES (LOGIN & ACTIVATE)
   ========================================================= */
.auth-page-wrapper {
    position: fixed;
    top: 74px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 74px);
    background-color: #017a8b;
    background-image: url('../img/bg-auth-desktop.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding-left: 8vw;
    padding-bottom: 8vh;
    overflow-y: auto;
}

.auth-form-box {
    background: rgba(1, 103, 114, 0.95);
    width: 100%;
    max-width: 500px;
    padding: 40px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    flex-shrink: 0;
}

.auth-form-title { color: #fff; font-size: 20px; font-weight: 600; margin-bottom: 20px; text-align: center; letter-spacing: 0.5px; }
.auth-input { width: 100%; padding: 16px 20px; margin-bottom: 12px; border: none; border-radius: 8px; font-size: 16px; background: #ffffff; color: #0f172a; font-family: inherit; }
.auth-btn { width: 100%; padding: 16px; background: #ffffff; color: #016772; border: none; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 8px; transition: all 0.2s; }
.auth-btn:hover { background: #e2e8f0;}

/* =========================================================
   HOME PAGE
   ========================================================= */
/* Контейнер главной страницы */
.page-wide {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 40px !important;
    box-sizing: border-box;
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    background: #013e46;
    color: #fff;
    border-radius: 24px;
    overflow: hidden;
    margin: 24px 0 48px;
    width: 100%;
    padding: 40px 72px;
    box-sizing: border-box;
}
.hero-text { position: relative; z-index: 1; max-width: 640px; }
.hero-text h1 { font-size: 52px; line-height: 1.05; margin: 0 0 18px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: #fff; }
.hero-text h1 .hero-title-accent { color: #7fe2e9; }
.hero-text p { font-size: 17px; line-height: 1.55; margin: 0 0 26px; color: #cfe9eb; }
.hero-btn { background: #fff; color: #0d4b50; font-weight: 600; padding: 12px 22px; border-radius: 10px; }
.hero-btn:hover { background: #e0f2f2; color: #0a383c; }

/* Контейнер для картинки */
.hero-art {
    opacity: 0.85;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 55%;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    pointer-events: none;
    z-index: 0;
}

/* Сама картинка с маской */
.hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    display: block;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 40%);
    mask-image: linear-gradient(to right, transparent 0%, black 40%);
}

.popular { margin: 0 0 56px; }
.popular-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.popular-head h2 { font-size: 28px; margin: 0; font-weight: 700; color: #013e46; }
.see-all { color: #017a8b; text-decoration: none; font-weight: 600; font-size: 14px; }
.see-all:hover { text-decoration: underline; }

/* Используем auto-fill вместо auto-fit, чтобы карточки не растягивались при малом количестве */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px;
    width: 100%;
}
.work-tile { text-decoration: none; color: inherit; display: block; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,23,42,.06); transition: transform .15s, box-shadow .15s; }
.work-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15,23,42,.1); }
.work-tile-thumb { aspect-ratio: 16 / 10; background: #f1f5f9; overflow: hidden; position: relative; }
.work-tile-thumb img, .work-tile-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-placeholder { width: 100%; height: 100%; background: linear-gradient(120deg, #e2e8f0, #cbd5e1); }
.work-tile-meta { padding: 12px 14px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.work-tile-title { font-weight: 600; color: #0f172a; font-size: 15px; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.work-tile-author { color: #017a8b; font-size: 13px; font-weight: 500; }

/* Популярные студенты */
.popular-students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 24px;
    width: 100%;
}
.student-tile { display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff; border-radius: 14px; padding: 24px 16px; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(15,23,42,.06); transition: transform 0.15s, box-shadow 0.15s; }
.student-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15,23,42,.1); }
.student-tile-avatar { width: 90px; height: 90px; border-radius: 50%; overflow: hidden; margin-bottom: 16px; border: 3px solid #eef2f7; background: #f1f5f9; }
.student-tile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-tile-info h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: #0f172a; }
.student-tile-group { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.student-tile-stats { font-size: 12px; color: #017a8b; font-weight: 600; background: #e6f2f3; padding: 4px 10px; border-radius: 10px; display: inline-block; }

/* Новости на главной */
.news-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 24px;
    width: 100%;
}
.news-tile { display: flex; flex-direction: column; background: #fff; border-radius: 14px; padding: 22px; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(15,23,42,.06); transition: transform 0.15s, box-shadow 0.15s; border-top: 4px solid #017a8b; }
.news-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15,23,42,.1); }
.news-tile-date { font-size: 12px; color: #94a3b8; margin-bottom: 10px; font-weight: 500; }
.news-tile-title { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 10px; line-height: 1.3; }
.news-tile-desc { font-size: 14px; color: #475569; line-height: 1.5; margin: 0; flex-grow: 1; }

/* =========================================================
   PORTFOLIO PAGE (DESKTOP)
   ========================================================= */
.banner {
    height: 160px;
    background: linear-gradient(135deg, #0b3a3d 0%, #0d7377 45%, #4fb3bf 100%);
    background-size: cover;
    background-position: center;
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

.hero-card {
    background: #fff;
    border-radius: 0 0 16px 16px;
    padding: 0 26px 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 18px;
}

.hero-row {
    display: flex;
    gap: 22px;
    align-items: flex-end;
    margin-top: -65px;
    position: relative;
}

/* Аватар на ПК */
.avatar, .avatar-placeholder {
    width: 130px; height: 130px;
    border-radius: 50%; border: 5px solid #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.1); flex-shrink: 0;
}
.avatar { background-size: cover; background-position: center; }
.avatar-placeholder { background: #0d7377; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 600; }

/* Текст на ПК */
.hero-info { flex: 1; padding-bottom: 6px; text-align: left; }
.hero-info h1 { margin: 0 0 6px; font-size: 26px; color: #0f172a; font-weight: 700; }
.hero-info .sub { color: #64748b; font-size: 14px; line-height: 1.5; }

/* Кнопки на ПК */
.hero-actions { display: flex; gap: 10px; padding-bottom: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hero-actions .btn { padding: 10px 18px; font-size: 14px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: #017a8b; color: #fff; border: 1.5px solid #017a8b; }
.btn-primary:hover { background: #0a5a5d; border-color: #0a5a5d; }
.hero-actions .btn-outline { border: 1.5px solid #017a8b; color: #017a8b; background: transparent; }
.hero-actions .btn-outline:hover { background: #e6f2f3; }

/* Статистика на ПК */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: #f8fafc; border-radius: 12px; padding: 18px 10px; margin: 18px 0 0 0; text-align: center; }
.stats > div { border-right: 1px solid #e2e8f0; }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font-size: 26px; color: #0f172a; font-weight: 700; }
.stats span { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }

.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.socials a { background: #f1f5f9; color: #0f172a; text-decoration: none; padding: 6px 12px; border-radius: 16px; font-size: 13px; transition: background .15s; }
.socials a:hover { background: #0d7377; color: #fff; }

/* Вкладки портфолио */
.tabs { display: flex; gap: 26px; border-bottom: 2px solid #e2e8f0; margin: 12px 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 0; color: #64748b; text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: #0d7377; border-color: #0d7377; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Карточки работ и достижений */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.work-card { position: relative; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: transform .15s, box-shadow .15s; }
.work-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.work-thumb { aspect-ratio: 16/10; background: #0f172a; position: relative; overflow: hidden; cursor: zoom-in; }
.work-thumb img, .work-thumb video, .work-thumb iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.work-thumb .badge-video { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 10px; }
.work-thumb .video-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: #fff; font-size: 16px; background: #0f172a; }
.work-body { padding: 14px 16px; }
.work-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.work-body h4 { margin: 0 0 4px; font-size: 15px; }
.work-body .cat { color: #0d7377; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.work-body .date { color: #94a3b8; font-size: 12px; margin-top: 4px; }
.work-body .desc { color: #475569; font-size: 13px; margin-top: 8px; line-height: 1.45; }

.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.ach-card { position: relative; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ach-thumb { aspect-ratio: 4/3; background: #f1f5f9; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.ach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ach-thumb .pdf-icon { font-size: 44px; color: #dc2626; font-weight: 700; }
.ach-body { padding: 12px 14px; }
.ach-body h4 { margin: 0 0 4px; font-size: 14px; }
.ach-body .date { color: #94a3b8; font-size: 12px; }
.ach-body .desc { color: #475569; font-size: 13px; margin-top: 6px; }
.ach-kind { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #017a8b; font-weight: 700; margin-bottom: 4px; }
a.work-card, a.ach-card { text-decoration: none; color: inherit; display: block; cursor: pointer; }

/* Меню карточек (три точки) */
.card-menu { position: relative; }
.card-menu-btn { background: transparent; color: #64748b; border: 0; width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.card-menu-btn:hover { background: #f1f5f9; color: #0f172a; }
.card-menu-list { display: none; position: absolute; top: 32px; right: 0; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); min-width: 150px; overflow: hidden; z-index: 20; }
.card-menu.open .card-menu-list { display: block; }
.card-menu-list button { display: block; width: 100%; text-align: left; background: transparent; color: #0f172a; border: 0; padding: 10px 14px; font-size: 14px; cursor: pointer; border-radius: 0; font-weight: 500; }
.card-menu-list button:hover { background: #f1f5f9; }
.card-menu-list button.danger { color: #dc2626; }
.card-menu-list button.danger:hover { background: #fee2e2; }

/* Модалки добавления и редактирования */
.add-toggle { display: inline-block; margin-bottom: 14px; }
.add-form { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; margin-bottom: 20px; display: none; }
.add-form.open { display: block; }
.edit-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.75); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.edit-panel { position: relative; background: #fff; border-radius: 12px; padding: 24px; width: min(640px,100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.edit-panel h3 { margin-top: 0; }
.edit-close { position: absolute; top: 8px; right: 8px; background: transparent; color: #64748b; border: 0; width: 32px; height: 32px; font-size: 20px; cursor: pointer; border-radius: 8px; }
.edit-close:hover { background: #f1f5f9; }

/* Формы с медиа */
.multi-form .hint { color: #94a3b8; font-size: 12px; margin: 4px 0 12px; }
.url-row { display: flex; gap: 6px; margin-bottom: 6px; }
.url-row input { flex: 1; }
.url-remove { background: #f1f5f9; color: #dc2626; border: 0; width: 36px; border-radius: 8px; font-size: 16px; cursor: pointer; }
.url-remove:hover { background: #fee2e2; }

.media-preview, .media-sortable { list-style: none; padding: 0; margin: 0; }
.media-preview:empty { display: none; }
.media-preview li, .media-sortable li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 6px; cursor: grab; user-select: none; min-height: 56px; max-height: 70px; overflow: hidden; }
.media-preview li.dragging, .media-sortable li.dragging { opacity: .4; }
.media-preview .drag, .media-sortable .drag { color: #94a3b8; cursor: grab; font-size: 14px; flex-shrink: 0; }
.media-preview .type, .media-sortable .type { font-size: 11px; color: #64748b; text-transform: uppercase; min-width: 44px; flex-shrink: 0; }
.media-preview .thumb, .media-sortable .thumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; max-height: 54px; }
.media-preview .thumb img, .media-sortable .thumb img, .media-preview .thumb video, .media-sortable .thumb video { max-height: 50px; max-width: 80px; width: auto; height: auto; object-fit: cover; border-radius: 4px; display: block; flex-shrink: 0; background: #e2e8f0; }
.media-preview .fname, .media-sortable .fname { font-size: 13px; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.media-preview .fsize, .media-sortable .fsize { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.media-preview .url, .media-sortable .url { font-size: 12px; color: #0d7377; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.media-preview .rm-file, .media-sortable .rm-file { background: #f1f5f9; border: 0; width: 28px; height: 28px; border-radius: 50%; color: #dc2626; font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.media-preview .rm-file:hover, .media-sortable .rm-file:hover { background: #fee2e2; }
.media-preview .rm, .media-sortable .rm { font-size: 12px; color: #dc2626; display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; flex-shrink: 0; }

/* Реакции и просмотры */
.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.reaction-btn { display: inline-flex; align-items: center; gap: 4px; background: #f1f5f9; color: #0f172a; border: 1.5px solid transparent; padding: 4px 10px; border-radius: 16px; font-size: 14px; line-height: 1; cursor: pointer; transition: all .15s; font-family: inherit; font-weight: 400; }
.reaction-btn:hover { background: #e2e8f0; transform: scale(1.05); }
.reaction-btn.active { background: #e0f2f2; border-color: #0d7377; color: #0d7377; font-weight: 600; }
.reaction-btn .emoji { font-size: 15px; line-height: 1; }
.reaction-btn .count { font-size: 12px; min-width: 8px; text-align: center; }
.reaction-btn.active .count { color: #0d7377; }
.views { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.views::before { content: '👁 '; margin-right: 4px; }
#share-btn.copied { background: #0d7377; color: #fff; border-color: #0d7377; }

/* Полноэкранная галерея */
/* Полноэкранная галерея */
.viewer { position: fixed; inset: 0; display: none; z-index: 1000; align-items: center; justify-content: center; }
.viewer.open { display: flex; }

.viewer-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.85); backdrop-filter: blur(3px); }

/* Панель на 90% экрана */
.viewer-panel {
    position: relative;
    background: #fff;
    border-radius: 14px;
    width: 90vw !important;      /* Ширина 90% от экрана */
    max-width: 1600px;           /* Максимальная ширина */
    height: 90vh !important;     /* Высота 90% от экрана */
    max-height: 900px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
    z-index: 1;
}

/* Сцена, где отображается контент */
.viewer-stage {
    position: relative;
    flex: 1;                     /* Занимает всё доступное пространство */
    min-height: 0;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.viewer-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Изображения и видео на весь экран */
.viewer-content img,
.viewer-content video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* PDF-файл (iframe) на весь экран */
.viewer-content iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Мета-информация внизу */
.viewer-meta {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    max-height: 220px;
    overflow-y: auto;
    flex-shrink: 0;
}
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.55); color: #fff; border: 0; width: 44px; height: 64px; font-size: 30px; cursor: pointer; z-index: 3; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: background .15s; }
.viewer-nav:hover { background: rgba(0,0,0,.8); }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-counter { position: absolute; bottom: 10px; right: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 12px; z-index: 3; }
.viewer-meta h3 { margin: 0 0 4px; font-size: 16px; }
.viewer-cat { color: #0d7377; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.viewer-desc { color: #475569; font-size: 13px; margin: 6px 0 0; line-height: 1.45; white-space: pre-wrap; }
.viewer-footer { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0; }
.viewer-views { font-size: 13px; color: #64748b; }
.viewer-views::before { content: '👁 '; margin-right: 4px; }
.viewer-reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer-reactions .reaction-btn { background: #f1f5f9; color: #0f172a; border: 1.5px solid transparent; padding: 4px 10px; border-radius: 16px; font-size: 13px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all .15s; font-family: inherit; }
.viewer-reactions .reaction-btn:hover { background: #e2e8f0; transform: scale(1.05); }
.viewer-reactions .reaction-btn.active { background: #e0f2f2; border-color: #0d7377; color: #0d7377; font-weight: 600; }
.viewer-close { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(0,0,0,.55); color: #fff; border: 0; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.viewer-close:hover { background: rgba(0,0,0,.8); }

/* Страница отдельной работы */
.single-work { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.back-link { display: inline-block; color: #017a8b; text-decoration: none; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.back-link:hover { text-decoration: underline; }
.single-work-title { font-size: 32px; margin: 0 0 10px; font-weight: 800; color: #013e46; line-height: 1.2; }
.single-work-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: #64748b; font-size: 14px; margin-bottom: 14px; }
.single-work-meta .cat { color: #017a8b; font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.single-work-meta .author a { color: #017a8b; text-decoration: none; font-weight: 600; }
.single-work-meta .author a:hover { text-decoration: underline; }
.single-work-desc { color: #334155; font-size: 15px; line-height: 1.6; white-space: pre-wrap; margin: 0 0 20px; }
.single-work-gallery { background: #0f172a; border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.single-work-stage { position: relative; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.single-work-content { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.single-work-content img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.single-work-content video { max-width: 100%; max-height: 100%; display: block; background: #000; }
.single-work-content iframe { width: 100%; height: 100%; border: 0; display: block; }
.single-work-footer { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding-top: 14px; border-top: 1px solid #e2e8f0; }

/* Секции портфолио (аккордеон) */
.portfolio-sections { margin: 24px 0; }
.psec { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 14px; overflow: hidden; border: 1px solid #eef2f7; }
.psec-head { cursor: pointer; padding: 18px 24px; font-weight: 700; font-size: 17px; color: #013e46; display: flex; align-items: center; justify-content: space-between; list-style: none; user-select: none; transition: background .15s; }
.psec-head::-webkit-details-marker { display: none; }
.psec-head::after { content: '▾'; font-size: 14px; color: #017a8b; transition: transform .2s; }
.psec[open] .psec-head::after { transform: rotate(180deg); }
.psec-head:hover { background: #f8fafc; }
.psec-body { padding: 8px 24px 24px; border-top: 1px solid #eef2f7; }
.subsec-title { font-size: 15px; margin: 18px 0 10px; color: #017a8b; font-weight: 700; }
.psec-desc { color: #64748b; font-size: 14px; margin: 8px 0 16px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid #eef2f7; vertical-align: top; font-size: 14px; }
.info-table th { width: 35%; color: #64748b; font-weight: 600; }

/* =========================================================
   SEARCH PAGES
   ========================================================= */
.search-mini { display: flex; align-items: center; background: #f1f5f9; border-radius: 999px; padding: 2px 4px 2px 14px; transition: background .15s; }
.search-mini:focus-within { background: #e6f2f3; box-shadow: 0 0 0 2px rgba(1,122,139,.15); }
.search-mini-input { width: 0; padding: 0; border: 0; background: transparent; font-size: 14px; outline: none; transition: width .2s, padding .2s; color: #0f172a; }
.search-mini-input::placeholder { color: #94a3b8; }
.search-mini:hover .search-mini-input, .search-mini:focus-within .search-mini-input { width: 180px; padding: 6px 4px; }
.search-mini .icon-btn { padding: 6px 8px; }

.search-form { display: flex; gap: 10px; align-items: center; }
.search-form input[type=text] { flex: 1; font-size: 15px; }
.search-section { font-size: 20px; margin: 24px 0 14px; color: #013e46; display: flex; align-items: center; gap: 10px; }
.search-count { background: #e6f2f3; color: #017a8b; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }

.search-users { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.search-user { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(15,23,42,.06); transition: transform .15s, box-shadow .15s; }
.search-user:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.1); }
.search-user-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #e2e8f0; flex-shrink: 0; }
.search-user-name { display: block; font-weight: 600; color: #0f172a; font-size: 14px; line-height: 1.2; }
.search-user-sub { display: block; color: #94a3b8; font-size: 12px; margin-top: 2px; }

.portfolio-search { display: flex; align-items: center; gap: 4px; margin-left: auto; background: #f1f5f9; border-radius: 999px; padding: 2px 4px 2px 12px; flex-shrink: 0; }
.portfolio-search input { width: 0; border: 0; background: transparent; padding: 0; font-size: 13px; outline: none; transition: width .2s, padding .2s; }
.portfolio-search:hover input, .portfolio-search:focus-within input { width: 160px; padding: 5px 4px; }
.portfolio-search button { background: transparent; border: 0; padding: 5px 8px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.portfolio-search button:hover { background: #e6f2f3; }
.portfolio-search button img { width: 18px; height: 18px; display: block; filter: brightness(0) saturate(100%) invert(16%) sepia(38%) saturate(2172%) hue-rotate(160deg) brightness(94%) contrast(101%); }

.search-news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 30px; }
.search-news-card { display: flex; gap: 16px; background: #fff; border-radius: 12px; padding: 16px; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: transform 0.15s, box-shadow 0.15s; }
.search-news-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.search-news-thumb { width: 100px; height: 100px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #e2e8f0; }
.search-news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search-news-body { display: flex; flex-direction: column; justify-content: center; }
.search-news-date { font-size: 12px; color: #94a3b8; margin-bottom: 4px; }
.search-news-title { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0 0 6px; line-height: 1.3; }
.search-news-desc { font-size: 13px; color: #475569; margin: 0; line-height: 1.4; }

/* =========================================================
   ANIMATED LOGO
   ========================================================= */
.site-logo svg { height: 52px; width: auto; display: block; overflow: visible; outline: none; flex-shrink: 0; cursor: pointer; }
.site-logo svg .logo-original path { transform-box: view-box; transform-origin: center; transition: transform 850ms cubic-bezier(.2,.75,.25,1), opacity 500ms ease; }
.site-logo svg .logo-word { opacity: 0; transition: opacity 250ms ease; }
.site-logo svg .logo-word path { fill: none; stroke: #017a8b; stroke-width: 13; stroke-linecap: square; stroke-linejoin: miter; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 750ms ease; }
.site-logo svg:hover .logo-original path, .site-logo svg:focus .logo-original path, .site-logo svg.active .logo-original path { opacity: 0; }
.site-logo svg:hover .logo-word, .site-logo svg:focus .logo-word, .site-logo svg.active .logo-word { opacity: 1; }
.site-logo svg:hover .logo-word path, .site-logo svg:focus .logo-word path, .site-logo svg.active .logo-word path { stroke-dashoffset: 0; }

.site-logo svg .logo-original path:nth-child(1) { transition-delay: 0ms; } .site-logo svg .logo-original path:nth-child(2) { transition-delay: 25ms; } .site-logo svg .logo-original path:nth-child(3) { transition-delay: 50ms; } .site-logo svg .logo-original path:nth-child(4) { transition-delay: 75ms; } .site-logo svg .logo-original path:nth-child(5) { transition-delay: 100ms; } .site-logo svg .logo-original path:nth-child(6) { transition-delay: 125ms; } .site-logo svg .logo-original path:nth-child(7) { transition-delay: 150ms; } .site-logo svg .logo-original path:nth-child(8) { transition-delay: 175ms; } .site-logo svg .logo-original path:nth-child(9) { transition-delay: 200ms; } .site-logo svg .logo-original path:nth-child(10) { transition-delay: 225ms; } .site-logo svg .logo-original path:nth-child(11) { transition-delay: 250ms; }

.site-logo svg:hover .logo-original path:nth-child(1), .site-logo svg:focus .logo-original path:nth-child(1), .site-logo svg.active .logo-original path:nth-child(1) { transform: translate(-40px,-20px) scale(.8); }
.site-logo svg:hover .logo-original path:nth-child(2), .site-logo svg:focus .logo-original path:nth-child(2), .site-logo svg.active .logo-original path:nth-child(2) { transform: translate(20px,25px) scale(.8); }
.site-logo svg:hover .logo-original path:nth-child(3), .site-logo svg:focus .logo-original path:nth-child(3), .site-logo svg.active .logo-original path:nth-child(3) { transform: translate(-15px,-25px) rotate(-8deg); }
.site-logo svg:hover .logo-original path:nth-child(4), .site-logo svg:focus .logo-original path:nth-child(4), .site-logo svg.active .logo-original path:nth-child(4) { transform: translate(25px,-15px) rotate(7deg); }
.site-logo svg:hover .logo-original path:nth-child(5), .site-logo svg:focus .logo-original path:nth-child(5), .site-logo svg.active .logo-original path:nth-child(5) { transform: translate(35px,-30px) scale(.85); }
.site-logo svg:hover .logo-original path:nth-child(6), .site-logo svg:focus .logo-original path:nth-child(6), .site-logo svg.active .logo-original path:nth-child(6) { transform: translate(45px,20px) scale(.8); }
.site-logo svg:hover .logo-original path:nth-child(7), .site-logo svg:focus .logo-original path:nth-child(7), .site-logo svg.active .logo-original path:nth-child(7) { transform: translate(-20px,10px) rotate(10deg); }
.site-logo svg:hover .logo-original path:nth-child(8), .site-logo svg:focus .logo-original path:nth-child(8), .site-logo svg.active .logo-original path:nth-child(8) { transform: translate(20px,25px) rotate(-7deg); }
.site-logo svg:hover .logo-original path:nth-child(9), .site-logo svg:focus .logo-original path:nth-child(9), .site-logo svg.active .logo-original path:nth-child(9) { transform: translate(-30px,30px) scale(.8); }
.site-logo svg:hover .logo-original path:nth-child(10), .site-logo svg:focus .logo-original path:nth-child(10), .site-logo svg.active .logo-original path:nth-child(10) { transform: translate(35px,25px) scale(.8); }
.site-logo svg:hover .logo-original path:nth-child(11), .site-logo svg:focus .logo-original path:nth-child(11), .site-logo svg.active .logo-original path:nth-child(11) { transform: translate(-10px,30px) rotate(6deg); }

@media (prefers-reduced-motion: reduce) { .site-logo svg * { transition-duration: .01ms !important; } }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    background: #f8fafc;
    color: #334155;
    padding: 60px 20px 20px;
    margin-top: 60px;
    flex-shrink: 0;
    font-size: 14px;
    border-top: 1px solid #e2e8f0;
}
.footer-content { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: #013e46; font-size: 16px; font-weight: 700; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: #013e46; font-size: 20px; font-weight: 800; }
.footer-logo { height: 40px; width: auto; }
.footer-desc { line-height: 1.6; color: #64748b; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #334155; text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: #017a8b; text-decoration: underline; }
.footer-contacts { list-style: none; padding: 0; margin: 0; }
.footer-contacts li { display: flex; gap: 12px; margin-bottom: 16px; line-height: 1.5; }
.footer-contacts svg { flex-shrink: 0; margin-top: 3px; color: #017a8b; }
.footer-contacts a { color: #334155; text-decoration: none; transition: color 0.2s; }
.footer-contacts a:hover { color: #017a8b; }
.footer-contacts small { color: #94a3b8; font-size: 12px; }
.footer-bottom { max-width: 1100px; margin: 0 auto; padding-top: 20px; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; color: #94a3b8; font-size: 13px; }
.footer-bottom p { margin: 0; }

/* =========================================================
   MOBILE ADAPTATION (MAIN)
   ========================================================= */
@media (max-width: 810px) {
    /* 1. Компактная шапка */
    .site-header { padding: 10px 16px; gap: 10px; flex-wrap: nowrap; justify-content: space-between; }
    .site-nav { display: none; }

    .site-logo-text { display: flex; font-size: 9px; line-height: 1.2; }
    .site-logo svg { height: 36px; }

    .site-actions { gap: 8px; }
    .search-mini { padding: 0; background: transparent; }
    .search-mini-input { display: none; }
    .search-mini .icon-btn { padding: 6px; }
    .user-chip { width: 32px; height: 32px; border-width: 2px; }

    .mobile-hide { display: none !important; }

    /* 2. Нижнее меню с бейджем */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid #eef2f7;
        justify-content: space-around;
        padding: 10px 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: #64748b; font-size: 11px; font-weight: 500; }
    .mobile-nav-item img { width: 24px; height: 24px; object-fit: contain; opacity: 0.6; }
    .mobile-nav-item.active { color: #017a8b; }
    .mobile-nav-item.active img { opacity: 1; filter: brightness(0) saturate(100%) invert(28%) sepia(31%) saturate(1193%) hue-rotate(140deg) brightness(92%) contrast(94%); }

    .mobile-nav-icon-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
    .mobile-nav-icon-wrap .notif-badge { top: -6px; right: -6px; padding: 1px 4px; font-size: 9px; border-width: 1px; }

    body { padding-bottom: 70px; }
    .site-footer { display: none; }

    /* 3. Портфолио (дизайн с макета) */
    :root { --teal: #087d86; --ink: #172c43; --muted: #74828d; --line: #dce5e8; --surface: #ffffff; --page: #f2f6f7; }
    body { background: var(--page); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }

    /* ГЛОБАЛЬНЫЕ ОТСТУПЫ ДЛЯ МОБИЛЬНЫХ */
    .container { padding: 0 16px !important; margin: 0 !important; }
    .card { margin: 0 0 16px 0 !important; border-radius: 16px !important; border: none !important; box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important; }
    .single-work { padding: 0 16px !important; }
    .dashboard-container { padding: 0 16px !important; }
    .news-content, .news-tile, .search-news-card { border-radius: 12px !important; }

    /* --- ШАПКА ПРОФИЛЯ НА МОБИЛЬНЫХ --- */
    .banner {
        display: block !important;
        height: 120px;
        border-radius: 16px 16px 0 0 !important;
        margin-top: 16px !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    .hero-card {
        background: #fff !important;
        border-radius: 0 0 16px 16px !important;
        padding: 0 20px 20px 20px !important;
        margin: 0 !important;
        margin-top: 0 !important;
        position: relative;
        z-index: 2;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    }

    .hero-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0 !important;
        margin-top: -50px !important;
        text-align: center !important;
    }

    .profile-avatar-box {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 12px !important;
        border-radius: 50% !important;
        border: 4px solid #fff !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
        background: #fff;
    }
    .profile-avatar-box .avatar,
    .profile-avatar-box .avatar-placeholder {
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        border-radius: 50% !important;
        font-size: 36px !important;
    }

    .profile-info {
        width: 100%;
        margin-bottom: 16px !important;
    }
    .profile-info h1 {
        font-size: 22px !important;
        margin-bottom: 4px !important;
        color: #172c43 !important;
        font-weight: 700;
        text-align: center !important;
    }
    .profile-info .sub {
        font-size: 13px !important;
        color: #74828d !important;
        text-align: center !important;
    }

    /* Кнопки на мобильных */
    .profile-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .profile-actions .btn {
        flex: 1 !important;
        justify-content: center !important;
        padding: 10px 12px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
        border-radius: 8px !important;
        font-weight: 600 !important;
    }

    .profile-actions .btn-primary {
        background: #017a8b !important;
        color: #fff !important;
        border: 1px solid #017a8b !important;
    }

    .profile-actions .btn-outline {
        background: transparent !important;
        border: 1px solid #017a8b !important;
        color: #017a8b !important;
    }

    .profile-actions .btn svg { display: none; }

    /* Статистика */
    .stats {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        background: #fff !important;
        border-radius: 12px !important;
        padding: 16px 10px !important;
        margin: 16px 0 0 0 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important;
        gap: 8px;
    }
    .stats > div { border: none !important; background: #f8fafc; border-radius: 8px; padding: 10px 0; }
    .stats b { font-size: 20px !important; color: #017a8b !important; }
    .stats span { font-size: 11px !important; text-transform: none !important; }

    /* Вкладки (пилюли) и Поиск */
    .tabs-wrapper {
        margin: 24px 0 20px !important;
        padding: 0 !important;
        overflow-x: visible !important;
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        border: none !important;
        margin: 0 !important;
        width: 100%;
    }
    .tabs a {
        background: #fff !important;
        border: 1px solid #dce5e8 !important;
        border-radius: 20px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        color: #74828d !important;
        text-decoration: none !important;
        white-space: normal !important;
        font-weight: 500 !important;
        margin-bottom: 0 !important;
        flex: 1 1 auto;
        text-align: center;
    }
    .tabs a.active { background: #087d86 !important; color: #fff !important; border-color: #087d86 !important; font-weight: 600 !important; }

    /* Поиск внутри портфолио */
    .portfolio-search {
        display: flex !important;
        width: 100% !important;
        margin-left: 0 !important;
        background: #fff !important;
        border: 1px solid #dce5e8 !important;
        border-radius: 12px !important;
        padding: 8px 12px !important;
        box-sizing: border-box;
    }
    .portfolio-search input { width: 100% !important; padding: 0 8px !important; display: block !important; border: none; outline: none; background: transparent; }
    .portfolio-search button img { width: 18px; height: 18px; opacity: 0.6; }

    /* Модалка просмотра на мобильных */
    .viewer-panel {
        width: 100vw !important;
        height: calc(100dvh - 70px) !important;
        max-height: calc(100dvh - 70px) !important;
        border-radius: 0 !important;
        max-width: 100vw !important;
        position: fixed;
        bottom: 70px;
        left: 0;
        display: flex;
        flex-direction: column;
        z-index: 2000;
    }
    .viewer-stage { flex: 1 !important; min-height: 0; }
    .viewer-meta {
        max-height: 250px !important;
        padding: 16px !important;
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        background: #fff;
    }
    .viewer-meta h3, .viewer-meta .viewer-cat { flex-shrink: 0; }
    .viewer-desc { flex: 1; overflow-y: auto; margin-bottom: 8px; min-height: 0; }
    .viewer-footer { flex-shrink: 0; margin-top: 0 !important; border-top: 1px solid #e2e8f0; padding-top: 10px; }
    .viewer-reactions { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; min-height: 30px; }

    /* Личная информация (Карточки) */
    .info-card { padding: 20px !important; margin: 0 !important; }
    .info-row { display: flex !important; flex-direction: column !important; border-bottom: 1px solid #dce5e8 !important; padding: 12px 0 !important; text-align: left !important; }
    .info-row:last-child { border-bottom: none !important; }
    .info-row span { font-size: 11px !important; color: #74828d !important; text-transform: uppercase !important; margin-bottom: 4px !important; }
    .info-row strong { font-size: 14px !important; color: #172c43 !important; }
    .info-block h4 { font-size: 14px !important; color: #087d86 !important; margin: 20px 0 8px !important; text-align: left !important; }
    .info-block p { font-size: 14px !important; line-height: 1.5 !important; text-align: left !important; }

    /* Карточки работ и достижений (2 колонки, квадраты) */
    .works-grid, .ach-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; padding: 0 !important; }
    .work-card, .ach-card { border-radius: 12px !important; border: none !important; box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important; overflow: hidden !important; background: #fff !important; }
    .work-thumb, .ach-thumb { aspect-ratio: 1/1 !important; border-radius: 12px 12px 0 0 !important; }
    .work-body, .ach-body { padding: 10px 12px !important; }

    /* Заголовок карточки: максимум 2 строки */
    .work-body h4, .ach-body h4 {
        font-size: 13px !important; font-weight: 700 !important; color: #172c43 !important;
        margin: 0 0 4px !important; line-height: 1.3 !important;
        display: -webkit-box !important; -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important; overflow: hidden !important;
    }
    .work-body .cat, .ach-body .date { font-size: 11px !important; color: #74828d !important; margin-top: 4px !important; }

    /* Кнопка добавить */
    .add-toggle { width: 100% !important; margin: 10px 0 20px !important; background: #087d86 !important; color: #fff !important; border-radius: 10px !important; padding: 14px !important; font-size: 14px !important; font-weight: 600 !important; border: none !important; text-align: center !important; }

    /* Заголовки страниц (Дашборд, Админка, Новости) */
    h1, h2 { font-size: 22px !important; margin-bottom: 16px !important; }

    /* =========================================================
       ГЛАВНАЯ СТРАНИЦА (HERO И КАРУСЕЛИ)
       ========================================================= */

    .page-wide {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 16px !important;
        max-width: 100% !important;
    }
    /* Hero секция */
    .hero {
        display: flex !important;
        flex-direction: column !important;
        padding: 24px !important;
        position: relative;
        overflow: hidden;
        background: #013e46;
        border-radius: 16px;
        margin-top: 16px;
        margin-bottom: 24px;
    }

    .hero-text { z-index: 2; position: relative; width: 100%; }
    .hero-text h1 { font-size: 32px !important; line-height: 1.1; margin-bottom: 12px; }
    .hero-text p { font-size: 14px !important; max-width: 85%; margin-bottom: 20px; }

    .hero-btn {
        display: inline-block;
        width: auto;
        padding: 10px 16px !important;
        font-size: 14px !important;
        white-space: nowrap;
    }

    /* Картинка балерины на фоне */
    .hero-art {
        display: block !important;
        position: absolute;
        bottom: 0;
        right: -20px;
        width: 60% !important;
        height: 100%;
        opacity: 0.6;
        z-index: 1;
        pointer-events: none;
    }
    .hero-art img { object-position: right bottom; }

    /* Заголовки секций и ссылки "Смотреть все" */
    .popular { margin-bottom: 32px !important; }
    .popular-head {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px !important;
    }
    .popular-head h2 {
        font-size: 22px !important;
        line-height: 1.2;
        margin: 0 !important;
        max-width: 65%;
    }
    .see-all {
        flex-shrink: 0;
        font-size: 13px !important;
        padding-top: 4px;
    }

    /* Горизонтальный скролл для карточек ТОЛЬКО на главной (index-page) */
    .index-page .popular-grid,
    .index-page .popular-students-grid,
    .index-page .news-grid-home {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        padding-bottom: 12px;
        
        /* Убираем отрицательные марджины */
        margin-left: 0 !important;
        margin-right: 0 !important;
        
        /* Оставляем только внутренний отступ */
        scroll-padding-left: 16px;
    }

    /* Прячем полосу прокрутки для главной */
    .index-page .popular-grid::-webkit-scrollbar,
    .index-page .popular-students-grid::-webkit-scrollbar,
    .index-page .news-grid-home::-webkit-scrollbar {
        display: none;
    }

    /* Карточки на главной: ширина 42%, чтобы 2 + чуть-чуть третьей влезало на экран */
    .index-page .work-tile, 
    .index-page .student-tile, 
    .index-page .news-tile {
        flex: 0 0 42% !important;
        scroll-snap-align: start;
        min-width: 0;
        max-width: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Настройки карточек работ на главной */
    .index-page .work-tile-thumb { aspect-ratio: 1 / 1 !important; border-radius: 12px !important; overflow: hidden; width: 100%; }
    .index-page .work-tile-meta { padding: 10px 4px !important; }
    .index-page .work-tile-title {
        font-size: 13px !important;
        white-space: normal !important; 
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important; 
        -webkit-box-orient: vertical !important;
        text-overflow: ellipsis !important;
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
    }
    .index-page .work-tile-author { font-size: 12px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* Студенты на главной */
    .index-page .student-tile { padding: 16px 8px !important; }
    .index-page .student-tile-avatar { width: 70px !important; height: 70px !important; margin-bottom: 10px !important; }
    .index-page .student-tile-info h4 {
        font-size: 13px !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        line-height: 1.3 !important;
        text-align: center;
    }
    .index-page .student-tile-group {
        font-size: 12px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }
    .index-page .student-tile-stats { font-size: 11px !important; padding: 4px 8px !important; }

    /* Новости на главной */
    .index-page .news-tile { border-radius: 12px !important; padding: 0 !important; overflow: hidden; }
    .index-page .news-tile > div[style*="padding:22px"] { padding: 12px !important; }
    .index-page .news-tile-title {
        font-size: 14px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    .index-page .news-tile-date { font-size: 11px !important; margin-bottom: 4px !important; }
}

@media (max-width: 520px) {
    .hero-row { flex-direction: column; align-items: center; text-align: center; }
    .viewer-close { top: 6px; right: 6px; }
    .popular-grid, .popular-students-grid, .news-grid-home { grid-template-columns: 1fr; }
    .hero-text h1 { font-size: 30px; }
    .hero-text p { font-size: 15px; }
    .hero-art { display: none; }
    .search-users { grid-template-columns: 1fr; }
    .single-work-title { font-size: 22px; }
}

/* =========================================================
   BEAUTIFIED ADD FORM (LIKE MOCKUP)
   ========================================================= */
.beautified-form {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    background: #fff;
    padding: 0;
    border: none;
    box-shadow: none;
}

.form-left { display: flex; flex-direction: column; gap: 20px; }
.form-right { display: flex; flex-direction: column; background: #f8fafc; padding: 24px; border-radius: 16px; border: 1px solid #e2e8f0; }

/* Красивая зона загрузки */
.upload-zone {
    border: 2px dashed #80cfd6;
    border-radius: 16px;
    background: #f0fbfb;
    transition: all 0.2s;
    position: relative;
    text-align: center;
}
.upload-zone:hover { background: #e6f7f8; border-color: #017a8b; }
.hidden-input { display: none; }
.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    cursor: pointer;
    margin: 0;
}
.upload-icon { font-size: 32px; color: #017a8b; margin-bottom: 12px; }
.upload-title { font-weight: 600; font-size: 15px; color: #017a8b; line-height: 1.3; margin-bottom: 8px; }
.upload-hint { font-size: 12px; color: #64748b; font-weight: 400; }

/* Поля ввода */
.beautified-form label { font-size: 14px; color: #334155; margin-bottom: 6px; }
.beautified-form input, .beautified-form select, .beautified-form textarea {
    background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px 14px;
    font-size: 14px; transition: border-color 0.2s;
}
.beautified-form input:focus, .beautified-form select:focus, .beautified-form textarea:focus {
    border-color: #017a8b; outline: none; box-shadow: 0 0 0 3px rgba(1, 122, 139, 0.1);
}

/* Блок предпросмотра */
.preview-box {
    width: 100%;
    aspect-ratio: 16/10;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.preview-box img, .preview-box video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.preview-placeholder {
    color: #94a3b8; font-size: 13px; text-align: center; padding: 20px;
}

/* Миниатюры */
.thumbnail-list {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
    margin: 0; list-style: none;
}
.thumbnail-list li {
    width: 80px; height: 80px; flex-shrink: 0; border-radius: 8px; overflow: hidden;
    cursor: pointer; border: 2px solid transparent; position: relative;
    background: #e2e8f0; padding: 0; display: block;
}
.thumbnail-list li img, .thumbnail-list li video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.thumbnail-list li.active { border-color: #017a8b; box-shadow: 0 0 0 2px rgba(1,122,139,0.2); }

/* Теги */
.tags-input-wrap { position: relative; }
.tags-input { width: 100%; padding-right: 40px !important; }
.tags-counter { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #94a3b8; }

/* Кнопки */
.form-bottom-actions {
    display: flex; gap: 12px; margin-top: auto; padding-top: 24px;
}
.form-bottom-actions .btn { flex: 1; justify-content: center; padding: 12px; font-size: 15px; border-radius: 10px; }

/* Мобильная адаптация */
@media (max-width: 810px) {
    .beautified-form { grid-template-columns: 1fr; gap: 20px; }
    .form-right { padding: 16px; }
    .form-bottom-actions { flex-direction: column-reverse; }
}

/* Авторизация на телефоне */
@media (max-width: 810px) {
    .auth-page-wrapper {
        justify-content: center;
        align-items: center;
        padding-top: 20px;
        padding-bottom: 90px;
        min-height: calc(100vh - 74px);
        overflow-y: auto;
        background-image: url('../img/bg-auth-mobile.png');
        background-position: center;
        padding-left: 16px;
        padding-right: 16px;
    }
    .auth-form-box {
        margin: 0;
        width: 100%;
        max-width: 400px;
        border-radius: 16px;
        padding: 24px 20px;
        margin-bottom: 0;
    }
    .auth-form-box .auth-form-title { margin-bottom: 16px; font-size: 18px; }
    .auth-form-box .auth-input { padding: 14px 16px; font-size: 15px; margin-bottom: 10px; }
    .auth-form-box .auth-btn { padding: 14px; font-size: 15px; }
}

/* Кнопка добавления (ссылка) */
a.add-toggle {
    background: #017a8b;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
    margin-bottom: 20px;
}
a.add-toggle:hover {
    background: #0a5a5d;
    color: #fff;
}

@media (max-width: 810px) {
    a.add-toggle {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px !important;
    }
}

/* =========================================================
   MOBILE ADMIN & NAVIGATION
   ========================================================= */
.mobile-menu-btn { display: none; background: transparent; border: 0; color: #017a8b; cursor: pointer; padding: 4px; }
.mobile-nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    flex-direction: column;
    z-index: 100;
}
.mobile-nav-dropdown.open { display: flex; }
.mobile-nav-dropdown a {
    padding: 14px 20px;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    border-bottom: 1px solid #eef2f7;
}
.mobile-nav-dropdown a:hover { background: #f8fafc; }

@media (max-width: 810px) {
    /* Показываем бургер */
    .mobile-menu-btn { display: block; }

    /* Сдвигаем логотип, чтобы влез бургер */
    .site-header { gap: 12px; padding: 10px 16px; position: relative; }
    .site-logo-text { display: flex !important; font-size: 9px !important; line-height: 1.2 !important; }
    .site-logo svg { height: 32px !important; }

    /* =========================================================
       АДАПТАЦИЯ ТАБЛИЦ АДМИНКИ (КАРТОЧКИ)
       ========================================================= */

    /* Скрываем заголовки таблиц */
    .card table thead, .card table th { display: none; }

    /* Делаем таблицу блочной */
    .card table, .card table tbody, .card table tr, .card table td {
        display: block;
        width: 100%;
    }

    /* Стили карточки */
    .card table tr {
        background: #fff;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        border: 1px solid #eef2f7;
    }

    /* Стили ячеек */
    .card table td {
        padding: 8px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px dashed #f1f5f9;
    }
    .card table td:last-child { border-bottom: none; padding-bottom: 0; }

    /* Подписи к полям слева */
    .card table td::before {
        content: attr(data-label);
        font-size: 12px;
        color: #94a3b8;
        font-weight: 600;
        text-transform: uppercase;
        text-align: left;
        margin-right: 16px;
    }

    /* Кнопки действий на всю ширину */
    .card table td[data-label="Действия"],
    .card table td[style*="flex-wrap"] {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
        padding-top: 12px;
    }
    .card table td[data-label="Действия"]::before { display: none; }

    .card table td button, .card table td .btn {
        flex: 1;
        margin: 0;
        padding: 10px !important;
        font-size: 13px !important;
        text-align: center;
        justify-content: center;
    }

    /* Форма массовых действий */
    #bulkPanel > form > div { flex-direction: column; align-items: stretch !important; }
    #bulkPanel select, #bulkPanel button { width: 100% !important; margin-top: 8px; }

    /* Чекбоксы */
    input[type="checkbox"] { width: 20px; height: 20px; margin: 0; }
}

/* =========================================================
   LARGE SCREENS ADAPTATION (2K & 4K)
   ========================================================= */

/* Для широких экранов (от 1400px) */
@media (min-width: 1400px) {
    .container {
        max-width: 90% !important; /* Растягиваем контейнер на 90% ширины экрана */
    }
    .page-wide {
        padding: 0 !important;
    }
    .hero {

    }
    .hero-text h1 {
        font-size: 64px !important;
    }
    .hero-text p {
        font-size: 20px !important;
    }

    /* Фикс гигантских карточек: auto-fill не растягивает одинокие элементы */
    .popular-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    }
    .popular-students-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }
    .news-grid-home {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    }
}

/* Для очень широких экранов (от 1900px, Full HD и выше) */
@media (min-width: 1900px) {
    .container {
        max-width: 85% !important; /* Растягиваем контейнер на 85% ширины экрана */
    }
    .hero {
        padding: 80px 100px !important;
    }
    .hero-text h1 {
        font-size: 80px !important;
    }
    .hero-text p {
        font-size: 26px !important;
    }
    .popular-head h2 {
        font-size: 36px !important;
    }
    .see-all {
        font-size: 18px !important;
    }

    .popular-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
        gap: 32px !important;
    }
    .popular-students-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
        gap: 32px !important;
    }
    .news-grid-home {
        grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)) !important;
        gap: 32px !important;
    }

    /* Увеличиваем карточки */
    .work-tile-title { font-size: 20px !important; }
    .work-tile-author { font-size: 16px !important; }
    .work-tile-meta { padding: 20px !important; }

    .student-tile-avatar { width: 120px !important; height: 120px !important; }
    .student-tile-info h4 { font-size: 20px !important; }
    .student-tile-group { font-size: 16px !important; }

    .news-tile-title { font-size: 24px !important; }
    .news-tile-desc { font-size: 18px !important; }
}

/* =========================================================
   АДАПТАЦИЯ ШАПКИ ДЛЯ ЭКРАНОВ ОТ 769 ДО 1250px
   ========================================================= */
@media (min-width: 991px) and (max-width: 1250px) {
    /* Шапка становится горизонтально прокручиваемой */
    .site-header {
        padding: 10px 16px;
        gap: 16px;
        overflow-x: auto; /* Разрешаем горизонтальный скролл */
        white-space: nowrap; /* Запрещаем перенос строк внутри */
        scrollbar-width: none; /* Прячем скроллбар в Firefox */
    }

    /* Прячем скроллбар в Chrome/Safari */
    .site-header::-webkit-scrollbar {
        display: none;
    }

    /* Логотип сжимается */
    .site-logo {
        gap: 8px;
        flex-shrink: 0;
    }
    .site-logo svg {
        height: 36px;
    }
    .site-logo-text {
        font-size: 9px;
        line-height: 1.2;
    }

    /* Навигация не сжимается и не переносится */
    .site-nav {
        gap: 16px;
        flex-shrink: 0;
    }
    .site-nav a {
        font-size: 13px;
        padding: 6px 8px;
        gap: 4px;
    }
    .nav-icon {
        width: 16px;
        height: 16px;
    }
    /* Убираем иконку "Добавить новость" в навигации, оставляем только плюс и текст */
    .site-nav a span[style*="font-size: 18px"] {
        font-size: 14px;
        margin-right: 2px;
    }

    /* Действия (поиск и профиль) не сжимаются */
    .site-actions {
        gap: 8px;
        flex-shrink: 0;
    }
    .search-mini-input {
        width: 0;
        padding: 0;
    }
    .search-mini:hover .search-mini-input,
    .search-mini:focus-within .search-mini-input {
        width: 120px;
    }
    .icon-btn img {
        width: 18px;
        height: 18px;
    }
    .user-chip {
        width: 32px;
        height: 32px;
    }
}

/* =========================================================
   АДАПТАЦИЯ ШАПКИ ДЛЯ ЭКРАНОВ 769-990px (Скрываем текст логотипа)
   ========================================================= */
@media (min-width: 810px) and (max-width: 990px) {
    /* Скрываем текст логотипа, оставляем только иконку */
    .site-logo-text {
        display: none !important;
    }

    /* Уменьшаем иконку логотипа */
    .site-logo svg {
        height: 40px;
    }

    /* Уменьшаем отступы между пунктами меню */
    .site-header {
        gap: 12px;
        padding: 10px 16px;
    }

    .site-nav {
        gap: 12px;
    }

    .site-nav a {
        font-size: 13px;
        padding: 6px 8px;
        gap: 4px;
    }

    .nav-icon {
        width: 16px;
        height: 16px;
    }

    /* Компактный поиск */
    .search-mini {
        padding: 0;
        background: transparent;
    }
    .search-mini-input {
        display: none;
    }
    .search-mini .icon-btn {
        padding: 6px;
    }

    /* Компактный профиль */
    .user-chip {
        width: 32px;
        height: 32px;
    }
}

/* Иконка PDF для карточек */
.pdf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: #f1f5f9;
    color: #dc2626;
    font-weight: bold;
    font-size: 24px;
}