.messages-page { padding: 30px 0 60px; background: #f8fafc; }
.messages-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 24px; align-items: start; }
.messages-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 22px rgba(32,33,43,.06); }
.messages-panel-head { padding: 20px 20px 8px; }
.messages-panel-head h3 { color: #20212B; margin: 0; }
.conversation-list { display: grid; gap: 8px; padding: 12px; }
.conversation-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: stretch; }
.conversation-btn { width: 100%; display: flex; justify-content: space-between; gap: 12px; text-align: left; padding: 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.conversation-row.is-active .conversation-btn, .conversation-btn:hover { border-color: #FDBE33; background: #fffaf0; }
.conversation-btn strong, .conversation-btn small { display: block; }
.conversation-btn small, .thread-header p, .thread-message small, .messages-empty { color: #667085; }
.conversation-btn em { align-self: center; padding: 3px 8px; border-radius: 999px; background: #b91c1c; color: #fff; font-style: normal; font-size: 12px; font-weight: 800; }
.conversation-delete-btn { width: 40px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #667085; }
.conversation-delete-btn:hover { color: #b91c1c; border-color: #fecaca; background: #fff0f0; }
.messages-thread-panel { min-height: 540px; padding: 20px; }
.thread-header { display: flex; gap: 14px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid #eef2f6; }
.thread-header img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.thread-header h1 { margin: 0 0 4px; color: #20212B; font-size: 26px; }
.thread-messages { display: grid; gap: 10px; max-height: 460px; overflow: auto; padding: 18px 0; }
.thread-message { max-width: 76%; padding: 12px 14px; border-radius: 8px; background: #f3f6ff; color: #20212B; }
.thread-message.is-mine { justify-self: end; background: #20212B; color: #fff; }
.thread-message p { margin: 4px 0; }
.thread-message.is-mine small { color: rgba(255,255,255,.72); }
.message-line-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.message-actions { display: inline-flex; gap: 6px; }
.message-action-btn { width: 28px; height: 28px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.message-action-btn:hover { background: #FDBE33; color: #20212B; border-color: #FDBE33; }
.reply-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding-top: 14px; border-top: 1px solid #eef2f6; }
.message-safety-note { grid-column: 1 / -1; padding: 11px 13px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #78350f; font-size: 14px; line-height: 1.45; }
.message-safety-note a,
.message-report-link { color: #8a4b00; font-weight: 800; text-decoration: underline; }
.message-report-link { font-size: 12px; }
.message-status { grid-column: 1 / -1; min-height: 18px; color: #8a4b00; font-weight: 700; }
.messages-empty { padding: 20px; border: 1px dashed #d0d5dd; border-radius: 8px; background: #fff; }
.btn-outline-custom { border: 1px solid #20212B; color: #20212B; background: #fff; font-weight: 800; }
.btn-outline-custom:hover { background: #20212B; color: #fff; }
.message-modal[hidden] { display: none; }
.message-modal { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 18px; }
.message-modal-backdrop { position: absolute; inset: 0; background: rgba(32,33,43,.58); }
.message-modal-dialog { position: relative; z-index: 1; width: min(560px, 100%); background: #fff; border-radius: 8px; box-shadow: 0 24px 70px rgba(32,33,43,.28); }
.message-modal-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 22px 22px 12px; border-bottom: 1px solid #eef2f6; }
.message-modal-header h2 { margin: 0; color: #20212B; font-size: 24px; }
.message-modal-body { display: grid; gap: 12px; padding: 20px 22px 22px; }
.message-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.message-icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid #e5e7eb; background: #fff; color: #20212B; display: inline-flex; align-items: center; justify-content: center; }
.message-icon-btn:hover { border-color: #FDBE33; background: #fffaf0; }
.message-modal-open { overflow: hidden; }
@media (max-width: 991px) { .messages-layout { grid-template-columns: 1fr; } }
@media (max-width: 575px) { .reply-form { grid-template-columns: 1fr; } .thread-message { max-width: 100%; } .message-modal-actions { display: grid; } }
