/* ============================================================
   ROOT VARIABLES (общие для всех страниц)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
    --border-color: #5a5a5a;
    --bg-light: #fafaf8;
    --bg-header: #f0ece4;
    --text-dark: #2c2c2c;
    --text-muted: #555;
    --accent: #8b7d6b;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --radius: 4px;
    --font-main: 'Yu Mincho', 'MS Mincho', 'Hiragino Mincho Pro', 'Noto Serif JP',
        '游明朝', '明朝体', 'SimSun', 'Times New Roman', serif;
    --font-sans: 'Yu Gothic', 'Hiragino Kaku Gothic Pro', 'Meiryo', 'MS PGothic',
        'Arial', 'Helvetica Neue', sans-serif;
    /* Цвета друзей (для таблицы участников) */
    --friend-blue: #e3f0fc;
    --friend-green: #e6f5e9;
    --friend-yellow: #fef9e7;
    --friend-purple: #f3eafb;
    /* Цвет печатей (используется на главной) */
    --stamp-red: #c45c48;
}

/* ============================================================
   ШРИФТ ДЛЯ РУССКОГО ЯЗЫКА
   ============================================================ */
.lang-ru {
    --font-main: 'PT Serif', 'Times New Roman', serif;
    --font-sans: 'PT Serif', 'Arial', sans-serif;
}

/* ============================================================
   СБРОС И ОБЩИЕ ПРАВИЛА
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

* {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img {
    pointer-events: none;
    user-drag: none;
    -webkit-user-drag: none;
}

/* ============================================================
   BODY
   ============================================================ */
body {
    background: #e8e4dc;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.5) 0%, transparent 70%),
        linear-gradient(180deg, #e8e4dc 0%, #dcd7cd 40%, #e8e4dc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 16px 60px;
    font-family: var(--font-main);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА (общий)
   ============================================================ */
.lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.lang-switcher button {
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-family: var(--font-sans);
    color: #5a4e44;
    background: #f5f2eb;
    border: 1px solid #d5cfc4;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.lang-switcher button:hover {
    background: #e8e2d6;
    border-color: #b5ada0;
}
.lang-switcher button.active {
    background: #6b5e53;
    color: #fff;
    border-color: #6b5e53;
    box-shadow: 0 2px 6px rgba(107, 94, 83, 0.3);
}

/* ============================================================
   КОНТЕЙНЕРЫ
   ============================================================ */
.form-container,
.profile-container {
    width: 100%;
    max-width: 820px;
    background: var(--white);
    border-radius: 2px;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 36px 40px 48px;
    position: relative;
    background-color: #fdfdfc;
}

.form-container {
    background-image: repeating-linear-gradient(0deg,
            transparent,
            transparent 27px,
            rgba(180, 170, 155, 0.10) 27px,
            rgba(180, 170, 155, 0.10) 28px);
}

@media (max-width: 600px) {
    .form-container {
        padding: 24px 16px 32px;
        border-radius: 0;
        background-image: none;
        background-color: #fdfdfc;
    }
    .profile-container {
        padding: 24px 16px 32px;
        border-radius: 0;
    }
    body {
        padding: 10px 6px 40px;
    }
}

/* ============================================================
   ЗАГОЛОВКИ (главная и профиль)
   ============================================================ */
.form-title,
.profile-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 2px;
    color: #1a1a1a;
    font-family: var(--font-main);
    position: relative;
    padding-bottom: 12px;
}
.form-title::after,
.profile-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}
.form-title::after {
    width: 100px;
}
.profile-title::after {
    width: 80px;
}

.form-subtitle,
.profile-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-family: var(--font-sans);
    letter-spacing: 0.03em;
}
.profile-subtitle {
    margin-bottom: 16px;
}

/* ============================================================
   ДАТА (главная)
   ============================================================ */
.date-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin: 16px 0 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    flex-wrap: wrap;
}
.date-row span {
    font-family: var(--font-main);
    white-space: nowrap;
}
.date-row .gregorian-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    margin-left: 6px;
}
.date-row input[type="text"] {
    width: 46px;
    padding: 4px 4px;
    text-align: center;
    border: 1px solid #c5bfb3;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: var(--font-main);
    background: #fefefd;
    pointer-events: none;
    color: #3a3530;
}

/* ============================================================
   АДРЕСАТ (главная)
   ============================================================ */
.addressee {
    text-align: right;
    font-size: 1.05rem;
    margin: 6px 0 20px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #1a1a1a;
    font-family: var(--font-main);
}

