/*
 * «Предъявы» — замечания к работе сайта: значок «!», окно отправки и раздел
 * админки. Правила — agent-rules/bug-reports.md.
 *
 * Значок живёт вплотную к вопросику мануал-модалки: два значка обязаны читаться
 * одной группой, а не двумя иконками в разных углах.
 */

.bug-hint {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 4px;
}

.bug-hint__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #e0b4b3;
    border-radius: 50%;
    background: #fff;
    color: #A6312E;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bug-hint__btn:hover {
    background: #A6312E;
    border-color: #A6312E;
    color: #fff;
}

/*
 * z-index 1300: выше мануал-модалки (1250) — окно замечания открывается тем же
 * жестом из той же группы, — но строго ниже глобального confirm (2000).
 */
.bug-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 20, 28, 0.55);
}

.bug-modal {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 26px 30px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(20, 20, 28, 0.28);
}

.bug-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #8A93AC;
    cursor: pointer;
}

.bug-modal__title {
    margin: 0 0 8px;
    font-family: 'Monomakh-Regular', serif;
    font-size: 24px;
    color: var(--darkBlue, #21212d);
}

.bug-modal__tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    border-bottom: 1px solid #E1E8F5;
}

.bug-modal__tab {
    padding: 7px 12px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: #8A93AC;
    font-size: 13px;
    cursor: pointer;
}

