/* ===== Message Center Styles - Chat UI Redesign ===== */

/* ===== THEME RESET ===== */
.tbc-mc-container,
.tbc-mc-container * {
    box-sizing: border-box;
}

.tbc-mc-container {
    --tbc-success: #28a745;
    --tbc-success-bg: rgba(40, 167, 69, 0.15);
    --tbc-danger: #dc3545;
    --tbc-danger-bg: rgba(220, 53, 69, 0.15);
    --tbc-warning: #d4880f;
    --tbc-warning-bg: rgba(212, 136, 15, 0.15);
    --tbc-info: #17a2b8;
    --tbc-info-bg: rgba(23, 162, 184, 0.15);
    --tbc-purple: #6f42c1;
    --tbc-purple-bg: rgba(111, 66, 193, 0.15);
    --tbc-neutral: #6c757d;
    --tbc-neutral-bg: rgba(108, 117, 125, 0.15);
}

.tbc-mc-container button {
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-indent: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== SHARED TAB NAVIGATION ===== */
.tbc-mc-tabs {
    display: flex;
    background: var(--fcom-secondary-bg);
    border-bottom: 1px solid var(--fcom-primary-border);
    padding: 0 16px;
    flex-shrink: 0;
}

.tbc-mc-tab {
    padding: 14px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--fcom-secondary-text);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tbc-mc-tab:hover {
    color: var(--fcom-primary-text);
    background: var(--fcom-light-bg);
}

.tbc-mc-tab.active {
    color: var(--fcom-text-link);
    border-bottom-color: var(--fcom-text-link);
}

.tbc-mc-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Critical for nested flex scroll */
}

.tbc-mc-tab-content.hidden {
    display: none;
}

/* ===== SHARED STATUS BADGES ===== */
.tbc-mc-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.tbc-mc-badge-pending,
.tbc-mc-batch-status-pending {
    background: var(--tbc-warning-bg);
    color: var(--tbc-warning);
}

.tbc-mc-badge-processing,
.tbc-mc-batch-status-processing {
    background: var(--tbc-info-bg);
    color: var(--tbc-info);
}

.tbc-mc-badge-completed,
.tbc-mc-batch-status-completed {
    background: var(--tbc-success-bg);
    color: var(--tbc-success);
}

.tbc-mc-badge-cancelled,
.tbc-mc-batch-status-cancelled {
    background: var(--tbc-danger-bg);
    color: var(--tbc-danger);
}

.tbc-mc-badge-immediate,
.tbc-mc-schedule-type-badge.immediate {
    background: var(--tbc-neutral-bg);
    color: var(--fcom-secondary-text);
}

.tbc-mc-badge-scheduled,
.tbc-mc-schedule-type-badge.scheduled {
    background: var(--tbc-info-bg);
    color: var(--tbc-info);
}

.tbc-mc-badge-recurring,
.tbc-mc-schedule-type-badge.recurring {
    background: var(--tbc-purple-bg);
    color: var(--tbc-purple);
}

/* ===== SHARED CARD STYLES ===== */
.tbc-mc-card {
    background: var(--fcom-primary-bg);
    border: 1px solid var(--fcom-primary-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tbc-mc-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tbc-mc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.tbc-mc-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--fcom-primary-text);
    margin: 0;
}

.tbc-mc-card-actions {
    display: flex;
    gap: 8px;
}

.tbc-mc-card-body {
    color: var(--fcom-secondary-text);
    font-size: 14px;
    line-height: 1.5;
}

.tbc-mc-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--fcom-secondary-border);
    font-size: 13px;
    color: var(--fcom-text-off);
}

/* ===== SHARED BUTTON STYLES ===== */
.tbc-mc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tbc-mc-btn-primary {
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
}

.tbc-mc-btn-primary:hover {
    filter: brightness(0.85);
}

.tbc-mc-btn-danger {
    background: var(--tbc-danger);
    color: white;
}

.tbc-mc-btn-danger:hover {
    filter: brightness(0.85);
}

.tbc-mc-btn-secondary {
    background: var(--tbc-neutral);
    color: white;
}

.tbc-mc-btn-secondary:hover {
    filter: brightness(0.85);
}

.tbc-mc-btn-outline {
    background: transparent;
    border: 1px solid var(--fcom-primary-border);
    color: var(--fcom-primary-text);
}

.tbc-mc-btn-outline:hover {
    background: var(--fcom-light-bg);
    border-color: var(--fcom-text-link);
    color: var(--fcom-text-link);
}

.tbc-mc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== SHARED LOADING STATE ===== */
.tbc-mc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--fcom-text-off);
    font-size: 14px;
}

.tbc-mc-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--fcom-primary-border);
    border-top-color: var(--fcom-text-link);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

/* ===== SHARED EMPTY STATE ===== */
.tbc-mc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--fcom-text-off);
    text-align: center;
}

.tbc-mc-empty-state h3 {
    margin: 0 0 8px;
    color: var(--fcom-secondary-text);
    font-size: 18px;
}

.tbc-mc-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* ===== MAIN CONTAINER ===== */
.tbc-mc-container {
    display: flex;
    flex-direction: column;
    min-height: 600px;
    height: calc(100vh - 150px);
    max-height: 900px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--fcom-primary-bg);
    margin: 0 auto;
}

/* ===== HEADER (Search + Bulk Actions) ===== */
.tbc-mc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--fcom-secondary-bg);
    border-bottom: 1px solid var(--fcom-primary-border);
    flex-shrink: 0;
    gap: 12px;
}

.tbc-mc-search {
    flex: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--fcom-primary-bg);
    color: var(--fcom-primary-text);
}

.tbc-mc-search:focus {
    border-color: var(--fcom-text-link);
}

/* Search Wrapper - contains search input and filter dropdown */
.tbc-mc-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 400px;
}

.tbc-mc-search-wrapper .tbc-mc-search {
    max-width: none;
    flex: 1;
}

/* Search Filter Dropdown */
.tbc-mc-search-filter {
    position: relative;
}

