*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Segoe UI,Arial,sans-serif;
}

body{
    background:#d9dbd5;
    height:100vh;
}

.wrapper{
    width:100%;
    height:100vh;

    display:flex;
    justify-content:center;
    align-items:center;

    padding:20px;
}

.app{

    width:1450px;
    height:92vh;

    background:white;

    border-radius:16px;

    overflow:hidden;

    display:flex;

    box-shadow:0 15px 45px rgba(0,0,0,.15);

}

/* ===========================
   SIDEBAR
=========================== */

.sidebar{

    width:340px;

    background:#ffffff;

    border-right:1px solid #e5e5e5;

    display:flex;

    flex-direction:column;

}

.sidebar-header{

    background:#128C7E;

    color:white;

    padding:28px;

}

.sidebar-header h1{

    font-size:28px;

    margin-bottom:6px;

}

.sidebar-header p{

    opacity:.9;

    font-size:14px;

}

.search-box{

    padding:18px;

    border-bottom:1px solid #efefef;

}

.search-box input{

    width:100%;

    padding:12px 16px;

    border:none;

    border-radius:30px;

    background:#f5f5f5;

    outline:none;

}

.conversation-list{

    overflow-y:auto;

    flex:1;

}

.conversation{

    display:flex;

    align-items:center;

    gap:14px;

    padding:18px;

    color:#222;

    text-decoration:none;

    transition:.2s;

    border-bottom:1px solid #f3f3f3;

}

.conversation:hover{

    background:#f7f7f7;

}

.avatar{

    width:52px;

    height:52px;

    border-radius:50%;

    background:#29b35a;

    color:white;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:20px;

    font-weight:bold;

    flex-shrink:0;

}

.conversation-info{

    flex:1;

}

.conversation-name{

    font-weight:600;

}

.conversation-user{

    font-size:13px;

    color:#888;

    margin-top:4px;

}

.conversation-time{

    font-size:12px;

    color:#999;

}

.back-button{

    margin:20px;

    color:#128C7E;

    text-decoration:none;

    font-weight:600;

}

/* ===========================
   CHAT
=========================== */

.chat-container{

    flex:1;

    display:flex;

    flex-direction:column;

    background:#efeae2;

}

.chat-header{

    height:80px;

    background:white;

    border-bottom:1px solid #e5e5e5;

    display:flex;

    align-items:center;

    gap:16px;

    padding:0 28px;

}

.chat-user h2{

    font-size:22px;

}

.chat-user span{

    color:#777;

    font-size:14px;

}

/* ===========================
   MESSAGES
=========================== */

.messages{

    flex:1;

    overflow-y:auto;

    padding:30px;

}

.bubble-row{

    display:flex;

    margin-bottom:14px;

}

.user{

    justify-content:flex-start;

}

.operator{

    justify-content:flex-end;

}

.bubble{

    max-width:70%;

    padding:14px 18px;

    border-radius:14px;

    line-height:1.5;

    font-size:15px;

    box-shadow:0 2px 6px rgba(0,0,0,.08);

}

.user-bubble{

    background:white;

}

.operator-bubble{

    background:#DCF8C6;

}

.time{

    margin-top:8px;

    text-align:right;

    font-size:11px;

    color:#777;

}

/* ===========================
   FOOTER
=========================== */

.chat-footer{

    background:white;

    border-top:1px solid #e5e5e5;

    padding:20px;

}

.chat-footer form{

    display:flex;

    gap:16px;

}

.chat-footer textarea{

    flex:1;

    resize:none;

    height:56px;

    border:1px solid #ddd;

    border-radius:12px;

    padding:16px;

    font-size:15px;

    outline:none;

}

.chat-footer button{

    width:140px;

    border:none;

    border-radius:12px;

    background:#128C7E;

    color:white;

    cursor:pointer;

    font-size:15px;

    transition:.2s;

}

.chat-footer button:hover{

    background:#0f7569;

}

/* ===========================
   WELCOME
=========================== */

.welcome{

    flex:1;

    display:flex;

    justify-content:center;

    align-items:center;

    flex-direction:column;

    background:#efeae2;

}

.welcome h2{

    font-size:34px;

    margin-bottom:12px;

}

.welcome p{

    color:#777;

}

/* Conversazione selezionata */

.conversation.active{

    background:#e8f5f2;

    border-left:4px solid #128C7E;

}

.conversation.active:hover{

    background:#dff2ee;

}

.conversation-right{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:8px;
}

.badge{
    min-width:22px;
    height:22px;
    padding:0 6px;
    border-radius:11px;
    background:#25D366;
    color:#fff;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:12px;
    font-weight:700;
}

.sidebar-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.logout-button{
    background:#ffffff22;
    color:#fff;
    text-decoration:none;
    padding:8px 12px;
    border-radius:8px;
    font-size:13px;
    font-weight:600;
    transition:.2s;
}

.logout-button:hover{
    background:#ffffff44;
}