/* ============================================================
   ИНФОРМАЦИОННАЯ ТАБЛИЦА (главная)
   ============================================================ */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95rem;
    table-layout: fixed;
    border: 1px solid #d5cfc4;
}
.info-table th,
.info-table td {
    border: 1px solid #d5cfc4;
    padding: 10px 12px;
    vertical-align: middle;
}
.info-table th {
    background: #f5f2eb;
    font-weight: 600;
    text-align: center;
    width: 26%;
    font-family: var(--font-main);
    letter-spacing: 0.04em;
    color: #3a3530;
    white-space: nowrap;
}
.info-table td {
    background: #fefefd;
    text-align: left;
}
.info-table .static-text {
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-dark);
}
.info-table .hashtag {
    display: inline-block;
    font-family: var(--font-sans);
    background: #f5f2eb;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-right: 10px;
}
.mirror {
    display: inline-block;
    transform: scaleX(-1);
}

/* ============================================================
   ТЕКСТОВЫЕ БЛОКИ (Purpose, Activity) - общие
   ============================================================ */
.textarea-group {
    margin-bottom: 18px;
}
.textarea-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: #3a3530;
    font-family: var(--font-main);
}
.textarea-group .label-sub {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    margin-left: 6px;
}
.static-text-display {
    width: 100%;
    min-height: 105px;
    border: 1px solid #d5cfc4;
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: var(--font-main);
    background: #f8f7f3;
    line-height: 1.7;
    color: var(--text-dark);
    cursor: default;
    overflow-y: auto;
    white-space: normal;
    word-wrap: break-word;
    transition: border-color 0.2s;
}
.static-text-display:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 125, 107, 0.08);
}
.static-text-display ul {
    margin: 4px 0 4px 20px;
    padding-left: 4px;
    list-style-type: disc;
}
.static-text-display ul li {
    margin-bottom: 2px;
}
.static-text-display p {
    margin: 0 0 8px 0;
}
.static-text-display p:last-child {
    margin-bottom: 0;
}
@media (max-width: 600px) {
    .static-text-display {
        min-height: 80px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* ============================================================
   СЕКЦИОННЫЕ ЗАГОЛОВКИ
   ============================================================ */
.section-label {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    margin: 22px 0 8px;
    color: #2c2c2c;
    font-family: var(--font-main);
    padding-left: 2px;
}

/* ============================================================
   ФОРМА ПОДАЧИ ЗАЯВКИ
   ============================================================ */
.application-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 16px;
    background: #fafaf7;
    border: 1px solid #e5dfd4;
    border-radius: var(--radius);
    margin-bottom: 14px;
}
.application-form label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #3a3530;
    font-family: var(--font-main);
    white-space: nowrap;
}
.application-form input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 7px 10px;
    border: 1px solid #d5cfc4;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-main);
    background: #fefefd;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.application-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 125, 107, 0.08);
}
.application-form .btn-submit {
    padding: 8px 20px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ============================================================
   СЕКЦИЯ СОВЕТНИКА
   ============================================================ */
.advisor-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #fafaf7;
    border: 1px solid #e5dfd4;
    border-radius: var(--radius);
}
.advisor-section label {
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: #3a3530;
    font-family: var(--font-main);
}
.advisor-section .advisor-sub {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}
.advisor-section .advisor-nickname {
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: #8b00ff;
    background: #fefefd;
    padding: 4px 10px;
    border-radius: var(--radius);
    border: 1px dashed #c5bfb3;
}
.advisor-confirmed {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 0.9rem;
    color: #2d6a4f;
    font-family: var(--font-sans);
    background: #e6f5e9;
    padding: 4px 12px;
    border-radius: 16px;
}
.advisor-confirmed .check-icon {
    font-size: 1.1rem;
}

/* ============================================================
   ПРИМЕЧАНИЕ "ПРИСОЕДИНИТЬСЯ" (главная)
   ============================================================ */
.join-note {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

/* ============================================================
   УВЕДОМЛЕНИЕ ОБ ОЖИДАНИИ (главная)
   ============================================================ */
.pending-notice {
    text-align: center;
    padding: 10px 16px;
    margin-bottom: 14px;
    background: #fef9e7;
    border: 1px solid #e8d9a0;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: #6b5e30;
    font-family: var(--font-sans);
    display: none;
    transition: opacity 0.3s;
}
.pending-notice.visible {
    display: block;
    animation: fadeInOut 4s ease forwards;
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-4px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-4px); }
}

