/* ==========================================================================
   OmniChat AI - Premium Design System (Vanilla CSS)
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
    --bg-main: #080c14;
    --bg-sidebar: #0d1321;
    --bg-glass: rgba(18, 26, 47, 0.5);
    --bg-glass-hover: rgba(26, 37, 66, 0.7);
    --border-glass: rgba(255, 255, 255, 0.05);
    --border-glass-active: rgba(99, 102, 241, 0.3);
    
    /* Harmonious Harmonized Colors */
    --primary: #6366f1; /* Beautiful Indigo */
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-hover: #4f46e5;
    
    --success: #10b981; /* Emerald Green */
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Social Brand Colors */
    --color-whatsapp: #25d366;
    --color-whatsapp-glow: rgba(37, 211, 102, 0.2);
    --color-facebook: #1877f2;
    --color-instagram: #e1306c;
    --color-tiktok: #00f2fe;
    
    /* Typography Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Layout Properties */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- Global Reset & Scrollbars --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(8, 12, 20, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* --- Layout Architecture --- */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 70% 20%, #1e1b4b 0%, var(--bg-main) 60%);
    overflow: hidden;
}

/* --- Sidebar Navigation --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 32px 8px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 20px var(--primary-glow);
}

.accent-text {
    background: linear-gradient(135deg, var(--primary) 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

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

.menu-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 100%);
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

.badge {
    position: absolute;
    right: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.badge-pulse::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
    animation: pulse 1.8s infinite;
}

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

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

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

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-glass);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Main Content Layout --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Topbar / Header */
.topbar {
    height: var(--topbar-height);
    background-color: rgba(8, 12, 20, 0.2);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-search {
    position: relative;
    width: 320px;
}

.topbar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.topbar-search input {
    width: 100%;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 10px 14px 10px 40px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-smooth);
}

.topbar-search input:focus {
    border-color: var(--primary);
    background-color: var(--bg-glass-hover);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.status-dot.online {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: flash 2s infinite;
}

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

.icon-button {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-glass);
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.icon-button:hover {
    background-color: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-main);
}

.premium-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 8px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    cursor: pointer;
}

/* --- Dynamic View Container --- */
.view-container {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
}

.dashboard-view {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.dashboard-view.active-view {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

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

.view-header h1 {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* --- Generic Premium Cards --- */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
}

/* --- Buttons --- */
.btn {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn-secondary-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.btn-icon-only {
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
}

.w-100 {
    width: 100%;
}

/* ==========================================================================
   SECTION 1: DASHBOARD SPECIFICS
   ========================================================================== */

/* KPIs Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
}

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

.metric-title {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.metric-icon.blue { background-color: rgba(59, 130, 246, 0.1); color: var(--info); }
.metric-icon.green { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.metric-icon.purple { background-color: rgba(168, 85, 247, 0.1); color: #c084fc; }
.metric-icon.orange { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 8px 0;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.metric-trend.upward { color: var(--success); }
.metric-trend.downward { color: var(--danger); }

/* Dashboard Detail Section layout */
.dashboard-details {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

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

.card-header h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
}

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

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

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

.legend-color.whatsapp { background-color: var(--color-whatsapp); }
.legend-color.facebook { background-color: var(--color-facebook); }
.legend-color.instagram { background-color: var(--color-instagram); }
.legend-color.tiktok { background-color: var(--color-tiktok); }

/* Chart Styling */
.chart-wrapper {
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    padding-top: 10px;
}

.simulated-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-grid-line {
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 1;
}

.chart-label {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-body);
}

.chart-line-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 3s ease forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* Activity Logs List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 220px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.activity-icon.bg-whatsapp { background-color: var(--color-whatsapp-glow); color: var(--color-whatsapp); border: 1px solid rgba(37, 211, 102, 0.15); }
.activity-icon.bg-facebook { background-color: rgba(24, 119, 242, 0.1); color: var(--color-facebook); border: 1px solid rgba(24, 119, 242, 0.15); }
.activity-icon.bg-system { background-color: rgba(99, 102, 241, 0.1); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.15); }

.activity-details {
    flex: 1;
}

.activity-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.activity-text strong {
    font-weight: 600;
}

.activity-text em {
    color: var(--primary);
    font-style: normal;
    font-weight: 500;
}

.activity-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.activity-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.activity-tag.success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); border-color: rgba(16, 185, 129, 0.2); }
.activity-tag.info { background-color: rgba(59, 130, 246, 0.1); color: var(--info); border-color: rgba(59, 130, 246, 0.2); }

