*{
    box-sizing:border-box;
}

:root{
    --bg:#0b141a;
    --panel:#111b21;
    --panel2:#202c33;
    --line:#26343c;
    --muted:#8696a0;
    --text:#e9edef;
    --green:#00a884;
    --green2:#005c4b;
    --input:#2a3942;
}

body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:linear-gradient(180deg,#00a884 0 120px,#0b141a 120px);
    color:var(--text);
}

a{
    text-decoration:none;
    color:inherit;
}

.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
}

.login-card{
    width:380px;
    background:rgba(17,27,33,.95);
    border:1px solid var(--line);
    border-radius:24px;
    padding:30px;
    box-shadow:0 25px 80px rgba(0,0,0,.35);
}

.login-logo{
    width:64px;
    height:64px;
    border-radius:22px;
    background:linear-gradient(135deg,#00a884,#11d69f);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;
    margin-bottom:18px;
}

.login-card h1{
    margin:0 0 6px;
    font-size:28px;
}

.login-card p{
    margin:0 0 24px;
    color:var(--muted);
}

.login-card label{
    font-size:13px;
    color:var(--muted);
}

.login-card input{
    width:100%;
    margin:8px 0 16px;
    padding:14px 16px;
    border:none;
    outline:none;
    border-radius:14px;
    background:var(--input);
    color:white;
}

.login-card button{
    width:100%;
    padding:14px;
    border:none;
    border-radius:14px;
    background:var(--green);
    color:white;
    font-weight:bold;
    cursor:pointer;
}

.alert{
    background:#3b1f1f;
    color:#ffb4b4;
    padding:12px;
    border-radius:12px;
    margin-bottom:16px;
}

.login-help{
    display:block;
    text-align:center;
    color:var(--muted);
    margin-top:16px;
}

.wa-shell{
    width:min(1500px,96vw);
    height:94vh;
    margin:3vh auto;
    display:flex;
    overflow:hidden;
    border-radius:18px;
    box-shadow:0 30px 90px rgba(0,0,0,.45);
    background:var(--panel);
    border:1px solid rgba(255,255,255,.08);
}

.sidebar{
    width:390px;
    background:var(--panel);
    border-right:1px solid var(--line);
    display:flex;
    flex-direction:column;
}

.profile-bar{
    min-height:70px;
    background:var(--panel2);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 16px;
    gap:10px;
}

.profile-left{
    display:flex;
    align-items:center;
    gap:12px;
}

.profile-left small,
.chat-header small,
.chat-info small{
    color:var(--muted);
    display:block;
    margin-top:3px;
    font-size:12px;
}

.top-actions{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.logout,
.connect-wa,
.header-link{
    color:white;
    font-size:12px;
    background:#183d37;
    padding:8px 10px;
    border-radius:999px;
}

.connect-wa,
.header-link{
    background:var(--green);
}

.avatar{
    width:44px;
    height:44px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#00a884,#01866c);
    color:white;
    font-weight:bold;
    flex:0 0 44px;
}

.me-avatar{
    background:linear-gradient(135deg,#667eea,#764ba2);
}

.search-box{
    padding:12px;
    background:var(--panel);
}

.search-box input{
    width:100%;
    background:var(--panel2);
    border:none;
    outline:none;
    color:white;
    padding:13px 16px;
    border-radius:14px;
}

.tabs{
    display:flex;
    gap:8px;
    padding:0 12px 12px;
}

.tabs button{
    border:none;
    color:#cdd6da;
    background:var(--panel2);
    border-radius:999px;
    padding:9px 12px;
    font-size:12px;
}

.tabs .active{
    background:#113f36;
    color:#9fffe0;
}

.chat-list{
    overflow:auto;
}

.chat-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 16px;
    border-bottom:1px solid rgba(255,255,255,.05);
}

.chat-item:hover,
.chat-item.active{
    background:#2a3942;
}

.chat-info{
    min-width:0;
    flex:1;
}

.chat-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}

.chat-top b{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.chat-top span{
    font-size:11px;
    color:var(--muted);
}

.chat-panel{
    flex:1;
    display:flex;
    flex-direction:column;
    min-width:0;
}

.chat-header{
    height:70px;
    background:var(--panel2);
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 18px;
}

.header-actions{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:8px;
}

.header-actions button{
    width:38px;
    height:38px;
    border:none;
    border-radius:50%;
    background:transparent;
    color:#cfd8dc;
    font-size:18px;
    cursor:pointer;
}

.header-actions button:hover{
    background:#2a3942;
}

.message-area{
    flex:1;
    overflow:auto;
    padding:26px;
    background:
      radial-gradient(circle at 20% 20%, rgba(0,168,132,.08), transparent 25%),
      radial-gradient(circle at 80% 60%, rgba(0,168,132,.05), transparent 30%),
      #0b141a;
}

.msg-row{
    display:flex;
    margin-bottom:10px;
}

.msg-row.right{
    justify-content:flex-end;
}

.bubble{
    max-width:min(620px,70%);
    padding:10px 12px 7px;
    border-radius:14px;
    box-shadow:0 1px 1px rgba(0,0,0,.15);
    line-height:1.45;
    font-size:14px;
}

.bubble.in{
    background:#202c33;
    color:#e9edef;
    border-top-left-radius:3px;
}

.bubble.out{
    background:#005c4b;
    color:#fff;
    border-top-right-radius:3px;
}

.time{
    display:block;
    text-align:right;
    color:rgba(255,255,255,.55);
    font-size:10px;
    margin-top:4px;
}

.chat-image{
    display:block;
    max-width:280px;
    border-radius:12px;
    margin-bottom:7px;
}

.file-card{
    display:block;
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.08);
    padding:12px;
    border-radius:12px;
    margin-bottom:7px;
}

.composer{
    min-height:72px;
    background:var(--panel2);
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 16px;
}

.icon-btn{
    width:44px;
    height:44px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    cursor:pointer;
    color:#cfd8dc;
}

.icon-btn:hover{
    background:#2a3942;
}

.composer input[type=text]{
    flex:1;
    border:none;
    outline:none;
    background:var(--input);
    color:white;
    padding:15px 18px;
    border-radius:16px;
}

.composer button{
    width:48px;
    height:48px;
    border:none;
    border-radius:50%;
    background:var(--green);
    color:white;
    font-size:20px;
    cursor:pointer;
}

@media(max-width:850px){

    body{
        background:#0b141a;
    }

    .wa-shell{
        width:100vw;
        height:100vh;
        margin:0;
        border-radius:0;
        flex-direction:column;
    }

    .sidebar{
        width:100%;
        height:42vh;
    }

    .chat-panel{
        height:58vh;
    }

    .bubble{
        max-width:86%;
    }

    .message-area{
        padding:16px;
    }
}