.tbc-mc-search-filter-btn {
    padding: 8px 12px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 20px;
    background: var(--fcom-primary-bg);
    color: var(--fcom-primary-text);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tbc-mc-search-filter-btn:hover {
    border-color: var(--fcom-text-link);
}

.tbc-mc-search-filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--fcom-primary-bg);
    border: 1px solid var(--fcom-primary-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    min-width: 140px;
    z-index: 100;
    overflow: hidden;
}

.tbc-mc-search-filter.open .tbc-mc-search-filter-dropdown {
    display: block;
}

.tbc-mc-search-filter-option {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.tbc-mc-search-filter-option:hover {
    background: var(--fcom-light-bg);
}

.tbc-mc-search-filter-option.active {
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
}

.tbc-mc-bulk-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tbc-mc-container .tbc-mc-bulk-actions button {
    padding: 8px 16px !important;
    border: 1px solid var(--fcom-primary-border) !important;
    border-radius: 6px !important;
    background: var(--fcom-primary-bg) !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--fcom-primary-text) !important;
    transition: all 0.2s !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    text-indent: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    visibility: visible !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tbc-mc-container .tbc-mc-bulk-actions button:hover:not(:disabled) {
    background: var(--fcom-light-bg) !important;
    border-color: var(--fcom-secondary-border) !important;
}

.tbc-mc-container .tbc-mc-bulk-actions button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: var(--fcom-light-bg) !important;
    color: var(--fcom-text-off) !important;
}

.tbc-mc-container .tbc-mc-mark-all-read {
    background: var(--tbc-success) !important;
    color: white !important;
    border-color: var(--tbc-success) !important;
}

.tbc-mc-container .tbc-mc-mark-all-read:hover:not(:disabled) {
    filter: brightness(0.85) !important;
}

.tbc-mc-container .tbc-mc-bulk-delete {
    background: var(--fcom-primary-bg) !important;
    color: var(--tbc-danger) !important;
    border-color: var(--tbc-danger) !important;
}

.tbc-mc-container .tbc-mc-bulk-delete:hover:not(:disabled) {
    background: var(--tbc-danger) !important;
    color: #fff !important;
}

.tbc-mc-container .tbc-mc-bulk-star {
    background: var(--fcom-primary-bg) !important;
    color: var(--tbc-warning) !important;
    border-color: var(--tbc-warning) !important;
}

.tbc-mc-container .tbc-mc-bulk-star:hover:not(:disabled) {
    background: var(--tbc-warning) !important;
    color: var(--fcom-primary-bg) !important;
}

/* Ensure button text is visible */
.tbc-mc-container .tbc-mc-bulk-actions button {
    min-width: auto !important;
    overflow: visible !important;
    text-indent: 0 !important;
    font-size: 13px !important;
    letter-spacing: normal !important;
}

/* ===== TWO-PANEL LAYOUT ===== */
.tbc-mc-panels {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== LEFT PANEL: Conversation List ===== */
.tbc-mc-conversation-list {
    width: 350px;
    min-width: 280px;
    border-right: 1px solid var(--fcom-primary-border);
    display: flex;
    flex-direction: column;
    background: var(--fcom-primary-bg);
}

/* Filter Tabs */
.tbc-mc-filters {
    display: flex;
    padding: 8px;
    gap: 4px;
    border-bottom: 1px solid var(--fcom-primary-border);
    flex-shrink: 0;
}

.tbc-mc-container .tbc-mc-filter-btn {
    flex: 1;
    padding: 8px 12px !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 13px !important;
    color: var(--fcom-secondary-text) !important;
    border-radius: 6px !important;
    transition: all 0.2s !important;
    font-weight: 500 !important;
}

.tbc-mc-container .tbc-mc-filter-btn:hover {
    background: var(--fcom-light-bg) !important;
}

.tbc-mc-container .tbc-mc-filter-btn.active {
    background: var(--fcom-primary-button) !important;
    color: var(--fcom-primary-button-text) !important;
}

.tbc-mc-filter-count {
    font-size: 11px;
    opacity: 0.8;
}

/* Conversation Items Container */
.tbc-mc-conversations {
    flex: 1;
    overflow-y: auto;
}

/* Individual Conversation Item */
.tbc-mc-conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--fcom-secondary-border);
    transition: background 0.15s;
    gap: 12px;
}

.tbc-mc-conversation-item:hover {
    background: var(--fcom-light-bg);
}

.tbc-mc-conversation-item.active {
    background: var(--fcom-active-bg);
}

.tbc-mc-conversation-item.unread {
    background: var(--fcom-highlight-bg);
}

/* Checkbox for bulk select */
.tbc-mc-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Shared Avatar Base */
.tbc-mc-avatar,
.tbc-mc-thread-avatar,
.tbc-mc-bubble-avatar {
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

/* Avatar Size: Conversation List (48px) */
.tbc-mc-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 16px;
}

.tbc-mc-avatar img,
.tbc-mc-avatar .avatar,
.tbc-mc-avatar > img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
}

