/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background-color: #d1d7db;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #00a884;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    width: 350px;
}

.login-box h2 {
    color: #00a884;
    margin-bottom: 20px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background-color: #008069;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.2s;
}

.login-box button:hover {
    background-color: #006b58;
}

.error-msg {
    color: red;
    font-size: 0.9em;
    margin-top: 10px;
}

/* App Container (WhatsApp Web Layout) */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: #f0f2f5;
    max-width: 1600px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* Sidebar */
.sidebar {
    width: 400px; /* Largura fixa típica */
    background: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e9edef;
}

.sidebar-header {
    height: 60px;
    background: #f0f2f5;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d1d7db;
}

/* Tabs & Filters */
.tabs-header {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e9edef;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #54656f;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #f5f6f6;
}

.tab-btn.active {
    color: #00a884;
    border-bottom: 3px solid #00a884;
}

.filters-bar {
    padding: 8px 12px;
    background: #fff;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid #f0f2f5;
    /* Esconde barra de rolagem */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.filters-bar::-webkit-scrollbar {
    display: none;
}

.filters-group {
    display: flex;
    gap: 8px;
}

.filter-chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e9edef;
    background: #f0f2f5;
    color: #54656f;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    background: #e9edef;
}

.filter-chip.active {
    background: #e7fce3;
    color: #008069;
    border-color: #00a884;
}

.badge {
    background: #25d366;
    color: white;
    font-size: 0.75em;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.header-actions button {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #54656f;
    cursor: pointer;
    margin-left: 15px;
}

.search-bar {
    padding: 8px 12px;
    background: white;
    border-bottom: 1px solid #f0f2f5;
}

.search-input-wrapper {
    background: #f0f2f5;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    color: #54656f;
    margin-right: 10px;
}

.search-input-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 12px 16px;
    display: flex;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.2s;
}

.chat-item:hover {
    background-color: #f5f6f6;
}

.chat-item.active {
    background-color: #f0f2f5;
}

/* Indicador de Atendimento Humano */
.chat-item.human {
    background-color: #e3f2fd; /* Azul muito claro */
    border-left: 4px solid #2196f3;
}

/* Indicador de Bot com Pendência (Solicitação) */
.chat-item.pending {
    background-color: #fff9c4; /* Amarelo muito claro */
    border-left: 4px solid #ffeb3b;
}

.chat-item-avatar {
    width: 49px;
    height: 49px;
    border-radius: 50%;
    background-color: #dfe3e5;
    margin-right: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2em;
}

.chat-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chat-item-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.contact-name {
    font-size: 1.1em;
    color: #111b21;
}

.last-msg-time {
    font-size: 0.8em;
    color: #667781;
}

.chat-item-bottom {
    display: flex;
    justify-content: space-between;
}

.last-message {
    font-size: 0.9em;
    color: #667781;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.pending-badge {
    background-color: #25d366;
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png'); /* Background padrão WhatsApp Web */
    background-repeat: repeat;
    background-color: #efeae2;
}

.chat-header {
    height: 60px;
    background: #f0f2f5;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #d1d7db;
}

.chat-info h3 {
    font-size: 1em;
    color: #111b21;
}

.chat-info span {
    font-size: 0.8em;
    color: #667781;
}

.chat-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

.action-btn.secondary {
    background-color: #e9edef;
    color: #111b21;
}

.action-btn.danger {
    background-color: #aebac1; /* Cor desabilitada/suave */
    color: white;
}
.action-btn.danger:hover {
    background-color: #d32f2f;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 50px;
    display: flex;
    flex-direction: column;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #667781;
}

.empty-state i {
    font-size: 4em;
    margin-bottom: 20px;
    color: #d1d7db;
}

/* Date Divider */
.date-divider {
    align-self: center;
    background-color: #fff;
    color: #54656f;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.8em;
    margin: 10px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    text-transform: uppercase;
    font-weight: 500;
}

.message-bubble {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 7.5px;
    margin-bottom: 10px;
    position: relative;
    font-size: 0.95em;
    line-height: 1.4;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.message-bubble.incoming {
    align-self: flex-start;
    background-color: white;
    border-top-left-radius: 0;
}

.message-bubble.outgoing {
    align-self: flex-end;
    background-color: #d9fdd3;
    border-top-right-radius: 0;
}

.msg-meta {
    display: flex;
    justify-content: flex-end;
    font-size: 0.7em;
    color: #667781;
    margin-top: 4px;
}

.msg-meta i {
    margin-left: 4px;
    font-size: 1em;
}

.status-icon {
    margin-left: 4px;
    font-size: 1.1em;
}

.status-sent {
    color: #8696a0; /* Cinza (um check) */
}

.status-delivered {
    color: #8696a0; /* Cinza (dois checks) */
}

.status-read {
    color: #53bdeb; /* Azul (dois checks) */
}

.status-failed {
    color: #f15c6d; /* Vermelho (exclamação) */
}

code {
    font-family: Consolas, "Courier New", monospace;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

.chat-input-area {
    height: 62px;
    background: #f0f2f5;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    border-top: 1px solid #d1d7db;
}

.chat-input-area input {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    margin: 0 10px;
    outline: none;
}

.attach-btn, .send-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #54656f;
    cursor: pointer;
}

.send-btn {
    color: #00a884;
}

/* Ícone de Verificado */
.verified-icon {
    color: #1da1f2; /* Azul estilo check */
    margin-left: 5px;
    font-size: 0.9em;
}
