:root{font-family:Inter,system-ui,sans-serif;background:#f5f7fb;color:#172033}
*{box-sizing:border-box}
body{margin:0}
header{display:flex;justify-content:space-between;align-items:center;padding:22px 28px;background:#101827;color:white}
header h1{margin:0;font-size:24px}
header p{margin:5px 0 0;color:#aeb8cb}
main{max-width:1280px;margin:24px auto;padding:0 18px 50px}
.card{background:white;border:1px solid #e4e8f0;border-radius:16px;padding:20px;box-shadow:0 6px 24px rgba(20,30,55,.05)}
.narrow{max-width:460px;margin:70px auto}
.hidden{display:none!important}
.grid.two{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}
.stats{display:grid;grid-template-columns:repeat(6,1fr);gap:12px;margin-bottom:18px}
.stat{background:white;border:1px solid #e4e8f0;border-radius:14px;padding:16px}
.stat strong{display:block;font-size:28px}.stat span{font-size:13px;color:#667085}
h2{font-size:18px;margin:0 0 16px}
label{display:block;font-size:13px;font-weight:600;color:#344054}
input,textarea{width:100%;margin-top:6px;border:1px solid #d0d5dd;border-radius:10px;padding:11px 12px;font:inherit;background:#fff}
textarea{resize:vertical}
button{border:0;border-radius:10px;padding:10px 14px;background:#202b3c;color:white;font-weight:700;cursor:pointer}
button:hover{filter:brightness(1.08)}
button.accent{background:#0f8f5f}
.actions,.cardHead{display:flex;gap:10px;align-items:center;justify-content:space-between}
.actions{justify-content:flex-start;margin-top:12px}
.formGrid{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.moduleList{display:grid;gap:10px}
.module{display:flex;justify-content:space-between;align-items:center;border:1px solid #e7ebf2;padding:12px;border-radius:12px}
.module span{display:grid;gap:3px}.module small{font-weight:400;color:#8a94a6}
.module input{width:20px;height:20px;margin:0}
.pill{padding:7px 11px;border-radius:999px;background:#334155;font-size:12px;font-weight:800}
.pill.live{background:#067647}.pill.warn{background:#b54708}
.note{margin-top:14px;padding:12px;border-radius:10px;background:#f2f4f7;color:#475467;font-size:13px}
.muted{color:#7a8496;font-size:13px}
.error{color:#b42318;margin-top:10px}
.list{display:grid;gap:8px;max-height:320px;overflow:auto}
.alert{border-left:4px solid #f79009;background:#fffaeb;padding:10px;border-radius:8px;display:grid;gap:4px}
.alert.high{border-left-color:#d92d20;background:#fef3f2}
.alert span{font-size:13px}.alert small{color:#7a8496}
.tableWrap{overflow:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{padding:11px 9px;border-bottom:1px solid #eaecf0;text-align:left;white-space:nowrap}
th{color:#667085;background:#f9fafb}
pre{white-space:pre-wrap;background:#101827;color:#d1f7e4;padding:12px;border-radius:10px;min-height:70px}
@media(max-width:900px){
  .grid.two{grid-template-columns:1fr}
  .stats{grid-template-columns:repeat(2,1fr)}
  .formGrid{grid-template-columns:1fr}
  header{align-items:flex-start;gap:12px}
}

.conversationCard{margin-bottom:18px}
.conversationLayout{display:grid;grid-template-columns:320px 1fr;gap:14px;min-height:520px}
.conversationList{border:1px solid #e4e8f0;border-radius:12px;overflow:auto;max-height:620px;background:#fafbfc}
.conversationItem{padding:12px;border-bottom:1px solid #eaecf0;cursor:pointer;display:grid;gap:5px}
.conversationItem:hover,.conversationItem.active{background:#eef4ff}
.conversationItem .top{display:flex;justify-content:space-between;gap:8px;align-items:center}
.conversationItem b{font-size:14px}
.conversationItem .preview{font-size:12px;color:#667085;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conversationItem small{color:#98a2b3}
.chatPanel{border:1px solid #e4e8f0;border-radius:12px;overflow:hidden;background:#efeae2;display:flex;flex-direction:column}
.chatHeader{background:#fff;padding:12px 14px;border-bottom:1px solid #e4e8f0;font-weight:800}
.chatMessages{padding:16px;overflow:auto;display:flex;flex-direction:column;gap:10px;max-height:565px;min-height:450px}
.msg{max-width:78%;padding:9px 11px;border-radius:10px;background:white;box-shadow:0 1px 2px rgba(0,0,0,.08);display:grid;gap:5px;align-self:flex-start}
.msg.out{align-self:flex-end;background:#d9fdd3}
.msg .meta{display:flex;gap:8px;justify-content:flex-end;color:#7a8496;font-size:10px}
.msg .type{font-weight:800;text-transform:uppercase}
.msg.voice{border-left:4px solid #7f56d9}
.emptyChat{margin:auto;color:#7a8496;text-align:center}
.smallInput{width:230px;margin:0}
.conversationCard .cardHead{align-items:flex-start;margin-bottom:14px}
@media(max-width:900px){
  .conversationLayout{grid-template-columns:1fr}
  .conversationList{max-height:260px}
  .chatMessages{min-height:360px}
  .conversationCard .cardHead{display:grid}
  .smallInput{width:100%}
}

.customerRow{cursor:pointer}
.customerRow:hover{background:#f2f6ff}