.tbc-mc-avatar .tbc-mc-initials {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Guest/Unknown avatar */
.tbc-mc-avatar.tbc-mc-guest,
.tbc-mc-thread-avatar.tbc-mc-guest {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* Conversation Info */
.tbc-mc-conversation-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tbc-mc-contact-name {
    font-weight: 600;
    color: var(--fcom-primary-text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Starred indicator next to name */
.tbc-mc-starred-indicator {
    font-size: 12px;
    flex-shrink: 0;
}

.tbc-mc-preview {
    color: var(--fcom-secondary-text);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbc-mc-conversation-item.unread .tbc-mc-preview {
    color: var(--fcom-primary-text);
    font-weight: 500;
}

.tbc-mc-time {
    color: var(--fcom-text-off);
    font-size: 12px;
    flex-shrink: 0;
}

/* Unread Indicator Dot */
.tbc-mc-unread-dot {
    width: 10px;
    height: 10px;
    background: var(--fcom-text-link);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== RIGHT PANEL: Message Thread ===== */
.tbc-mc-thread-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--fcom-secondary-bg);
}

.tbc-mc-thread-panel.empty {
    align-items: center;
    justify-content: center;
}

.tbc-mc-empty-state {
    text-align: center;
    color: var(--fcom-text-off);
}

.tbc-mc-empty-state .bb-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

/* Thread Header */
.tbc-mc-thread-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--fcom-primary-bg);
    border-bottom: 1px solid var(--fcom-primary-border);
    gap: 12px;
    flex-shrink: 0;
}

.tbc-mc-back-btn {
    display: none;
    padding: 8px 12px !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 16px !important;
    color: var(--fcom-text-link) !important;
    font-weight: 500 !important;
}

.tbc-mc-back-btn:hover {
    text-decoration: underline;
}

/* Avatar Size: Thread Header (40px) */
.tbc-mc-thread-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 14px;
}

.tbc-mc-thread-avatar img,
.tbc-mc-thread-avatar .avatar,
.tbc-mc-thread-avatar > img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

.tbc-mc-thread-info {
    flex: 1;
}

.tbc-mc-thread-name {
    font-weight: 600;
    color: var(--fcom-primary-text);
    font-size: 16px;
    text-decoration: none;
}

.tbc-mc-thread-name:hover {
    color: var(--fcom-text-link);
    text-decoration: underline;
}

.tbc-mc-thread-phone {
    color: var(--fcom-secondary-text);
    font-size: 13px;
}

/* Messages Container */
.tbc-mc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== CHAT BUBBLES ===== */
.tbc-mc-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

/* Bubble Row - contains avatar + bubble */
.tbc-mc-bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}

.tbc-mc-bubble-row.tbc-mc-received {
    flex-direction: row;
    justify-content: flex-start;
}

