/* ----- Сброс и база ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background: #eef0f4;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #ffffff;
}

.app {
    flex: 1;
    min-height: 0;
    display: flex;
}
/* ----- Левая панель (sidebar) ----- */
.sidebar {
    width: 340px;
    min-width: 340px;
    background: #f9fafc;
    border-right: 1px solid #eef0f4;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease, opacity 0.2s ease;
    overflow: hidden;
}

.sidebar--collapsed {
    width: 0;
    min-width: 0;
    opacity: 0;
    border-right: none;
    pointer-events: none;
}

.sidebar__header {
    padding: 24px 24px 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar__title {
    font-size: 20px;
    font-weight: 600;
    color: #1e1e2a;
    letter-spacing: -0.3px;
    margin: 0;
}

.sidebar__new-btn {
    background: #6c5ce7;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.sidebar__new-btn:hover {
    background: #5a4bd1;
}

.sidebar__search {
    margin: 0 16px 16px 16px;
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e9ecf0;
    transition: border 0.2s;
}

.sidebar__search:focus-within {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

.search__icon {
    padding: 0 8px 0 14px;
    font-size: 16px;
    color: #8e929b;
}

.search__input {
    border: none;
    background: transparent;
    padding: 12px 14px 12px 0;
    font-size: 14px;
    width: 100%;
    outline: none;
    color: #1e1e2a;
}

.search__input::placeholder {
    color: #a8aeb8;
}

.sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar__list::-webkit-scrollbar {
    width: 4px;
}
.sidebar__list::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar__list::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 8px;
}

/* ----- Кнопка "Уведомления" ----- */
.notification-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    gap: 12px;
    background: #ffffff;
    margin-bottom: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.notification-item:hover {
    background: #f0f2f6;
}

.notification-item__icon {
    font-size: 20px;
    line-height: 1;
}

.notification-item__title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: #1e1e2a;
}

.notification-item__badge {
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    flex-shrink: 0;
    line-height: 1;
}


/* Элемент списка (запрос) */
.thread-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    gap: 12px;
    position: relative;
}

.thread-item:hover {
    background: #f0f2f6;
}

.thread-item--active {
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.thread-item--active:hover {
    background: #ffffff;
}

.thread-item--archived {
    background: #f5f5f5;
}

.thread-item--archived:hover {
    background: #ebebeb;
}

.thread-item__info {
    flex: 1;
    min-width: 0;
}

.thread-item__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.thread-item__title {
    font-weight: 600;
    font-size: 14px;
    color: #1e1e2a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-item__status {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 12px;
    flex-shrink: 0;
    line-height: 18px;
}

.status--active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status--archived {
    background: #e0e0e0;
    color: #5a5f6b;
}

.thread-item__description {
    font-size: 13px;
    color: #6f7480;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__empty {
    padding: 32px 16px;
    text-align: center;
    color: #8e929b;
    font-size: 14px;
}

/* ----- Правая панель (чат) ----- */
.chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-width: 0;
}

.chat__header {
    padding: 16px 24px;
    border-bottom: 1px solid #eef0f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
    flex-shrink: 0;
}

.chat__header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.chat__toggle-btn {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
    color: #3c3c4a;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.chat__toggle-btn:hover {
    color: #6c5ce7;
    background: #f0edff;
}

.toggle-icon {
    line-height: 1;
}

