/* ==========================================================================
   OmniSend CSS Design System - Glassmorphism Dark Mode
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #0a0e17;
    --panel-dark: rgba(16, 22, 35, 0.65);
    --panel-dark-solid: #101623;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(37, 211, 102, 0.4);
    
    --primary-color: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.15);
    --whatsapp-green: #25D366;
    --whatsapp-green-glow: rgba(37, 211, 102, 0.15);
    --whatsapp-teal: #128C7E;
    --whatsapp-light: #dcf8c6;
    --whatsapp-bg: #efeae2;
    --whatsapp-bg-dark: #0b141a;
    --whatsapp-bubble-out: #005c4b;
    --whatsapp-bubble-in: #202c33;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #1f2937;
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;

    /* Fonts & Geometry */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;
    --sidebar-width: 280px;
    --header-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Animation Speeds */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Core Resets & Page Settings
   ========================================================================== */

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100dvh;
    width: 100vw;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(37, 211, 102, 0.08) 0px, transparent 50%);
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.app-container {
    display: flex;
    width: 100vw;
    height: 100dvh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--panel-dark);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--whatsapp-green));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-icon i {
    width: 22px;
    height: 22px;
    color: white;
}

.whatsapp-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--whatsapp-green);
    border: 2px solid var(--bg-dark);
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-secondary);
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.menu-item i {
    width: 18px;
    height: 18px;
}

.menu-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    color: white;
    background: var(--primary-glow);
    border-left: 3px solid var(--primary-color);
}

.menu-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.pulse-indicator {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--whatsapp-green);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(37, 211, 102, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 16px;
}

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

.status-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.status-indicator-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online { background-color: var(--whatsapp-green); }
.status-offline { background-color: var(--danger); }
.status-warning { background-color: var(--warning); }

.status-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.status-description {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Workspace layout */
.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}

.workspace-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(8px);
    background: rgba(10, 14, 23, 0.4);
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.workspace-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

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

.connection-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.connection-pill.connected {
    color: var(--whatsapp-green);
    border-color: rgba(37, 211, 102, 0.3);
    background: var(--whatsapp-green-glow);
}

.connection-pill i {
    width: 14px;
    height: 14px;
}