.tbc-mc-bubble-row.tbc-mc-sent {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

/* Avatar Size: Chat Bubble (28px) */
.tbc-mc-bubble-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.tbc-mc-bubble-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.tbc-mc-bubble-initials {
    /* Inherits color and font-weight from base */
}

/* Received Messages (left, gray) */
.tbc-mc-bubble.tbc-mc-received {
    background: var(--fcom-light-bg);
    color: var(--fcom-primary-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Sent Messages (right, blue) */
.tbc-mc-bubble.tbc-mc-sent {
    background: var(--fcom-text-link);
    color: var(--fcom-primary-button-text);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Starred/Important Message Highlight */
.tbc-mc-bubble.tbc-mc-starred {
    box-shadow: 0 0 0 2px #ffc107;
}

.tbc-mc-bubble.tbc-mc-starred.tbc-mc-received {
    background: var(--fcom-highlight-bg);
}

.tbc-mc-bubble.tbc-mc-starred.tbc-mc-sent {
    background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
    box-shadow: 0 0 0 2px #ffc107;
}

/* Bubble Content */
.tbc-mc-bubble-content {
    margin: 0;
    line-height: 1.4;
    font-size: 14px;
}

/* Bubble Timestamp and Star */
.tbc-mc-bubble-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 8px;
}

.tbc-mc-bubble-time {
    font-size: 11px;
    opacity: 0.7;
}

/* Always visible star on bubble */
.tbc-mc-bubble-star {
    cursor: pointer;
    font-size: 28px;
    opacity: 0.4;
    transition: all 0.2s;
}

.tbc-mc-bubble-star:hover {
    opacity: 1;
    transform: scale(1.1);
}

.tbc-mc-bubble-star.starred {
    opacity: 1;
    color: #ffc107;
}

.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-star {
    color: rgba(255,255,255,0.5);
}

.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-star:hover,
.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-star.starred {
    color: #ffc107;
}

/* Delete button in footer */
.tbc-mc-bubble-delete {
    cursor: pointer;
    font-size: 28px;
    opacity: 0.3;
    transition: all 0.2s;
    margin-left: 8px;
}

.tbc-mc-bubble-delete:hover {
    opacity: 1;
    color: #dc3545;
    transform: scale(1.1);
}

.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-delete {
    color: rgba(255,255,255,0.5);
}

.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-delete:hover {
    color: #ff6b6b;
}

/* Note Button */
.tbc-mc-bubble-note {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.3;
    transition: all 0.2s;
    margin-left: 8px;
}

.tbc-mc-bubble-note:hover {
    opacity: 1;
    transform: scale(1.1);
}

.tbc-mc-bubble-note.has-note {
    opacity: 0.8;
}

.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-note {
    opacity: 0.4;
}

.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-note.has-note {
    opacity: 0.9;
}

/* Note Display */
.tbc-mc-bubble-note-display {
    font-size: 12px;
    color: var(--fcom-secondary-text);
    font-style: italic;
    padding: 6px 10px;
    margin-top: 4px;
    background: var(--fcom-light-bg);
    border-radius: 8px;
    border-left: 3px solid #ffc107;
}

.tbc-mc-bubble.tbc-mc-sent .tbc-mc-bubble-note-display {
    color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.1);
    border-left-color: rgba(255,255,255,0.6);
}

/* Bubble Actions - now in footer, not hover */
.tbc-mc-bubble-actions-footer {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Voicemail Bubble */
.tbc-mc-bubble.tbc-mc-voicemail {
    background: var(--fcom-secondary-content-bg, var(--fcom-light-bg));
    border: 1px solid var(--fcom-primary-border);
}

.tbc-mc-bubble.tbc-mc-voicemail audio {
    width: 100%;
    max-width: 250px;
    height: 36px;
    margin-bottom: 8px;
}

.tbc-mc-transcription {
    font-style: italic;
    font-size: 13px;
    color: var(--fcom-secondary-text);
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid var(--fcom-primary-border);
}

/* Media in Bubbles */
.tbc-mc-bubble-media {
    margin-top: 8px;
}

.tbc-mc-bubble-media img {
    max-width: 200px;
    border-radius: 8px;
    cursor: pointer;
}

/* Date Separator */
.tbc-mc-date-separator {
    text-align: center;
    color: var(--fcom-secondary-text);
    font-size: 12px;
    padding: 16px 0;
}

.tbc-mc-date-separator span {
    background: var(--fcom-primary-border);
    color: var(--fcom-primary-text);
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 12px;
}

/* ===== REPLY BAR ===== */
.tbc-mc-reply-bar {
    display: flex;
    padding: 12px 16px;
    background: var(--fcom-primary-bg);
    border-top: 1px solid var(--fcom-primary-border);
    gap: 12px;
    flex-shrink: 0;
}

.tbc-mc-container .tbc-mc-reply-btn {
    flex: 1;
    padding: 12px 24px !important;
    background: var(--fcom-primary-button) !important;
    color: var(--fcom-primary-button-text) !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    text-align: center !important;
}

.tbc-mc-container .tbc-mc-reply-btn:hover {
    filter: brightness(0.85);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tbc-mc-container .tbc-mc-call-btn {
    padding: 12px 24px !important;
    background: var(--tbc-success) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    min-width: 80px !important;
}

.tbc-mc-container .tbc-mc-call-btn:hover {
    filter: brightness(0.85) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ===== SLIDE-OVER REPLY PANEL ===== */
.tbc-mc-reply-panel {
    position: fixed;
    top: 0;
    right: -75%;
    width: 75%;
    max-width: 700px;
    height: 100%;
    background: var(--fcom-primary-bg);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tbc-mc-reply-panel.open {
    right: 0;
}

.tbc-mc-reply-panel-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
    flex-shrink: 0;
}

.tbc-mc-close-reply {
    background: transparent;
    border: none;
    color: var(--fcom-primary-button-text);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
    line-height: 1;
}

.tbc-mc-reply-panel-title {
    font-size: 18px;
    font-weight: 500;
}

.tbc-mc-reply-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--fcom-primary-bg);
}

/* Overlay when reply panel is open */
.tbc-mc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.tbc-mc-overlay.visible {
    opacity: 1;
    visibility: visible;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== FEEDBACK TOAST ===== */
.tbc-mc-toast {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 99999 !important;
    min-width: 280px !important;
    max-width: 400px !important;
    padding: 16px 24px !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
    animation: toastSlideIn 0.3s ease-out !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.tbc-mc-toast.fade-out {
    animation: toastFadeOut 0.3s ease-in forwards !important;
}

.tbc-mc-toast.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
}

.tbc-mc-toast.error {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%) !important;
    color: white !important;
}

.tbc-mc-toast::before {
    content: '✓';
    font-size: 18px;
    font-weight: bold;
}

.tbc-mc-toast.error::before {
    content: '✕';
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Hide old sms-feedback in message center */
.tbc-mc-container .sms-feedback,
.tbc-mc-header .sms-feedback {
    display: none !important;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .tbc-mc-container {
        height: calc(100vh - 100px);
        max-height: none;
        border-radius: 0;
    }

    .tbc-mc-header {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }

    .tbc-mc-search {
        max-width: 100%;
        width: 100%;
    }

    .tbc-mc-bulk-actions {
        width: 100%;
        justify-content: space-between;
    }

    .tbc-mc-bulk-actions button {
        flex: 1;
        font-size: 11px !important;
        padding: 6px 8px !important;
    }

    /* Mobile: Smaller avatars */
    .tbc-mc-avatar {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    .tbc-mc-avatar img,
    .tbc-mc-avatar .avatar {
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }

    /* Mobile: Full width conversation list */
    .tbc-mc-conversation-list {
        width: 100%;
        min-width: 100%;
        border-right: none;
    }

    /* Mobile: Thread panel slides over */
    .tbc-mc-thread-panel {
        position: fixed;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .tbc-mc-thread-panel.active {
        left: 0;
    }

    .tbc-mc-back-btn {
        display: block;
    }

    /* Mobile: Reply panel full width */
    .tbc-mc-reply-panel {
        width: 100%;
        right: -100%;
        max-width: none;
    }

    .tbc-mc-bubble {
        max-width: 85%;
    }

    /* Emoji Picker Mobile Fix */
    .tbc-mc-emoji-picker-container {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 9999 !important;
        max-width: 90vw !important;
        max-height: 70vh !important;
        width: 320px !important;
        height: 400px !important;
    }

    .tbc-mc-emoji-picker-container em-emoji-picker {
        width: 300px !important;
        height: 350px !important;
        max-width: none !important;
    }
}

/* Button Processing State */
.tbc-mc-processing {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== SCHEDULED TAB - TWO PANEL LAYOUT ===== */
.tbc-mc-scheduled-tab {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.tbc-mc-scheduled-panels {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Panel: Message List */
.tbc-mc-scheduled-list {
    width: 350px;
    min-width: 280px;
    border-right: 1px solid var(--fcom-primary-border);
    display: flex;
    flex-direction: column;
    background: var(--fcom-primary-bg);
}

.tbc-mc-scheduled-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--fcom-primary-border);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.tbc-mc-scheduled-filters {
    display: flex;
    gap: 4px;
}

.tbc-mc-scheduled-bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tbc-mc-select-all-scheduled {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--fcom-secondary-text);
    user-select: none;
}

.tbc-mc-select-all-scheduled input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tbc-mc-scheduled-bulk-delete {
    padding: 8px 16px;
    border: 1px solid var(--fcom-primary-border);
    background: var(--fcom-primary-bg);
    color: var(--fcom-primary-text);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tbc-mc-scheduled-bulk-delete:hover:not(:disabled) {
    background: var(--tbc-danger-bg);
    border-color: var(--tbc-danger);
    color: var(--tbc-danger);
}

.tbc-mc-scheduled-bulk-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tbc-mc-scheduled-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.tbc-mc-scheduled-filter-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--fcom-secondary-text);
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.tbc-mc-scheduled-filter-btn:hover {
    background: var(--fcom-light-bg);
}

.tbc-mc-scheduled-filter-btn.active {
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
}

.tbc-mc-scheduled-items {
    flex: 1;
    overflow-y: auto;
}

/* Individual list item */
.tbc-mc-scheduled-item {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--fcom-secondary-border);
    transition: background 0.15s;
    gap: 12px;
}

.tbc-mc-scheduled-item:hover {
    background: var(--fcom-light-bg);
}

.tbc-mc-scheduled-item.active {
    background: var(--fcom-active-bg);
}

.tbc-mc-scheduled-item.is-pending {
    border-left: 3px solid var(--tbc-warning);
}

.tbc-mc-scheduled-item.is-completed {
    border-left: 3px solid var(--tbc-success);
}

.tbc-mc-scheduled-item-icon {
    flex-shrink: 0;
    padding-top: 2px;
}

.tbc-mc-status-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tbc-mc-status-dot.tbc-mc-status-pending {
    background: var(--tbc-warning);
}

.tbc-mc-status-dot.tbc-mc-status-processing {
    background: var(--tbc-info);
    animation: pulse 1.5s infinite;
}

.tbc-mc-status-dot.tbc-mc-status-completed {
    background: var(--tbc-success);
}

.tbc-mc-status-dot.tbc-mc-status-cancelled {
    background: var(--tbc-danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tbc-mc-scheduled-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tbc-mc-scheduled-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.tbc-mc-scheduled-item-title {
    font-weight: 600;
    color: var(--fcom-primary-text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.tbc-mc-scheduled-item-time {
    color: var(--fcom-text-off);
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tbc-mc-scheduled-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--fcom-secondary-text);
}

.tbc-mc-scheduled-item-type {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tbc-mc-scheduled-item-recipients {
    color: var(--fcom-text-off);
}

.tbc-mc-scheduled-item-preview {
    color: var(--fcom-secondary-text);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right Panel: Detail */
.tbc-mc-scheduled-detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--fcom-secondary-bg);
    overflow: hidden;
}

.tbc-mc-scheduled-detail-panel.empty {
    align-items: center;
    justify-content: center;
}

.tbc-mc-scheduled-detail-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--fcom-primary-bg);
    border-bottom: 1px solid var(--fcom-primary-border);
    gap: 12px;
    flex-shrink: 0;
}

.tbc-mc-scheduled-back-btn {
    display: none;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--fcom-text-link);
    font-weight: 500;
}

.tbc-mc-scheduled-detail-title-wrap {
    flex: 1;
}

.tbc-mc-scheduled-detail-title-wrap h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    color: var(--fcom-primary-text);
}

.tbc-mc-scheduled-detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tbc-mc-scheduled-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tbc-mc-scheduled-detail-section {
    background: var(--fcom-primary-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.tbc-mc-scheduled-detail-section h4 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fcom-secondary-text);
    text-transform: uppercase;
}

.tbc-mc-scheduled-message-box {
    background: var(--fcom-secondary-bg);
    border: 1px solid var(--fcom-primary-border);
    border-radius: 8px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--fcom-primary-text);
    white-space: pre-wrap;
}

/* Quick Stats */
.tbc-mc-scheduled-detail-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.tbc-mc-scheduled-stat {
    flex: 1;
    background: var(--fcom-primary-bg);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.tbc-mc-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--fcom-primary-text);
}

.tbc-mc-stat-label {
    display: block;
    font-size: 12px;
    color: var(--fcom-text-off);
    margin-top: 4px;
}

/* Dates */
.tbc-mc-scheduled-detail-dates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tbc-mc-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--fcom-secondary-border);
}

.tbc-mc-date-row:last-child {
    border-bottom: none;
}

.tbc-mc-date-label {
    font-size: 13px;
    color: var(--fcom-secondary-text);
}

.tbc-mc-date-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--fcom-primary-text);
}

