
*{box-sizing:border-box}
body{margin:0;font-family:Arial,"Microsoft YaHei",sans-serif;background:#edf2f7;color:#111827}
button,input,textarea,select{font-family:inherit}
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f172a,#2563eb)}
.login-card{width:420px;background:#fff;border-radius:18px;padding:34px;box-shadow:0 24px 70px rgba(0,0,0,.26)}
.login-card h1{margin:0 0 8px}.login-card p{color:#64748b;margin:0 0 22px}
.label{display:block;font-weight:700;margin:12px 0 7px}
.input,.select{width:100%;height:42px;border:1px solid #d8dee8;border-radius:9px;padding:0 12px;background:#fff;font-size:14px}
.textarea{width:100%;border:1px solid #d8dee8;border-radius:9px;padding:12px;resize:vertical;font-size:14px}
.btn{border:0;border-radius:9px;background:#2563eb;color:white;padding:10px 15px;cursor:pointer;font-size:14px}
.btn:hover{opacity:.92}.btn.full{width:100%;height:44px}.btn.gray{background:#475569}.btn.red{background:#dc2626}.btn.green{background:#16a34a}.btn.orange{background:#ea580c}
.msg{display:none;white-space:pre-wrap;background:#0f172a;color:#fff;border-radius:10px;padding:12px;margin-top:12px;line-height:1.6}
.app{display:flex;height:100vh;overflow:hidden}
.side{width:300px;background:#fff;border-right:1px solid #e5e7eb;display:flex;flex-direction:column}
.side-head{height:64px;padding:14px 16px;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;justify-content:space-between}
.side-head h2{margin:0;font-size:20px}
.search{padding:12px;border-bottom:1px solid #e5e7eb}
.conv-list{flex:1;overflow:auto}
.conv{padding:14px 16px;border-bottom:1px solid #f1f5f9;cursor:pointer}
.conv:hover,.conv.active{background:#eff6ff}
.conv-top{display:flex;justify-content:space-between;gap:8px}
.phone{font-weight:800}.time{font-size:12px;color:#64748b}.last{margin-top:6px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
.unread{background:#ef4444;color:#fff;border-radius:999px;padding:2px 7px;font-size:12px}
.chat{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{height:64px;background:#fff;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;justify-content:space-between;padding:0 18px}
.chat-title{font-size:18px;font-weight:800}.chat-sub{font-size:12px;color:#64748b;margin-top:3px}
.messages{flex:1;overflow:auto;padding:22px;background:#f8fafc}
.empty{height:100%;display:flex;align-items:center;justify-content:center;color:#64748b}
.bubble-row{display:flex;margin:10px 0}
.bubble-row.out{justify-content:flex-end}
.bubble{max-width:70%;padding:11px 13px;border-radius:14px;line-height:1.55;box-shadow:0 2px 8px rgba(15,23,42,.06);white-space:pre-wrap;word-break:break-word}
.bubble.in{background:#fff;border-top-left-radius:4px}
.bubble.out{background:#2563eb;color:#fff;border-top-right-radius:4px}
.meta{font-size:11px;opacity:.75;margin-top:5px}
.status{font-size:12px;margin-left:5px}
.composer{background:#fff;border-top:1px solid #e5e7eb;padding:12px}
.composer textarea{width:100%;height:82px;border:1px solid #d8dee8;border-radius:10px;padding:10px;resize:none;font-size:14px}
.composer-actions{display:flex;justify-content:space-between;align-items:center;margin-top:8px}
.admin-layout{display:flex;min-height:100vh}
.admin-menu{width:230px;background:#101827;color:#cbd5e1}
.brand{height:64px;display:flex;align-items:center;padding:0 20px;font-size:20px;font-weight:900;border-bottom:1px solid rgba(255,255,255,.08)}
.admin-menu button{width:calc(100% - 24px);margin:5px 12px;height:42px;border:0;border-radius:9px;background:transparent;color:#cbd5e1;text-align:left;padding:0 14px;cursor:pointer}
.admin-menu button.active,.admin-menu button:hover{background:#2563eb;color:#fff}
.admin-main{flex:1;min-width:0;background:#eef2f7}
.admin-top{height:64px;background:#fff;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center;padding:0 22px}
.content{padding:20px}
.page{display:none}.page.active{display:block}
.grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.stat,.card{background:#fff;border-radius:14px;padding:18px;box-shadow:0 4px 20px rgba(15,23,42,.06);margin-bottom:16px}
.num{font-size:28px;font-weight:900;margin-top:8px}
.muted{color:#64748b;font-size:13px}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;min-width:760px}
.table th{background:#f8fafc;color:#475569;text-align:left;padding:11px;border-bottom:1px solid #e5e7eb;font-size:13px}
.table td{padding:11px;border-bottom:1px solid #e5e7eb;font-size:13px;vertical-align:top}
.badge{display:inline-block;border-radius:999px;padding:4px 8px;font-size:12px;background:#e0e7ff;color:#3730a3}
.badge.ok{background:#dcfce7;color:#166534}.badge.bad{background:#fee2e2;color:#991b1b}.badge.gray{background:#e5e7eb;color:#374151}
.modal-mask{display:none;position:fixed;inset:0;background:rgba(15,23,42,.5);align-items:center;justify-content:center;z-index:30;padding:16px}
.modal{width:520px;max-width:100%;background:#fff;border-radius:14px;padding:20px;box-shadow:0 22px 80px rgba(0,0,0,.32)}
pre{white-space:pre-wrap;word-break:break-word}
@media(max-width:800px){.app{display:block;height:auto}.side{width:100%;height:320px}.chat{height:calc(100vh - 320px)}.grid{grid-template-columns:repeat(2,1fr)}.admin-menu{width:80px}.brand span,.admin-menu .text{display:none}}
