:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #172033; background: #f3f6fb; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button { border: 0; border-radius: 10px; padding: 11px 16px; background: #2457d6; color: white; cursor: pointer; font-weight: 700; }
button.secondary { background: #e7edf8; color: #29426f; }
button:hover { filter: brightness(.96); }
.link { padding: 0; background: transparent; color: #2457d6; text-align: left; }
.shell { width: min(1400px, 100%); margin: 0 auto; padding: 28px; }
.card { background: white; border: 1px solid #e0e7f2; border-radius: 18px; box-shadow: 0 12px 35px rgba(30, 50, 90, .07); }
.auth-card { max-width: 430px; margin: 12vh auto; padding: 34px; }
.eyebrow { margin: 0 0 8px; color: #5571aa; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1, h2 { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 42px); letter-spacing: -.04em; }
h2 { font-size: 20px; }
.muted { color: #6d7890; }
form { display: grid; gap: 14px; margin-top: 24px; }
label { display: grid; gap: 7px; color: #536079; font-size: 14px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #d6deec; border-radius: 10px; padding: 12px; color: #172033; background: #fff; }
.error { min-height: 20px; color: #b32d45; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.topbar-actions, .detail-actions, .list-heading { display: flex; align-items: center; gap: 10px; }
.topbar-actions select { min-width: 190px; }
.workspace { display: grid; grid-template-columns: 360px 1fr; gap: 18px; min-height: 650px; }
.conversation-list, .conversation-detail { padding: 20px; }
.list-heading { justify-content: space-between; margin-bottom: 14px; }
.conversation-item { display: block; width: 100%; text-align: left; background: #f7f9fd; color: #172033; border: 1px solid transparent; margin-bottom: 8px; }
.conversation-item.active { border-color: #6d91e8; background: #edf3ff; }
.conversation-item strong, .conversation-item small { display: block; }
.conversation-item small { margin-top: 5px; color: #6d7890; }
.empty { display: grid; place-items: center; height: 100%; min-height: 500px; color: #7c879b; }
.detail-heading { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #e8edf5; }
.messages { display: grid; gap: 12px; padding: 20px 0; min-height: 470px; max-height: 560px; overflow: auto; align-content: start; }
.message { max-width: 78%; padding: 12px 14px; border-radius: 14px; white-space: pre-wrap; }
.message.customer { justify-self: start; background: #edf1f7; }
.message.bot, .message.agent { justify-self: end; background: #2457d6; color: white; }
.message-meta { display: block; margin-bottom: 4px; opacity: .68; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.reply { display: grid; grid-template-columns: 1fr auto; margin-top: 0; }
.kb-panel { margin-top: 18px; padding: 20px; }
.kb-list { display: grid; gap: 8px; margin-bottom: 16px; }
.kb-item { padding: 12px; border: 1px solid #e0e7f2; border-radius: 10px; }
.kb-item strong, .kb-item small { display: block; }
.kb-item small { margin-top: 5px; color: #6d7890; }
.kb-form { grid-template-columns: 1fr 2fr auto auto; align-items: start; margin-top: 0; }
.kb-form textarea { min-height: 92px; resize: vertical; border: 1px solid #d6deec; border-radius: 10px; padding: 12px; font: inherit; }
.inline { display: flex; align-items: center; gap: 6px; padding: 12px 0; white-space: nowrap; }
.inline input { width: auto; }
.management-panel { margin-top: 18px; padding: 20px; }
.management-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.management-grid textarea { min-height: 120px; resize: vertical; border: 1px solid #d6deec; border-radius: 10px; padding: 12px; font: inherit; }
.token-list, .audit-list { display: grid; gap: 8px; margin-top: 14px; }
.token-item, .audit-item { padding: 10px; border: 1px solid #e0e7f2; border-radius: 10px; font-size: 13px; }
.token-item button { float: right; padding: 5px 8px; font-size: 11px; }
.audit-item small { display: block; color: #6d7890; margin-top: 4px; }
@media (max-width: 820px) { .management-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .shell { padding: 14px; } .topbar, .detail-heading { align-items: flex-start; flex-direction: column; } .workspace { grid-template-columns: 1fr; } .conversation-list { min-height: 240px; } }