/* Media */
.tbc-mc-scheduled-media {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tbc-mc-scheduled-thumb {
    max-width: 80px;
    max-height: 80px;
    border-radius: 8px;
    border: 1px solid var(--fcom-primary-border);
    cursor: pointer;
    transition: transform 0.2s;
}

.tbc-mc-scheduled-thumb:hover {
    transform: scale(1.05);
}

.tbc-mc-file-link {
    display: inline-block;
    padding: 8px 12px;
    background: var(--fcom-secondary-content-bg, var(--fcom-light-bg));
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: var(--fcom-primary-text);
}

/* Action Bar */
.tbc-mc-scheduled-detail-actions {
    padding: 16px;
    background: var(--fcom-primary-bg);
    border-top: 1px solid var(--fcom-primary-border);
    flex-shrink: 0;
}

.tbc-mc-scheduled-detail-actions .tbc-mc-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    justify-content: center;
}

/* Empty state */
.tbc-mc-scheduled-tab .tbc-mc-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--fcom-secondary-text);
}

/* ===== SCHEDULED TAB MOBILE ===== */
@media (max-width: 768px) {
    .tbc-mc-scheduled-list {
        width: 100%;
        min-width: 100%;
        border-right: none;
    }

    .tbc-mc-scheduled-detail-panel {
        position: fixed;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .tbc-mc-scheduled-detail-panel.active {
        left: 0;
    }

    .tbc-mc-scheduled-back-btn {
        display: block;
    }

    .tbc-mc-scheduled-detail-stats {
        flex-wrap: wrap;
    }

    .tbc-mc-scheduled-stat {
        min-width: calc(50% - 6px);
    }

    .tbc-mc-scheduled-item-meta {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .tbc-mc-scheduled-item {
        padding: 12px;
    }

    .tbc-mc-scheduled-detail-content {
        padding: 12px;
    }

    .tbc-mc-scheduled-detail-section {
        padding: 12px;
    }

    .tbc-mc-stat-value {
        font-size: 20px;
    }
}

/* ===== SEND SMS TAB - TWO PANEL LAYOUT ===== */
.tbc-mc-send-tab {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.tbc-mc-send-panels {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left Panel: Contact Type List */
.tbc-mc-send-list {
    width: 320px;
    min-width: 280px;
    border-right: 1px solid var(--fcom-primary-border);
    display: flex;
    flex-direction: column;
    background: var(--fcom-primary-bg);
}

.tbc-mc-send-list-header {
    padding: 16px;
    border-bottom: 1px solid var(--fcom-primary-border);
    background: var(--fcom-light-bg);
    flex-shrink: 0;
}

.tbc-mc-send-list-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--fcom-primary-text);
}

.tbc-mc-send-types {
    flex: 1;
    overflow-y: auto;
}

.tbc-mc-send-type-item {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--fcom-secondary-border);
    transition: background 0.15s;
    gap: 14px;
}

.tbc-mc-send-type-item:hover {
    background: var(--fcom-light-bg);
}

.tbc-mc-send-type-item.active {
    background: var(--fcom-active-bg);
    border-left: 3px solid var(--fcom-text-link);
}

.tbc-mc-send-type-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.tbc-mc-send-type-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tbc-mc-send-type-title {
    font-weight: 600;
    color: var(--fcom-primary-text);
    font-size: 14px;
}

.tbc-mc-send-type-desc {
    color: var(--fcom-secondary-text);
    font-size: 12px;
}

/* Right Panel: Detail */
.tbc-mc-send-detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--fcom-secondary-bg);
    overflow: hidden;
}

