:root{

    --sidebar-width:360px;

    --header-height:70px;

    --footer-height:72px;

    --background:#f0f2f5;

    --sidebar:#ffffff;

    --chat:#efeae2;

    --incoming:#ffffff;

    --outgoing:#d9fdd3;

    --border:#d1d7db;

    --text:#111b21;

    --secondary:#667781;

    --primary:#00a884;

    --hover:#f5f6f6;

}

*{

    margin:0;

    padding:0;

    box-sizing:border-box;

}

html,
body{

    width:100%;

    height:100%;

    overflow:hidden;

    font-family:Arial,Helvetica,sans-serif;

    background:var(--background);

    color:var(--text);

}

.app{

    display:flex;

    width:100vw;

    height:100vh;

}

/**********************
 SIDEBAR
**********************/

.sidebar{

    width:var(--sidebar-width);

    background:var(--sidebar);

    border-right:1px solid var(--border);

    display:flex;

    flex-direction:column;

}

.sidebar-header{

    height:70px;

    padding:15px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    border-bottom:1px solid var(--border);

}

.logo{

    display:flex;

    align-items:center;

    gap:10px;

    font-size:22px;

    font-weight:bold;

    color:var(--primary);

}

.sidebar-actions{

    display:flex;

    gap:8px;

}

.icon-button{

    width:38px;

    height:38px;

    border:none;

    border-radius:50%;

    background:transparent;

    cursor:pointer;

    transition:.2s;

    color:#54656f;

    font-size:18px;

}

.icon-button:hover{

    background:#ececec;

}

.sidebar-search{

    padding:12px;

    position:relative;

    border-bottom:1px solid var(--border);

}

.sidebar-search i{

    position:absolute;

    left:24px;

    top:22px;

    color:#999;

}

.sidebar-search input{

    width:100%;

    padding:11px 15px 11px 42px;

    border:none;

    border-radius:10px;

    background:#f0f2f5;

    outline:none;

}

.conversation-list{

    flex:1;

    overflow-y:auto;

}

/**********************
 CONVERSATION
**********************/

.conversation{

    display:flex;

    align-items:center;

    gap:15px;

    padding:14px;

    cursor:pointer;

    border-bottom:1px solid #f3f3f3;

    transition:.2s;

}

.conversation:hover{

    background:var(--hover);

}

.conversation.active{

    background:#e9edef;

}

.avatar{

    width:50px;

    height:50px;

    border-radius:50%;

    background:#dfe5e7;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:22px;

    font-weight:bold;

    color:#54656f;

    flex-shrink:0;

}

.conversation-info{

    flex:1;

    overflow:hidden;

}

.conversation-name{

    font-weight:600;

    margin-bottom:4px;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

}

.conversation-last{

    font-size:13px;

    color:var(--secondary);

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

}

.badge{

    background:var(--primary);

    color:white;

    border-radius:50px;

    padding:2px 8px;

    font-size:11px;

}

/**********************
 CHAT
**********************/

.chat{

    flex:1;

    display:flex;

    flex-direction:column;

    background:var(--chat);

}

.chat-header{

    height:70px;

    background:white;

    border-bottom:1px solid var(--border);

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 20px;

}

.chat-contact{

    display:flex;

    align-items:center;

    gap:15px;

}

.chat-avatar{

    width:46px;

    height:46px;

    border-radius:50%;

    background:#dfe5e7;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:22px;

}

.chat-title{

    font-weight:600;

}

.chat-subtitle{

    font-size:13px;

    color:var(--secondary);

}

.chat-actions{

    display:flex;

    gap:8px;

}

/**********************
 MESSAGES
**********************/

.chat-messages{

    flex:1;

    overflow-y:auto;

    padding:30px;

}

.message{

    display:flex;

    margin-bottom:10px;

}

.message.in{

    justify-content:flex-start;

}

.message.out{

    justify-content:flex-end;

}

