/* Mensagens -> Histórico (12 Oct 2026): the read-only Guesty archive inside the messages sheet.
   The rows reuse .message-thread and the conversation reuses the chat bubbles (.guesty-chat-*),
   so each instance keeps its own theme; only the new chrome lives here. Loaded after
   materialize-madalena.css. */
body.rm-admin .messages-history[hidden] { display: none; }
body.rm-admin .messages-history-summary { margin: 0 16px 6px; padding: 8px 12px; border-radius: 12px; background: #f4f6f9; color: #5b6472; font-size: 12px; font-weight: 600; line-height: 1.35; }
body.rm-admin .messages-history-summary:empty { display: none; }
body.rm-admin .message-thread.is-history .message-thread-unit { background: #eef0f4; color: #5b6472; }
body.rm-admin .message-thread.is-history .message-thread-status { color: #7b8491; }
body.rm-admin .messages-history-more { display: flex; justify-content: center; padding: 12px 16px 4px; }
body.rm-admin .messages-history-more[hidden] { display: none; }
body.rm-admin .messages-history .empty-state .button,
body.rm-admin .messages-history-chat .empty-state .button { margin-top: 10px; }

/* One archived conversation: a pane over the sheet (list, search and tabs stay underneath). */
body.rm-admin .messages-history-chat { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; min-height: 0; background: #fff; transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
body.rm-admin .messages-history-chat[hidden] { display: none; }
body.rm-admin .messages-history-chat.is-open { transform: none; }
body.rm-admin .messages-history-chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 10px 8px; border-bottom: 1px solid #eef0f4; }
body.rm-admin .messages-history-chat-head .icon-button { flex: none; width: 40px; min-width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f4f6f9; box-shadow: none; font-size: 26px; }
body.rm-admin .messages-history-chat-copy { flex: 1; min-width: 0; }
body.rm-admin .messages-history-chat-copy h3 { margin: 0; color: #10243e; font-size: 17px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.rm-admin .messages-history-chat-copy p { margin: 2px 0 0; color: #7b8494; font-size: 12px; line-height: 1.3; }
body.rm-admin .messages-history-chat .messages-history-chat-stay { flex: none; padding: 10px 16px 8px; border-top: 0; border-bottom: 1px solid #eef0f4; }
body.rm-admin .messages-history-chat .messages-history-chat-stay[hidden] { display: none; }
body.rm-admin .messages-history-chat-stays { flex: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 8px 16px; border-bottom: 1px solid #eef0f4; color: #7b8494; font-size: 11px; }
body.rm-admin .messages-history-chat-stays[hidden] { display: none; }
body.rm-admin .messages-history-chat-stays span { flex: 0 0 100%; }
body.rm-admin .messages-history-chat-stays b { padding: 2px 8px; border-radius: 999px; background: #eef0f4; color: #4b5563; font-weight: 600; }
body.rm-admin .messages-history-chat .messages-history-chat-list { flex: 1; min-height: 0; }
body.rm-admin .messages-history-older { display: flex; justify-content: center; margin: 4px 0 10px; }
body.rm-admin .messages-history-chat .guesty-chat-media.is-image img { height: auto; aspect-ratio: 280 / 220; object-fit: cover; }
body.rm-admin .messages-history-chat .guesty-chat-media-status.is-history-file i { animation: none; }
body.rm-admin .messages-history-chat-foot { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #eef0f4; background: #f7f8fb; color: #5b6472; font-size: 12.5px; font-weight: 600; line-height: 1.35; text-align: center; }
body.rm-admin .messages-history-chat-foot i { margin: 0; font-size: 16px; }
@media (prefers-reduced-motion: reduce) { body.rm-admin .messages-history-chat { transition: none; } }

/* Five tabs (RM: Todas, Reservas, Consultas, WhatsApp, Histórico) still fit a 360-440 px phone. */
@media (max-width: 440px) { body.rm-admin .messages-sheet-tabs.is-five button { min-width: 62px; padding: 0 4px; font-size: 10.5px; } }