.chat__contact {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat__contact-title {
    font-weight: 600;
    font-size: 15px;
    color: #1e1e2a;
    line-height: 1.3;
}

.chat__contact-status {
    font-size: 12px;
    font-weight: 500;
    padding: 0 8px;
    border-radius: 10px;
    display: inline-block;
    align-self: flex-start;
    line-height: 20px;
}

.chat__placeholder-title {
    font-size: 15px;
    color: #8e929b;
    font-weight: 500;
}

.chat__header-right {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.gear-wrapper {
    cursor: pointer;
    padding: 6px;
    border-radius: 12px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gear-wrapper:hover {
    background: #f0f2f6;
}

.gear-icon {
    width: 24px;
    height: 24px;
    color: #3c3c4a;
    transition: transform 0.25s;
}

.gear-wrapper:hover .gear-icon {
    transform: rotate(45deg);
}

/* Выпадающее меню */
.gear-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    min-width: 200px;
    padding: 8px 0;
    z-index: 100;
    border: 1px solid #f0f2f6;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #1e1e2a;
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
}

.dropdown-item:hover {
    background: #f5f7fb;
}

.dropdown-item--danger {
    color: #e74c3c;
}

.dropdown-item--danger:hover {
    background: #fde8e8;
}

.dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    margin: 6px 12px;
    border: none;
    border-top: 1px solid #eef0f4;
}

/* Область сообщений */
.chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 8px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fafbfc;
}

.chat__messages::-webkit-scrollbar {
    width: 4px;
}
.chat__messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat__messages::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 8px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: messageSlide 0.2s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message--sent {
    align-self: flex-end;
}

.message--received {
    align-self: flex-start;
}

.message__bubble {
    padding: 12px 18px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    word-wrap: break-word;
    position: relative;
}

.message--sent .message__bubble {
    background: #6c5ce7;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message--received .message__bubble {
    background: #ffffff;
    border: 1px solid #eef0f4;
    border-bottom-left-radius: 4px;
    color: #1e1e2a;
}

.message__text {
    font-size: 14px;
    line-height: 1.5;
    display: block;
	white-space: pre-line;
}

.message__time {
    font-size: 11px;
    color: #8e929b;
    margin-top: 4px;
    display: block;
    text-align: right;
    opacity: 0.7;
}

.message--sent .message__time {
    color: rgba(255, 255, 255, 0.7);
}

.message--received .message__time {
    color: #8e929b;
}

.messages-end {
    height: 4px;
}

.message__images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.message__images img {
    width: 160px; height: 160px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}
.message__images img:only-child { width: 100%; max-width: 260px; height: auto; object-fit: contain; }
.message__files { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.message__file {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; text-decoration: none;
    padding: 5px 10px; border-radius: 10px;
    background: #f0edff; color: #6c5ce7;
}
.message--sent .message__file { background: rgba(255,255,255,.15); color: #fff; }

/* Пустое состояние чата */
.chat__empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8e929b;
    gap: 12px;
}

.empty-state__icon {
    font-size: 48px;
    opacity: 0.5;
}

.empty-state__text {
    font-size: 15px;
    font-weight: 500;
}

/* Футер чата — поле ввода */
.chat__footer {
    padding: 16px 24px 24px 24px;
    background: #ffffff;
    border-top: 1px solid #eef0f4;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.footer-actions {
    display: flex;
    flex-direction: row;      /* ← кнопки в ряд */
    gap: 4px;
    align-items: center;
    padding-bottom: 2px;
}

.footer-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 4px;
    color: #6f7480;
    transition: color 0.2s, background 0.2s;
    border-radius: 12px;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-btn:hover {
    color: #6c5ce7;
    background: #f0edff;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #f5f7fb;
    border-radius: 28px;
    padding: 4px 4px 4px 16px;
    border: 1px solid #eef0f4;
    transition: border 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.08);
}

.chat__input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    outline: none;
    color: #1e1e2a;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    line-height: 1.5;
    font-family: inherit;
    overflow-y: auto;
}

.chat__input::placeholder {
    color: #a8aeb8;
}

.chat__send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 28px;
    background: #6c5ce7;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.chat__send-btn:hover:not(:disabled) {
    background: #5a4bd1;
}

.chat__send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.chat__send-btn:disabled {
    background: #d0d5dd;
    cursor: default;
}