.bubble{

    max-width:70%;

    border-radius:10px;

    padding:10px 14px;

    position:relative;

    font-size:15px;

    line-height:1.4;

    word-break:break-word;

}

.message.in .bubble{

    background:var(--incoming);

}

.message.out .bubble{

    background:var(--outgoing);

}

.message-time{

    margin-top:6px;

    text-align:right;

    font-size:11px;

    color:#667781;

}

/**********************
 FOOTER
**********************/

.chat-footer{

    height:72px;

    background:white;

    display:flex;

    align-items:center;

    gap:10px;

    padding:0 15px;

    border-top:1px solid var(--border);

}

.chat-footer input{

    flex:1;

    border:none;

    outline:none;

    background:#f0f2f5;

    border-radius:10px;

    padding:13px 15px;

    font-size:15px;

}

.send-button{

    width:46px;

    height:46px;

    border:none;

    border-radius:50%;

    background:var(--primary);

    color:white;

    cursor:pointer;

    transition:.2s;

    font-size:18px;

}

.send-button:hover{

    transform:scale(1.05);

}

/**********************
 EMPTY
**********************/

.empty{

    padding:30px;

    color:#666;

    text-align:center;

}

.welcome{

    height:100%;

    display:flex;

    flex-direction:column;

    justify-content:center;

    align-items:center;

    color:#667781;

}

.welcome i{

    font-size:90px;

    margin-bottom:20px;

}

.welcome h2{

    margin-bottom:10px;

}

.loading{

    padding:30px;

    text-align:center;

    color:#666;

}

.day-separator{

    display:flex;

    justify-content:center;

    margin:20px 0;

}

.day-separator span{

    background:#d9fdd3;

    padding:6px 14px;

    border-radius:10px;

    font-size:12px;

    color:#555;

}

.bubble-footer{

    display:flex;

    justify-content:flex-end;

    align-items:center;

    gap:6px;

    margin-top:6px;

    font-size:11px;

    color:#667781;

}

.checks{

    min-width:22px;

    text-align:right;

}

.read{

    color:#53bdeb;

}

.failed{

    color:red;

    font-weight:bold;

}
#loading{

    position:fixed;

    inset:0;

    display:none;

    justify-content:center;

    align-items:center;

    background:rgba(255,255,255,.45);

    z-index:9999;

}

#toast{

    position:fixed;

    left:50%;

    bottom:35px;

    transform:translateX(-50%);

    background:#202c33;

    color:white;

    padding:12px 22px;

    border-radius:12px;

    opacity:0;

    transition:.3s;

    z-index:9999;

}

#toast.show{

    opacity:1;

}

/*************************
 MODAL
*************************/

.modal{

    position:fixed;

    inset:0;

    display:none;

    justify-content:center;

    align-items:center;

    background:rgba(0,0,0,.45);

    z-index:9999;

}

.modal.show{

    display:flex;

}

.modal-window{

    width:430px;

    background:white;

    border-radius:14px;

    overflow:hidden;

    box-shadow:0 10px 40px rgba(0,0,0,.25);

}

.modal-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:18px;

    border-bottom:1px solid #ddd;

}

.modal-body{

    display:flex;

    flex-direction:column;

    padding:20px;

    gap:10px;

}

.modal-body label{

    font-size:14px;

    font-weight:bold;

}

.modal-body input{

    border:1px solid #ddd;

    border-radius:10px;

    padding:12px;

    font-size:15px;

    outline:none;

}

.modal-body input:focus{

    border-color:#00a884;

}

.modal-footer{

    display:flex;

    justify-content:flex-end;

    padding:20px;

    border-top:1px solid #ddd;

}

.btn-create{

    background:#00a884;

    color:white;

    border:none;

    padding:12px 20px;

    border-radius:8px;

    cursor:pointer;

    font-size:15px;

}

.btn-create:hover{

    background:#008f72;

}