.workspace-viewport {
    flex: 1;
    height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    padding: 32px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.view-panel {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.view-panel.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   UI Components (Buttons, Cards, Forms)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-text-only {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color var(--transition-fast);
}

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

.btn-full-width {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Cards */
.grid-card {
    background: var(--panel-dark);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

/* Forms */
.card-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-row {
    display: flex;
    gap: 16px;
}

.form-group-row .form-group {
    flex: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

input, select, textarea {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   VIEW: OVERVIEW (Metrics Dashboard)
   ========================================================================== */

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

.kpi-card {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.kpi-card:nth-child(2)::after { background: var(--whatsapp-green); }
.kpi-card:nth-child(3)::after { background: var(--info); }
.kpi-card:nth-child(4)::after { background: var(--warning); }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-sent { background: rgba(99, 102, 241, 0.12); color: var(--primary-color); }
.icon-delivered { background: rgba(37, 211, 102, 0.12); color: var(--whatsapp-green); }
.icon-read { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.icon-conversations { background: rgba(245, 158, 11, 0.12); color: var(--warning); }

.kpi-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 500;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-neutral { color: var(--text-muted); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.main-chart-card {
    min-height: 340px;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-sent { background-color: var(--primary-color); }
.dot-read { background-color: var(--whatsapp-green); }

.chart-container {
    width: 100%;
    height: calc(100% - 40px);
    display: flex;
    align-items: center;
}

.analytics-svg {
    width: 100%;
    height: 100%;
}

.quick-status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.status-item-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-item-card .status-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.status-item-card .status-icon i {
    width: 18px;
    height: 18px;
}

.status-details {
    flex: 1;
}

.status-details h5 {
    font-size: 0.85rem;
    font-weight: 600;
}

.status-details p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
}

.badge-active { background: rgba(37, 211, 102, 0.12); color: var(--whatsapp-green); }
.badge-neutral { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.badge-inactive { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.quick-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   VIEW: LIVE CHAT / INBOX (Phone & API Log panels)
   ========================================================================== */

.inbox-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) minmax(0, 340px);
    height: 100%;
    margin: 0;
    border-top: 1px solid var(--border-color);
    min-height: 0;
}

.inbox-layout.hide-logs {
    grid-template-columns: 280px minmax(0, 1fr);
}

.inbox-layout.hide-logs .api-inspector-panel {
    display: none;
}

.chat-list-panel {
    border-right: 1px solid var(--border-color);
    background: rgba(10, 14, 23, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.panel-search-bar {
    padding: 16px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.panel-search-bar input {
    width: 100%;
    padding-left: 36px;
}

.panel-search-bar i {
    position: absolute;
    left: 28px;
    top: 28px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.chat-items-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.chat-item.active {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--primary-color);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.chat-avatar.status-online {
    box-shadow: 0 0 0 2px var(--bg-dark), 0 0 0 4px var(--whatsapp-green);
}

.chat-item-details {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.chat-item-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-item-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.chat-item-badge {
    background: var(--whatsapp-green);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

/* Conversation workspace panel */
.chat-conversation-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: var(--whatsapp-bg-dark);
    position: relative;
    min-width: 0;
    height: 100%;
    min-height: 0;
}

/* Custom overlay design for WhatsApp look */
.chat-conversation-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

.chat-header {
    height: var(--header-height);
    background: #111b21;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    flex-shrink: 0;
}

.chat-header .chat-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.chat-header .chat-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-header .chat-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.messages-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

.empty-conversation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: var(--text-muted);
    text-align: center;
    padding: 0 40px;
}

.empty-conversation i {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.08);
}

/* Chat bubble aesthetics */
.message-bubble {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    position: relative;
    font-size: 0.88rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.message-bubble.out {
    align-self: flex-end;
    background: var(--whatsapp-bubble-out);
    color: #e9edef;
    border-top-right-radius: 2px;
}

.message-bubble.in {
    align-self: flex-start;
    background: var(--whatsapp-bubble-in);
    color: #e9edef;
    border-top-left-radius: 2px;
}

.bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.bubble-meta i {
    width: 13px;
    height: 13px;
}

.bubble-meta i.ticks-read { color: #53bdeb; }

/* Interactive Template and Button Layouts inside chat */
.bubble-template-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bubble-header {
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.bubble-media-preview {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 320px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.bubble-media-preview img, .bubble-media-preview video {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.media-actions-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.bubble-media-preview:hover .media-actions-overlay {
    opacity: 1;
}

.btn-media-download {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-media-download:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.btn-media-download i {
    width: 16px;
    height: 16px;
}

.bubble-footer {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.bubble-interactive-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
}

.chat-bubble-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: #53bdeb;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-bubble-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Input styling */
.chat-input-area {
    background: #111b21;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
    flex-shrink: 0;
}

.chat-input-area.disabled {
    pointer-events: none;
    opacity: 0.4;
}

.input-utilities {
    display: flex;
    gap: 16px;
}

.utility-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.utility-btn:hover {
    color: var(--whatsapp-green);
}

.utility-btn i {
    width: 16px;
    height: 16px;
}

.input-form-row {
    display: flex;
    gap: 12px;
}

.input-form-row input {
    flex: 1;
    background: #2a3942;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 0.9rem;
}

.input-form-row input:focus {
    box-shadow: none;
    background: #32444f;
}

.send-msg-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--whatsapp-teal);
}

.send-msg-btn:hover {
    background: var(--whatsapp-green);
}

/* API Inspector Side Panel */
.api-inspector-panel {
    background: var(--panel-dark-solid);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    min-height: 0;
}

.inspector-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inspector-header h4 {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inspector-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-family: monospace;
    font-size: 0.78rem;
}

.empty-log-msg {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
    text-align: center;
    padding-top: 30px;
}

.log-entry {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.log-entry-header {
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.log-type-request { background-color: var(--primary-color); }
.log-type-response { background-color: var(--success); }
.log-type-webhook { background-color: var(--info); }
.log-type-error { background-color: var(--danger); }

.log-entry-content {
    padding: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #22c55e;
}

/* ==========================================================================
   VIEW: TEMPLATE MANAGER & PREVIEW
   ========================================================================== */

.template-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    height: 100%;
}

.template-list-panel {
    display: flex;
    flex-direction: column;
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.template-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.template-card {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-card:hover, .template-card.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.03);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-card-category {
    font-size: 0.72rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-weight: 600;
}

.template-card-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-card-footer {
    margin-top: auto;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

.template-badge-approved { color: var(--success); }
.template-badge-pending { color: var(--warning); }

.template-status-approved { color: var(--success) !important; font-weight: 600; }
.template-status-pending { color: var(--warning) !important; font-weight: 600; }
.template-status-rejected { color: var(--danger) !important; font-weight: 600; }

.quality-tag { font-weight: 500; text-transform: uppercase; border-radius: 4px; }
.quality-tag-green { background: rgba(16, 185, 129, 0.15) !important; color: #10b981 !important; border: 1px solid rgba(16, 185, 129, 0.3) !important; }
.quality-tag-yellow { background: rgba(245, 158, 11, 0.15) !important; color: #f59e0b !important; border: 1px solid rgba(245, 158, 11, 0.3) !important; }
.quality-tag-red { background: rgba(239, 68, 68, 0.15) !important; color: #ef4444 !important; border: 1px solid rgba(239, 68, 68, 0.3) !important; }

/* Phone Mockup Preview details */
.template-preview-panel, .campaign-preview-panel {
    border-left: 1px solid var(--border-color);
    padding-left: 32px;
}

.preview-card-sticky {
    position: sticky;
    top: 0;
}

.phone-mockup-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.phone-mockup {
    width: 280px;
    height: 480px;
    background: #010101;
    border: 10px solid #2b2b2b;
    border-radius: 36px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.phone-screen {
    flex: 1;
    background-color: var(--whatsapp-bg-dark);
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-size: cover;
    opacity: 0.9;
    display: flex;
    flex-direction: column;
}

.phone-header {
    height: 48px;
    background: #1f2c34;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.phone-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--whatsapp-teal);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}

.phone-meta h5 {
    font-size: 0.8rem;
    font-weight: 600;
}

.phone-meta p {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.phone-messages-area {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.phone-messages-area.static-height {
    min-height: 220px;
    justify-content: center;
}

.phone-whatsapp-template-bubble {
    align-self: flex-start;
    background: #202c33;
    border-radius: 8px;
    border-top-left-radius: 2px;
    padding: 8px 10px;
    max-width: 90%;
    color: #e9edef;
    font-size: 0.78rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.template-header-preview {
    font-weight: 700;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

.template-body-preview {
    line-height: 1.35;
    word-break: break-word;
}

.template-footer-preview {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
}

.template-buttons-preview {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
}

.template-btn-preview-node {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #53bdeb;
    text-align: center;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ==========================================================================
   VIEW: CAMPAIGN BROADCASTS
   ========================================================================== */

.campaign-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 32px;
}

.csv-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.005);
    transition: all var(--transition-fast);
}

.csv-upload-box:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.02);
}

.csv-upload-box i {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
}

.csv-upload-box p span {
    color: var(--primary-color);
    font-weight: 600;
}

.file-name-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--whatsapp-green);
}

.campaigns-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.no-campaigns {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    gap: 12px;
}

.no-campaigns i {
    width: 36px;
    height: 36px;
    color: rgba(255, 255, 255, 0.05);
}

.campaign-card {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.campaign-card-header {
    display: flex;
    justify-content: space-between;
}

.campaign-card-meta h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.campaign-card-meta span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.campaign-status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}

.campaign-status-completed { background: rgba(37, 211, 102, 0.12); color: var(--whatsapp-green); }
.campaign-status-running { background: rgba(99, 102, 241, 0.12); color: var(--primary-color); }
.campaign-status-scheduled { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.campaign-status-paused { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.campaign-progress-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.campaign-progress-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.campaign-progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.campaign-progress-bar-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   VIEW: FLOW BUILDER (Visual chatbot setup)
   ========================================================================== */

.flow-builder-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: calc(100dvh - var(--header-height) - 100px);
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: calc(100dvh - var(--header-height) - 260px);
}

.flow-rule-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.flow-rule-card:hover {
    border-color: var(--primary-color);
}

.flow-rule-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flow-rule-keyword {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--whatsapp-green);
}

.flow-rule-action-summary {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flow-rule-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.flow-workspace-panel {
    background: #090d14;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workspace-header-bar {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workspace-title-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.workspace-title-info span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.flow-workspace-grid {
    flex: 1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow: auto;
    padding: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-content: flex-start;
}

/* Simulated Bot visual nodes */
.bot-node {
    width: 220px;
    background: var(--panel-dark-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeIn var(--transition-fast);
}

.bot-node.node-trigger { border-color: var(--primary-color); }
.bot-node.node-response { border-color: var(--whatsapp-green); }

.bot-node-header {
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.node-response .bot-node-header {
    background: rgba(37, 211, 102, 0.08);
}

.bot-node-body {
    padding: 12px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.node-connector-out {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid var(--bg-dark);
}

.node-connector-in {
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--whatsapp-green);
    border: 2px solid var(--bg-dark);
}

/* ==========================================================================
   VIEW: WEBHOOK CONSOLE & SIMULATOR
   ========================================================================== */

.webhooks-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
}

.webhook-event-selectors {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.selector-card {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.selector-card:hover, .selector-card.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.02);
}

.selector-card .card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.selector-card.active .card-icon {
    color: var(--primary-color);
    background: var(--primary-glow);
}

.selector-card h5 {
    font-size: 0.85rem;
    font-weight: 600;
}

.selector-card p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.payload-config-card {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.payload-config-card h5 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.webhook-logs-panel {
    display: flex;
    flex-direction: column;
}

.webhook-logs-viewport {
    flex: 1;
    border: 1px solid var(--border-color);
    background: #090d16;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
}

.no-webhooks {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 12px;
}

.no-webhooks i {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   VIEW: BUSINESS PROFILE & CATALOGS
   ========================================================================== */

.profile-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.catalog-card {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.catalog-image {
    height: 110px;
    overflow: hidden;
}

.catalog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-card-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.catalog-card-details h5 {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-card-details .price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--whatsapp-green);
}

.catalog-card-details .sku {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: monospace;
}

.catalog-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

/* ==========================================================================
   VIEW: SETTINGS
   ========================================================================== */

.settings-layout {
    max-width: 680px;
    margin: 0 auto;
}

.settings-card {
    background: var(--panel-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.form-buttons-row {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(4, 6, 10, 0.8);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast) ease-in-out;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--panel-dark-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn var(--transition-normal);
}

.modal-large {
    max-width: 820px;
}

@keyframes modalSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Template builder dynamic preview and editor grids */
.template-builder-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.builder-preview {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.builder-preview h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* Quick webhook popover positioning */
.trigger-popover-btn {
    position: relative;
}

.popover-overlay {
    position: absolute;
    top: 80px;
    right: 32px;
    width: 320px;
    background: var(--panel-dark-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 150;
    display: none;
    flex-direction: column;
    animation: fadeIn var(--transition-fast);
}

.popover-overlay.active {
    display: flex;
}

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

.popover-header h5 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-close-popover {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.popover-body {
    padding: 16px;
}

.popover-body p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.popover-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popover-btn-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.popover-btn-action:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary-color);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(10, 14, 23, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-back-btn {
    display: none !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .inbox-layout {
        grid-template-columns: 240px 1fr;
    }
    .api-inspector-panel {
        display: none; /* Hide API log side on medium screens */
    }
    .template-layout, .campaign-layout, .profile-layout {
        grid-template-columns: 1fr;
        height: auto !important;
    }
    .template-preview-panel, .campaign-preview-panel {
        border-left: none;
        padding-left: 0;
        margin-top: 32px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 100;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .mobile-toggle {
        display: block;
    }
    
    /* Header optimizations */
    .workspace-header {
        padding: 0 12px;
        gap: 8px;
    }
    .workspace-header h2 {
        font-size: 1.1rem;
    }
    #quick-webhook-btn span {
        display: none;
    }
    #quick-webhook-btn {
        padding: 8px;
    }
    .connection-pill {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    /* Viewport spacing */
    .workspace-viewport {
        padding: 12px;
    }
    
    /* Grid system updates */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Inbox / Live Chat Layout Drill Down */
    .inbox-layout {
        display: flex;
        flex-direction: column;
        height: 100%;
        border-top: none;
    }
    
    .inbox-layout.has-active-chat .chat-list-panel {
        display: none !important;
    }
    .inbox-layout.has-active-chat .chat-conversation-panel {
        display: flex !important;
    }
    .inbox-layout:not(.has-active-chat) .chat-list-panel {
        display: flex !important;
        width: 100% !important;
    }
    .inbox-layout:not(.has-active-chat) .chat-conversation-panel {
        display: none !important;
    }
    
    /* Back button in inbox header */
    .mobile-back-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        background: rgba(255, 255, 255, 0.03);
        color: var(--text-muted);
        cursor: pointer;
        transition: all var(--transition-fast);
        margin-right: 8px;
    }
    
    /* Hide active chat action button labels */
    #toggle-logs-btn span {
        display: none;
    }
    #toggle-logs-btn {
        padding: 8px !important;
    }
    
    /* Popover positioning & size for webhook mock tool */
    .webhook-popover {
        width: calc(100vw - 24px) !important;
        right: 12px !important;
        left: 12px !important;
        top: 60px !important;
    }
    
    /* Bot Builder (Flow Builder) responsive sizing */
    .builder-workspace {
        flex-direction: column;
    }
    .nodes-palette {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        max-height: 160px;
        overflow-y: auto;
    }
    .canvas-container {
        height: 400px;
    }
}

/* Message History Table Styles */
.history-table th, .history-table td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}
.status-badge-sent {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}
.status-badge-delivered {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}
.status-badge-read {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.status-badge-failed {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* AI Intent Styles */
.intent-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.intent-interested {
    background: rgba(37, 211, 102, 0.15) !important;
    color: #25D366 !important;
    border: 1px solid rgba(37, 211, 102, 0.3) !important;
}
.intent-question {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #F59E0B !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.intent-unsubscribe {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #EF4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.intent-rejected {
    background: rgba(156, 163, 175, 0.15) !important;
    color: #9CA3AF !important;
    border: 1px solid rgba(156, 163, 175, 0.3) !important;
}
.intent-neutral {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3B82F6 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* Chat Sidebar Intent Dot Colors */
.chat-item-intent-indicator.intent-interested {
    background-color: #25D366 !important;
    box-shadow: 0 0 6px rgba(37, 211, 102, 0.6);
}
.chat-item-intent-indicator.intent-question {
    background-color: #F59E0B !important;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}
.chat-item-intent-indicator.intent-unsubscribe {
    background-color: #EF4444 !important;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}
.chat-item-intent-indicator.intent-rejected {
    background-color: #9CA3AF !important;
}
.chat-item-intent-indicator.intent-neutral {
    background-color: #3B82F6 !important;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

/* Chat Tags Styling */
.tags-filter-bar {
    display: flex;
    gap: 6px;
    padding: 0 12px 10px 12px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.tags-filter-bar::-webkit-scrollbar {
    display: none;
}

.tags-filter-btn {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
    cursor: pointer;
    margin-right: 4px;
    transition: all var(--transition-fast) ease-in-out;
}
.tags-filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}
.tags-filter-btn.active {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(0, 168, 204, 0.4);
}

.active-tag-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 168, 204, 0.12) !important;
    color: #00e5ff !important;
    border: 1px solid rgba(0, 168, 204, 0.25) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast) ease-in-out;
}
.active-tag-pill:hover {
    background: rgba(0, 168, 204, 0.2) !important;
    border-color: rgba(0, 168, 204, 0.4) !important;
}

.remove-tag-btn {
    cursor: pointer;
    font-weight: bold;
    margin-left: 2px;
    opacity: 0.6;
    transition: opacity var(--transition-fast) ease-in-out, color var(--transition-fast) ease;
}
.remove-tag-btn:hover {
    opacity: 1 !important;
    color: #ff5252 !important;
}

.add-tag-pill-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--text-muted) !important;
    border: 1px dashed rgba(255, 255, 255, 0.15) !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-fast) ease-in-out;
}
.add-tag-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-color) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.add-tag-input {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--accent-color) !important;
    width: 85px;
    color: var(--text-color) !important;
    outline: none;
    transition: all var(--transition-fast) ease-in-out;
}
.add-tag-input:focus {
    box-shadow: 0 0 8px rgba(0, 168, 204, 0.3);
    background: rgba(255, 255, 255, 0.12) !important;
}

.badge-tag-pill {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(0, 168, 204, 0.08) !important;
    color: #00e5ff !important;
    border: 1px solid rgba(0, 168, 204, 0.15) !important;
    transition: all var(--transition-fast) ease-in-out;
}