.chat__send-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    #app {
        border-radius: 0;
        max-height: 100vh;
    }
    .sidebar {
        width: 280px;
        min-width: 280px;
    }
    .sidebar--collapsed {
        width: 0;
        min-width: 0;
    }
    .chat__header {
        padding: 12px 16px;
    }
    .chat__messages {
        padding: 16px 16px 4px 16px;
    }
    .chat__footer {
        padding: 12px 16px 16px 16px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .footer-actions {
        flex-direction: row;   /* сохраняем горизонталь */
        gap: 2px;
    }
    .footer-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .input-wrapper {
        flex: 1 1 100%;
    }
    .message {
        max-width: 88%;
    }
    .gear-dropdown {
        right: -8px;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 240px;
        min-width: 240px;
    }
    .thread-item {
        padding: 10px 12px;
    }
    .sidebar__header {
        padding: 16px 16px 12px 16px;
        flex-wrap: wrap;
    }
    .sidebar__new-btn {
        font-size: 12px;
        padding: 4px 12px;
    }
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
/* Модальное окно */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e1e2a;
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #8e929b;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f0f2f6;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-hint {
    font-size: 13px;
    color: #6f7480;
    margin-bottom: 12px;
}

.modal-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e9ecf0;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    outline: none;
    transition: border 0.2s;
}

.modal-textarea:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.08);
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-secondary {
    padding: 10px 20px;
    border: 1px solid #e9ecf0;
    background: #ffffff;
    color: #5a5f6b;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #f5f7fb;
}

.btn-primary {
    padding: 10px 24px;
    border: none;
    background: #6c5ce7;
    color: #ffffff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
    background: #5a4bd1;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #d0d5dd;
    cursor: not-allowed;
}
/* ===== КОНЕЦ МОДАЛЬНОГО ОКНА ===== */

/* ===== КНОПКА ТРЕДА ВНУТРИ ПУЗЫРЯ ===== */
.thread-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
    /* входящее сообщение (белый пузырь) */
    background: #f0edff;
    color: #6c5ce7;
}
.thread-btn:hover { background: #e4dfff; }
.thread-btn:active { transform: scale(.97); }

/* В исходящем (фиолетовом) пузыре — полупрозрачная белая */
.message--sent .thread-btn {
    background: rgba(255, 255, 255, .18);
    color: #ffffff;
}
.message--sent .thread-btn:hover { background: rgba(255, 255, 255, .3); }

/* Если в треде уже есть ответы — контрастная */
.thread-btn.has-replies {
    background: #6c5ce7;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(108, 92, 231, .35);
}
.thread-btn.has-replies:hover { background: #5a4bd1; }
.message--sent .thread-btn.has-replies {
    background: #ffffff;
    color: #6c5ce7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* ===== ВЛОЖЕНИЯ В ПУЗЫРЕ (если ещё не добавлены) ===== */
.message__images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.message__images img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}
.message__images img:only-child {
    width: 100%;
    max-width: 260px;
    height: auto;
    object-fit: contain;
}
.message__files { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; margin-top: 8px; }
.message__file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 10px;
    background: #f0edff;
    color: #6c5ce7;
}
.message--sent .message__file { background: rgba(255, 255, 255, .15); color: #fff; }
}

/* ===== РЕЖИМ ТРЕДА ===== */
.thread-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    margin: -24px -24px 16px -24px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.thread-back {
    background: transparent;
    border: none;
    color: #6c5ce7;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 10px;
    transition: background 0.15s;
}
.thread-back:hover {
    background: #f0edff;
}
.thread-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e2a;
}
.message--parent {
    max-width: 100%;
    align-self: stretch;
}
.message--parent .message__bubble {
    background: #fffdf2;
    border: 2px solid #ffd84d;
    border-radius: 16px;
}
.thread-divider {
    text-align: center;
    color: #8e929b;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}
.thread-divider::before,
.thread-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 40px);
    height: 1px;
    background: #eef0f4;
}
.thread-divider::before { left: 0; }
.thread-divider::after { right: 0; }
.thread-empty {
    text-align: center;
    color: #8e929b;
    font-size: 13px;
    padding: 24px;
    font-style: italic;
}
/* ===== КОНЕЦ ТРЕДОВ ===== */
/* ===== Кнопка поделиться ссылкой ===== */
.chat__link-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
    margin-right: 8px;   /* ← отступ от шестерёнки */
}
.chat__link-btn:hover {
    background: #f0edff;
}
.chat__link-btn:active {
    transform: scale(0.92);
}
/* ===== Страница уведомлений ===== */
.notifications-view {
    flex: 1;
    overflow-y: auto;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
}
.notifications__list {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notifications__empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #8e929b;
    padding: 60px 0;
}
.notifications__empty-icon { font-size: 48px; opacity: 0.5; }
.notifications__empty-text { font-size: 15px; font-weight: 500; }

