/* ==========================================================================
   WhatsApp Multi-Tenant SaaS Platform - Core Stylesheet (Vanilla CSS3)
   Lightweight, responsive, modern, high-contrast, production-ready
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: #ecfdf5;
    --accent-glow: rgba(16, 185, 129, 0.15);
    
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: rgba(37, 99, 235, 0.12);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-bright: #ffffff;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-sidebar: #1e293b;
    
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #ca8a04;
    --warning-bg: #fef9c3;
    --info: #2563eb;
    --info-bg: #dbeafe;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    
    --sidebar-width: 256px;
    --header-height: 64px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   App Layout
   -------------------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.25s ease-in-out;
    z-index: 40;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-sidebar);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.sidebar-brand svg {
    width: 24px;
    height: 24px;
    fill: var(--accent);
}

.sidebar-badge {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-group-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.1em;
    padding: 12px 10px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-link:hover {
    background-color: var(--bg-sidebar-hover);
    color: var(--text-sidebar-bright);
}

.nav-link.active {
    background-color: var(--bg-sidebar-active);
    color: #60a5fa;
    font-weight: 600;
}

.nav-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-sidebar);
}

.tenant-badge {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.4);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: #cbd5e1;
}

.tenant-badge-title {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: block;
}

.tenant-badge-name {
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-meta {
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.content-container {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   UI Components: Cards & Grids
   -------------------------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    background-color: #fafbfc;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Metric Card */
.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-sub {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Buttons & Controls
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-whatsapp {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-whatsapp:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Alerts & Notifications
   -------------------------------------------------------------------------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.alert-success {
    background-color: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: var(--warning-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: var(--info-bg);
    color: #075985;
    border: 1px solid #bae6fd;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.badge-success { background-color: #dcfce7; color: #15803d; }
.badge-danger { background-color: #fee2e2; color: #b91c1c; }
.badge-warning { background-color: #fef9c3; color: #a16207; }
.badge-info { background-color: #dbeafe; color: #1d4ed8; }
.badge-neutral { background-color: #f1f5f9; color: #475569; }

/* --------------------------------------------------------------------------
   Data Tables
   -------------------------------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.table th {
    padding: 10px 16px;
    background-color: transparent;
    color: #94a3b8;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f8fafc;
    color: var(--text-main);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #f8fafc;
}

/* --------------------------------------------------------------------------
   Forms & Inputs
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.15);
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* --------------------------------------------------------------------------
   Modal Foundation (Vanilla JS Controlled)
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #fafbfc;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .topbar {
        padding: 0 16px;
    }

    .content-container {
        padding: 16px;
    }
}

/* ==========================================================================
   WhatsApp Communication Center & WATI-Style Inbox Styles
   ========================================================================== */
.inbox-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 600px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.inbox-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.inbox-main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* LEFT COLUMN: Conversation List */
.inbox-col-left {
    width: 350px;
    min-width: 320px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    height: 100%;
}

.inbox-search-box {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: #f8fafc;
}

.inbox-filters {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-light);
    background: #ffffff;
    scrollbar-width: thin;
}

.inbox-filter-pill {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: #f1f5f9;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.inbox-filter-pill:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.inbox-filter-pill.active {
    background: #0f172a;
    color: #ffffff;
}

.inbox-filter-pill .badge-count {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.inbox-filter-pill:not(.active) .badge-count {
    background: #cbd5e1;
    color: #334155;
}

.conv-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
}

.conv-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.12s ease;
    position: relative;
}

.conv-item:hover {
    background: #f8fafc;
}

.conv-item.active {
    background: #f0fdf4;
    border-left: 3px solid #16a34a;
}

.conv-item.unread {
    background: #f8fafc;
}

.conv-item.unread .conv-name {
    font-weight: 700;
}

.conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.conv-avatar.active-channel {
    background: #dcfce7;
    color: #15803d;
}

.conv-body {
    flex: 1;
    min-width: 0;
}

.conv-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.conv-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.conv-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.conv-preview-text {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conv-badge {
    background: #22c55e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
    flex-shrink: 0;
}

.conv-tag-pill {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 4px;
}

.conv-agent-badge {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* CENTER COLUMN: Chat Window */
.inbox-col-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #efeae2;
    background-image: radial-gradient(#d1d7db 1px, transparent 1px);
    background-size: 16px 16px;
    height: 100%;
    position: relative;
}

.chat-header {
    background: #ffffff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    z-index: 10;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.date-separator {
    text-align: center;
    margin: 12px 0;
}

.date-separator span {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    box-shadow: var(--shadow-sm);
}

.msg-row {
    display: flex;
    width: 100%;
}

.msg-row.outbound {
    justify-content: flex-end;
}

.msg-row.inbound {
    justify-content: flex-start;
}

.msg-bubble {
    max-width: 68%;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    position: relative;
    font-size: 14px;
    line-height: 1.45;
}

.msg-row.outbound .msg-bubble {
    background: #d9fdd3;
    color: #111b21;
    border-top-right-radius: 2px;
}

.msg-row.inbound .msg-bubble {
    background: #ffffff;
    color: #111b21;
    border-top-left-radius: 2px;
}

.msg-text {
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
}

.msg-status-tick {
    display: inline-flex;
    align-items: center;
}

.msg-status-tick.read {
    color: #53bdeb;
}

.msg-status-tick.failed {
    color: #ef4444;
}

.msg-template-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: #dcfce7;
    color: #15803d;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.chat-composer {
    background: #f0f2f5;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-composer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input {
    flex: 1;
    background: #ffffff;
    border: 1px solid #d1d7db;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #25d366;
}

.btn-chat-send {
    background: #25d366;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.btn-chat-send:hover {
    background: #1eb857;
}

/* RIGHT COLUMN: Contact CRM Details */
.inbox-col-right {
    width: 320px;
    min-width: 300px;
    background: #ffffff;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

.contact-crm-header {
    padding: 24px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    background: #f8fafc;
}

.contact-crm-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.contact-crm-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.contact-crm-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Empty State */
.inbox-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.inbox-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #94a3b8;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .inbox-col-right {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 320px;
        z-index: 30;
        box-shadow: -4px 0 12px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }
    .inbox-col-right.open {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .inbox-col-left {
        width: 100%;
    }
    .inbox-col-center {
        display: none;
    }
    .inbox-main-layout.chat-active .inbox-col-left {
        display: none;
    }
    .inbox-main-layout.chat-active .inbox-col-center {
        display: flex;
        width: 100%;
    }
}

