:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --line: #dce5f0;
  --line-strong: #c5d3e4;
  --text: #10233f;
  --muted: #687a92;
  --green: #087bff;
  --green-deep: #075fc4;
  --green-soft: #e7f2ff;
  --gold: #d69a2d;
  --gold-soft: #fff4dc;
  --red: #c84f5a;
  --red-soft: #ffeaed;
  --blue: #14a9d4;
  --blue-soft: #e3f7fc;
  --cyan: #20d6ff;
  --navy: #071b3a;
  --navy-soft: #0d2c58;
  --shadow: 0 10px 30px rgba(20, 54, 96, .08);
  --sidebar: 224px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 1120px; min-height: 100%; background: var(--bg); color: var(--text); font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif; font-size: 14px; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid rgba(8, 123, 255, .36); outline-offset: 2px; }
svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 20px 14px 16px; background: var(--navy); color: #edf6ff; display: flex; flex-direction: column; z-index: 20; box-shadow: 8px 0 28px rgba(5, 27, 61, .08); }
.brand { height: 48px; padding: 0 8px; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; background: #0b4ea8; border: 1px solid rgba(104, 196, 255, .35); border-radius: 8px; box-shadow: 0 8px 18px rgba(0, 114, 255, .25); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 2px; color: #8fa9c9; font-size: 11px; }
.nav-list { margin-top: 27px; display: grid; gap: 5px; }
.nav-item { position: relative; width: 100%; height: 43px; border: 0; border-radius: 6px; padding: 0 12px; color: #9db0c9; background: transparent; display: flex; align-items: center; gap: 11px; text-align: left; transition: color .18s ease, background .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: #123d75; box-shadow: inset 0 0 0 1px rgba(70, 164, 255, .16); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 24px; background: var(--cyan); border-radius: 0 3px 3px 0; box-shadow: 0 0 12px rgba(32, 214, 255, .55); }
.nav-item b { min-width: 20px; height: 20px; margin-left: auto; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; background: #c0524d; color: #fff; font-size: 11px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.09); padding-top: 15px; }
.connection-state { padding: 0 9px 14px; display: flex; gap: 9px; align-items: center; }
.connection-state > span { width: 8px; height: 8px; border-radius: 50%; background: #27d6a1; box-shadow: 0 0 0 4px rgba(39,214,161,.11), 0 0 12px rgba(39,214,161,.34); }
.connection-state strong, .connection-state small { display: block; }
.connection-state strong { font-size: 12px; font-weight: 600; }
.connection-state small { color: #7894b7; font-size: 10px; margin-top: 2px; }
.user-chip { width: 100%; padding: 9px; border: 1px solid rgba(130,180,239,.08); color: inherit; background: rgba(255,255,255,.045); border-radius: 6px; display: flex; align-items: center; text-align: left; gap: 9px; }
.user-chip > span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #1688e8; color: #fff; font-weight: 800; font-size: 11px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip small { color: #7894b7; font-size: 10px; margin-top: 2px; }
.user-chip svg { width: 14px; margin-left: auto; color: #81968f; }

.main-area { margin-left: var(--sidebar); width: calc(100% - var(--sidebar)); min-height: 100vh; }
.topbar { height: 78px; padding: 0 28px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); box-shadow: 0 5px 18px rgba(21, 56, 101, .035); }
.topbar h1 { margin: 0; font-size: 20px; line-height: 1.2; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.global-search, .conversation-tools label, .data-filters label { height: 36px; border: 1px solid var(--line); background: var(--surface-soft); border-radius: 6px; display: flex; align-items: center; gap: 8px; padding: 0 11px; }
.global-search { width: 250px; }
.global-search svg, .conversation-tools label svg, .data-filters label svg { width: 15px; color: #78857f; }
.global-search input, .conversation-tools input, .data-filters input { width: 100%; border: 0; background: transparent; outline: 0; color: var(--text); }
.icon-btn { position: relative; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.notify-dot { position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: #c74e49; border: 1px solid #fff; }
.primary-btn, .ghost-btn, .filter-btn { min-height: 36px; border-radius: 6px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; }
.primary-btn { border: 1px solid var(--green); background: var(--green); color: #fff; }
.primary-btn:hover { background: var(--green-deep); border-color: var(--green-deep); }
.ghost-btn, .filter-btn { border: 1px solid var(--line); background: #fff; color: #34413d; }
.ghost-btn:hover, .filter-btn:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.primary-btn.small, .ghost-btn.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.text-btn { border: 0; background: transparent; color: var(--green); font-weight: 600; padding: 4px; }

.page { display: none; padding: 24px 28px 34px; }
.page.active { display: block; }
.page.inbox-page { padding: 0; height: calc(100vh - 78px); overflow: hidden; }
.welcome-strip { min-height: 116px; padding: 21px 24px; color: #f2f8ff; background: #0b376d; border: 1px solid #18508e; border-radius: 7px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 14px 30px rgba(7, 45, 92, .16); }
.welcome-strip h2 { margin: 4px 0 7px; font-size: 22px; }
.welcome-strip p { margin: 0; color: #b9cee8; }
.welcome-strip p strong { color: #fff; }
.eyebrow { color: #63dcff; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.welcome-actions { display: flex; gap: 8px; }
.welcome-strip .ghost-btn { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(255,255,255,.06); }
.welcome-strip .primary-btn { background: #fff; border-color: #fff; color: #0b4f9c; }

.metrics-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.metric-card { min-height: 112px; padding: 17px; border: 1px solid var(--line); background: #fff; border-radius: 7px; display: flex; align-items: flex-start; gap: 14px; }
.metric-icon { width: 39px; height: 39px; border-radius: 7px; display: grid; place-items: center; }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.gold { color: #a36c0d; background: var(--gold-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-body { flex: 1; min-width: 0; }
.metric-body > span { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 5px; display: flex; align-items: baseline; gap: 4px; }
.metric-value strong { font-size: 24px; }
.metric-value small { color: var(--muted); }
.metric-trend { margin-top: 6px; font-size: 11px; color: var(--muted); }
.metric-trend b { color: var(--green); font-weight: 600; }
.metric-trend b.down { color: var(--red); }

.dashboard-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .8fr); gap: 14px; }
.dashboard-grid.lower { grid-template-columns: minmax(0, 1.75fr) minmax(330px, .75fr); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 4px 16px rgba(20, 54, 96, .035); }
.panel-head { min-height: 64px; padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 15px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 18px; height: 2px; display: block; }
.legend-total { background: var(--green); }
.legend-ai { background: var(--gold); }
.chart-wrap { height: 240px; padding: 16px 16px 12px; }
.chart-wrap.large { height: 300px; }
.chart-wrap canvas { width: 100%; height: 100%; }
.channel-chart { min-height: 240px; padding: 20px; display: flex; align-items: center; gap: 24px; }
.donut { width: 138px; height: 138px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) 0 41%, #d49a36 41% 66%, #4d84ad 66% 84%, #9daaa5 84% 100%); position: relative; }
.donut::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: #fff; }
.donut > div { z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 22px; }
.donut span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.channel-list { flex: 1; display: grid; gap: 12px; }
.channel-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.channel-label { display: flex; align-items: center; gap: 7px; }
.channel-label i { width: 8px; height: 8px; border-radius: 2px; }
.channel-item strong { font-size: 12px; }
.channel-bar { height: 4px; grid-column: 1 / -1; background: #edf0ef; border-radius: 2px; overflow: hidden; }
.channel-bar span { display: block; height: 100%; border-radius: inherit; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 39px; padding: 0 14px; background: #f8faf9; color: #74807b; font-size: 10px; font-weight: 700; text-align: left; white-space: nowrap; }
td { height: 58px; padding: 0 14px; border-top: 1px solid #edf0ef; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: #fbfcfb; }
.person { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.avatar { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.person strong, .person small { display: block; }
.person small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.intent-badge, .tag, .status-badge { width: max-content; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.intent-badge, .status-badge { padding: 4px 7px; }
.intent-badge.high, .status-badge.warning { background: var(--red-soft); color: var(--red); }
.intent-badge.medium { background: var(--gold-soft); color: #94620d; }
.intent-badge.low { background: #edf0ef; color: #66726d; }
.status-badge.success { background: var(--green-soft); color: var(--green); }
.status-badge.info { background: var(--blue-soft); color: var(--blue); }
.status-badge svg { width: 12px; height: 12px; }
.row-btn { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; color: var(--green); border-radius: 5px; display: grid; place-items: center; }
.row-btn svg { width: 14px; }
.ai-panel { min-height: 300px; }
.ai-score { padding: 20px 22px 13px; display: flex; align-items: center; gap: 25px; }
.score-ring { width: 100px; height: 100px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--green) 0 86%, #e7ece9 86%); display: grid; place-items: center; position: relative; text-align: center; }
.score-ring::after { content: ""; position: absolute; width: 75px; height: 75px; border-radius: 50%; background: #fff; }
.score-ring strong, .score-ring span { z-index: 1; position: absolute; }
.score-ring strong { font-size: 20px; transform: translateY(-7px); }
.score-ring span { color: var(--muted); font-size: 9px; transform: translateY(14px); }
.score-list { flex: 1; display: grid; gap: 12px; }
.score-list div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.score-list strong { color: var(--text); }
.ai-note { margin: 5px 17px 16px; padding: 10px; background: #f8f6ef; border: 1px solid #eee4cd; border-radius: 6px; display: flex; gap: 8px; color: #6d6044; }
.ai-note svg { width: 15px; color: var(--gold); }
.ai-note p { margin: 0; font-size: 10px; line-height: 1.6; }

.inbox-layout { height: 100%; display: grid; grid-template-columns: 292px minmax(480px, 1fr) 290px; background: #fff; }
.conversation-sidebar { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.conversation-tools { height: 58px; padding: 10px; display: flex; gap: 7px; border-bottom: 1px solid var(--line); }
.conversation-tools label { flex: 1; }
.filter-tabs { height: 40px; padding: 0 10px; display: flex; gap: 15px; border-bottom: 1px solid var(--line); }
.filter-tabs button, .task-tabs button { position: relative; border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 0; }
.filter-tabs button.active, .task-tabs button.active { color: var(--green); font-weight: 700; }
.filter-tabs button.active::after, .task-tabs button.active::after { content: ""; position: absolute; height: 2px; left: 0; right: 0; bottom: -1px; background: var(--green); }
.filter-tabs span { margin-left: 2px; }
.conversation-list { flex: 1; overflow-y: auto; }
.conversation-card { width: 100%; padding: 13px 11px; border: 0; border-bottom: 1px solid #edf0ef; background: #fff; display: flex; gap: 9px; text-align: left; }
.conversation-card:hover { background: #f8faf9; }
.conversation-card.active { background: #edf5ff; box-shadow: inset 3px 0 var(--green); }
.conversation-card .avatar-wrap { position: relative; }
.channel-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #27d6a1; }
.conversation-main { min-width: 0; flex: 1; }
.conversation-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-line strong { font-size: 12px; }
.conversation-line time { color: #8b9691; font-size: 9px; }
.conversation-preview { margin: 5px 0 6px; color: #69756f; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-meta { display: flex; align-items: center; gap: 4px; }
.tag { padding: 3px 5px; background: #edf0ef; color: #68736e; font-weight: 600; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.gold { background: var(--gold-soft); color: #8b5e12; }
.tag.red { background: var(--red-soft); color: var(--red); }
.unread-count { margin-left: auto; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: #c34d48; color: #fff; font-size: 9px; }
.chat-workspace { min-width: 0; background: #f7f9f8; display: grid; grid-template-rows: 63px 36px minmax(0, 1fr) auto auto; }
.chat-header { padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.chat-header .person strong { font-size: 14px; }
.chat-header-actions { display: flex; gap: 6px; }
.chat-banner { padding: 0 15px; background: #e8f2ee; border-bottom: 1px solid #d4e5df; color: #4a6860; display: flex; align-items: center; gap: 7px; font-size: 10px; }
.chat-banner svg { width: 13px; color: var(--green); }
.chat-banner button { margin-left: auto; border: 0; background: transparent; color: var(--green); font-weight: 700; }
.chat-banner.human { background: var(--gold-soft); border-color: #edddb9; color: #80612b; }
.messages { min-height: 0; padding: 18px 20px; overflow-y: auto; }
.message-time { margin: 9px 0 13px; text-align: center; color: #8c9792; font-size: 9px; }
.message-row { margin: 10px 0; display: flex; align-items: flex-start; gap: 8px; }
.message-row.out { justify-content: flex-end; }
.message-row .avatar { width: 27px; height: 27px; font-size: 9px; }
.message-bubble { max-width: 70%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; line-height: 1.65; box-shadow: 0 2px 5px rgba(28,48,41,.03); }
.message-row.out .message-bubble { background: #dceee8; border-color: #cbe2da; }
.message-bubble small { display: block; margin-top: 4px; text-align: right; color: #89938f; font-size: 8px; }
.message-system { width: max-content; max-width: 80%; margin: 12px auto; padding: 5px 9px; border-radius: 4px; background: #e9edeb; color: #69746f; font-size: 9px; }
.reply-suggestion { margin: 0 14px 8px; padding: 10px 12px; border: 1px solid #d9e3df; background: #fff; border-radius: 6px; box-shadow: 0 3px 12px rgba(28,48,41,.05); }
.reply-suggestion > div:first-child { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; }
.reply-suggestion > div:first-child svg { width: 14px; }
.reply-suggestion > div:first-child span { margin-left: auto; color: #82908a; }
.reply-suggestion p { margin: 8px 0; color: #45524e; font-size: 11px; line-height: 1.6; }
.reply-suggestion > div:last-child { display: flex; justify-content: flex-end; gap: 6px; }
.composer { padding: 8px 14px 11px; border-top: 1px solid var(--line); background: #fff; }
.composer-tools { display: flex; gap: 4px; }
.composer-tools button { width: 27px; height: 27px; border: 0; background: transparent; color: #69756f; display: grid; place-items: center; }
.composer-tools button:hover { background: #f1f4f2; border-radius: 4px; }
.composer-tools svg { width: 15px; }
.composer textarea { width: 100%; padding: 7px 3px; resize: none; border: 0; outline: 0; color: var(--text); line-height: 1.5; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; }
.composer-foot > span { color: #8a9590; font-size: 9px; }
.customer-context { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; }
.context-section { padding: 15px; border-bottom: 1px solid var(--line); }
.context-section h4 { margin: 0 0 11px; font-size: 12px; display: flex; align-items: center; justify-content: space-between; }
.context-section h4 button { border: 0; background: transparent; color: var(--green); font-size: 10px; }
.customer-identity { text-align: center; padding-top: 5px; }
.customer-identity .avatar { width: 48px; height: 48px; margin: 0 auto 8px; font-size: 15px; }
.customer-identity h3 { margin: 0; font-size: 15px; }
.customer-identity p { margin: 4px 0 9px; color: var(--muted); font-size: 10px; }
.identity-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.info-list { display: grid; gap: 10px; }
.info-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; font-size: 10px; }
.info-row span { color: var(--muted); }
.info-row strong { font-weight: 600; line-height: 1.45; }
.context-summary { padding: 10px; background: #f6f8f7; border-radius: 5px; color: #4d5a55; font-size: 10px; line-height: 1.65; }
.timeline { display: grid; gap: 12px; }
.timeline-item { position: relative; padding-left: 17px; font-size: 10px; }
.timeline-item::before { content: ""; position: absolute; left: 2px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.timeline-item::after { content: ""; position: absolute; left: 4.5px; top: 12px; bottom: -14px; width: 1px; background: #dfe5e2; }
.timeline-item:last-child::after { display: none; }
.timeline-item span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }

.section-toolbar { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; }
.section-toolbar > div:last-child { display: flex; gap: 8px; }
.segmented { display: inline-flex; padding: 3px; background: #e6ebe8; border-radius: 6px; gap: 2px; }
.segmented button { min-height: 30px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: #67746e; font-size: 11px; }
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 5px rgba(20,54,96,.1); font-weight: 700; }
.segmented.compact button { min-height: 27px; padding: 0 9px; }
.data-panel { overflow: hidden; }
.data-filters { min-height: 56px; padding: 9px 13px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.data-filters label { width: 280px; }
.data-filters > span { margin-left: auto; color: var(--muted); font-size: 10px; }
.filter-btn { min-height: 36px; font-size: 11px; font-weight: 500; }
.filter-btn svg { width: 14px; }
.customer-table th:first-child, .customer-table td:first-child { width: 38px; padding-right: 2px; }
.customer-table .tag + .tag { margin-left: 3px; }
.next-action { color: #4b5853; max-width: 160px; }
.next-action small { display: block; margin-top: 3px; color: var(--red); }

.knowledge-summary, .task-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 14px; }
.summary-tile { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: center; gap: 12px; }
.summary-tile > i { width: 34px; height: 34px; padding: 8px; border-radius: 6px; color: var(--green); background: var(--green-soft); }
.summary-tile strong, .summary-tile span { display: block; }
.summary-tile strong { font-size: 19px; }
.summary-tile span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.knowledge-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, .7fr); gap: 14px; }
.knowledge-list-panel { min-height: 610px; }
.knowledge-list { padding: 0 14px; }
.knowledge-item { padding: 14px 4px; border-bottom: 1px solid #edf0ef; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; }
.knowledge-type { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.knowledge-type svg { width: 17px; }
.knowledge-item h4 { margin: 0; font-size: 12px; }
.knowledge-item p { margin: 4px 0 6px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knowledge-meta { display: flex; gap: 10px; color: #8a9590; font-size: 9px; }
.knowledge-actions { display: flex; align-items: center; gap: 7px; }
.knowledge-test { min-height: 610px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.knowledge-test > .panel-head > svg { color: var(--green); }
.test-thread { padding: 18px; overflow-y: auto; }
.test-placeholder { height: 100%; min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.test-placeholder svg { width: 34px; height: 34px; margin-bottom: 10px; color: #9ca9a4; }
.test-placeholder strong { color: #4b5853; font-size: 12px; }
.test-placeholder span { margin-top: 4px; font-size: 10px; }
.test-input { padding: 12px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 36px; gap: 8px; align-items: end; }
.test-input textarea { resize: none; padding: 9px; border: 1px solid var(--line); border-radius: 5px; outline: 0; }
.test-input .primary-btn { padding: 0; width: 36px; }
.test-message { margin-bottom: 10px; }
.test-message.user { text-align: right; }
.test-message span { display: inline-block; max-width: 88%; padding: 8px 10px; border-radius: 6px; background: #edf0ef; font-size: 10px; line-height: 1.6; text-align: left; }
.test-message.ai span { background: var(--green-soft); }

.task-panel { min-height: 540px; }
.task-tabs { height: 43px; padding: 0 18px; display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.task-list { padding: 0 16px; }
.task-item { min-height: 68px; padding: 11px 4px; border-bottom: 1px solid #edf0ef; display: grid; grid-template-columns: 28px minmax(0,1fr) 120px 110px 80px; align-items: center; gap: 10px; }
.task-check { width: 20px; height: 20px; border: 1px solid #bcc8c3; border-radius: 4px; background: #fff; display: grid; place-items: center; color: #fff; }
.task-check.done { background: var(--green); border-color: var(--green); }
.task-check svg { width: 13px; }
.task-main strong { display: block; font-size: 12px; }
.task-main span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.task-due, .task-owner { font-size: 10px; color: #53605b; }
.task-due.overdue { color: var(--red); }

.analytics-metrics { margin-top: 0; }
.analytics-grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .7fr); gap: 14px; }
.panel select { height: 32px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #4e5b56; padding: 0 8px; }
.topic-list { padding: 16px 18px; display: grid; gap: 15px; }
.topic-item { display: grid; grid-template-columns: 80px 1fr 34px; gap: 8px; align-items: center; font-size: 10px; }
.topic-bar { height: 7px; background: #edf0ef; border-radius: 4px; overflow: hidden; }
.topic-bar span { height: 100%; display: block; background: var(--green); border-radius: inherit; }
.insight-panel { margin-top: 14px; }
.insight-grid { padding: 16px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.insight-card { padding: 14px; border: 1px solid var(--line); background: #fafbfa; border-radius: 6px; }
.insight-card > div { display: flex; align-items: center; gap: 8px; }
.insight-card svg { width: 16px; color: var(--green); }
.insight-card strong { font-size: 11px; }
.insight-card p { margin: 9px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.65; }

.settings-layout { max-width: 1040px; display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 14px; }
.settings-nav { padding: 6px; background: #e8ecea; border-radius: 7px; align-self: start; display: grid; gap: 2px; }
.settings-nav button { min-height: 39px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: #5c6964; display: flex; align-items: center; gap: 9px; text-align: left; font-size: 11px; }
.settings-nav button.active { background: #fff; color: var(--green); box-shadow: 0 1px 5px rgba(20,54,96,.1); font-weight: 700; }
.settings-nav svg { width: 15px; }
.settings-panel { min-height: 590px; padding: 22px; }
.setting-view { display: none; }
.setting-view.active { display: block; }
.settings-title { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.settings-title h3 { margin: 0; font-size: 17px; }
.settings-title p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid label, .form-row { display: grid; gap: 7px; }
.form-grid label > span, .form-row > span { color: #4c5954; font-size: 11px; font-weight: 600; }
.form-grid input, .form-grid select, .form-row textarea { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--text); outline: 0; }
.form-row { margin-top: 15px; }
.form-row textarea { padding: 9px 10px; resize: vertical; }
.span-2 { grid-column: span 2; }
.form-actions { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.connection-card { min-height: 65px; padding: 11px 13px; margin-bottom: 17px; border: 1px solid var(--line); background: #f8faf9; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; }
.connection-card > div { display: flex; align-items: center; gap: 10px; }
.connection-card strong, .connection-card small { display: block; }
.connection-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.integration-icon { width: 36px; height: 36px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 800; }
.integration-icon.wecom { background: #16865f; }
.integration-icon.ai { background: #087bff; font-size: 11px; }
.form-note { margin-top: 16px; padding: 10px 12px; border: 1px solid #e7dcc4; background: #fbf7ed; border-radius: 5px; color: #736343; display: flex; gap: 8px; font-size: 10px; line-height: 1.5; }
.form-note svg { width: 15px; }
.range-row { min-height: 38px; display: flex; align-items: center; gap: 9px; }
.range-row input { padding: 0; accent-color: var(--green); }
.range-row output { width: 42px; color: var(--green); font-weight: 700; }
.toggle-row { min-height: 61px; padding: 10px 0; border-bottom: 1px solid #edf0ef; display: flex; align-items: center; justify-content: space-between; }
.toggle-row strong, .toggle-row span { display: block; }
.toggle-row strong { font-size: 11px; }
.toggle-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.toggle-row input { appearance: none; width: 36px; height: 20px; border-radius: 10px; background: #cbd4d0; position: relative; transition: .2s; }
.toggle-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-row input:checked { background: var(--green); }
.toggle-row input:checked::after { transform: translateX(16px); }
.security-list { display: grid; }
.security-list > div { min-height: 72px; border-bottom: 1px solid #edf0ef; display: grid; grid-template-columns: 36px 1fr auto; gap: 11px; align-items: center; }
.security-list > div > svg { width: 33px; height: 33px; padding: 8px; border-radius: 6px; color: var(--green); background: var(--green-soft); }
.security-list strong, .security-list span { display: block; }
.security-list strong { font-size: 11px; }
.security-list div > div span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.danger-zone { margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; }
.danger-zone strong { font-size: 11px; }
.danger-zone p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }

.toast-stack { position: fixed; right: 20px; top: 92px; z-index: 60; display: grid; gap: 8px; }
.toast { width: 300px; padding: 11px 13px; border: 1px solid #cfe0d9; background: #fff; border-radius: 6px; box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 9px; animation: toast-in .22s ease-out; }
.toast svg { width: 16px; color: var(--green); margin-top: 1px; }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 11px; }
.toast span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .65s linear infinite; }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(4,20,43,.52); display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { width: 510px; max-height: 85vh; overflow: auto; background: #fff; border-radius: 7px; box-shadow: 0 18px 50px rgba(7,38,77,.24); }

/* Deep ocean technology theme refinements */
.metric-card, .summary-tile, .connection-card, .insight-card { box-shadow: 0 3px 14px rgba(20, 54, 96, .03); }
.metric-card:hover, .summary-tile:hover { border-color: #c4d9f1; box-shadow: 0 8px 22px rgba(20, 73, 133, .07); }
.metric-icon.green { color: #087bff; background: #e7f2ff; }
.metric-icon.gold { color: #a66b08; background: #fff3d9; }
.metric-icon.blue { color: #0698bd; background: #e2f7fc; }
.metric-icon.red { color: #bd4350; background: #ffeaed; }
.legend-ai { background: #18b7d9; }
.donut { background: conic-gradient(#087bff 0 41%, #18b7d9 41% 66%, #d69a2d 66% 84%, #91a4ba 84% 100%); }
.score-ring { background: conic-gradient(#087bff 0 86%, #e5edf7 86%); }
.ai-note { background: #f3f8ff; border-color: #d8e8fb; color: #48627f; }
.ai-note svg { color: #087bff; }
.inbox-layout { background: #f7faff; }
.conversation-sidebar, .chat-workspace, .customer-context { background: #fff; }
.chat-banner { color: #315d8b; background: #eef6ff; border-color: #d4e7fb; }
.chat-banner svg { color: #087bff; }
.message-row.out .message-bubble { color: #fff; background: #0b68d1; }
.message-row.in .message-bubble { color: #203650; background: #edf3fa; }
.composer { border-color: #cad9ea; box-shadow: 0 8px 22px rgba(21, 72, 130, .07); }
.context-summary { color: #455d78; background: #f3f7fc; }
.segmented, .settings-nav { background: #e7eef7; }
.knowledge-type, .summary-tile > i, .security-list > div > svg { color: #087bff; background: #e7f2ff; }
.test-message.ai span { color: #174a7c; background: #e8f3ff; }
.connection-card { background: #f6f9fd; }
.form-note { color: #66552d; background: #fff8e9; border-color: #ead9ad; }
.toast { border-color: #cfe0f5; }
.modal header { min-height: 70px; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal h3 { margin: 0; font-size: 16px; }
.modal header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.modal form > div { padding: 17px 18px; display: grid; gap: 13px; }
.modal label { display: grid; gap: 6px; }
.modal label > span { color: #4b5853; font-size: 11px; font-weight: 600; }
.modal input, .modal textarea, .modal select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; outline: 0; }
.modal textarea { padding: 9px 10px; resize: vertical; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.empty-state { padding: 55px 20px; color: var(--muted); text-align: center; }
.empty-state svg { width: 30px; height: 30px; margin-bottom: 8px; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 5px; font-size: 10px; }

@media (max-width: 1280px) {
  :root { --sidebar: 204px; }
  .inbox-layout { grid-template-columns: 260px minmax(450px,1fr) 260px; }
  .global-search { width: 210px; }
  .channel-chart { gap: 14px; padding: 16px; }
  .donut { width: 120px; height: 120px; }
  .donut::after { width: 78px; height: 78px; }
}