.notifications__item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    transition: box-shadow 0.15s;
    cursor: pointer;
}

/* ===== ВЕРХНЕЕ МЕНЮ ===== */
.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 60px;
    background: #ffffff;
    color: #1e1e2a;
    flex-shrink: 0;
    border-bottom: 1px solid #eef0f4;
    z-index: 50;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

.topbar__left {
    display: flex;
    align-items: center;
}

.topbar__logo {
    font-size: 15px;
    font-weight: 700;
    color: #1e1e2a;
    text-decoration: none;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 12px;
    transition: background 0.15s;
}

.topbar__logo:hover {
    background: #f5f7fb;
}

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.topbar__link {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #6f7480;
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar__link:hover {
    background: #f5f7fb;
    color: #1e1e2a;
}

.topbar__link--active {
    background: #f0edff;
    color: #6c5ce7;
}

.topbar__link--active:hover {
    background: #e8e3ff;
    color: #5a4bd1;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Адаптив */
@media (max-width: 600px) {
    .topbar {
        padding: 0 12px;
        height: 52px;
        gap: 12px;
    }
    .topbar__link {
        padding: 6px 10px;
        font-size: 12px;
    }
    .topbar__logo {
        font-size: 13px;
        padding: 4px 8px;
    }
}

/* ===== ЭКРАН ВХОДА ===== */
.login-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fb;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.04);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.login-logo { font-size: 44px; margin-bottom: 4px; }
.login-title { font-size: 22px; font-weight: 700; color: #1e1e2a; letter-spacing: -0.3px; }
.login-subtitle { font-size: 14px; color: #8e929b; margin-bottom: 12px; }
.login-field { width: 100%; }
.login-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #e9ecf0;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    color: #1e1e2a;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.login-error {
    width: 100%;
    text-align: center;
    font-size: 13px;
    color: #e74c3c;
    background: #fde8e8;
    padding: 8px 12px;
    border-radius: 10px;
}
.login-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: #6c5ce7;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

/* ===== Филиалы внутри карточки запроса ===== */
.thread-item__workplaces {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;   /* две колонки — компактнее */
    gap: 2px 12px;
    background: #f5f7fb;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    padding: 8px 10px;
}
.workplace-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    color: #6f7480;
    line-height: 1.7;
    min-width: 0;
}
.workplace-row__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.workplace-row__status {
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}
.wp-ok { color: #2e7d32; }
.wp-no { color: #e74c3c; }
.workplace-row__min {
    color: #8e929b;
    font-size: 10px;
    font-weight: 500;
    margin-right: 4px;
}

.login-btn:hover:not(:disabled) { background: #5a4bd1; }
.login-btn:active:not(:disabled) { transform: scale(0.98); }
.login-btn:disabled { background: #d0d5dd; cursor: not-allowed; }

.notifications__item:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04); }
.notifications__item-icon { font-size: 20px; flex-shrink: 0; }
.notifications__item-content { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.notifications__item-title { font-size: 14px; font-weight: 600; color: #1e1e2a; }
.notifications__item-text { font-size: 13px; color: #6f7480; }
.notifications__item-time { font-size: 12px; color: #8e929b; }