/* ==========================================
   PPPP CHAT SYSTEM
   admin.css
   Version 4.0.0 Final Stable
========================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial,sans-serif;
}

:root{
    --primary:#0066ff;
    --primary-dark:#0052cc;
    --bg:#f5f6fa;
    --white:#ffffff;
    --border:#dddddd;
    --shadow:0 10px 30px rgba(0,0,0,.12);
    --radius:12px;
}

body{
    background:var(--bg);
    color:#222;
}

/* ================= Login ================= */

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

.login-card{
    width:100%;
    max-width:380px;
    background:var(--white);
    padding:30px;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.login-card h1{
    margin-bottom:10px;
}

.login-card p{
    margin-bottom:20px;
    color:#666;
}

.login-card input{
    width:100%;
    padding:12px;
    margin-bottom:15px;
    border:1px solid var(--border);
    border-radius:8px;
}

.login-card button{
    width:100%;
    padding:12px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    background:var(--primary);
    color:#fff;
    transition:.2s;
}

.login-card button:hover{
    background:var(--primary-dark);
}

.google-btn{
    background:#db4437;
}

.google-btn:hover{
    opacity:.9;
}

.divider{
    margin:18px 0;
    text-align:center;
    color:#888;
}

.error{
    margin-top:15px;
    color:#d60000;
}

/* ================= Dashboard ================= */

.admin-layout{
    display:flex;
    height:100vh;
    overflow:hidden;
}

/* Sidebar */

.sidebar{
    width:320px;
    background:#fff;
    border-right:1px solid var(--border);
    display:flex;
    flex-direction:column;
}

.logo{
    padding:20px;
    background:var(--primary);
    color:#fff;
    font-size:22px;
    font-weight:bold;
}

.sidebar-header{
    padding:15px;
    border-bottom:1px solid var(--border);
    font-weight:bold;
}

.conversation-list{
    flex:1;
    overflow-y:auto;
}

.conversation-item{
    padding:15px;
    border-bottom:1px solid #eee;
    cursor:pointer;
    transition:.2s;
}

.conversation-item:hover{
    background:#f5f7fb;
}

.conversation-item.active{
    background:#eaf2ff;
    border-left:4px solid var(--primary);
}

/* Chat Area */

.chat-area{
    flex:1;
    display:flex;
    flex-direction:column;
}

.chat-header{
    padding:18px;
    background:#fff;
    display:flex;
    justify-content:space-between;
    align-items:center;
    border-bottom:1px solid var(--border);
}

.chat-header button{
    padding:10px 18px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    background:var(--primary);
    color:#fff;
}

.chat-header button:hover{
    background:var(--primary-dark);
}

.admin-messages{
    flex:1;
    overflow-y:auto;
    padding:20px;
    background:#fafafa;
}

.admin-message{
    display:flex;
    margin:12px 0;
}

.admin-message.admin{
    justify-content:flex-end;
}

.admin-message.visitor{
    justify-content:flex-start;
}

.bubble{
    max-width:75%;
    padding:12px 16px;
    border-radius:16px;
    word-break:break-word;
    line-height:1.45;
}

.admin-message.admin .bubble{
    background:var(--primary);
    color:#fff;
}

.admin-message.visitor .bubble{
    background:#ececec;
    color:#222;
}

.typing-indicator{
    min-height:22px;
    padding:0 20px;
    font-size:13px;
    color:#666;
    font-style:italic;
}

.chat-footer{
    display:flex;
    gap:10px;
    padding:15px;
    background:#fff;
    border-top:1px solid var(--border);
}

.chat-footer input{
    flex:1;
    padding:12px;
    border:1px solid var(--border);
    border-radius:8px;
    outline:none;
}

.chat-footer button{
    padding:12px 24px;
    border:none;
    border-radius:8px;
    cursor:pointer;
    background:var(--primary);
    color:#fff;
}

.chat-footer button:hover{
    background:var(--primary-dark);
}

/* ================= Mobile ================= */

@media (max-width:768px){

    .admin-layout{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
        height:40%;
    }

    .chat-area{
        display:flex;
        height:60%;
    }

}