/* ===== SMP Multichannel – Frontend Styles ===== */
.smp-float-widget {
    position: fixed;
    z-index: 99999;
}
.smp-pos-bottom-right { bottom: 24px; right: 24px; }
.smp-pos-bottom-left  { bottom: 24px; left:  24px; }

.smp-float-btn {
    width: 54px; height: 54px;
    background: var(--smp-primary, #2563eb);
    color: #fff; border: none; border-radius: 50%;
    font-size: 24px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(37,99,235,.4);
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
.smp-float-btn:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(37,99,235,.5); }

.smp-float-badge {
    position: absolute; top: -4px; right: -4px;
    background: #dc2626; color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 99px; border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
}

.smp-float-panel {
    position: absolute; bottom: 64px;
    width: 320px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    overflow: hidden;
}
.smp-pos-bottom-right .smp-float-panel { right: 0; }
.smp-pos-bottom-left  .smp-float-panel { left:  0; }

.smp-float-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    background: var(--smp-primary, #2563eb);
    color: #fff; font-weight: 600;
    gap: 8px;
}
.smp-float-header span { flex: 1; }
.smp-float-open-full, .smp-float-close {
    background: transparent; border: none; color: #fff;
    cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px;
    text-decoration: none;
}
.smp-float-open-full:hover, .smp-float-close:hover { background: rgba(255,255,255,.2); }

.smp-float-conv-list { max-height: 380px; overflow-y: auto; }
.smp-float-conv-list .smp-conv-item { padding: 10px 12px; }

/* ── Shortcode / Inline Inbox ── */
.smp-shortcode-widget, .smp-page-inbox {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.smp-inline-inbox {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100%;
    min-height: 500px;
    background: #fff;
}
/* Layout 3 cột với CRM panel (giống backend) */
.smp-inline-inbox-3col {
    grid-template-columns: 260px 1fr 360px;
    min-height: 600px;
}
.smp-inline-inbox-3col .smp-crm-panel {
    width: auto;
    border-left: 1px solid #e2e8f0;
}
@media (max-width: 1300px) {
    .smp-inline-inbox-3col {
        grid-template-columns: 240px 1fr 330px;
    }
}
@media (max-width: 1000px) {
    .smp-inline-inbox-3col {
        grid-template-columns: 220px 1fr;
    }
    .smp-inline-inbox-3col .smp-crm-panel { display: none; }
    .smp-inline-inbox-3col .smp-crm-panel.is-mobile-open {
        display: flex;
        position: fixed;
        right: 0; top: 0; bottom: 0;
        z-index: 99999;
        box-shadow: -4px 0 20px rgba(0,0,0,.2);
        width: 360px;
        max-width: 92vw;
        background: #fff;
    }
}
.smp-page-inbox { min-height: 600px; }
.smp-inline-conv-list { height: calc(100% - 60px); overflow-y: auto; }

/* ── Login notice ── */
.smp-login-notice {
    padding: 24px; text-align: center;
    border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc;
}

/* ── Shared conv/message styles (duplicated from admin for standalone use) ── */
.smp-conv-sidebar {
    border-right: 1px solid #cbd5e1;
    display: flex; flex-direction: column;
    background: #f8fafc;
}
.smp-conv-toolbar {
    padding: 12px; border-bottom: 2px solid #e2e8f0;
    display: flex; flex-direction: column; gap: 7px;
    background: #fff;
}
.smp-conv-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 13px; cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: background .15s;
}
.smp-conv-item:hover { background: #eff6ff; }
.smp-conv-item.is-active { background: #dbeafe; border-left: 4px solid #1d4ed8; }
.smp-conv-avatar { position: relative; flex-shrink: 0; }
.smp-conv-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(15,23,42,.15); }
.smp-avatar-placeholder {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .95rem;
    box-shadow: 0 1px 4px rgba(29,78,216,.3);
}
.smp-conv-info { flex: 1; min-width: 0; }
.smp-conv-header { display: flex; justify-content: space-between; align-items: baseline; font-size: .87rem; }
.smp-conv-header small { color: #64748b; font-size: .7rem; flex-shrink: 0; margin-left: 6px; font-weight: 600; }
.smp-conv-name { font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smp-conv-preview { font-size: .76rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.smp-chat-main { display: flex; flex-direction: column; }
.smp-chat-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #94a3b8; gap: 8px; }
.smp-chat-header { padding: 10px 14px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.smp-chat-header-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.smp-channel-tag {
    font-size: .68rem; padding: 2px 8px; border-radius: 99px; font-weight: 600; white-space: nowrap;
}
.smp-channel-tag.smp-channel-zalo      { background: #e0eeff; color: #0068ff; }
.smp-channel-tag.smp-channel-messenger { background: #e0f2ff; color: #0099ff; }
.smp-channel-tag.smp-channel-shopee    { background: #fee2e2; color: #f53d2d; }
.smp-channel-tag.smp-channel-tiktok    { background: #f1f5f9; color: #010101; }
.smp-messages-area { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; }
.smp-msg { display: flex; flex-direction: column; max-width: 72%; }
.smp-msg-in  { align-self: flex-start; }
.smp-msg-out { align-self: flex-end; }
.smp-msg-bubble { padding: 9px 13px; border-radius: 16px; font-size: .875rem; line-height: 1.5; word-break: break-word; }
.smp-msg-in  .smp-msg-bubble { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.smp-msg-out .smp-msg-bubble { background: var(--smp-primary, #2563eb); color: #fff; border-bottom-right-radius: 4px; }
.smp-msg-time { font-size: .65rem; color: #94a3b8; margin-top: 2px; padding: 0 4px; }
.smp-msg-out .smp-msg-time { text-align: right; }
.smp-chat-input-area { padding: 12px 14px; border-top: 2px solid #e2e8f0; display: flex; gap: 8px; align-items: flex-end; background: #fff; }
.smp-msg-input { flex: 1; border: 1.5px solid #cbd5e1; border-radius: 9px; padding: 10px 13px; resize: none; font-size: .88rem; color: #0f172a; }
.smp-msg-input:focus { outline: none; border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.smp-send-btn { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; border: none; border-radius: 9px; padding: 10px 20px; cursor: pointer; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 8px rgba(29,78,216,.3); transition: all .15s; }
.smp-send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(29,78,216,.4); }
.smp-loading { text-align: center; padding: 20px; color: #64748b; font-size: .85rem; font-weight: 600; }

.smp-select { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: .8rem; background: #fff; width: 100%; }
.smp-input  { border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: .8rem; width: 100%; box-sizing: border-box; }

@media (max-width: 600px) {
    .smp-inline-inbox { grid-template-columns: 1fr; }
    .smp-float-panel  { width: 90vw; }
}