.pending-section {
    margin-bottom: 14px;
}
.pending-section .section-label {
    margin-bottom: 6px;
}
#pending-list .pending-item {
    padding: 8px 12px;
    background: #fefefd;
    border: 1px dashed #d5cfc4;
    border-radius: var(--radius);
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
#pending-list .pending-item .pending-badge {
    font-size: 0.7rem;
    background: #f5f2eb;
    padding: 2px 8px;
    border-radius: 12px;
    color: #5a4e44;
    white-space: nowrap;
}

/* ============================================================
   ТАБЛИЦА УЧАСТНИКОВ (главная)
   ============================================================ */
.member-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid #d5cfc4;
    table-layout: auto;
}
.member-table th,
.member-table td {
    border: 1px solid #d5cfc4;
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
}
.member-table th {
    background: #f5f2eb;
    font-weight: 600;
    font-family: var(--font-main);
    letter-spacing: 0.04em;
    color: #3a3530;
}
.member-table th:nth-child(1) { width: 10%; }
.member-table th:nth-child(2) { width: 34%; }
.member-table th:nth-child(3) { width: 30%; }
.member-table th:nth-child(4) { width: 26%; }
.member-table td {
    background: #fefefd;
}
.member-table .no-col {
    font-weight: 600;
    color: #5a5a5a;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    background: #fafaf7;
}
.member-table .friend-blue {
    background: var(--friend-blue);
}
.member-table .friend-green {
    background: var(--friend-green);
}
.member-table .friend-yellow {
    background: var(--friend-yellow);
}
.member-table .friend-purple {
    background: var(--friend-purple);
}
.member-table a {
    color: #5a4e44;
    text-decoration: underline;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}
.member-table .friendship-badge {
    display: inline-block;
    font-size: 0.75rem;
    background: #f5f2eb;
    padding: 2px 10px;
    border-radius: 12px;
    color: #5a4e44;
    font-family: var(--font-sans);
    white-space: nowrap;
}

/* ============================================================
   БЛОКИ УТВЕРЖДЕНИЯ (главная)
   ============================================================ */
.approval-blocks {
    display: flex;
    gap: 24px;
    margin-top: 26px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.approval-block {
    flex: 1;
    min-width: 190px;
    border: 1px solid #d5cfc4;
    border-radius: var(--radius);
    padding: 18px 14px 14px;
    text-align: center;
    background: #fdfdfb;
    transition: box-shadow 0.2s;
}
.approval-block:hover {
    box-shadow: var(--shadow-sm);
}
.approval-block .approval-title {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    color: #2c2c2c;
    font-family: var(--font-main);
}
.approval-block .approval-stamp {
    display: inline-block;
    width: 70px;
    height: 70px;
    margin: 4px 0 8px;
}
.approval-block .stamp-svg {
    width: 70px;
    height: 70px;
    display: block;
}
.approval-block .approval-name {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-main);
}

/* ============================================================
   ОБЩАЯ КНОПКА ОТПРАВКИ
   ============================================================ */
.btn-submit {
    display: inline-block;
    padding: 12px 44px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    font-family: var(--font-main);
    color: #fff;
    background: #6b5e53;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
    box-shadow: 0 2px 8px rgba(107, 94, 83, 0.25);
    -webkit-appearance: none;
    -moz-appearance: none;
}
.btn-submit:hover {
    background: #5a4e44;
    box-shadow: 0 4px 14px rgba(107, 94, 83, 0.35);
    transform: translateY(-1px);
}
.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(107, 94, 83, 0.3);
}
.btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   СТИЛИ ДЛЯ СТРАНИЦЫ ПРОФИЛЯ (плиточный вид)
   ============================================================ */

.member-name-header {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin: 20px 0 10px;
    color: #2c2c2c;
    font-family: var(--font-main);
    letter-spacing: 0.06em;
}
.member-name-header .nick {
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

/* ===== Плиточная сетка ===== */
.works-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.work-item {
    background: #f9f7f4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.work-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.work-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* квадрат */
    background: #eae6df;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Плейсхолдер, если нет картинки */
.no-image {
    font-size: 64px;
    line-height: 1;
    color: #aaa;
    user-select: none;
}

/* Информация под картинкой */
.work-info {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.work-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #2c2c2c;
    line-height: 1.3;
}
.work-description {
    font-size: 0.9rem;
    color: #555;
    margin: 4px 0;
}
.work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: auto;
    padding-top: 6px;
    font-size: 0.8rem;
    color: #777;
    border-top: 1px solid #ece8e0;
}
.work-meta .date {
    white-space: nowrap;
}
.work-meta a {
    color: #6b5e53;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
}
.work-meta a:hover {
    border-bottom-color: #6b5e53;
}

/* Сообщение "Нет работ" */
.no-works {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.2rem;
    color: #999;
    padding: 40px 0;
}

.back-link {
    display: inline-block;
    margin-top: 24px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: #5a4e44;
    text-decoration: none;
    border: 1px solid #d5cfc4;
    padding: 6px 18px;
    border-radius: var(--radius);
    transition: background 0.2s;
}
.back-link:hover {
    background: #f5f2eb;
}

/* ============================================================
   МЕДИА-ЗАПРОСЫ для профиля (дополнение к существующим)
   ============================================================ */
@media (max-width: 600px) {
    .works-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }
    .work-image {
        aspect-ratio: 1 / 1;
    }
    .no-image {
        font-size: 48px;
    }
}

