*{box-sizing:border-box}
body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:#f2f5fb;color:#1e293b;font-size:14px}
:root{
  --navy:#172554;--blue:#2563eb;--purple:#7c3aed;--green:#16a34a;
  --orange:#f97316;--red:#dc2626;--pink:#db2777;--cyan:#0891b2;
  --border:#dfe5ef;--muted:#64748b;--white:#fff
}
.layout{display:flex;min-height:100vh}
.sidebar{width:255px;background:var(--navy);color:#fff;position:fixed;inset:0 auto 0 0;padding:20px 14px;overflow:auto;z-index:20}
.brand{font-size:18px;font-weight:950;padding:9px 10px 20px;border-bottom:1px solid #33447a}
.brand small{display:block;color:#67e8f9;font-size:11.5px;letter-spacing:1px;margin-top:5px}
.nav-title{font-size:11px;font-weight:800;color:#9fb0d7;margin:19px 10px 8px;letter-spacing:1px}
.nav a{display:flex;align-items:center;gap:10px;text-decoration:none;color:#dbe5ff;font-size:13.5px;font-weight:700;padding:10px 11px;border-radius:8px;margin:2px 0}
.nav a:hover,.nav a.active{background:var(--purple);color:#fff}
.icon{width:26px;height:26px;border-radius:6px;background:#33447a;display:grid;place-items:center;font-size:13px;font-style:normal}
.active .icon{background:#5b21b6}
.main{margin-left:255px;width:calc(100% - 255px)}
.topbar{height:68px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 27px;position:sticky;top:0;z-index:5}
.search{width:430px;border:1px solid #d6dee9;border-radius:8px;padding:11px 14px;font-size:13.5px;outline:none}
.user{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:800}
.avatar{width:38px;height:38px;border-radius:8px;background:var(--purple);color:#fff;display:grid;place-items:center;font-size:14px;font-weight:800}
.content{padding:24px 27px 40px}
.title-row{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:16px}
.title-row h1{margin:0;font-size:28px;font-weight:950;color:#0f172a}
.title-row p{margin:5px 0 0;font-size:13.5px;color:var(--muted)}
.header-actions{display:flex;gap:7px}.btn{border:0;border-radius:8px;padding:10px 16px;font-size:13px;font-weight:900;cursor:pointer}
.export{background:#e0e7ff;color:#3730a3}

.summary-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.summary-item{background:#fff;border:1px solid var(--border);border-radius:10px;padding:14px 16px;display:flex;align-items:center;justify-content:space-between}
.summary-item .label{font-size:12px;color:var(--muted);font-weight:850;text-transform:uppercase}
.summary-item strong{font-size:24px}
.summary-item:nth-child(1){border-left:5px solid var(--blue)}.summary-item:nth-child(1) strong{color:var(--blue)}
.summary-item:nth-child(2){border-left:5px solid var(--orange)}.summary-item:nth-child(2) strong{color:var(--orange)}
.summary-item:nth-child(3){border-left:5px solid var(--green)}.summary-item:nth-child(3) strong{color:var(--green)}
.summary-item:nth-child(4){border-left:5px solid var(--purple)}.summary-item:nth-child(4) strong{color:var(--purple)}

.toolbar{background:#fff;border:1px solid var(--border);border-radius:10px;padding:12px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.toolbar input,.toolbar select{border:1px solid #d6dee9;border-radius:7px;padding:9px 12px;font-size:13px;background:#fff}
.toolbar input{flex:1;min-width:230px}.toolbar select{min-width:145px}
.filter-btn{border:0;border-radius:7px;padding:9px 15px;font-size:13px;font-weight:900;cursor:pointer}
.apply{background:var(--blue);color:#fff}.reset{background:#e2e8f0;color:#334155}
.date{font-size:12px;color:var(--muted);font-weight:750}

.query-layout{display:grid;grid-template-columns:400px 1fr;gap:16px;min-height:610px}
.query-list,.query-detail{background:#fff;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.query-list-head{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center}
.query-list-head h2{font-size:15px;margin:0;font-weight:950}
.query-detail-head h2{font-size:17px;margin:0;font-weight:950}
.query-list-head span{font-size:12px;color:var(--muted);font-weight:750}
.query-items{max-height:560px;overflow:auto}
.query-item{padding:14px 16px;border-bottom:1px solid #edf0f5;cursor:pointer}
.query-item:hover{background:#f8fafc}.query-item.selected{background:#eef4ff;border-left:4px solid var(--blue);padding-left:12px}
.q-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.q-id{font-size:12.5px;font-weight:950;color:var(--blue)}
.q-time{font-size:11.5px;color:#94a3b8}
.q-owner{margin-top:6px;font-size:13.5px;font-weight:850;color:#172033}.q-business{font-size:12px;color:var(--muted);margin-top:2px}
.q-subject{margin-top:7px;font-size:13px;line-height:1.4;font-weight:800}
.q-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:10px}
.chip{display:inline-block;padding:4px 9px;border-radius:5px;font-size:11px;font-weight:850}
.chip.general{background:#e0e7ff;color:#3730a3}.chip.card{background:#dcfce7;color:#166534}.chip.pricing{background:#fef3c7;color:#92400e}.chip.account{background:#fce7f3;color:#be185d}.chip.usage{background:#dbeafe;color:#1d4ed8}
.status{font-size:11.5px;font-weight:950}.s-new{color:#2563eb}.s-replied{color:#c2410c}.s-resolved{color:#15803d}.s-closed{color:#64748b}

.query-detail{display:flex;flex-direction:column}
.query-detail-head{padding:18px 20px;border-bottom:1px solid var(--border)}
.detail-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:10px}
.person{display:flex;align-items:center;gap:12px}.person-avatar{width:42px;height:42px;border-radius:9px;background:#ede9fe;color:#6d28d9;display:grid;place-items:center;font-size:14px;font-weight:950}
.person strong{font-size:14.5px}.person small{display:block;font-size:12px;color:var(--muted);margin-top:3px}
.detail-tags{display:flex;gap:8px;align-items:center}
.detail-body{padding:20px;flex:1;overflow:auto;background:#fbfcfe}
.message-block{max-width:720px;background:#fff;border:1px solid #e7ecf3;border-radius:10px;padding:16px;margin-bottom:14px}
.message-block.admin{margin-left:40px;border-left:4px solid var(--green)}
.message-label{font-size:11.5px;text-transform:uppercase;color:var(--muted);font-weight:900;margin-bottom:7px;letter-spacing:0.5px}
.message-text{font-size:13.5px;color:#334155;line-height:1.7}
.detail-info{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px}
.detail-box{border:1px solid #e7ecf3;border-radius:8px;background:#fff;padding:12px}
.detail-box label{display:block;font-size:11px;text-transform:uppercase;color:var(--muted);font-weight:850;margin-bottom:4px;letter-spacing:0.4px}
.detail-box strong{font-size:13px;word-break:break-all}
.reply-box{border-top:1px solid var(--border);padding:16px 20px;background:#fff}
.reply-box label{display:block;font-size:11.5px;color:var(--muted);font-weight:850;text-transform:uppercase;margin-bottom:8px;letter-spacing:0.4px}
.reply-box textarea{width:100%;height:85px;border:1px solid #d6dee9;border-radius:8px;padding:12px;font:13.5px Inter,Segoe UI,Arial,sans-serif;resize:vertical}
.reply-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:10px}
.reply-actions button{border:0;border-radius:7px;padding:10px 16px;font-size:13px;font-weight:900;cursor:pointer}
.send{background:var(--blue);color:#fff}.resolve{background:#dcfce7;color:#166534}.close{background:#e2e8f0;color:#334155}

.note{margin-top:16px;background:#eef6ff;border-left:5px solid var(--blue);padding:13px 16px;border-radius:8px;font-size:13px;color:#475569;line-height:1.6}
footer{text-align:center;color:#94a3b8;font-size:12px;margin-top:24px;padding-top:16px;border-top:1px solid #e5e7eb}

@media(max-width:1050px){.query-layout{grid-template-columns:1fr}.query-list{min-height:360px}.query-items{max-height:330px}.summary-strip{grid-template-columns:repeat(2,1fr)}.detail-info{grid-template-columns:repeat(2,1fr)}}
@media(max-width:800px){.sidebar{width:70px}.brand{font-size:0}.brand small,.nav-title,.nav a span{display:none}.nav a{justify-content:center}.main{margin-left:70px;width:calc(100% - 70px)}.search{width:55%}}
@media(max-width:600px){.content{padding:15px}.topbar{padding:11px}.user{display:none}.search{width:100%}.title-row{display:block}.header-actions{margin-top:10px}.summary-strip,.detail-info{grid-template-columns:1fr}.toolbar input,.toolbar select{width:100%;min-width:0}.message-block.admin{margin-left:0}}
