/* Secure Messaging — Profile Inbox tab + global header badge.
   Chat thread styling lives in secure-messaging.css; this file covers the
   conversation list and the header unread badge only. */

/* ---- Profile sidebar "Inbox" nav badge ---- */
.sidebar-nav .nav-link .sm-nav-badge {
    margin-left: auto;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 .35rem;
    background: #ce4f49;
    color: #fff;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .5rem; }

/* ---- Two-pane inbox layout (list sidebar + detail thread) ---- */
.sm-inbox {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1rem;
    align-items: stretch;
    min-height: 540px;
}
.sm-inbox-sidebar {
    border: 1px solid #eef0f2;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sm-inbox-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 540px;
}
.sm-inbox-detail .sm-wrap { flex: 1; min-height: 0; }
.sm-inbox-detail .sm-thread { max-height: none; }

.sm-inbox-placeholder {
    margin: auto;
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
}
.sm-inbox-placeholder i { font-size: 2.25rem; margin-bottom: .75rem; opacity: .5; }
.sm-inbox-placeholder p { font-size: .9rem; margin: 0; }

/* Back button — only shown on mobile (detail overlays the list) */
.sm-header-left { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.sm-inbox-back {
    display: none;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.1rem;
    cursor: pointer;
    padding: .25rem .4rem;
}

/* ---- Inbox conversation list ---- */
.sm-inbox-list { display: flex; flex-direction: column; gap: .6rem; padding: .75rem; overflow-y: auto; flex: 1; }
.sm-convo.is-active { border-color: #ce4f49; background: #fdecea; }

@media (max-width: 860px) {
    .sm-inbox { grid-template-columns: 1fr; min-height: 0; }
    .sm-inbox-detail { display: none; }
    .sm-inbox.sm-detail-open .sm-inbox-sidebar { display: none; }
    .sm-inbox.sm-detail-open .sm-inbox-detail { display: flex; min-height: 70vh; }
    .sm-inbox-back { display: inline-flex; }
}

.sm-inbox-empty,
.sm-inbox-loading {
    text-align: center;
    color: #9ca3af;
    font-size: .9rem;
    padding: 2.5rem 1rem;
}

.sm-convo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, border-color .15s;
}
.sm-convo:hover { border-color: #ce4f49; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.sm-convo.is-unread { background: #fffdf9; }

.sm-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 1.1rem;
}
.sm-convo.is-closed .sm-avatar { color: #b0b6bf; }

.sm-convo-main { flex: 1; min-width: 0; }
.sm-convo-top { display: flex; align-items: baseline; gap: .5rem; }
.sm-convo-order { font-weight: 700; font-size: .9rem; }
.sm-convo-lane {
    font-size: .72rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: .1rem .45rem;
    border-radius: 999px;
}
.sm-convo-snippet {
    font-size: .83rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: .2rem;
}
.sm-convo.is-unread .sm-convo-snippet { color: #1f2937; font-weight: 600; }

.sm-convo-right { text-align: right; flex-shrink: 0; }
.sm-convo-time { font-size: .72rem; color: #9ca3af; }
.sm-convo-unread {
    display: inline-block;
    margin-top: .4rem;
    min-width: 1.3rem;
    height: 1.3rem;
    line-height: 1.3rem;
    padding: 0 .4rem;
    background: #ce4f49;
    color: #fff;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}
.sm-closed-tag { font-size: .72rem; color: #6b7280; }

/* ---- Global header unread badge (on the account icon) ---- */
.user-dropdown .logo_right { position: relative; }
.sm-header-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 .28rem;
    background: #ce4f49;
    color: #fff;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

/* ---- Mobile: badge dot on the hamburger button ---- */
.mobile_menu_btn { position: relative; }
.sm-hamburger-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 .25rem;
    background: #ce4f49;
    color: #fff;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

/* ---- Mobile: inline count next to the INBOX menu item ---- */
.sm-menu-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    margin-left: .5rem;
    padding: 0 .35rem;
    background: #ce4f49;
    color: #fff;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}