/* ============================================================
   МЕДИА-ЗАПРОСЫ (мобильные устройства)
   ============================================================ */
@media (max-width: 600px) {
    /* Главная страница */
    .approval-blocks {
        gap: 12px;
        flex-direction: column;
    }
    .approval-block {
        min-width: unset;
        padding: 14px 12px;
    }
    .approval-block .approval-stamp,
    .approval-block .stamp-svg {
        width: 56px;
        height: 56px;
    }
    .btn-submit {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    .application-form,
    .advisor-section {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px;
    }
    .application-form input[type="text"],
    .advisor-section .advisor-nickname {
        width: 100%;
    }
    .application-form .btn-submit {
        width: 100%;
    }

    /* Профиль */
    .work-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .work-image {
        flex: 0 0 150px;
        max-width: 150px;
        height: 150px;
    }
    .work-meta {
        justify-content: center;
    }
}




/* ============================================================
   ПЕЧАТЬ (главная)
   ============================================================ */
@media print {
    body {
        background: #fff;
        padding: 0;
    }
    .form-container {
        box-shadow: none;
        border: 1px solid #ccc;
        max-width: 100%;
        padding: 30px;
        background-image: none;
        background-color: #fff;
    }
    .btn-submit,
    .lang-switcher,
    .application-form,
    .pending-notice,
    .pending-section {
        display: none !important;
    }
    .static-text-display {
        border: 1px solid #ccc !important;
        background: #fafafa !important;
    }
}

/* ============================================================
   ТЁМНАЯ ТЕМА (исправленная)
   ============================================================ */
body.dark-mode {
    --bg-body: #121212;
    --bg-container: #1e1e1e;
    --bg-input: #2a2a2a;
    --bg-header: #2a2a2a;
    --text-primary: #e8e8e8;
    --text-muted: #aaa;
    --border-light: #3a3a3a;
    --accent: #b0a090;
    --shadow: 0 4px 16px rgba(0,0,0,0.8);
    --white: #1e1e1e;
    --bg-light: #1e1e1e;
}

body.dark-mode {
    background: var(--bg-body);
    color: var(--text-primary);
}

body.dark-mode .form-container,
body.dark-mode .profile-container {
    background: var(--bg-container);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

body.dark-mode .form-title,
body.dark-mode .profile-title,
body.dark-mode .addressee,
body.dark-mode .section-label,
body.dark-mode .member-name-header,
body.dark-mode .member-name-header .nick,
body.dark-mode .work-title,
body.dark-mode .approval-block .approval-title,
body.dark-mode .approval-block .approval-name,
body.dark-mode .info-table .static-text,
body.dark-mode .static-text-display,
body.dark-mode .textarea-group label,
body.dark-mode .application-form label,
body.dark-mode .advisor-section label,
body.dark-mode .advisor-section .advisor-nickname,
body.dark-mode .advisor-confirmed,
body.dark-mode .btn-submit,
body.dark-mode .back-link,
body.dark-mode .member-table a,
body.dark-mode .member-table td,
body.dark-mode .member-table th {
    color: var(--text-primary) !important;
}

body.dark-mode .form-subtitle,
body.dark-mode .profile-subtitle,
body.dark-mode .date-row .gregorian-date,
body.dark-mode .text-muted,
body.dark-mode .label-sub,
body.dark-mode .join-note,
body.dark-mode .approval-name,
body.dark-mode .work-meta,
body.dark-mode .no-works,
body.dark-mode .work-description,
body.dark-mode .member-table .no-col,
body.dark-mode .pending-item,
body.dark-mode .pending-badge {
    color: var(--text-muted) !important;
}

/* Таблицы */
body.dark-mode .info-table,
body.dark-mode .member-table,
body.dark-mode .info-table th,
body.dark-mode .info-table td,
body.dark-mode .member-table th,
body.dark-mode .member-table td {
    border-color: var(--border-light);
    background: var(--bg-container);
}

body.dark-mode .info-table th,
body.dark-mode .member-table th {
    background: var(--bg-header);
    color: var(--text-primary);
}

body.dark-mode .info-table td,
body.dark-mode .member-table td {
    background: var(--bg-input);
}

/* Поля ввода, статические блоки */
body.dark-mode .static-text-display,
body.dark-mode .application-form,
body.dark-mode .advisor-section {
    background: var(--bg-input);
    border-color: var(--border-light);
    color: var(--text-primary);
}

body.dark-mode .application-form input[type="text"],
body.dark-mode .advisor-nickname {
    background: var(--bg-body);
    color: var(--text-primary);
    border-color: var(--border-light);
}

/* Кнопки переключателя языка и темы */
body.dark-mode .lang-switcher button,
body.dark-mode .theme-toggle {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-light);
}
body.dark-mode .lang-switcher button:hover,
body.dark-mode .theme-toggle:hover {
    background: #3a3a3a;
}
body.dark-mode .lang-switcher button.active {
    background: #6b5e53;
    color: #fff;
}

/* Основная кнопка */
body.dark-mode .btn-submit {
    background: #5a4e44;
    color: #fff;
}
body.dark-mode .btn-submit:hover {
    background: #4a3f36;
}

/* Уведомления */
body.dark-mode .pending-notice {
    background: #3d3a2e;
    border-color: #6b5e30;
    color: #f0e6c0;
}

/* Цвета для строк "друзей" – делаем их тёмными оттенками */
body.dark-mode .member-table .friend-blue { background: #1a2a3f; color: #c0d0e0; }
body.dark-mode .member-table .friend-green { background: #1a3a2a; color: #c0e0d0; }
body.dark-mode .member-table .friend-yellow { background: #3a3a1a; color: #e0d0a0; }
body.dark-mode .member-table .friend-purple { background: #2a1a3a; color: #d0c0e0; }

/* Блоки утверждения */
body.dark-mode .approval-block {
    background: var(--bg-input);
    border-color: var(--border-light);
}

/* Ссылка "назад" */
body.dark-mode .back-link {
    color: var(--text-primary);
    border-color: var(--border-light);
}
body.dark-mode .back-link:hover {
    background: var(--bg-input);
}

/* Разделители работ */
body.dark-mode .work-item {
    border-bottom-color: var(--border-light);
}

body.dark-mode .form-title,
body.dark-mode .profile-title,
body.dark-mode .form-title::after,
body.dark-mode .profile-title::after {
    color: #f0f0f0 !important;
    border-bottom-color: var(--accent) !important;
}

body.dark-mode .date-row span,
body.dark-mode .date-row input,
body.dark-mode .date-row .gregorian-date {
    color: #e0e0e0 !important;
    background: transparent !important;
    border-color: var(--border-light) !important;
}

body.dark-mode .info-table .hashtag {
    background: var(--bg-input) !important;
    color: #e0e0e0 !important;
    border: 1px solid var(--border-light) !important;
}

body.dark-mode .textarea-group label,
body.dark-mode .section-label,
body.dark-mode .addressee,
body.dark-mode .member-name-header,
body.dark-mode .member-name-header .nick {
    color: #f0f0f0 !important;
}

body.dark-mode .info-table th {
    background: var(--bg-header) !important;
    color: #f0f0f0 !important;
}

body.dark-mode .info-table td,
body.dark-mode .info-table .static-text {
    color: #e0e0e0 !important;
    background: var(--bg-container) !important;
}

body.dark-mode .profile-title,
body.dark-mode .profile-subtitle {
    color: #f0f0f0 !important;
}

body.dark-mode .static-text-display {
    background: var(--bg-input) !important;
    color: #e0e0e0 !important;
    border-color: var(--border-light) !important;
}

body.dark-mode .static-text-display a {
    color: #b0a090 !important;
}

body.dark-mode .static-text-display ul li,
body.dark-mode .static-text-display p {
    color: #e0e0e0 !important;
}

body.dark-mode .advisor-confirmed {
    background: #1a3a2a !important;
    color: #a0d0b0 !important;
    border: 1px solid #2a5a3a !important;
}
body.dark-mode .advisor-confirmed .check-icon {
    color: #a0d0b0 !important;
}