Files
WhatsAppCentralizado/odoo_whatsapp_hub/static/src/css/dollars_theme.css
Claude AI 5dd3499097 feat: Major WhatsApp integration update with Odoo and pause/resume
## Frontend
- Add media display (images, audio, video, docs) in Inbox
- Add pause/resume functionality for WhatsApp accounts
- Fix media URLs to use nginx proxy (relative URLs)

## API Gateway
- Add /accounts/:id/pause and /accounts/:id/resume endpoints
- Fix media URL handling for browser access

## WhatsApp Core
- Add pauseSession() - disconnect without logout
- Add resumeSession() - reconnect using saved credentials
- Add media download and storage for incoming messages
- Serve media files via /media/ static route

## Odoo Module (odoo_whatsapp_hub)
- Add Chat Hub interface with DOLLARS theme (dark, 3-column layout)
- Add WhatsApp/DRRR theme switcher for chat view
- Add "ABRIR CHAT" button in conversation form
- Add send_message_from_chat() method
- Add security/ir.model.access.csv
- Fix CSS scoping to avoid breaking Odoo UI
- Update webhook to handle message events properly

## Documentation
- Add docs/CONTEXTO_DESARROLLO.md with complete project context

## Infrastructure
- Add whatsapp_media Docker volume
- Configure nginx proxy for /media/ route
- Update .gitignore to track src/sessions/ source files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:48:56 +00:00

775 lines
17 KiB
CSS