/* ==========================================================================
   SECTION 2: CHANNELS SPECIFICS
   ========================================================================== */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.channel-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    position: relative;
    border-color: var(--border-glass);
}

.channel-card.active-border {
    border-color: var(--border-glass-active);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

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

.channel-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.channel-logo.whatsapp { background: linear-gradient(135deg, #128c7e 0%, #25d366 100%); }
.channel-logo.facebook { background: linear-gradient(135deg, #0e52b2 0%, #1877f2 100%); }
.channel-logo.instagram { background: linear-gradient(135deg, #f09433 0%, #e1306c 25%, #c13584 50%, #833ab4 75%, #5851db 100%); }
.channel-logo.tiktok { background: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%); }

.status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pill.status-active {
    background-color: rgba(37, 211, 102, 0.15);
    color: var(--color-whatsapp);
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.status-pill.status-inactive {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.channel-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.channel-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.channel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.channel-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.channel-meta strong {
    color: var(--text-primary);
}

.channel-meta em {
    font-style: italic;
}

/* ==========================================================================
   SECTION 3: E-COMMERCE SPECIFICS
   ========================================================================== */
.connector-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

.connector-form-card h3 {
    margin-bottom: 20px;
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Form Styles */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

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

.form-group.row-2 .col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

input[type="text"], input[type="password"], select {
    background-color: rgba(8, 12, 20, 0.4);
    border: 1px solid var(--border-glass);
    padding: 11px 14px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    transition: var(--transition-smooth);
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
    background-color: rgba(8, 12, 20, 0.6);
}

/* Select element customization */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '\f078';
    font-family: 'FontAwesome';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-secondary);
    pointer-events: none;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

/* API Connect Success banner */
.connection-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background-color: rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 14px 18px;
    border-radius: var(--border-radius-md);
    margin-top: 20px;
    display: none; /* Controlled by JS */
}

.connection-status-banner.success {
    display: flex;
}

.connection-status-banner i {
    font-size: 1.3rem;
    color: var(--success);
    margin-top: 2px;
}

.connection-status-banner h4 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.connection-status-banner p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Sandbox and Console styling */
.sandbox-card {
    display: flex;
    flex-direction: column;
}

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

.card-header-actions h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
}

.sandbox-search {
    display: flex;
    gap: 8px;
    width: 250px;
}

.sandbox-search input {
    background-color: rgba(8, 12, 20, 0.4);
    border: 1px solid var(--border-glass);
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    width: 100%;
    outline: none;
}

.console-box {
    background-color: #05070c;
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.console-header {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.console-dot.red { background-color: #ef4444; }
.console-dot.yellow { background-color: #f59e0b; }
.console-dot.green { background-color: #10b981; }

.console-title {
    font-family: monospace;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

.console-body {
    padding: 14px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: #38bdf8;
    max-height: 140px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
}

/* Sandbox Products visual Grid Preview */
.sandbox-results-preview h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.sandbox-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.sandbox-product-item {
    display: flex;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 10px;
    border-radius: var(--border-radius-md);
    align-items: center;
}

.sandbox-product-img {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.05);
}

.sandbox-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.sandbox-product-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.sandbox-product-price {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 700;
}

.sandbox-product-stock {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.stock-tag {
    color: var(--success);
    font-weight: 600;
}

/* ==========================================================================
   SECTION 4: WHATSAPP SIMULATOR SPECIFICS
   ========================================================================== */
.simulator-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
}

.flow-builder-card h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 10px;
}

.info-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Rules visualization list */
.rules-editor h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.rules-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

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

.rule-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.rule-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.rule-badge.trigger { background-color: rgba(59, 130, 246, 0.15); color: var(--info); }
.rule-badge.action { background-color: rgba(16, 185, 129, 0.15); color: var(--success); }
.rule-badge.db-action { background-color: rgba(168, 85, 247, 0.15); color: #c084fc; }
.rule-badge.human-action { background-color: rgba(245, 158, 11, 0.15); color: var(--warning); }

.rule-body {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding-left: 8px;
}

.rule-body i {
    color: var(--text-muted);
}

.rule-body p {
    flex: 1;
}

/* Quick simulator button clicks */
.quick-client-actions h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.action-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-msg-btn {
    border-radius: 20px !important;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    transition: var(--transition-smooth);
}

.quick-msg-btn:hover {
    background-color: var(--primary-glow);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* iPhone/Smartphone UI Frame Shell */
.phone-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-frame {
    width: 330px;
    height: 640px;
    background-color: #000;
    border-radius: 40px;
    border: 10px solid #1c1d24;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.1);
    position: relative;
    overflow: hidden;
}

/* Phone Bezel/Camera Notch */
.phone-camera-notch {
    width: 110px;
    height: 25px;
    background-color: #000;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    z-index: 50;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background-color: #0b141a; /* WhatsApp default dark bg */
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Simulated WA wallpaper */
    background-repeat: repeat;
    background-blend-mode: overlay;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* WhatsApp Mobile UI Header */
.wa-header {
    background-color: #1f2c34;
    padding: 30px 12px 10px 12px; /* Top padding is bigger to account for notch */
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.wa-back {
    color: #8696a0;
    font-size: 0.85rem;
    cursor: pointer;
}

.wa-avatar-container {
    position: relative;
}

.wa-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.wa-header-left .wa-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: var(--color-whatsapp);
    border-radius: 50%;
    border: 1.5px solid #1f2c34;
}

.wa-chat-info {
    display: flex;
    flex-direction: column;
}

.wa-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e9edef;
}

.wa-subtitle {
    font-size: 0.65rem;
    color: #8696a0;
}

.wa-header-icons {
    display: flex;
    gap: 14px;
    color: #aebac1;
    font-size: 0.85rem;
}

/* WhatsApp Chat area styling */
.wa-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wa-date-divider {
    align-self: center;
    background-color: #182229;
    color: #8696a0;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 8px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Individual Msg bubble */
.wa-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.wa-msg.received {
    align-self: flex-start;
}

.wa-msg.sent {
    align-self: flex-end;
}

.wa-msg-bubble {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,0.15);
}

.wa-msg.received .wa-msg-bubble {
    background-color: #202c33;
    color: #e9edef;
    border-top-left-radius: 0;
}

.wa-msg.sent .wa-msg-bubble {
    background-color: #005c4b; /* WhatsApp Sent Dark */
    color: #e9edef;
    border-top-right-radius: 0;
}

.wa-msg-time {
    display: block;
    text-align: right;
    font-size: 0.62rem;
    color: #8696a0;
    margin-top: 4px;
}

.wa-msg.sent .wa-msg-time {
    color: #86a39b;
}

/* Catalog Card styling inside WhatsApp */
.wa-msg-card {
    background-color: #202c33;
    border-radius: 8px;
    border-top-left-radius: 0;
    overflow: hidden;
    width: 200px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wa-card-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
}

.wa-card-details {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wa-card-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #e9edef;
}

.wa-card-price {
    font-size: 0.75rem;
    color: #00a884;
    font-weight: 700;
}

.wa-card-link-btn {
    background-color: rgba(0, 168, 132, 0.15);
    color: #00a884;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    display: block;
    margin-top: 4px;
    transition: var(--transition-smooth);
}

.wa-card-link-btn:hover {
    background-color: rgba(0, 168, 132, 0.25);
}

.wa-msg-bubble ul {
    margin: 6px 0;
    padding-left: 14px;
}

.wa-msg-bubble li {
    font-size: 0.78rem;
    margin: 2px 0;
}

/* Chat typing indicator simulation */
.wa-typing-indicator {
    background-color: #202c33;
    color: #8696a0;
    padding: 6px 10px;
    border-radius: 8px;
    border-top-left-radius: 0;
    font-size: 0.72rem;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: slideUp 0.1s ease;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background-color: #8696a0;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* WhatsApp Mobile Input container bar */
.wa-input-area {
    background-color: #1f2c34;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.wa-input-container {
    flex: 1;
    background-color: #2a3942;
    border-radius: 24px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wa-input-container i {
    color: #8696a0;
    font-size: 0.95rem;
    cursor: pointer;
}

.wa-input-container input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e9edef;
    font-size: 0.8rem;
    font-family: var(--font-body);
}

.wa-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #00a884; /* WA primary green */
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: var(--transition-smooth);
}

.wa-send-btn:hover {
    background-color: #008f72;
    transform: scale(1.05);
}

.wa-send-btn i {
    font-size: 0.82rem;
}

/* ==========================================================================
   SECTION 5: SOCIAL MEDIA COMMENTS SPECIFICS
   ========================================================================== */
.comments-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.post-selector-card {
    display: flex;
    flex-direction: column;
}

.post-selector-card h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 8px;
}

/* Social post container */
.social-post-preview {
    background-color: #182238;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: var(--border-radius-md);
    margin-top: 14px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.page-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--primary);
}

.page-title {
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-badge {
    color: var(--color-facebook);
    font-size: 0.8rem;
}

.post-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}

.post-text {
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #e2e8f0;
}

.highlight-code {
    background-color: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
}

.post-image-container {
    width: 100%;
    height: 180px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    background-color: rgba(0, 0, 0, 0.2);
}

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

.post-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.text-facebook { color: var(--color-facebook); }

/* Comment Rules Description */
.comment-rules-settings {
    margin-top: 20px;
    background-color: rgba(24, 119, 242, 0.03);
    border: 1px dashed rgba(24, 119, 242, 0.2);
    border-radius: var(--border-radius-md);
    padding: 14px;
}

.comment-rules-settings h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

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

.rule-icon {
    font-size: 1.1rem;
    margin-top: 2px;
}

.rule-desc {
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.rule-desc strong {
    color: var(--text-primary);
}

.quote-text {
    color: #34d399;
    font-style: normal;
}

/* Comment Stream view (Simulating FB Threads) */
.comment-stream-card {
    display: flex;
    flex-direction: column;
}

.comment-feed {
    flex: 1;
    overflow-y: auto;
    max-height: 350px;
    padding-right: 4px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-wrapper-node {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-box-user, .comment-box-bot {
    display: flex;
    gap: 10px;
    position: relative;
}

.comment-box-bot {
    padding-left: 36px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.bot-avatar {
    border: 1px solid var(--primary);
}

.bot-connector-line {
    position: absolute;
    left: 16px;
    top: -12px;
    width: 14px;
    height: 28px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 8px;
}

.comment-bubble {
    background-color: #1e293b;
    border-radius: var(--border-radius-md);
    padding: 10px 12px;
    max-width: 85%;
}

.comment-bubble.bot {
    background-color: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.comment-bubble .user-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-bubble .author-badge {
    background-color: var(--primary-glow);
    color: #a5b4fc;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    margin-left: 4px;
}

.comment-bubble .comment-text {
    font-size: 0.8rem;
    color: #e2e8f0;
    margin-top: 4px;
    line-height: 1.4;
}

.comment-actions {
    display: flex;
    gap: 8px;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
}

.comment-time {
    font-weight: normal;
}

/* Custom mock inputs */
.add-custom-comment-box {
    display: flex;
    gap: 8px;
}

.add-custom-comment-box input {
    flex: 1;
    background-color: rgba(8, 12, 20, 0.4);
    border: 1px solid var(--border-glass);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
}

/* ==========================================================================
   MODAL DIALOGS AND OVERLAYS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(5, 7, 12, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    position: relative;
    border-color: rgba(255, 255, 255, 0.08);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.qr-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qr-modal-body h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.qr-modal-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* QR code container & scanner mockup */
.qr-container {
    width: 220px;
    height: 220px;
    background-color: white;
    border-radius: var(--border-radius-md);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.qr-code-placeholder svg {
    display: block;
}

.qr-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(8, 12, 20, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.qr-loading-overlay.active {
    opacity: 1;
}

.qr-loading-overlay i {
    font-size: 2.5rem;
}

.qr-loading-overlay span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-whatsapp);
}

/* Bouncing QR Checkmark */
.animate-bounce {
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.qr-instructions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    width: 100%;
    margin-bottom: 24px;
}

.qr-instructions .step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================================================
   TOAST AND POPUP NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(18, 26, 47, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--primary);
    padding: 12px 18px;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 360px;
    transform: translateX(100px);
    opacity: 0;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastIn {
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left-color: var(--success); }
.toast.info { border-left-color: var(--info); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger { border-left-color: var(--danger); }
.toast.whatsapp-toast { border-left-color: var(--color-whatsapp); }

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.info .toast-icon { color: var(--info); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.danger .toast-icon { color: var(--danger); }
.toast.whatsapp-toast .toast-icon { color: var(--color-whatsapp); }

.toast-details {
    flex: 1;
}

.toast-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-details {
        grid-template-columns: 1fr;
    }
    
    .connector-layout, .simulator-layout, .comments-layout {
        grid-template-columns: 1fr;
    }
    
    .phone-wrapper {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        padding: 16px;
    }
    
    .sidebar-brand {
        padding-bottom: 16px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .menu-item {
        padding: 8px 12px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .topbar {
        padding: 0 16px;
    }
    
    .view-container {
        padding: 16px;
    }
    
    .channels-grid {
        grid-template-columns: 1fr;
    }
}
