/* Nachrichten (25.10.2026, aus karsara style_rtl.css): /messages/, Zaehler im Benutzermenue, Anhaenge, Gaeste. Geladen in header.php */
.app-wrap { padding: 0 12px 20px; }
.app-box { border: 1px solid #ddd; border-radius: 6px; padding: 10px 14px; margin: 12px 0; background: #fafafa; line-height: 2; }
.app-box.app-ok { border-color: #8bc48a; background: #f0faef; }
.app-box.app-warn { border-color: #e0a0a0; background: #fdf1f1; }
.app-form label { display: block; margin: 10px 0; font-weight: bold; }
.app-form input[type=text], .app-form input[type=email], .app-form input[type=password], .app-form textarea { display: block; width: 100%; max-width: 480px; box-sizing: border-box; padding: 6px; margin-top: 4px; font-family: inherit; }
.app-submit, .app-status input[type=submit] { padding: 7px 22px; cursor: pointer; }
.app-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.app-table th, .app-table td { border: 1px solid #ddd; padding: 6px 10px; text-align: right; }
.app-table th { background: #f0f0f0; }
.app-badge { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 12px; background: #e6e6e6; }
.app-date { color: #888; font-size: 12px; }
.rf-card { background: #fff; border: 1px solid #dfe5ee; border-radius: 10px; padding: 16px 18px 18px; margin: 0 0 16px; box-shadow: 0 1px 3px rgba(20, 40, 80, .05); }
.rf-title { margin: 0 0 14px !important; font-size: 16px; font-weight: 700; color: #1f3a63; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rf-title small { font-weight: 400; font-size: 12px; color: #7a8599; }
.rf-btn { cursor: pointer; border: 1px solid #2b4c7e; background: #fff; color: #2b4c7e; border-radius: 8px; padding: 9px 22px; font-size: 14px; font-weight: 700; }
.rf-btn:hover { background: #eef2f8; }
.rf-btn-primary { background: #2b4c7e; color: #fff; }
.rf-btn-primary:hover { background: #223d66; }
.rf-btn-ghost { border-style: dashed; font-weight: 400; padding: 6px 16px; margin-top: 8px; }
.msg-wrap input, .msg-wrap textarea, .msg-wrap button { font-family: inherit; }
.msg-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 10px; background: #d9534f; color: #fff !important; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; vertical-align: middle; }
/* unread badge at the top-left of the avatar circle (always visible, not only on hover) */
.avatar-wrap { float: right; position: relative; display: block; }
.avatar-wrap img#avatar { float: none; display: block; }
.msg-badge-avatar { position: absolute; top: -4px; left: 2px; z-index: 3; box-shadow: 0 0 0 2px #fff; }
.msg-link .msg-badge { margin-left: 4px; }
.msg-link { float: right; padding: 0 22px 0 0; width: 100%; text-align: right; margin: 10px 11px 0 0; }
.msg-link a, .msg-link a:hover, .msg-link a:visited { color: #666666; }
.msg-link:before { content: "✉ "; color: #A4A4A4; font-size: 18px; }
.msg-tabs a { display: inline-block; margin: 0 0 8px 8px; padding: 3px 12px; border: 1px solid #b9c6dc; border-radius: 16px; color: #2b4c7e; text-decoration: none; }
.msg-tabs a.msg-tab-on { background: #2b4c7e; color: #fff; }
.msg-list tr.msg-unread td { background: #fff8e1; font-weight: 700; }
.msg-meta { color: #555; }
.msg-thread { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg-bubble { max-width: 82%; padding: 9px 13px; border-radius: 12px; line-height: 1.9; word-wrap: break-word; }
.msg-bubble .msg-head { font-size: 12px; margin-bottom: 4px; }
.msg-mine { align-self: flex-start; background: #e7f0fb; }
.msg-other { align-self: flex-end; background: #f1f1f1; }
.msg-support { background: #e8f5e9; }
.msg-reply textarea { width: 100%; box-sizing: border-box; }
.msg-close { margin-top: 8px; }
/* message attachments (18.10.2026): thumbnails, PDF links, lightbox (js/messages.js) */
.msg-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.msg-att-img { display: block; line-height: 0; border: 1px solid #d5dbe5; border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; }
.msg-att-img img { display: block; max-width: 160px; max-height: 160px; width: auto; height: auto; }
.msg-att-pdf { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #d5dbe5; border-radius: 8px; background: #fff; color: #2b4c7e; text-decoration: none; font-size: 13px; max-width: 100%; }
.msg-att-icon { background: #c0392b; color: #fff; border-radius: 4px; padding: 0 5px; font-size: 11px; font-weight: 700; line-height: 18px; }
.msg-att-size { color: #888; font-size: 11px; direction: ltr; }
.msg-files { display: block; margin-top: 8px; }
.msg-files input[type=file] { display: block; margin-top: 4px; }
.msg-files-hint { color: #777; font-size: 12px; margin: 4px 0 8px; }
.msg-lightbox { display: none; position: fixed; inset: 0; top: 0; right: 0; bottom: 0; left: 0; z-index: 100000; background: rgba(0, 0, 0, .85); align-items: center; justify-content: center; cursor: zoom-out; }
.msg-lightbox img { max-width: 94vw; max-height: 90vh; box-shadow: 0 4px 30px rgba(0, 0, 0, .5); background: #fff; cursor: default; }
.msg-lightbox-close { position: absolute; top: 12px; left: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; line-height: 40px; cursor: pointer; }
.msg-lightbox-close:hover { background: rgba(255, 255, 255, .3); }
body.msg-lightbox-open { overflow: hidden; }
.msg-pending { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.msg-pending-item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 1px solid #d5dbe5; border-radius: 8px; background: #fff; font-size: 12px; max-width: 100%; }
.msg-pending-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; }
.msg-pending-item bdi { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-pending-remove { border: 0; background: #eee; color: #c0392b; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 22px; padding: 0; }
textarea.msg-drop-active { outline: 2px dashed #2b4c7e; outline-offset: 2px; background: #f3f7fd; }

/* recipient without account at /messages/<id>/: e-mail -> code (messages.php) */
.msg-guest-box { max-width: 520px; }
.msg-guest-code { max-width: 180px !important; letter-spacing: 4px; text-align: center; }
.msg-guest-again { margin-top: 6px; }
.msg-guest-hint { color: #666; font-size: 13px; }
/* payamsara: Eintrag "پیام‌ها" im Benutzermenue (header.php) und Link auf der Anzeigenseite (good.php) */
.msg-menu { margin: 4px 0; }
.msg-menu a { color: #444; }
.msg-menu .msg-badge { margin-right: 4px; }
.msg-ad-contact { margin: 8px 0; }
.msg-ad-contact a { display: inline-block; padding: 4px 14px; border: 1px solid #b9c6dc; border-radius: 16px; color: #2b4c7e; text-decoration: none; background: #fff; }
.msg-ad-contact a:hover { background: #eef3fa; }
@media (max-width: 768px) { .msg-bubble { max-width: 94%; } .app-table th, .app-table td { padding: 4px 6px; } }