/* DOLLARS WhatsApp Theme - Dark Mode with Amber Accents */
/* All styles are scoped to .o_dollars_chat to avoid affecting other Odoo views */
/* ============================================
MAIN CONTAINER - All styles scoped here
============================================ */
.o_dollars_chat {
--bg-primary: #0a0a0f;
--bg-secondary: #12121a;
--bg-tertiary: #1a1a24;
--bg-hover: #22222e;
--bg-active: #2a2a38;
--accent-primary: #f59e0b;
--accent-secondary: #fbbf24;
--accent-glow: rgba(245, 158, 11, 0.3);
--text-primary: #ffffff;
--text-secondary: #a1a1aa;
--text-muted: #71717a;
--border-color: #27272a;
--border-light: #3f3f46;
--success: #22c55e;
--danger: #ef4444;
--info: #3b82f6;
--msg-inbound-bg: #1e1e2a;
--msg-outbound-bg: #2d2a1f;
--msg-outbound-border: rgba(245, 158, 11, 0.2);
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-full: 9999px;
--shadow-glow: 0 0 20px var(--accent-glow);
display: flex;
flex-direction: column;
height: 100vh;
background: var(--bg-primary);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
color: var(--text-primary);
overflow: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
}
/* Header */
.o_dollars_chat .o_dollars_header {
background: var(--bg-secondary);
padding: 12px 24px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--border-color);
flex-shrink: 0;
position: relative;
}
.o_dollars_chat .o_dollars_header::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
animation: dollarsHeaderGlow 3s ease-in-out infinite;
}
@keyframes dollarsHeaderGlow {
0%, 100% { opacity: 0.3; }
50% { opacity: 1; }
}
.o_dollars_chat .o_dollars_logo {
display: flex;
align-items: center;
gap: 12px;
}
.o_dollars_chat .o_dollars_logo_icon {
width: 40px;
height: 40px;
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
box-shadow: var(--shadow-glow);
color: #000;
}
.o_dollars_chat .o_dollars_logo_text {
font-size: 20px;
font-weight: 700;
letter-spacing: 2px;
color: var(--accent-primary);
}
.o_dollars_chat .o_dollars_status {
display: flex;
align-items: center;
gap: 16px;
}
.o_dollars_chat .o_dollars_status_item {
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--text-secondary);
font-family: monospace;
}
.o_dollars_chat .o_dollars_status_dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--success);
animation: dollarsPulse 2s infinite;
}
@keyframes dollarsPulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.5; transform: scale(0.8); }
}
.o_dollars_chat .o_dollars_header_actions {
display: flex;
align-items: center;
gap: 8px;
}
.o_dollars_chat .o_dollars_header_btn {
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
color: var(--text-secondary);
padding: 8px 16px;
border-radius: var(--radius-md);
font-size: 13px;
cursor: pointer;
transition: all 0.15s ease;
display: flex;
align-items: center;
gap: 6px;
}
.o_dollars_chat .o_dollars_header_btn:hover {
background: var(--bg-hover);
color: var(--text-primary);
border-color: var(--accent-primary);
}
/* Main Layout */
.o_dollars_chat .o_dollars_main {
display: flex;
flex: 1;
overflow: hidden;
}
/* Sidebar */
.o_dollars_chat .o_dollars_sidebar {
width: 320px;
background: var(--bg-secondary);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
flex-shrink: 0;
}
.o_dollars_chat .o_dollars_sidebar_header {
padding: 16px;
border-bottom: 1px solid var(--border-color);
}
.o_dollars_chat .o_dollars_search {
position: relative;
}
.o_dollars_chat .o_dollars_search input {
width: 100%;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
padding: 10px 12px 10px 40px;
color: var(--text-primary);
font-size: 14px;
outline: none;
transition: all 0.15s ease;
}
.o_dollars_chat .o_dollars_search input:focus {
border-color: var(--accent-primary);
box-shadow: 0 0 0 3px var(--accent-glow);
}
.o_dollars_chat .o_dollars_search input::placeholder {
color: var(--text-muted);
}
.o_dollars_chat .o_dollars_search_icon {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: var(--text-muted);
}
.o_dollars_chat .o_dollars_conversations {
flex: 1;
overflow-y: auto;
}
.o_dollars_chat .o_dollars_conv_item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
cursor: pointer;
transition: all 0.15s ease;
border-left: 3px solid transparent;
}
.o_dollars_chat .o_dollars_conv_item:hover {
background: var(--bg-hover);
}
.o_dollars_chat .o_dollars_conv_item.active {
background: var(--bg-active);
border-left-color: var(--accent-primary);
}
.o_dollars_chat .o_dollars_conv_avatar {
width: 48px;
height: 48px;
border-radius: 50%;
background: var(--bg-tertiary);
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
position: relative;
flex-shrink: 0;
color: var(--text-primary);
}
.o_dollars_chat .o_dollars_conv_avatar.online::after {
content: '';
position: absolute;
bottom: 2px;
right: 2px;
width: 12px;
height: 12px;
background: var(--success);
border-radius: 50%;
border: 2px solid var(--bg-secondary);
}
.o_dollars_chat .o_dollars_conv_info {
flex: 1;
min-width: 0;
}
.o_dollars_chat .o_dollars_conv_name {
font-weight: 600;
font-size: 14px;
margin-bottom: 2px;
color: var(--text-primary);
}
.o_dollars_chat .o_dollars_conv_preview {
font-size: 13px;
color: var(--text-secondary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.o_dollars_chat .o_dollars_conv_meta {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 4px;
}
.o_dollars_chat .o_dollars_conv_time {
font-size: 11px;
color: var(--text-muted);
font-family: monospace;
}
.o_dollars_chat .o_dollars_conv_badge {
background: var(--accent-primary);
color: #000;
font-size: 11px;
font-weight: 600;
padding: 2px 6px;
border-radius: var(--radius-full);
min-width: 20px;
text-align: center;
}
/* Chat Area */
.o_dollars_chat .o_dollars_chat_area {
flex: 1;
display: flex;
flex-direction: column;
background: var(--bg-primary);
min-width: 0;
}
.o_dollars_chat .o_dollars_chat_header {
padding: 16px 24px;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 16px;
}
.o_dollars_chat .o_dollars_chat_avatar {
width: 44px;
height: 44px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-weight: 600;
color: #000;
}
.o_dollars_chat .o_dollars_chat_info {
flex: 1;
}
.o_dollars_chat .o_dollars_chat_name {
font-weight: 600;
font-size: 16px;
color: var(--text-primary);
margin-bottom: 2px;
}
.o_dollars_chat .o_dollars_chat_status {
font-size: 12px;
color: var(--text-secondary);
display: flex;
align-items: center;
gap: 6px;
}
.o_dollars_chat .o_dollars_chat_actions {
display: flex;
gap: 8px;
}
.o_dollars_chat .o_dollars_chat_btn {
width: 40px;
height: 40px;
border-radius: 50%;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
color: var(--text-secondary);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.15s ease;
}
.o_dollars_chat .o_dollars_chat_btn:hover {
background: var(--bg-hover);
color: var(--accent-primary);
border-color: var(--accent-primary);
}
/* Messages */
.o_dollars_chat .o_dollars_messages {
flex: 1;
overflow-y: auto;
padding: 24px;
display: flex;
flex-direction: column;
gap: 16px;
}
.o_dollars_chat .o_dollars_messages::-webkit-scrollbar {
width: 6px;
}
.o_dollars_chat .o_dollars_messages::-webkit-scrollbar-track {
background: var(--bg-primary);
}
.o_dollars_chat .o_dollars_messages::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 3px;
}
.o_dollars_chat .o_dollars_message {
display: flex;
gap: 12px;
max-width: 70%;
animation: dollarsMessageIn 0.2s ease-out;
}
@keyframes dollarsMessageIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.o_dollars_chat .o_dollars_message.inbound {
align-self: flex-start;
}
.o_dollars_chat .o_dollars_message.outbound {
align-self: flex-end;
flex-direction: row-reverse;
}
.o_dollars_chat .o_dollars_msg_avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--bg-tertiary);
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
flex-shrink: 0;
color: var(--text-primary);
}
.o_dollars_chat .o_dollars_message.outbound .o_dollars_msg_avatar {
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
color: #000;
}
.o_dollars_chat .o_dollars_msg_content {
display: flex;
flex-direction: column;
gap: 4px;
}
.o_dollars_chat .o_dollars_msg_header {
display: flex;
align-items: center;
gap: 8px;
font-size: 12px;
}
.o_dollars_chat .o_dollars_msg_sender {
font-weight: 600;
color: var(--accent-primary);
}
.o_dollars_chat .o_dollars_message.inbound .o_dollars_msg_sender {
color: var(--info);
}
.o_dollars_chat .o_dollars_msg_time {
color: var(--text-muted);
font-family: monospace;
font-size: 11px;
}
.o_dollars_chat .o_dollars_msg_bubble {
background: var(--msg-inbound-bg);
padding: 12px 16px;
border-radius: var(--radius-lg);
border-top-left-radius: var(--radius-sm);
line-height: 1.5;
font-size: 14px;
color: var(--text-primary);
}
.o_dollars_chat .o_dollars_message.outbound .o_dollars_msg_bubble {
background: var(--msg-outbound-bg);
border: 1px solid var(--msg-outbound-border);
border-top-left-radius: var(--radius-lg);
border-top-right-radius: var(--radius-sm);
}
.o_dollars_chat .o_dollars_msg_status {
font-size: 11px;
color: var(--text-muted);
text-align: right;
}
.o_dollars_chat .o_dollars_msg_status.read {
color: var(--info);
}
/* Media */
.o_dollars_chat .o_dollars_msg_image {
max-width: 280px;
max-height: 200px;
border-radius: var(--radius-md);
cursor: pointer;
display: block;
margin-bottom: 8px;
}
.o_dollars_chat .o_dollars_msg_audio {
width: 240px;
height: 40px;
}
.o_dollars_chat .o_dollars_msg_video {
max-width: 320px;
border-radius: var(--radius-md);
}
.o_dollars_chat .o_dollars_msg_doc {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
background: var(--bg-tertiary);
border-radius: var(--radius-md);
color: var(--text-primary);
text-decoration: none;
margin-bottom: 8px;
}
.o_dollars_chat .o_dollars_msg_doc:hover {
background: var(--bg-hover);
}
.o_dollars_chat .o_dollars_msg_doc i {
font-size: 24px;
color: var(--accent-primary);
}
/* Input Area */
.o_dollars_chat .o_dollars_input_area {
padding: 16px 24px;
background: var(--bg-secondary);
border-top: 1px solid var(--border-color);
display: flex;
align-items: flex-end;
gap: 12px;
}
.o_dollars_chat .o_dollars_input_wrapper {
flex: 1;
}
.o_dollars_chat .o_dollars_input_wrapper textarea {
width: 100%;
background: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
padding: 12px 16px;
color: var(--text-primary);
font-size: 14px;
font-family: inherit;
resize: none;
outline: none;
min-height: 44px;
max-height: 120px;
transition: all 0.15s ease;
}
.o_dollars_chat .o_dollars_input_wrapper textarea:focus {
border-color: var(--accent-primary);
box-shadow: 0 0 0 3px var(--accent-glow);
}
.o_dollars_chat .o_dollars_input_wrapper textarea::placeholder {
color: var(--text-muted);
}
.o_dollars_chat .o_dollars_send_btn {
width: 48px;
height: 48px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
border: none;
color: #000;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.15s ease;
font-size: 18px;
box-shadow: var(--shadow-glow);
}
.o_dollars_chat .o_dollars_send_btn:hover {
transform: scale(1.05);
}
.o_dollars_chat .o_dollars_send_btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
/* Details Panel */
.o_dollars_chat .o_dollars_details {
width: 280px;
background: var(--bg-secondary);
border-left: 1px solid var(--border-color);
display: flex;
flex-direction: column;
flex-shrink: 0;
}
.o_dollars_chat .o_dollars_details_header {
padding: 24px;
text-align: center;
border-bottom: 1px solid var(--border-color);
}
.o_dollars_chat .o_dollars_details_avatar {
width: 80px;
height: 80px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
margin: 0 auto 16px;
box-shadow: var(--shadow-glow);
color: #000;
}
.o_dollars_chat .o_dollars_details_name {
font-size: 18px;
font-weight: 600;
margin-bottom: 4px;
color: var(--text-primary);
}
.o_dollars_chat .o_dollars_details_phone {
font-size: 14px;
color: var(--text-secondary);
font-family: monospace;
}
.o_dollars_chat .o_dollars_details_status {
display: inline-flex;
align-items: center;
gap: 6px;
margin-top: 12px;
padding: 6px 12px;
background: var(--bg-tertiary);
border-radius: var(--radius-full);
font-size: 12px;
color: var(--text-secondary);
}
.o_dollars_chat .o_dollars_details_content {
flex: 1;
overflow-y: auto;
padding: 16px;
}
.o_dollars_chat .o_dollars_details_section {
margin-bottom: 24px;
}
.o_dollars_chat .o_dollars_details_section_title {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--text-muted);
margin-bottom: 12px;
font-weight: 600;
}
.o_dollars_chat .o_dollars_details_item {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
background: var(--bg-tertiary);
border-radius: var(--radius-md);
margin-bottom: 8px;
cursor: pointer;
transition: all 0.15s ease;
color: var(--text-primary);
}
.o_dollars_chat .o_dollars_details_item:hover {
background: var(--bg-hover);
}
.o_dollars_chat .o_dollars_details_item i {
color: var(--accent-primary);
width: 20px;
text-align: center;
}
.o_dollars_chat .o_dollars_details_item span {
font-size: 13px;
}
/* Empty State */
.o_dollars_chat .o_dollars_empty {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 40px;
}
.o_dollars_chat .o_dollars_empty_icon {
width: 80px;
height: 80px;
background: var(--bg-tertiary);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
margin-bottom: 24px;
color: var(--text-muted);
}
.o_dollars_chat .o_dollars_empty_title {
font-size: 20px;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-primary);
}
.o_dollars_chat .o_dollars_empty_text {
color: var(--text-secondary);
font-size: 14px;
}
/* Loading */
.o_dollars_chat .o_dollars_loading {
display: flex;
align-items: center;
justify-content: center;
padding: 40px;
}
.o_dollars_chat .o_dollars_spinner {
width: 40px;
height: 40px;
border: 3px solid var(--border-color);
border-top-color: var(--accent-primary);
border-radius: 50%;
animation: dollarsSpin 1s linear infinite;
}
@keyframes dollarsSpin {
to { transform: rotate(360deg); }
}
/* Responsive */
@media (max-width: 1200px) {
.o_dollars_chat .o_dollars_details {
display: none;
}
}
@media (max-width: 768px) {
.o_dollars_chat .o_dollars_sidebar {
width: 100%;
position: absolute;
z-index: 10;
}
}