.tbc-mc-send-detail-panel.empty {
    align-items: center;
    justify-content: center;
}

.tbc-mc-send-detail-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--fcom-primary-bg);
    border-bottom: 1px solid var(--fcom-primary-border);
    gap: 12px;
    flex-shrink: 0;
}

.tbc-mc-send-back-btn {
    display: none;
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--fcom-text-link);
    font-weight: 500;
}

.tbc-mc-send-detail-title-wrap {
    flex: 1;
}

.tbc-mc-send-detail-title-wrap h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--fcom-primary-text);
}

.tbc-mc-send-detail-title-wrap p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--fcom-secondary-text);
}

.tbc-mc-send-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Role filter section */
.tbc-mc-role-filter-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--fcom-secondary-bg);
    border-radius: 10px;
    border: 1px solid var(--fcom-primary-border);
}

.tbc-mc-role-filter-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.tbc-mc-role-filter-section .tbc-mc-multiselect {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 6px;
    font-size: 14px;
}

.tbc-mc-role-filter-section .tbc-mc-help-text {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--fcom-secondary-text);
}

/* Role cards */
.tbc-mc-role-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tbc-mc-role-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: var(--fcom-primary-bg);
    border: 1px solid var(--fcom-primary-border);
    border-radius: 10px;
    padding: 14px 16px;
    gap: 10px 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.tbc-mc-role-card:hover {
    border-color: var(--fcom-text-link);
    background: var(--fcom-secondary-bg);
}

.tbc-mc-role-card.selected {
    border-color: var(--fcom-text-link);
    background: var(--fcom-highlight-bg);
}

.tbc-mc-role-checkbox {
    flex-shrink: 0;
}

.tbc-mc-role-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.tbc-mc-role-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.tbc-mc-role-name {
    font-weight: 600;
    color: var(--fcom-primary-text);
    font-size: 14px;
}

.tbc-mc-role-desc {
    color: var(--fcom-secondary-text);
    font-size: 12px;
}

.tbc-mc-role-count {
    font-size: 13px;
    color: var(--fcom-text-off);
    flex-shrink: 0;
}

/* Role users summary - spans full width below role info */
.tbc-mc-role-users-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-basis: 100%;
    margin-top: 4px;
    padding: 10px 14px;
    background: var(--fcom-highlight-bg);
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid var(--fcom-secondary-border);
}

.tbc-mc-role-users-count {
    color: var(--fcom-primary-text);
}

.tbc-mc-role-users-count strong {
    color: var(--fcom-text-link);
    font-weight: 600;
}

.tbc-mc-view-users-btn {
    background: var(--fcom-primary-button);
    border: none;
    color: var(--fcom-primary-button-text);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tbc-mc-view-users-btn:hover {
    filter: brightness(0.85);
}

/* Mobile: Stack role card content */
@media (max-width: 480px) {
    .tbc-mc-role-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tbc-mc-role-card > .tbc-mc-role-checkbox {
        position: absolute;
        right: 16px;
        top: 14px;
    }

    .tbc-mc-role-card {
        position: relative;
        padding-right: 50px;
    }

    .tbc-mc-role-info {
        width: 100%;
    }

    .tbc-mc-role-count {
        font-size: 12px;
        color: var(--fcom-text-link);
        background: var(--fcom-highlight-bg);
        padding: 2px 8px;
        border-radius: 10px;
    }

    .tbc-mc-role-users-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        text-align: center;
    }

    .tbc-mc-view-users-btn {
        width: 100%;
        padding: 10px;
    }
}

/* Users slide-out panel */
.tbc-mc-users-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--fcom-primary-bg);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.tbc-mc-users-panel.open {
    right: 0;
}

.tbc-mc-users-panel-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
    flex-shrink: 0;
    gap: 12px;
}

.tbc-mc-close-users-panel {
    background: transparent;
    border: none;
    color: var(--fcom-primary-button-text);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tbc-mc-users-panel-title {
    font-size: 18px;
    font-weight: 500;
    flex: 1;
}

.tbc-mc-users-panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--fcom-secondary-bg);
    border-bottom: 1px solid var(--fcom-primary-border);
}

.tbc-mc-select-all-users {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.tbc-mc-users-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.tbc-mc-users-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tbc-mc-user-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--fcom-secondary-border);
    gap: 12px;
}

.tbc-mc-user-item:hover {
    background: var(--fcom-secondary-bg);
}

.tbc-mc-user-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.tbc-mc-user-item.opted-out {
    opacity: 0.5;
    background: var(--fcom-secondary-bg);
}

.tbc-mc-user-info {
    flex: 1;
    min-width: 0;
}

.tbc-mc-user-name {
    font-weight: 500;
    color: var(--fcom-primary-text);
    font-size: 14px;
    display: block;
}

.tbc-mc-user-phone {
    color: var(--fcom-secondary-text);
    font-size: 13px;
    display: block;
    margin-top: 2px;
}

