*{box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;margin:0;color:#1a1a1a;background:#f5f5f7}
header{background:#fff;border-bottom:1px solid #e5e5e5;padding:12px 24px;display:flex;justify-content:space-between;align-items:center}
header h1{margin:0;font-size:18px} header h1 a{color:#111;text-decoration:none}
header nav span{color:#666;margin-right:12px;font-size:14px} header nav a{color:#0a7d2e;font-size:14px}
main{max-width:900px;margin:30px auto;padding:0 20px}
footer{text-align:center;color:#999;font-size:12px;margin:50px 0 30px}
.card{background:#fff;border-radius:12px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,0.05)}
.card h2{margin-top:0}
.card form{display:flex;flex-direction:column;gap:8px;max-width:340px}
.card label{font-size:13px;color:#666;margin-top:8px}
.card input,.card button{padding:10px 12px;font-size:15px;border:1px solid #d0d0d0;border-radius:8px}
.card button{background:#0a7d2e;color:#fff;border:none;cursor:pointer;font-weight:600;margin-top:12px}
.err{background:#fee;color:#c00;padding:10px 14px;border-radius:8px;margin-bottom:12px}
.hint{color:#999;font-size:13px}
.chat{background:#fff;border-radius:12px;padding:20px;box-shadow:0 1px 3px rgba(0,0,0,0.05)}
.dealbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #eee}
.dealbar input{padding:6px 10px;border:1px solid #d0d0d0;border-radius:6px}
.dealbar button{padding:6px 12px;border:none;background:#0a7d2e;color:#fff;border-radius:6px;cursor:pointer}
.dealbar a{color:#0a7d2e;font-size:14px} .inline{display:inline-block}
#messages{min-height:200px;max-height:60vh;overflow-y:auto;margin-bottom:16px}
.msg{padding:10px 14px;border-radius:10px;margin-bottom:10px;max-width:85%}
.msg pre{margin:0;white-space:pre-wrap;word-wrap:break-word;font-family:inherit;font-size:14px;line-height:1.5}
.msg.user{background:#e7f5e9;margin-left:auto} .msg.assistant{background:#f0f0f3} .msg.err{background:#fee;color:#c00}
#send textarea{width:100%;padding:10px;border:1px solid #d0d0d0;border-radius:8px;font:inherit;resize:vertical}
#send .row{display:flex;justify-content:space-between;align-items:center;margin-top:8px}
.file-label{padding:6px 12px;background:#f0f0f3;border-radius:6px;cursor:pointer;font-size:14px}
.file-label input{display:none}
#send button[type=submit]{padding:8px 16px;background:#0a7d2e;color:#fff;border:none;border-radius:6px;cursor:pointer;font-weight:600}
#send button:disabled{opacity:0.5;cursor:wait}
table{border-collapse:collapse;width:100%;margin:12px 0}
table th,table td{text-align:left;padding:8px 12px;border-bottom:1px solid #eee}
table th{color:#666;font-weight:500;width:120px}
.tl{padding:12px;background:#fafafa;border-radius:8px;margin-bottom:8px}
.tl .date{font-size:12px;color:#999;margin-bottom:4px}
.tl pre{margin:0;white-space:pre-wrap;font:14px inherit}

/* === админка + ссылка-плашка (добавлено 2026-06-11) === */
.adminbar{margin-bottom:16px;padding:10px 14px;background:#eef7f0;border:1px solid #bfe3c8;border-radius:8px}
.adminbar a{color:#0a7d2e;font-weight:600;text-decoration:none;font-size:14px}
.admin-layout{display:flex;gap:16px;align-items:flex-start}
.userlist{list-style:none;margin:0;padding:0;flex:0 0 260px;border:1px solid #e5e5e5;border-radius:10px;overflow:hidden;max-height:70vh;overflow-y:auto;background:#fff}
.userlist li{border-bottom:1px solid #f0f0f0}
.userlist li a{display:flex;justify-content:space-between;gap:8px;padding:10px 12px;text-decoration:none;color:#1a1a1a;font-size:14px}
.userlist li a:hover{background:#f5f5f7}
.userlist li a.active{background:#eef7f0;font-weight:600}
.userlist .cnt{color:#999;font-size:12px}
.userlist .empty{padding:12px;color:#999}
.userchat{flex:1 1 auto;min-width:0;background:#fff;border:1px solid #e5e5e5;border-radius:10px;padding:16px}
.userchat h3{margin:0 0 12px;font-size:15px;color:#333;word-break:break-all}
.userchat #messages{min-height:auto;max-height:65vh}
.empty{color:#999}
@media(max-width:680px){.admin-layout{flex-direction:column}.userlist{flex:1 1 auto;width:100%}}

/* === дата/время в админке (добавлено 2026-06-18) === */
.msg .ts{font-size:11px;color:#999;margin-bottom:4px}
.userlist .u-info{display:flex;flex-direction:column;min-width:0}
.userlist .u-last{color:#aaa;font-size:11px;margin-top:2px}