.bug-modal__tab.is-active { border-bottom-color: #A6312E; color: #21212d; }
.bug-modal__tab-count { margin-left: 6px; font-size: 11px; }

.bug-modal__mine { margin: 0 0 14px; padding: 0; list-style: none; }

.bug-modal__mine-item {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #E1E8F5;
    border-radius: 10px;
    font-size: 13px;
}

.bug-modal__mine-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bug-modal__mine-body { margin: 0 0 8px; white-space: pre-wrap; }

.bug-modal__mine-answer {
    margin: 0 0 8px;
    padding: 8px 10px;
    border-left: 3px solid #2f7a4f;
    border-radius: 8px;
    background: #f3faf6;
}

.bug-modal__mine-answer b { display: block; margin-bottom: 3px; font-size: 12px; color: #5C6584; }
.bug-modal__mine-answer p { margin: 0; white-space: pre-wrap; }
.bug-modal__mine-rework { margin: 0 0 8px; font-size: 12px; color: #a3702a; }
.bug-modal__mine-actions,
.bug-modal__mine-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.bug-modal__mine-form textarea { flex: 1 1 100%; }

.bug-modal__place {
    margin: 0 0 16px;
    font-size: 12px;
    color: #8A93AC;
    word-break: break-all;
}

.bug-modal__place code { margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: #f2f4f8; }
.bug-modal__url { display: block; margin-top: 2px; }

.bug-modal__label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    color: #5C6584;
}

.bug-modal__body { min-height: 120px; resize: vertical; }
.bug-modal__optional { color: #8A93AC; font-weight: 400; }

/* --- Общие выключатели значков «?» и «!» -------------------------------
 * Геометрия повторяет .ai-toggles — переключатели проекта выглядят одинаково.
 */

.hint-toggles {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid #E1E8F5;
    border-radius: 12px;
    background: #fbfcfe;
}

.hint-toggles__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

/* «Менять нельзя» — приглушаем, а не прячем: модератору видно состояние. */
.hint-toggles__item.is-locked { opacity: 0.55; cursor: default; }

.hint-toggles__switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex: none;
}

.hint-toggles__switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.hint-toggles__switch input:disabled { cursor: default; }

.hint-toggles__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(33, 33, 45, 0.22);
    transition: background 0.18s ease;
    pointer-events: none;
}

.hint-toggles__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.18s ease;
}

.hint-toggles__switch input:checked + .hint-toggles__track { background: #4a9e6a; }
.hint-toggles__switch input:checked + .hint-toggles__track::after { transform: translateX(18px); }

.hint-toggles__hint { font-size: 12px; color: rgba(33, 33, 45, 0.55); }
.hint-toggles__error { font-size: 12px; color: #a04545; }

.bug-modal__files-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.bug-modal__attach {
    padding: 7px 14px;
    border: 1px solid #b9c6da;
    border-radius: 8px;
    background: #fff;
    color: #3F5D87;
    font-size: 13px;
    cursor: pointer;
}

.bug-modal__attach:hover { background: #f2f6fc; }
.bug-modal__hint { font-size: 12px; color: #8A93AC; }
.bug-modal__picker { display: none; }

/* Плитка на каждый файл: крестик убирает ровно её, остальные остаются. */
.bug-modal__files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.bug-modal__file {
    position: relative;
    width: 108px;
    padding-bottom: 4px;
    border: 1px solid #E1E8F5;
    border-radius: 10px;
    overflow: hidden;
    background: #fbfcfe;
}

.bug-modal__file img {
    display: block;
    width: 100%;
    height: 72px;
    object-fit: cover;
}

.bug-modal__file-ext {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
    font-size: 13px;
    font-weight: 600;
    color: #5C6584;
    background: #eef2f8;
}

.bug-modal__file-name {
    display: block;
    padding: 4px 6px 0;
    font-size: 10px;
    line-height: 1.3;
    color: #8A93AC;
    word-break: break-all;
}

.bug-modal__file-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(20, 20, 28, 0.6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.bug-modal__file-remove:hover { background: #A6312E; }

.bug-modal__errors {
    margin: 0 0 12px;
    padding-left: 18px;
    color: #A6312E;
    font-size: 13px;
}

.bug-modal__ok { margin: 0 0 12px; color: #2f7a4f; font-size: 14px; }

.bug-modal__actions { display: flex; gap: 10px; }

.bug-modal__submit {
    padding: 9px 22px;
    border: none;
    border-radius: 8px;
    background: #A6312E;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.bug-modal__submit:disabled { opacity: 0.5; cursor: default; }

.bug-modal__cancel {
    padding: 9px 18px;
    border: 1px solid #b9c6da;
    border-radius: 8px;
    background: #fff;
    color: #5C6584;
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .bug-modal { padding: 22px 18px 20px; }
    .bug-modal__title { font-size: 20px; }
}

/* --- Раздел «Замечания» в админке --- */

.admin-bugs__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-bugs__create {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    background: #3F5D87;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.admin-bugs__lead,
.admin-bugs__muted { color: #8A93AC; font-size: 13px; }
.admin-bugs__lead { max-width: 760px; margin: 6px 0 18px; }

.admin-bugs__filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-bugs__search { flex: 0 1 320px; }
.admin-bugs__select { flex: 0 1 320px; }

.admin-bugs__statusfilter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.admin-bugs__statusfilter-label { font-size: 12px; color: #8A93AC; }

.admin-bugs__chip {
    padding: 5px 12px;
    border: 1px solid #E1E8F5;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    color: #5C6584;
    cursor: pointer;
}

.admin-bugs__chip.is-active { border-color: #3F5D87; background: #eef3fb; color: #21212d; }
.admin-bugs__chip-count { margin-left: 6px; font-size: 11px; color: #8A93AC; }

.admin-bugs__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-bugs__table th,
.admin-bugs__table td { padding: 10px 12px; border-bottom: 1px solid #E1E8F5; text-align: left; vertical-align: top; }
.admin-bugs__table th { font-size: 12px; text-transform: uppercase; color: #8A93AC; letter-spacing: 0.03em; }
.admin-bugs__row { cursor: pointer; }
.admin-bugs__row:hover { background: #f7f9fd; }
.admin-bugs__row-title { display: block; }
.admin-bugs__url { display: block; margin-top: 2px; color: #8A93AC; font-size: 11px; word-break: break-all; }
.admin-bugs__agent { display: inline-block; margin-top: 3px; font-size: 11px; color: #3F5D87; }

.admin-bugs__status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
    background: #eef2f8;
    color: #5C6584;
}

.admin-bugs__status--open { background: #fdeceb; color: #A6312E; }
.admin-bugs__status--in_work { background: #fdf6e7; color: #a3702a; }
.admin-bugs__status--answered { background: #eaf4ef; color: #2f7a4f; }
.admin-bugs__status--rework { background: #fdeceb; color: #A6312E; }
.admin-bugs__status--closed { background: #f0f1f4; color: #8A93AC; }

/* Карточка длинная: замечание + круги переписки + скриншоты + контекст.
   Без прокрутки кнопки ответа уезжают за нижний край экрана. */
.admin-bugs__card { max-width: 760px; overflow-y: auto; }
.admin-bugs__meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; color: #8A93AC; }

.admin-bugs__edit-toggle {
    margin-left: 10px;
    padding: 0;
    border: none;
    background: none;
    color: #3F5D87;
    font-size: 12px;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
}

.admin-bugs__edit {
    padding: 12px 14px;
    border: 1px solid #E1E8F5;
    border-radius: 10px;
    background: #fbfcfe;
}
.admin-bugs__place { margin: 10px 0 16px; font-size: 12px; color: #8A93AC; word-break: break-all; }
.admin-bugs__place code { padding: 1px 5px; border-radius: 4px; background: #f2f4f8; }

.admin-bugs__thread { margin-bottom: 16px; }

.admin-bugs__msg {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    border-left: 3px solid #E1E8F5;
    background: #f7f9fd;
    font-size: 14px;
}

.admin-bugs__msg b { display: block; margin-bottom: 4px; font-size: 12px; color: #5C6584; }
.admin-bugs__msg p { margin: 0 0 6px; white-space: pre-wrap; }
.admin-bugs__msg--body { border-left-color: #A6312E; }
.admin-bugs__msg--answer { border-left-color: #2f7a4f; background: #f3faf6; }
.admin-bugs__msg--rework { border-left-color: #d8a657; background: #fdf8ec; }
.admin-bugs__msg--old { opacity: 0.75; }

.admin-bugs__files { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.admin-bugs__file {
    position: relative;
    width: 140px;
    border: 1px solid #E1E8F5;
    border-radius: 10px;
    overflow: hidden;
}

.admin-bugs__file img { display: block; width: 100%; height: 92px; object-fit: cover; }

.admin-bugs__file-ext {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 92px;
    padding: 6px;
    font-size: 12px;
    color: #5C6584;
    background: #eef2f8;
    word-break: break-all;
    text-align: center;
}

.admin-bugs__file-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(20, 20, 28, 0.6);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.admin-bugs__file-remove:hover { background: #A6312E; }

.admin-bugs__context {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 14px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7f9fd;
    font-size: 12px;
    color: #5C6584;
}

.admin-bugs__context dt { color: #8A93AC; }
.admin-bugs__context dd { margin: 0; word-break: break-all; }

.admin-bugs__label { display: block; margin-bottom: 12px; font-size: 13px; color: #5C6584; }
.admin-bugs__answer { min-height: 96px; resize: vertical; }
.admin-bugs__actions { align-items: center; flex-wrap: wrap; }
.admin-bugs__status-select { width: auto; min-width: 150px; }

/* --- Раздел «Подсказки и замечания»: вкладки и «Доступ» ----------------- */

.admin-hints__tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #E1E8F5;
}

.admin-hints__tab {
    padding: 9px 16px;
    border-bottom: 2px solid transparent;
    color: #8A93AC;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}

.admin-hints__tab.is-active { border-bottom-color: #A6312E; color: #21212d; }
.admin-hints__subtitle { margin: 24px 0 10px; font-size: 16px; color: var(--darkBlue, #21212d); }
.admin-hints__muted { color: #8A93AC; font-size: 13px; }

.admin-hint-access__lead,
.admin-hint-access__note { color: #8A93AC; font-size: 13px; }
.admin-hint-access__lead { max-width: 760px; margin: 6px 0 18px; }
.admin-hint-access__note { max-width: 760px; margin: 8px 0 0; }

.admin-hint-access__switches {
    border-collapse: collapse;
    font-size: 14px;
}

.admin-hint-access__switches th,
.admin-hint-access__switches td {
    padding: 10px 22px 10px 0;
    text-align: left;
    vertical-align: middle;
}

.admin-hint-access__switches thead th {
    font-size: 12px;
    text-transform: uppercase;
    color: #8A93AC;
    letter-spacing: 0.03em;
}

.admin-hint-access__filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-hint-access__search { flex: 0 1 340px; }
.admin-hint-access__select { flex: 0 1 220px; }

/* Массовая выдача: строка стоит отдельно от фильтров — это действие, а не отбор. */
.admin-hint-access__bulk {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 4px;
    padding: 10px 12px;
    border: 1px solid #E1E8F5;
    border-radius: 10px;
    background: #F7F9FE;
}
.admin-hint-access__bulk-label { font-size: 13px; color: #5C6580; font-weight: 600; }
.admin-hint-access__bulk-result { font-size: 13px; color: #2e7e4a; }

.admin-hint-access__table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.admin-hint-access__table th,
.admin-hint-access__table td { padding: 10px 12px; border-bottom: 1px solid #E1E8F5; text-align: left; vertical-align: middle; }
.admin-hint-access__table th { font-size: 12px; text-transform: uppercase; color: #8A93AC; letter-spacing: 0.03em; }

.admin-hint-access__login { display: block; font-size: 11px; color: #8A93AC; }
.admin-hint-access__cell { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.admin-hint-access__state {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.admin-hint-access__state.is-on { background: #eaf4ef; color: #2f7a4f; }
.admin-hint-access__state.is-off { background: #f0f1f4; color: #8A93AC; }
/* Причина — то, ради чего строка и существует: без неё «почему не видно»
   выясняется в базе. */
.admin-hint-access__reason { font-size: 12px; color: #8A93AC; }

/* --- Строка «Значки» в меню пользователя -------------------------------- */

.header-user-menu__hints {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px;
    border-top: 1px solid #E1E8F5;
    font-size: 13px;
    color: #5C6584;
}

.header-user-menu__hints-label { flex: none; }

.header-user-menu__hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Сам значок вместо подписи: строка не повторяет «показывать» дважды. */
.header-user-menu__hint-sign {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #b9c6da;
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: #5C6584;
}

.header-user-menu__hint-sign.is-bug-reports { border-color: #e0b4b3; color: #A6312E; }

.header-user-menu__hint input {
    position: absolute;
    opacity: 0;
    width: 34px;
    height: 18px;
    margin: 0;
    right: 0;
    cursor: pointer;
}

.header-user-menu__hint-track {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: rgba(33, 33, 45, 0.22);
    transition: background 0.18s ease;
    pointer-events: none;
}

.header-user-menu__hint-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.18s ease;
}

.header-user-menu__hint input:checked ~ .header-user-menu__hint-track { background: #4a9e6a; }
.header-user-menu__hint input:checked ~ .header-user-menu__hint-track::after { transform: translateX(16px); }