.tbc-mc-opted-out-badge {
    font-size: 11px;
    background: var(--tbc-danger-bg);
    color: var(--tbc-danger);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.tbc-mc-users-panel-footer {
    padding: 16px 20px;
    background: var(--fcom-secondary-bg);
    border-top: 1px solid var(--fcom-primary-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tbc-mc-users-selected-count {
    font-size: 14px;
    color: var(--fcom-secondary-text);
}

.tbc-mc-users-done-btn {
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.tbc-mc-users-done-btn:hover {
    filter: brightness(0.85);
}

/* Users panel overlay */
.tbc-mc-users-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.tbc-mc-users-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.tbc-mc-loading-small {
    padding: 12px 20px;
    color: var(--fcom-secondary-text);
    font-size: 13px;
    text-align: center;
}

/* Mobile: Users panel full width */
@media (max-width: 768px) {
    .tbc-mc-users-panel {
        max-width: none;
    }
}

/* Hierarchy list (products, dates, customers) */
.tbc-mc-hierarchy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tbc-mc-hierarchy-item {
    background: var(--fcom-primary-bg);
    border: 1px solid var(--fcom-primary-border);
    border-radius: 10px;
    overflow: hidden;
}

.tbc-mc-hierarchy-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    gap: 12px;
    transition: background 0.2s;
}

.tbc-mc-hierarchy-header:hover {
    background: var(--fcom-light-bg);
}

.tbc-mc-hierarchy-expand {
    color: var(--fcom-text-link);
    font-size: 12px;
    transition: transform 0.2s;
}

.tbc-mc-hierarchy-item.expanded .tbc-mc-hierarchy-expand {
    transform: rotate(90deg);
}

.tbc-mc-hierarchy-title {
    flex: 1;
    font-weight: 500;
    color: var(--fcom-primary-text);
}

.tbc-mc-hierarchy-count {
    font-size: 12px;
    color: var(--fcom-text-off);
    background: var(--fcom-light-bg);
    padding: 4px 10px;
    border-radius: 12px;
}

.tbc-mc-hierarchy-content {
    display: none;
    border-top: 1px solid var(--fcom-primary-border);
    padding: 12px 16px;
    background: var(--fcom-secondary-bg);
}

.tbc-mc-hierarchy-item.expanded .tbc-mc-hierarchy-content {
    display: block;
}

/* Date items nested in products */
.tbc-mc-date-item {
    margin-left: 20px;
    border-bottom: 1px solid var(--fcom-secondary-border);
}

.tbc-mc-date-item:last-child {
    border-bottom: none;
}

.tbc-mc-date-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.tbc-mc-date-header:hover {
    background: var(--fcom-light-bg);
}

.tbc-mc-date-label {
    flex: 1;
    font-size: 13px;
    color: var(--fcom-primary-text);
}

.tbc-mc-date-count {
    font-size: 12px;
    color: var(--fcom-text-off);
    background: var(--fcom-light-bg);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Customer items nested in dates */
.tbc-mc-date-customers {
    padding: 8px 12px 8px 32px;
    background: var(--fcom-secondary-bg);
}

.tbc-mc-customer-select-all {
    padding: 8px 0;
    border-bottom: 1px solid var(--fcom-primary-border);
    margin-bottom: 8px;
}

.tbc-mc-customer-select-all label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fcom-primary-text);
    cursor: pointer;
}

.tbc-mc-customer-item {
    padding: 6px 0;
}

.tbc-mc-customer-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.tbc-mc-customer-item.opted-out label {
    opacity: 0.5;
    cursor: not-allowed;
}

.tbc-mc-customer-name {
    flex: 1;
    color: var(--fcom-primary-text);
}

.tbc-mc-customer-phone {
    color: var(--fcom-text-off);
    font-size: 12px;
}

.tbc-mc-opted-out {
    color: var(--tbc-danger);
    font-size: 11px;
}

/* Loading small indicator */
.tbc-mc-loading-small {
    padding: 12px;
    font-size: 13px;
    color: var(--fcom-text-off);
    text-align: center;
}

/* No data message */
.tbc-mc-no-data {
    padding: 16px;
    font-size: 13px;
    color: var(--fcom-text-off);
    text-align: center;
    font-style: italic;
}

/* Parsed number items */
.tbc-mc-parsed-number-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--fcom-secondary-bg);
    border-radius: 6px;
    margin-bottom: 6px;
}

.tbc-mc-parsed-number-item span {
    font-size: 13px;
    color: var(--fcom-primary-text);
}

.tbc-mc-invalid-number {
    padding: 4px 0;
    font-size: 13px;
}

/* Category filter section */
.tbc-mc-category-filter-section {
    background: var(--fcom-primary-bg);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.tbc-mc-category-filter-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.tbc-mc-multiselect {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 8px;
}

.tbc-mc-help-text {
    font-size: 11px;
    color: var(--fcom-text-off);
    margin: 0 0 12px 0;
}

.tbc-mc-load-products-btn {
    width: 100%;
}

/* Manual input section */
.tbc-mc-manual-input-section {
    background: var(--fcom-primary-bg);
    border-radius: 10px;
    padding: 16px;
}

.tbc-mc-manual-input-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.tbc-mc-manual-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.tbc-mc-manual-textarea:focus {
    outline: none;
    border-color: var(--fcom-text-link);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.tbc-mc-parse-numbers-btn {
    width: 100%;
}

.tbc-mc-parsed-numbers-section {
    background: var(--fcom-primary-bg);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

.tbc-mc-parsed-numbers-section h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--fcom-primary-text);
}

.tbc-mc-valid-numbers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tbc-mc-valid-number-chip {
    background: var(--tbc-success-bg);
    color: var(--tbc-success);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
}

.tbc-mc-invalid-numbers-alert {
    margin-top: 16px;
    padding: 12px;
    background: var(--tbc-warning-bg);
    border-radius: 8px;
}

.tbc-mc-invalid-numbers-alert h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--tbc-warning);
}

.tbc-mc-invalid-numbers-list {
    font-size: 13px;
    color: var(--tbc-warning);
}

