/* easyzap chat — overrides e layout 3 colunas no estilo WhatsApp Web. */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #eef1f5;
    color: #1f2937;
}

.easyzap-app {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    height: 100vh;
    overflow: hidden;
}

/* ====== COLUNA 1: sidebar ====== */
.ez-sidebar {
    background: #fff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ez-sidebar-header {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
.ez-brand strong { font-size: 1.05rem; }
.ez-user-menu { display: flex; gap: 4px; align-items: center; }
.ez-user-menu select { width: auto; }
.ez-filter-btn { font-size: 0.75rem; padding: 2px 8px; }
.ez-filter-btn.active { background: #4b5563; color: #fff; border-color: #4b5563; }
.ez-sidebar-list { flex: 1; overflow-y: auto; }

.ez-conv-item {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    display: flex;
    gap: 10px;
    transition: background 0.15s;
}
.ez-conv-item:hover { background: #f9fafb; }
.ez-conv-item.active { background: #e0e7ff; }
.ez-conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #d1d5db;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}
.ez-conv-body { flex: 1; min-width: 0; }
.ez-conv-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ez-conv-preview {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ez-conv-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.ez-conv-time { font-size: 0.7rem; color: #9ca3af; }
.ez-conv-unread {
    background: #10b981;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* ====== COLUNA 2: conversa ====== */
.ez-conversation {
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ez-conv-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    min-height: 60px;
}
.ez-conv-empty { color: #9ca3af; }
.ez-conv-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #ece5dd;
    background-image: url('/public/quicky/media/image/bg.png');
}
.ez-msg {
    max-width: 70%;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    word-wrap: break-word;
    clear: both;
}
.ez-msg-inbound {
    background: #fff;
    float: left;
}
.ez-msg-outbound {
    background: #dcf8c6;
    float: right;
}
.ez-msg-text { font-size: 0.9rem; }
.ez-msg-time {
    font-size: 0.7rem;
    color: #6b7280;
    text-align: right;
    margin-top: 2px;
}
.ez-msg-status { margin-left: 4px; }
.ez-conv-composer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 10px;
}

/* ====== COLUNA 3: detalhes ====== */
.ez-details {
    background: #fff;
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
    padding: 16px;
}
.ez-details-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.ez-details-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #d1d5db;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 auto 8px;
}
.ez-details-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}
.ez-details-section h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 8px;
}
.ez-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 10px;
    font-size: 0.75rem;
    margin: 2px;
}
.ez-note {
    padding: 8px;
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    font-size: 0.8rem;
    margin-bottom: 6px;
    border-radius: 4px;
}

/* responsivo: em telas pequenas, esconde a coluna de detalhes */
@media (max-width: 1100px) {
    .easyzap-app { grid-template-columns: 280px 1fr; }
    .ez-details { display: none; }
}
@media (max-width: 768px) {
    .easyzap-app { grid-template-columns: 1fr; }
    .ez-sidebar { display: none; }
}
