/* ============================================================
   Messages — стили блока сообщений на дашборде
   ============================================================ */

/* --------------------------------------------------------
   Форма отправки
   -------------------------------------------------------- */
.msg-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-2);
    align-items: flex-end;
}

.msg-form-textarea {
    flex: 1;
    min-height: 42px;
    max-height: 200px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    resize: none;
    line-height: 1.5;
    transition: border-color 120ms;
}

.msg-form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-focus);
}

.msg-form-textarea::placeholder {
    color: var(--text-tertiary);
}

.msg-form-send {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-primary);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    transition: background 120ms;
}

.msg-form-send:hover:not(:disabled) {
    background: var(--accent-hover);
}

.msg-form-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.msg-form-send svg {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------
   Список сообщений
   -------------------------------------------------------- */
.msg-list {
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow-y: auto;
}

.msg-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    transition: background 120ms;
}

.msg-item:last-child {
    border-bottom: none;
}

.msg-item:hover {
    background: var(--bg-surface-2);
}

.msg-item:hover .msg-item-delete {
    opacity: 1;
}

/* Шапка сообщения */
.msg-item-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.msg-item-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.msg-item-position {
    font-size: 11px;
    color: var(--text-tertiary);
}

.msg-item-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: auto;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Текст */
.msg-item-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Кнопка удаления */
.msg-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 120ms;
}

.msg-item-delete:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.msg-item-delete svg {
    width: 14px;
    height: 14px;
}

/* --------------------------------------------------------
   Пустое состояние
   -------------------------------------------------------- */
.msg-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.msg-empty svg {
    display: block;
    margin: 0 auto 8px;
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

/* --------------------------------------------------------
   Бейдж «Министр» / «Зам»
   -------------------------------------------------------- */
.msg-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.msg-badge-minister {
    background: #fdecec;
    color: #a82828;
}

.msg-badge-deputy {
    background: #fdf0e6;
    color: #a05a20;
}