/* Action bar */
.tbc-mc-send-detail-actions {
    padding: 16px;
    background: var(--fcom-primary-bg);
    border-top: 1px solid var(--fcom-primary-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.tbc-mc-selected-summary {
    flex: 1;
}

.tbc-mc-selected-count {
    font-size: 14px;
    color: var(--fcom-secondary-text);
    font-weight: 500;
}

.tbc-mc-open-compose {
    min-width: 160px;
}

/* Slide-over Compose Panel */
.tbc-mc-compose-slide {
    position: fixed;
    top: 0;
    right: -75%;
    width: 75%;
    max-width: 700px;
    height: 100%;
    background: var(--fcom-primary-bg);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tbc-mc-compose-slide.open {
    right: 0;
}

.tbc-mc-compose-slide-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
    flex-shrink: 0;
    gap: 12px;
}

.tbc-mc-close-compose {
    background: transparent;
    border: none;
    color: var(--fcom-primary-button-text);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.tbc-mc-compose-slide-title {
    font-size: 18px;
    font-weight: 500;
    flex: 1;
}

.tbc-mc-compose-recipient-count {
    font-size: 14px;
    opacity: 0.9;
}

.tbc-mc-compose-slide-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--fcom-primary-bg);
}

.tbc-mc-compose-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.tbc-mc-compose-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Compose slide contact list */
.tbc-mc-compose-contact-list {
    display: none;
    max-height: 180px;
    overflow-y: auto;
    padding: 12px;
    background: var(--fcom-secondary-bg);
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid var(--fcom-primary-border);
}

.tbc-mc-compose-contact-list-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--fcom-secondary-text);
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fcom-primary-border);
}

.tbc-mc-compose-summary {
    font-size: 14px;
    color: var(--fcom-primary-text);
    line-height: 1.4;
}

.tbc-mc-compose-recipients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tbc-mc-compose-recipient {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--fcom-primary-bg);
    border-radius: 20px;
    font-size: 13px;
    color: var(--fcom-primary-text);
    border: 1px solid var(--fcom-primary-border);
}

.tbc-mc-compose-recipient-phone {
    font-size: 11px;
    color: var(--fcom-secondary-text);
    margin-left: 6px;
}

/* ===== SEND SMS TAB MOBILE ===== */
@media (max-width: 768px) {
    .tbc-mc-send-list {
        width: 100%;
        min-width: 100%;
        border-right: none;
    }

    .tbc-mc-send-detail-panel {
        position: fixed;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }

    .tbc-mc-send-detail-panel.active {
        left: 0;
    }

    .tbc-mc-send-back-btn {
        display: block;
    }

    .tbc-mc-compose-slide {
        width: 100%;
        right: -100%;
        max-width: none;
    }

    .tbc-mc-send-detail-actions {
        flex-direction: column;
        gap: 12px;
    }

    .tbc-mc-selected-summary {
        text-align: center;
    }

    .tbc-mc-open-compose {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tbc-mc-send-type-item {
        padding: 14px;
    }

    .tbc-mc-send-type-icon {
        font-size: 24px;
    }

    .tbc-mc-role-card {
        padding: 12px;
    }
}

/* ===== CALL TAB LAYOUT ===== */
.tbc-mc-call-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 20px;
    overflow-y: auto;
}

.tbc-mc-call-center-wrapper {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.tbc-mc-call-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbc-mc-call-icon .bb-icon {
    font-size: 36px;
    color: white;
}

.tbc-mc-call-center-wrapper h3 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--fcom-primary-text);
}

.tbc-mc-call-description {
    margin: 0 0 30px;
    font-size: 14px;
    color: var(--fcom-secondary-text);
    line-height: 1.5;
}

.tbc-mc-call-center-container {
    background: var(--fcom-primary-bg);
    border: 1px solid var(--fcom-primary-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tbc-mc-search-input-wrapper {
    margin-bottom: 16px;
}

.tbc-mc-search-input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tbc-mc-search-input-wrapper input:focus {
    outline: none;
    border-color: var(--fcom-text-link);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.tbc-mc-btn-call {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tbc-mc-btn-call:disabled {
    background: var(--fcom-secondary-border);
    color: var(--fcom-text-off);
    cursor: not-allowed;
}

.tbc-mc-btn-call .bb-icon {
    font-size: 18px;
}

#call-center-feedback {
    margin-top: 16px;
}

#call-center-feedback .tbc-mc-feedback {
    margin: 0;
    border-radius: 8px;
}

.tbc-mc-call-help {
    margin-top: 24px;
}

.tbc-mc-call-help p {
    font-size: 12px;
    color: var(--fcom-text-off);
    margin: 0;
}

/* Call tab mobile adjustments */
@media (max-width: 480px) {
    .tbc-mc-call-tab {
        padding: 20px 16px;
    }

    .tbc-mc-call-icon {
        width: 60px;
        height: 60px;
    }

    .tbc-mc-call-icon .bb-icon {
        font-size: 28px;
    }

    .tbc-mc-call-center-wrapper h3 {
        font-size: 20px;
    }

    .tbc-mc-call-center-container {
        padding: 16px;
    }
}

/* ===== SETTINGS TAB ===== */
.tbc-mc-settings {
    padding: 32px;
    max-width: 600px;
}

.tbc-mc-settings-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--fcom-primary-text);
}

.tbc-mc-settings-desc {
    color: var(--fcom-secondary-text);
    font-size: 13px;
    margin: 0 0 24px 0;
}

.tbc-mc-settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tbc-mc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tbc-mc-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--fcom-primary-text);
}

.tbc-mc-field input[type="text"],
.tbc-mc-field input[type="password"] {
    padding: 10px 12px;
    border: 1px solid var(--fcom-primary-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    transition: border-color 0.2s;
}

.tbc-mc-field input[type="text"]:focus,
.tbc-mc-field input[type="password"]:focus {
    outline: none;
    border-color: var(--fcom-text-link);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.tbc-mc-settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.tbc-mc-btn-primary {
    background: var(--fcom-primary-button);
    color: var(--fcom-primary-button-text);
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.tbc-mc-btn-primary:hover {
    filter: brightness(0.85);
}

.tbc-mc-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#tbc-mc-settings-feedback {
    font-size: 13px;
    font-weight: 500;
}

/* ===== FEEDBACK MESSAGES ===== */
.tbc-mc-feedback {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.tbc-mc-feedback p {
    margin: 0;
}

.tbc-mc-feedback.success {
    background: var(--fcom-light-bg, #d4edda);
    color: var(--fcom-primary-text, #155724);
}

.tbc-mc-feedback.error {
    background: var(--fcom-highlight-bg, #f8d7da);
    color: var(--fcom-primary-text, #721c24);
}

.tbc-mc-feedback.notice,
.tbc-mc-feedback.alert {
    background: var(--fcom-light-bg, #fff3cd);
    color: var(--fcom-primary-text, #856404);
}

