:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #18202f;
  --muted: #667085;
  --line: #dce2ea;
  --primary: #176b87;
  --primary-strong: #0d4f63;
  --accent: #b45309;
  --success: #1f7a4d;
  --danger: #b42318;
  --radius: 8px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

/* Screenshot replica layer */
:root {
  --cc-bg: #f6f8fc;
  --cc-panel: #ffffff;
  --cc-border: #e7eaf2;
  --cc-border-strong: #d9deea;
  --cc-text: #0f172a;
  --cc-muted: #6b7a90;
  --cc-subtle: #96a2b8;
  --cc-primary: #4f46e5;
  --cc-primary-soft: #eef2ff;
  --cc-blue: #0ea5e9;
  --cc-green: #10b981;
  --cc-red: #f43f5e;
  --cc-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 8px 20px rgba(15, 23, 42, 0.04);
  --cc-radius: 8px;
}

body:not(.auth-body):not(.public-body) {
  grid-template-columns: 256px minmax(0, 1fr);
  background: var(--cc-bg);
  color: var(--cc-text);
  overflow: hidden;
}

body[data-watermark]::before {
  top: 188px;
  left: 380px;
  z-index: 0;
  color: rgba(15, 23, 42, 0.045);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-shadow:
    520px 330px 0 currentColor,
    120px 660px 0 currentColor;
}

.sidebar,
.app-shell {
  position: relative;
  z-index: 1;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--cc-border);
  box-shadow: none;
}

.brand {
  min-height: 86px;
  padding: 26px 24px 18px;
  align-items: center;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--cc-primary);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

.brand-copy strong {
  color: #07142f;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.08;
}

.brand-copy span {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.nav-tree {
  padding: 16px;
  gap: 18px;
  scrollbar-width: thin;
}

.nav-domain > summary {
  color: #7b879b;
  padding: 4px 8px 6px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-domain > summary::after,
.nav-group > summary::after {
  content: ">";
  color: #a8b2c2;
  font-size: 12px;
}

.nav-domain[open] > summary::after,
.nav-group[open] > summary::after {
  transform: rotate(90deg);
}

.nav-group {
  margin: 4px 0 0;
  padding: 0;
  border-left: 0;
}

.nav-group > summary {
  min-height: 32px;
  padding: 7px 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-group a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  margin: 2px 0;
  padding: 10px 12px;
  color: #536174;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.nav-group a:hover {
  background: #f5f7fb;
  color: var(--cc-primary);
}

.nav-group a.active {
  background: #eef2ff;
  color: var(--cc-primary);
}

.nav-icon {
  width: 18px;
  height: 18px;
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.language-switcher {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 6px 8px;
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  background: #f8fafc;
}

.language-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  stroke: currentColor;
  fill: none;
}

.language-switcher div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.language-switcher a {
  display: grid;
  place-items: center;
  min-height: 24px;
  border: 0;
  border-radius: 6px;
  padding: 0 4px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.language-switcher a.active,
.language-switcher a:hover {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.logout-form {
  margin: 0 16px 16px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
}

.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #e0e7ff;
  color: var(--cc-primary);
  font-size: 13px;
  font-weight: 900;
}

.account-copy strong {
  color: #172033;
  font-size: 13px;
}

.account-copy small {
  color: #8b96a9;
  font-size: 11px;
}

.topbar {
  height: 64px;
  flex-basis: 64px;
  border-bottom: 1px solid var(--cc-border);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 32px;
}

.breadcrumbs {
  color: #8b96a9;
  font-size: 11px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.breadcrumbs strong {
  color: #5f6c82;
}

.topbar-title h2 {
  margin-top: 5px;
  color: #07142f;
  font-size: 14px;
  font-weight: 900;
}

.global-search {
  width: 320px;
}

.global-search input {
  min-height: 38px;
  border-color: #dfe4ee;
  border-radius: 8px;
  background: #fbfcff;
  color: #334155;
  font-size: 13px;
}

.sync-status {
  color: #8995a9;
  font-size: 10px;
  letter-spacing: 0;
}

.sync-status strong {
  color: #16a34a;
}

.latency-status strong {
  color: #0f172a;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
}

.main {
  overflow: auto;
  padding: 32px;
  background: var(--cc-bg);
}

.panel,
.form-panel,
.metric {
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  background: #ffffff;
  box-shadow: var(--cc-shadow);
}

.button,
button,
input,
select,
textarea {
  border-radius: 8px;
}

.replica-dashboard {
  display: grid;
  gap: 24px;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.replica-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.replica-kpi-card,
.replica-panel,
.replica-workbench-tail {
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--cc-shadow);
}

.replica-kpi-card {
  position: relative;
  min-height: 132px;
  padding: 22px 22px 18px;
  overflow: hidden;
}

.replica-kpi-card span {
  display: block;
  color: #536174;
  font-size: 13px;
  font-weight: 700;
}

.replica-kpi-card strong {
  display: block;
  margin-top: 36px;
  color: #020617;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.kpi-icon {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.kpi-icon svg {
  width: 21px;
  height: 21px;
  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
}

.kpi-icon-indigo {
  color: var(--cc-primary);
  background: #eef2ff;
}

.kpi-icon-green {
  color: var(--cc-green);
  background: #ecfdf5;
}

.kpi-icon-red {
  color: var(--cc-red);
  background: #fff1f2;
}

.kpi-icon-blue {
  color: var(--cc-blue);
  background: #eff6ff;
}

.kpi-change {
  position: absolute;
  right: 22px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.kpi-change.positive,
.kpi-change.online {
  background: #dcfce7;
  color: #059669;
}

.kpi-change.negative {
  background: #ffe4e6;
  color: #e11d48;
}

.replica-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) 356px;
  gap: 24px;
}

.replica-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) 356px;
  gap: 24px;
}

.replica-panel {
  padding: 26px;
}

.trend-panel {
  min-height: 376px;
}

.channel-panel {
  min-height: 376px;
}

.bot-monitor-panel,
.priority-panel {
  min-height: 336px;
}

.replica-panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.replica-panel-title h2 {
  margin: 0;
  color: #07142f;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.replica-panel-title h3 {
  margin: 0;
  color: #07142f;
  font-size: 14px;
  font-weight: 900;
}

.replica-panel-title p {
  margin: 7px 0 0;
  color: #8a96aa;
  font-size: 13px;
  line-height: 1.45;
}

.replica-panel-title a {
  color: var(--cc-primary);
  font-size: 13px;
  font-weight: 900;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--cc-primary);
  font-size: 11px;
  font-weight: 900;
}

.trend-chart {
  height: 262px;
}

.trend-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trend-grid line {
  stroke: #e9edf5;
  stroke-width: 1;
}

.trend-chart text {
  fill: #7f8baa;
  font-size: 12px;
  font-weight: 700;
}

.channel-list {
  display: grid;
  gap: 22px;
  padding-top: 28px;
}

.channel-row {
  display: grid;
  gap: 8px;
}

.channel-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.channel-row-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.channel-row-head span::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.channel-row strong {
  color: #172033;
  font-size: 13px;
}

.channel-row em {
  color: #c0c8d6;
  font-style: normal;
}

.channel-bar {
  height: 5px;
  border-radius: 999px;
  background: #f1f4f9;
  overflow: hidden;
}

.channel-bar span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: currentColor;
}

.channel-web {
  color: var(--cc-primary);
}

.channel-telegram {
  color: #0ea5e9;
}

.channel-whatsapp,
.channel-wechat,
.channel-lark {
  color: #10b981;
}

.bot-monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bot-monitor-card {
  display: grid;
  gap: 16px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
}

.bot-monitor-card:hover {
  border-color: #d8ddfb;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.08);
}

.bot-monitor-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.bot-monitor-head strong {
  min-width: 0;
  color: #07142f;
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.run-badge.is-active {
  background: #dcfce7;
  color: #059669;
}

.bot-monitor-card p {
  margin: 0;
  color: #70809a;
  font-size: 12px;
  line-height: 1.5;
  min-height: 36px;
}

.bot-monitor-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bot-monitor-metrics span {
  color: #72809a;
  font-size: 11px;
  font-weight: 800;
}

.bot-monitor-metrics strong {
  display: block;
  margin-top: 3px;
  color: #07142f;
  font-size: 12px;
  font-weight: 900;
}

.priority-ticket-list {
  display: grid;
  gap: 12px;
}

.priority-ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 12px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcff;
  color: inherit;
}

.priority-ticket span {
  display: block;
  color: #8da0c2;
  font-size: 11px;
  font-weight: 900;
}

.priority-ticket strong {
  display: block;
  margin-top: 6px;
  color: #07142f;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
}

.priority-ticket small {
  margin-top: 7px;
  color: #8a96aa;
  font-size: 11px;
  font-weight: 700;
}

.priority-ticket em {
  padding: 4px 7px;
  border-radius: 4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.priority-ticket em.high {
  background: #ffe4e6;
  color: #e11d48;
}

.priority-ticket em.medium {
  background: #fff7ed;
  color: #f97316;
}

.replica-workbench-tail {
  padding: 24px;
}

.workbench-tail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.workbench-tail-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #ffffff;
}

.workbench-tail-card h3 {
  margin: 0;
  color: #07142f;
  font-size: 13px;
  font-weight: 900;
}

.workbench-tail-card p {
  margin: 5px 0 12px;
  color: #8a96aa;
  font-size: 12px;
  line-height: 1.45;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  background: #f8fafc;
  color: #637087;
  font-size: 12px;
  font-weight: 900;
}

tbody td {
  color: #273244;
  font-size: 13px;
}

.column-resize-handle {
  background: transparent;
}

.column-resize-handle:hover,
.column-resize-handle.active {
  background: rgba(79, 70, 229, 0.28);
}

@media (max-width: 1280px) {
  .replica-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .replica-analytics-grid,
  .replica-bottom-grid {
    grid-template-columns: 1fr;
  }

  .bot-monitor-grid,
  .workbench-tail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body:not(.auth-body):not(.public-body) {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  body[data-watermark]::before {
    left: 32px;
    top: 360px;
    text-shadow: none;
  }

  .topbar {
    padding: 14px 18px;
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .topbar-title {
    min-width: 0;
  }

  .breadcrumbs {
    flex-wrap: wrap;
  }

  .global-search {
    width: 100%;
  }

  .main {
    padding: 18px;
  }

  .replica-kpi-grid,
  .bot-monitor-grid,
  .workbench-tail-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 268px 1fr;
}

body[data-watermark]::before {
  content: attr(data-watermark);
  position: fixed;
  top: 160px;
  left: 360px;
  z-index: 50;
  pointer-events: none;
  color: rgba(79, 70, 229, 0.018);
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  transform: rotate(-18deg);
  transform-origin: left top;
  user-select: none;
  text-shadow:
    620px 420px 0 currentColor;
}

a {
  color: var(--primary);
  text-decoration: none;
}

small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.sidebar {
  background: #101827;
  color: white;
  padding: 18px 14px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  color: #ffffff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 38px;
  height: 38px;
}

.brand-mark rect {
  fill: var(--primary);
}

.brand-mark path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark path:nth-of-type(2) {
  fill: #f59e0b;
  stroke: none;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  display: block;
  color: #ffffff;
}

.brand-copy span {
  display: block;
  color: #aab3c2;
  font-size: 12px;
}

.nav-tree {
  display: grid;
  gap: 7px;
}

.nav-domain,
.nav-group {
  border-radius: 8px;
}

.nav-domain > summary,
.nav-group > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.nav-domain > summary::-webkit-details-marker,
.nav-group > summary::-webkit-details-marker {
  display: none;
}

.nav-domain > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
  padding: 9px 10px;
  border: 1px solid #263246;
  border-radius: 8px;
  background: #182235;
}

.nav-domain > summary::after,
.nav-group > summary::after {
  content: "›";
  transition: transform 0.16s ease;
}

.nav-domain[open] > summary::after,
.nav-group[open] > summary::after {
  transform: rotate(90deg);
}

.nav-group {
  margin: 7px 0 9px 8px;
  padding-left: 10px;
  border-left: 1px solid #2e3b52;
}

.nav-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #aab3c2;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 8px;
}

.nav-group a {
  display: block;
  color: #c9d3e1;
  padding: 8px 10px;
  border-radius: 8px;
  margin: 3px 0 3px 6px;
  font-size: 13px;
}

.nav-group a.active,
.nav-group a:hover {
  background: #263246;
  color: #ffffff;
}

.language-switcher {
  border-top: 1px solid #263246;
  margin-top: 14px;
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.language-switcher > span {
  color: #aab3c2;
  font-size: 12px;
}

.language-switcher div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.language-switcher a {
  color: #c9d3e1;
  border: 1px solid #263246;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
}

.language-switcher a.active,
.language-switcher a:hover {
  background: #263246;
  color: #ffffff;
}

.logout-form {
  margin-top: 14px;
  border-top: 1px solid #263246;
  padding-top: 14px;
  display: grid;
  gap: 8px;
}

.logout-form span {
  color: #aab3c2;
  font-size: 13px;
}

.logout-form button {
  border: 1px solid #3b475b;
  background: #182235;
  color: #ffffff;
  border-radius: 8px;
  min-height: 34px;
  cursor: pointer;
}

.main {
  padding: 28px;
  min-width: 0;
}

.auth-body,
.public-body {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 100vh;
  background: #f9fafb;
}

.public-body {
  padding: 24px;
}

.public-shell {
  width: min(920px, 100%);
}

.public-panel {
  padding: 24px;
  border-radius: 16px;
}

.public-acceptance-form {
  margin-top: 18px;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
}

.auth-shell {
  width: min(420px, calc(100vw - 32px));
}

.auth-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.auth-console-panel {
  position: relative;
  overflow: hidden;
}

.auth-console-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.9), rgba(255, 255, 255, 0) 52%);
  pointer-events: none;
}

.auth-console-panel > * {
  position: relative;
  z-index: 1;
}

.auth-brand {
  color: var(--text);
  margin-bottom: 20px;
}

.auth-brand .brand-copy strong {
  color: var(--text);
}

.auth-brand .brand-copy span {
  color: var(--muted);
}

.auth-language-switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.auth-language-switcher a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
}

.auth-language-switcher a.active,
.auth-language-switcher a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.auth-copy-block {
  margin-bottom: 18px;
}

.auth-copy-block > span {
  color: #4f46e5;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.auth-copy-block h1 {
  margin: 8px 0 8px;
  color: #111827;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
}

.auth-copy-block p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
}

.public-acceptance-hero {
  margin: 18px 0;
  padding: 22px;
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  background: linear-gradient(90deg, #eef2ff, rgba(238, 242, 255, 0.45));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.public-acceptance-hero span {
  color: #4f46e5;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.public-acceptance-hero h2 {
  margin: 8px 0 7px;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.public-acceptance-hero p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.public-acceptance-hero strong {
  color: #111827;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.public-acceptance-grid {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.public-acceptance-grid div {
  min-width: 0;
  padding: 16px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #f9fafb;
}

.public-acceptance-grid span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 900;
}

.public-acceptance-grid strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.auth-panel p,
.muted {
  color: var(--muted);
}

.alert {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 14px 0;
}

.alert.danger {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: var(--danger);
}

.alert.success {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: var(--success);
}

.optional-field {
  display: none;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.page-header p,
.panel-title p {
  color: var(--muted);
  margin: 6px 0 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.row-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.panel {
  padding: 16px;
  overflow-x: auto;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.8fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.workbench-panel {
  min-width: 0;
}

.todo-card {
  color: var(--text);
  border-left: 4px solid #c8d2df;
}

.todo-card:hover {
  border-color: var(--primary);
}

.todo-high {
  border-left-color: var(--accent);
}

.todo-critical {
  border-left-color: var(--danger);
}

.todo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.todo-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.compact-empty {
  padding: 16px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  position: relative;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 2;
}

.column-resize-handle::after {
  content: "";
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: 3px;
  width: 1px;
  background: transparent;
}

th:hover .column-resize-handle::after,
.column-resize-handle.active::after {
  background: var(--primary);
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.button.primary:hover {
  background: var(--primary-strong);
}

.button.danger {
  color: var(--danger);
  border-color: #fecdca;
  background: #fff;
}

.button.small {
  min-height: 32px;
  padding: 5px 10px;
}

.form-panel {
  display: grid;
  gap: 12px;
}

.bot-forms-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.bot-create-form {
  align-content: start;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 0;
  background: #fbfcfe;
}

.form-section legend,
.collapsible-section > summary {
  color: var(--text);
  font-weight: 750;
  font-size: 14px;
}

.collapsible-section > summary {
  cursor: pointer;
  list-style: none;
}

.collapsible-section > summary::-webkit-details-marker {
  display: none;
}

.collapsible-section > summary::after {
  content: " 展开";
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.collapsible-section[open] > summary {
  margin-bottom: 12px;
}

.collapsible-section[open] > summary::after {
  content: " 收起";
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.clone-panel {
  position: sticky;
  top: 18px;
}

.compact-form {
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

code {
  display: block;
  color: #344054;
  background: #f0f3f8;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  word-break: break-all;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  background: #edf2f7;
  color: #344054;
}

.status {
  background: #fff7ed;
  color: var(--accent);
}

.status.health-ok {
  background: #ecfdf3;
  color: var(--success);
}

.status.health-warning {
  background: #fff7ed;
  color: var(--accent);
}

.status.health-failed {
  background: #fef3f2;
  color: var(--danger);
}

.status.sla-overdue {
  background: #fef3f2;
  color: var(--danger);
}

.status.sla-due_soon {
  background: #fff7ed;
  color: var(--accent);
}

.status.sla-open {
  background: #eff8ff;
  color: var(--primary);
}

.status.sla-normal,
.status.sla-closed {
  background: #edf2f7;
  color: #344054;
}

.status.severity-critical {
  background: #fef3f2;
  color: var(--danger);
}

.status.severity-high {
  background: #fff7ed;
  color: var(--accent);
}

.status.severity-normal {
  background: #eff8ff;
  color: var(--primary);
}

.segmented {
  display: inline-flex;
  background: #e9eef5;
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
}

.segmented a {
  color: #344054;
  padding: 7px 10px;
  border-radius: 6px;
}

.segmented a.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stack {
  display: grid;
  gap: 10px;
}

.full-width {
  flex-basis: 100%;
  width: 100%;
}

.row-card {
  padding: 12px;
  display: grid;
  gap: 6px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.onboarding-card {
  align-content: start;
  gap: 12px;
}

.onboarding-card-title,
.onboarding-step {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.onboarding-step {
  justify-content: flex-start;
}

.onboarding-steps {
  display: grid;
  gap: 8px;
}

.row-card span,
.details dd {
  color: var(--muted);
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.messages {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.message.customer {
  border-left: 4px solid var(--primary);
}

.message.bot {
  border-left: 4px solid var(--accent);
}

.message.agent {
  border-left: 4px solid var(--success);
}

.message.internal_note {
  border-left: 4px solid #667085;
  background: #f8fafc;
}

.message header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.message p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.message-metadata {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.reply-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 110px;
  gap: 10px;
  margin-top: 14px;
  align-items: start;
}

.note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  margin-top: 10px;
  align-items: start;
}

.side-panels {
  display: grid;
  gap: 14px;
}

.details {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px 12px;
  margin: 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
}

.table-edit-row td {
  background: #fafbfc;
}

.table-edit-row form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 8px;
}

.table-edit-row form.channel-edit-form {
  grid-template-columns: 1fr;
  gap: 12px;
}

.checkbox-field {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.checkbox-field input {
  width: auto;
}

.action-row,
.inline-action {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.action-row {
  margin-top: 14px;
}

.compact-actions {
  margin-top: 0;
  gap: 6px;
}

.diagnostic-action {
  margin-top: 8px;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.diagnostic-check {
  border-left: 4px solid var(--line);
}

.diagnostic-check.ok,
.diagnostic-check.info {
  border-left-color: var(--success);
}

.diagnostic-check.warning {
  border-left-color: var(--accent);
}

.diagnostic-check.failed {
  border-left-color: var(--danger);
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.readiness-check {
  border-left: 4px solid var(--line);
}

.readiness-check.ok {
  border-left-color: var(--success);
}

.readiness-check.warning {
  border-left-color: var(--accent);
}

.readiness-check.failed {
  border-left-color: var(--danger);
}

.filter-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-form label {
  min-width: 150px;
  max-width: 220px;
}

.filter-form .button {
  min-height: 38px;
}

.status-filter {
  display: none;
}

.knowledge-list {
  display: grid;
  gap: 12px;
}

.knowledge-card {
  background: #fafbfc;
}

.approval-actions,
.acceptance-actions,
.review-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.review-form {
  min-width: min(100%, 320px);
}

.review-form input {
  min-width: 180px;
  width: auto;
  flex: 1;
}

.card-meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  body[data-watermark]::before {
    top: 180px;
    left: 48px;
    font-size: 12px;
    line-height: 1;
    text-shadow: none;
  }

  .sidebar {
    min-height: auto;
    max-height: none;
    position: static;
  }

  .nav-tree {
    grid-template-columns: 1fr;
  }

  .metrics,
  .split,
  .conversation-layout,
  .bot-forms-grid {
    grid-template-columns: 1fr;
  }

  .clone-panel {
    position: static;
  }

  .reply-form,
  .table-edit-row form,
  .inline-fields,
  .diagnostic-grid,
  .form-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Polished internal admin console layer */
body:not(.auth-body):not(.public-body) {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  overflow: hidden;
  background: #f9fafb;
  color: #1f2937;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

body[data-watermark]::before {
  z-index: 30;
}

.sidebar {
  background: #ffffff;
  color: #111827;
  border-right: 1px solid #e5e7eb;
  padding: 0;
  min-height: 100vh;
  max-height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.brand {
  color: #111827;
  margin: 0;
  padding: 24px;
  gap: 12px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #4f46e5;
  color: #ffffff;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.brand-copy strong {
  color: #1f2937;
  font-size: 20px;
  letter-spacing: 0;
  line-height: 1.1;
}

.brand-copy span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 600;
}

.nav-tree {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.nav-domain,
.nav-group {
  border-radius: 0;
}

.nav-domain > summary {
  color: #9ca3af;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nav-domain > summary:hover,
.nav-group > summary:hover {
  color: #4b5563;
  background: transparent;
}

.nav-domain > summary::after,
.nav-group > summary::after {
  color: #9ca3af;
  content: "›";
}

.nav-group {
  margin: 4px 0 0;
  padding-left: 0;
  border-left: 0;
}

.nav-domain .nav-group + .nav-group {
  margin-top: 3px;
}

.nav-group > summary {
  color: #6b7280;
  padding: 8px 8px 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.nav-group a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: #6b7280;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 2px 0;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-group a::before {
  content: none;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-right: 12px;
  color: #6b7280;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: color 0.15s ease;
}

.nav-group a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-group a.active,
.nav-group a:hover {
  background: #eef2ff;
  color: #4338ca;
}

.nav-group a.active .nav-icon,
.nav-group a:hover .nav-icon {
  color: #4338ca;
}

.nav-group a.active {
  font-weight: 700;
}

.language-switcher {
  margin: 0 16px 12px;
  padding: 4px;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.language-icon {
  width: 14px;
  height: 14px;
  color: #9ca3af;
  margin-left: 6px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.language-switcher div {
  display: flex;
  gap: 2px;
}

.language-switcher a {
  color: #9ca3af;
  border: 0;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
}

.language-switcher a.active,
.language-switcher a:hover {
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.logout-form {
  margin: 0;
  border-top: 1px solid #f3f4f6;
  padding: 16px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #eef2ff;
  color: #4338ca;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.account-copy {
  min-width: 0;
}

.account-copy strong {
  display: block;
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  margin-top: 2px;
}

.logout-form button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #9ca3af;
  border-radius: 8px;
  font-size: 16px;
}

.logout-form button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.logout-form button:hover {
  color: #4b5563;
  background: #f3f4f6;
}

.app-shell {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  flex: 0 0 64px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 20px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.breadcrumbs strong {
  color: #6b7280;
}

.topbar-title h2 {
  margin: 4px 0 0;
  color: #1f2937;
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.global-search {
  position: relative;
  display: block;
  width: min(320px, 28vw);
}

.global-search .topbar-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.global-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px 8px 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-size: 14px;
  outline: none;
}

.global-search input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.sync-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 14px;
  border-right: 1px solid #f3f4f6;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9ca3af;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.sync-status strong {
  color: #059669;
}

.latency-status strong {
  color: #374151;
}

.status-icon {
  width: 14px;
  height: 14px;
  color: #6366f1;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  animation: softPulse 2s infinite ease-in-out;
}

.latency-status .status-icon {
  color: #818cf8;
}

.icon-button {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #9ca3af;
  background: #ffffff;
  border: 1px solid transparent;
  line-height: 1;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon-button:hover {
  color: #4f46e5;
  background: #f8fafc;
  border-color: #eef2ff;
}

.notification-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f43f5e;
  border: 1px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.08);
}

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 32px;
  background: #f9fafb;
}

.page-header {
  margin-bottom: 24px;
  align-items: flex-start;
}

.page-header h1 {
  color: #111827;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.page-header p {
  color: #6b7280;
  font-size: 14px;
  margin: 8px 0 0;
  font-weight: 500;
}

.panel,
.metric,
.row-card,
.form-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.panel {
  padding: 24px;
}

.panel + .panel,
.panel + .bot-forms-grid,
.bot-forms-grid + .panel {
  margin-top: 24px;
}

.panel-title {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 18px;
}

.panel-title h2,
.panel-title h3 {
  color: #1f2937;
  font-size: 14px;
  font-weight: 800;
}

.panel-title p {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric {
  min-height: 98px;
  padding: 18px;
  justify-content: space-between;
}

.metric span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric strong {
  color: #111827;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.compact-metrics {
  margin-top: -4px;
}

.compact-metrics .metric {
  min-height: 86px;
}

.compact-metrics .metric strong {
  font-size: 26px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.workbench-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.ops-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.compact-stack {
  max-height: 116px;
  overflow-y: auto;
  padding-right: 2px;
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mini-stat {
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #f9fafb;
  padding: 14px;
}

.mini-stat span {
  color: #6b7280;
  display: block;
  font-size: 10px;
  font-weight: 800;
}

.mini-stat strong {
  color: #111827;
  display: block;
  font-size: 24px;
  line-height: 1;
  margin-top: 8px;
}

.mini-stat small {
  color: #059669;
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-top: 6px;
}

.promo-card {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.promo-card h2,
.promo-card p,
.promo-card .promo-head,
.promo-card .promo-head strong {
  color: #ffffff;
}

.promo-card p {
  color: #c7d2fe;
  font-size: 12px;
  line-height: 1.55;
}

.promo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.promo-head span {
  color: #c7d2fe;
  font-size: 28px;
}

.promo-head strong {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 9px;
  padding: 4px 8px;
}

.promo-card .button {
  background: #ffffff;
  border-color: #ffffff;
  color: #4338ca;
  justify-content: center;
  margin-top: 18px;
}

.bot-summary-bar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid #e0e7ff;
  background: #eef2ff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.bot-summary-bar > span {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #ffffff;
  color: #4f46e5;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.bot-summary-bar h2 {
  color: #312e81;
  font-size: 14px;
  font-weight: 800;
  margin: 0;
}

.bot-summary-bar p {
  color: #4338ca;
  font-size: 12px;
  font-weight: 600;
  margin: 5px 0 0;
}

.bot-fleet-panel {
  margin-bottom: 24px;
}

.bot-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bot-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 138px;
  border: 1px solid #f3f4f6;
  background: #f9fafb;
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bot-card:hover {
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.bot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bot-card-head strong {
  color: #111827;
  font-size: 13px;
}

.bot-card p {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.bot-card-meta {
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
}

.bot-state-active {
  background: #ecfdf5;
  color: #059669;
  border-color: #d1fae5;
}

.lead-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
  gap: 24px;
  margin-bottom: 24px;
}

.lead-ai-summary {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  background: linear-gradient(90deg, #eef2ff, rgba(238, 242, 255, 0.5));
  padding: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.lead-ai-summary > span {
  color: #4f46e5;
  font-size: 24px;
}

.lead-ai-summary h2 {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 6px;
}

.lead-ai-summary p {
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0;
}

.lead-cvr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
}

.lead-cvr-card span {
  color: #9ca3af;
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-cvr-card strong {
  color: #111827;
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-top: 8px;
}

.lead-cvr-card small {
  color: #059669;
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 8px;
}

.lead-cvr-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eef2ff;
  color: #4f46e5 !important;
  display: grid !important;
  place-items: center;
  font-size: 22px !important;
}

.ledger-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.ledger-summary-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 24px;
}

.ledger-summary-card.primary {
  background: linear-gradient(135deg, #eef2ff, #ffffff);
  border-color: #e0e7ff;
}

.ledger-summary-card span {
  color: #9ca3af;
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ledger-summary-card strong {
  color: #111827;
  display: block;
  font-size: 30px;
  line-height: 1;
  margin-top: 10px;
}

.ledger-summary-card small {
  color: #059669;
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-top: 10px;
}

.collaboration-command-panel,
.dispatch-command-panel,
.knowledge-command-panel,
.commerce-ledger-command {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.25fr);
  align-items: stretch;
  gap: 24px;
}

.ops-command-copy,
.collaboration-card,
.dispatch-flow-grid div,
.knowledge-stat-grid div,
.commerce-flow-grid div {
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ops-command-copy {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.knowledge-command-panel .ops-command-copy {
  border-color: #e0e7ff;
  background: linear-gradient(90deg, #eef2ff, rgba(238, 242, 255, 0.52));
}

.ops-command-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4f46e5;
}

.ops-command-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.ops-command-copy h2 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
}

.ops-command-copy p {
  margin: 8px 0 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 650;
}

.ops-command-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ops-command-tags span {
  padding: 5px 9px;
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  background: #ffffff;
  color: #4338ca;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
}

.collaboration-card-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.collaboration-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.collaboration-card strong {
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 900;
}

.collaboration-card small {
  margin-top: auto;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 750;
}

.collaboration-card.empty-card {
  border-style: dashed;
  background: #f9fafb;
}

.dispatch-flow-grid,
.knowledge-stat-grid,
.commerce-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dispatch-flow-grid div,
.knowledge-stat-grid div,
.commerce-flow-grid div {
  padding: 22px;
}

.knowledge-stat-grid div.primary,
.commerce-flow-grid div.primary {
  background: #eef2ff;
  border-color: #e0e7ff;
}

.dispatch-flow-grid span,
.knowledge-stat-grid span,
.commerce-flow-grid span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dispatch-flow-grid strong,
.knowledge-stat-grid strong,
.commerce-flow-grid strong {
  display: block;
  margin-top: 9px;
  color: #111827;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dispatch-flow-grid small,
.knowledge-stat-grid small,
.commerce-flow-grid small {
  display: block;
  margin-top: 9px;
  color: #059669;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
}

.commerce-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr);
  align-items: start;
  gap: 24px;
}

.commerce-console-grid > .panel {
  margin-top: 0;
}

.commerce-console-grid > .form-panel {
  position: sticky;
  top: 20px;
}

.knowledge-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 24px;
  overflow: visible;
}

.knowledge-console-grid > .panel {
  margin-top: 0;
  min-width: 0;
  overflow-x: hidden;
}

.knowledge-create-panel {
  position: static;
  width: 100%;
  min-width: 0;
}

.control-panel .filter-form {
  margin-bottom: 0;
}

.table-panel {
  overflow-x: auto;
}

.table-panel table {
  min-width: 920px;
}

.report-performance-panel {
  overflow-x: auto;
  overflow-y: hidden;
}

.report-performance-table {
  width: max-content;
  min-width: 1680px;
  table-layout: auto;
}

.report-performance-table th,
.report-performance-table td {
  min-width: 88px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  vertical-align: middle;
}

.report-performance-table th {
  text-transform: none;
}

.report-performance-table th:nth-child(5),
.report-performance-table td:nth-child(5) {
  min-width: 180px;
}

.report-performance-table td:nth-child(5) small {
  display: block;
  margin-top: 4px;
  color: #7b879b;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

.analysis-funnel-panel {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 24px;
}

.analysis-funnel-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.analysis-funnel-bars {
  display: grid;
  gap: 16px;
}

.analysis-funnel-bars div {
  min-width: 0;
}

.analysis-funnel-bars span,
.analysis-funnel-bars strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analysis-funnel-bars span {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.analysis-funnel-bars strong {
  justify-content: flex-end;
  margin-top: -16px;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
}

.analysis-funnel-bars i {
  display: block;
  max-width: 100%;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #10b981);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.analysis-funnel-card.compact {
  display: flex;
  flex-direction: column;
}

.analysis-bar-chart {
  flex: 1;
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
}

.analysis-bar-chart div {
  position: relative;
  width: 34px;
  min-height: 26px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #4f46e5, #c7d2fe);
}

.analysis-bar-chart span {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  color: #9ca3af;
  font-family: Consolas, "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.analysis-insight-grid,
.security-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 24px;
  margin-bottom: 24px;
}

.security-command-card {
  min-height: 128px;
}

.security-command-card h2 {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 10px;
}

.security-command-card p {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0;
}

.workbench-panel {
  min-height: 230px;
}

.button,
button,
input[type="submit"] {
  border-radius: 8px;
  font-weight: 700;
}

.button {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  min-height: 38px;
  padding: 9px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.button:hover {
  background: #f9fafb;
  color: #4f46e5;
  border-color: #c7d2fe;
}

.button.primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.button.primary:hover {
  background: #4338ca;
  color: #ffffff;
}

input,
select,
textarea {
  border-color: #d1d5db;
  border-radius: 12px;
  color: #1f2937;
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.filter-form {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}

.segmented {
  background: #ffffff;
  border-color: #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.segmented a {
  color: #6b7280;
  border-radius: 9px;
  font-weight: 700;
  flex: 0 0 auto;
  white-space: nowrap;
}

.segmented a.active {
  background: #111827;
  color: #ffffff;
}

table {
  border-collapse: collapse;
  border-radius: 14px;
  overflow: hidden;
}

thead,
thead tr {
  background: #f9fafb;
}

th {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
  padding: 15px 18px;
}

td {
  color: #4b5563;
  font-size: 14px;
  padding: 16px 18px;
  border-bottom-color: #f3f4f6;
}

tbody tr:hover {
  background: #f9fafb;
}

.pill,
.status {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
}

.status.sla-urgent,
.status.severity-urgent,
.status.health-warning,
.status:has(+ small) {
  background: #fff1f2;
  color: #be123c;
  border-color: #ffe4e6;
}

.sla-normal,
.severity-normal {
  background: #f3f4f6;
  color: #6b7280;
}

.sla-overdue,
.severity-overdue,
.severity-high {
  background: #fff1f2;
  color: #be123c;
  border-color: #ffe4e6;
}

.empty {
  color: #9ca3af;
  font-weight: 600;
}

.row-card {
  padding: 14px;
  border-radius: 14px;
}

.row-card:hover {
  border-color: #c7d2fe;
  background: #f8fafc;
}

.todo-head strong,
.row-card strong {
  color: #1f2937;
  font-size: 13px;
}

.row-card span {
  color: #6b7280;
  font-size: 12px;
}

.reception-lobby {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 680px;
  margin-bottom: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.lobby-list {
  min-width: 0;
  background: #f9fafb;
  border-right: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
}

.lobby-list-header {
  padding: 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lobby-list-header h2,
.lobby-console-header h2 {
  margin: 0;
  color: #111827;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
}

.lobby-list-header p,
.lobby-console-header p {
  margin: 6px 0 0;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.lobby-list-header > span {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
}

.lobby-search {
  margin: 16px 20px 12px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.lobby-search svg,
.lobby-message-avatar svg,
.lobby-empty-state svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.lobby-session-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px;
}

.lobby-session-card {
  position: relative;
  display: block;
  padding: 16px;
  border-left: 4px solid transparent;
  border-radius: 0;
  color: #374151;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lobby-session-card:hover,
.lobby-session-card.active {
  background: rgba(238, 242, 255, 0.56);
  border-left-color: #4f46e5;
}

.lobby-alert-dot {
  position: absolute;
  right: 14px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f43f5e;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.09);
}

.lobby-session-top {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.lobby-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4338ca;
  border: 2px solid #ffffff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.lobby-avatar.large {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.lobby-session-top strong {
  display: block;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-session-top small,
.lobby-session-top time {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
}

.lobby-session-card p {
  margin: 12px 0 10px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lobby-session-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lobby-session-meta > span:first-child {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-console {
  min-width: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.lobby-console-header {
  min-height: 76px;
  padding: 18px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lobby-customer-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lobby-console-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lobby-chat-preview {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lobby-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 74%;
}

.lobby-message.bot,
.lobby-message.assistant,
.lobby-message.agent,
.lobby-message.staff,
.lobby-message.human {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.lobby-message-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 800;
}

.lobby-message.bot .lobby-message-avatar,
.lobby-message.assistant .lobby-message-avatar {
  background: #eef2ff;
  color: #4338ca;
  border-color: #e0e7ff;
}

.lobby-message.agent .lobby-message-avatar,
.lobby-message.staff .lobby-message-avatar,
.lobby-message.human .lobby-message-avatar {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.lobby-message-body {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border-top-left-radius: 4px;
  background: #ffffff;
  border: 1px solid #f3f4f6;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.lobby-message.bot .lobby-message-body,
.lobby-message.assistant .lobby-message-body {
  border-top-left-radius: 18px;
  border-top-right-radius: 4px;
  background: #eef2ff;
  border-color: #e0e7ff;
}

.lobby-message.agent .lobby-message-body,
.lobby-message.staff .lobby-message-body,
.lobby-message.human .lobby-message-body {
  border-top-left-radius: 18px;
  border-top-right-radius: 4px;
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.lobby-message-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lobby-message-body strong {
  color: #374151;
  font-size: 11px;
  font-weight: 800;
}

.lobby-message.agent .lobby-message-body strong,
.lobby-message.staff .lobby-message-body strong,
.lobby-message.human .lobby-message-body strong {
  color: #ffffff;
}

.lobby-message-body span {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
}

.lobby-message.agent .lobby-message-body span,
.lobby-message.staff .lobby-message-body span,
.lobby-message.human .lobby-message-body span {
  color: rgba(255, 255, 255, 0.76);
}

.lobby-message-body p {
  margin: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.lobby-context-panel {
  padding: 18px 24px;
  border-top: 1px solid #f3f4f6;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.lobby-context-panel div {
  min-width: 0;
}

.lobby-context-panel span {
  display: block;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 5px;
}

.lobby-context-panel strong {
  display: block;
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-empty-state {
  min-height: 520px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #9ca3af;
  text-align: center;
}

.lobby-empty-state svg {
  width: 48px;
  height: 48px;
  color: #d1d5db;
}

.lobby-empty-state strong {
  color: #374151;
  font-size: 14px;
}

.lobby-empty-state span {
  font-size: 12px;
  font-weight: 600;
}

.customer-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.customer-command-card {
  min-height: 116px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #f3f4f6;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.customer-command-card span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-command-card strong {
  display: block;
  margin-top: 14px;
  color: #111827;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.customer-command-card svg {
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: 14px;
  background: #eef2ff;
  color: #4f46e5;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.customer-lobby-panel {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.customer-lobby-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.customer-lobby-head h2 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.customer-lobby-head p {
  max-width: 720px;
  margin: 7px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
}

.customer-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.customer-profile-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #f9fafb;
  color: #374151;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.customer-profile-card:hover {
  border-color: #e0e7ff;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.08);
}

.customer-profile-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4338ca;
  border: 2px solid #ffffff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.customer-profile-top strong {
  display: block;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-profile-top small {
  display: block;
  margin-top: 4px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-profile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.customer-profile-meta div {
  padding: 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #f3f4f6;
}

.customer-profile-meta span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
}

.customer-profile-meta strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.customer-detail-command,
.bot-detail-command {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
  align-items: stretch;
  gap: 24px;
}

.customer-detail-identity {
  min-width: 0;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.customer-detail-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4338ca;
  border: 2px solid #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.customer-detail-identity h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 900;
}

.customer-detail-identity p {
  margin: 7px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
}

.customer-detail-metrics,
.bot-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.customer-detail-metrics div,
.bot-detail-metrics div {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.customer-detail-metrics div.primary,
.bot-detail-metrics div.primary {
  background: #eef2ff;
  border-color: #e0e7ff;
}

.customer-detail-metrics span,
.bot-detail-metrics span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-detail-metrics strong,
.bot-detail-metrics strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-detail-metrics small,
.bot-detail-metrics small {
  display: block;
  margin-top: 8px;
  color: #059669;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
}

.customer-detail-console,
.bot-detail-console-grid,
.bot-channel-console-grid {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  align-items: start;
  gap: 24px;
}

.customer-detail-console > .panel,
.bot-detail-console-grid > .panel,
.bot-channel-console-grid > .panel {
  margin-top: 0;
}

.customer-edit-panel,
.bot-faq-panel,
.bot-channel-create-panel {
  position: sticky;
  top: 20px;
}

.bot-detail-command .ops-command-copy {
  border-color: #e0e7ff;
  background: linear-gradient(90deg, #eef2ff, rgba(238, 242, 255, 0.55));
}

.bot-detail-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bot-detail-form .panel-title,
.bot-detail-form label:has(textarea),
.bot-detail-form .checkbox-field,
.bot-detail-form .inline-fields,
.bot-detail-form .button.primary {
  grid-column: 1 / -1;
}

.bot-detail-form .inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bot-detail-form textarea {
  min-height: 96px;
}

.customer-identity-strip,
.customer-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.customer-identity-strip {
  min-height: 28px;
  margin-bottom: 10px;
}

.customer-identity-strip span,
.customer-tag-row span {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #f3f4f6;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-tag-row span {
  background: #eef2ff;
  border-color: #e0e7ff;
  color: #4338ca;
}

.conversation-command-hero {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  align-items: center;
  gap: 24px;
}

.conversation-hero-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.conversation-hero-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4338ca;
  border: 2px solid #ffffff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.conversation-hero-main h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.conversation-hero-main p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.conversation-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.conversation-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.conversation-command-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #f9fafb;
}

.conversation-command-grid span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 900;
}

.conversation-command-grid strong {
  display: block;
  margin-top: 7px;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commerce-command-hero,
.service-ticket-hero {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  align-items: center;
  gap: 24px;
}

.commerce-hero-main,
.service-ticket-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.commerce-hero-icon,
.service-ticket-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #e0e7ff;
}

.commerce-hero-icon svg,
.service-ticket-icon svg,
.cycle-step svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.commerce-hero-main h2,
.service-ticket-main h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.commerce-hero-main p,
.service-ticket-main p {
  margin: 7px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
}

.commerce-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.commerce-money-grid,
.service-ticket-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.commerce-money-grid div,
.service-ticket-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #f9fafb;
}

.commerce-money-grid span,
.service-ticket-grid span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 900;
}

.commerce-money-grid strong,
.service-ticket-grid strong {
  display: block;
  margin-top: 7px;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-cycle-track {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.cycle-step {
  position: relative;
  min-width: 0;
  padding: 18px;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cycle-step::after {
  content: "";
  position: absolute;
  left: 48px;
  right: 18px;
  bottom: 16px;
  height: 3px;
  border-radius: 999px;
  background: #e5e7eb;
}

.cycle-step.done::after {
  background: #10b981;
}

.cycle-step.warning::after {
  background: #f59e0b;
}

.cycle-step > span {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4f46e5;
}

.cycle-step.done > span {
  background: #ecfdf5;
  color: #059669;
}

.cycle-step.warning > span {
  background: #fffbeb;
  color: #d97706;
}

.cycle-step strong {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 5px;
}

.cycle-step small {
  display: block;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
  padding-bottom: 12px;
}

.system-command-hero,
.team-command-hero,
.audit-command-panel {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.system-command-hero,
.team-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  align-items: center;
  gap: 24px;
}

.system-hero-main,
.audit-command-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-hero-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #e0e7ff;
}

.system-hero-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.system-hero-main h2,
.audit-command-copy h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
}

.system-hero-main p,
.audit-command-copy p {
  margin: 7px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.system-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.system-command-metrics,
.access-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.system-command-metrics div,
.access-command-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #f9fafb;
}

.access-command-grid {
  margin-bottom: 24px;
}

.access-command-card.primary {
  background: #eef2ff;
  border-color: #e0e7ff;
}

.system-command-metrics span,
.access-command-card span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 900;
}

.system-command-metrics strong,
.access-command-card strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-command-card small {
  display: block;
  margin-top: 8px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
}

.audit-command-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1fr);
  gap: 22px;
}

.audit-timeline-preview {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.audit-timeline-preview article {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #f9fafb;
  display: grid;
  grid-template-columns: 92px minmax(0, 0.8fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.audit-timeline-preview time {
  color: #9ca3af;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.audit-timeline-preview strong {
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-timeline-preview span {
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-strip,
.team-card-grid {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.user-profile-chip,
.team-profile-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.user-profile-chip,
.team-profile-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.user-profile-chip strong,
.team-profile-head strong {
  display: block;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-chip small,
.team-profile-head small {
  display: block;
  margin-top: 4px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-profile-card p {
  min-height: 44px;
  margin: 14px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 700;
}

.bot-forms-grid,
.split,
.conversation-layout {
  gap: 24px;
}

.bot-forms-grid {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
}

.form-section {
  padding: 18px;
  margin: 16px 0;
}

.form-section legend,
.form-section summary {
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
}

.clone-panel {
  position: sticky;
  top: 24px;
  align-self: start;
}

.messages {
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 620px;
  overflow-y: auto;
}

.message {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  max-width: 74%;
  margin: 0;
}

.message.customer,
.message.inbound {
  background: #ffffff;
  border-top-left-radius: 4px;
  align-self: flex-start;
}

.message.bot,
.message.assistant,
.message.outbound,
.message.agent {
  background: #eef2ff;
  border-color: #e0e7ff;
  border-top-right-radius: 4px;
  align-self: flex-end;
}

.message.agent,
.message.outbound {
  background: #4f46e5;
  border-color: #4f46e5;
}

.message.agent p,
.message.outbound p,
.message.agent header strong,
.message.outbound header strong,
.message.agent header span,
.message.outbound header span,
.message.agent .message-metadata,
.message.outbound .message-metadata {
  color: #ffffff;
}

.message.internal_note {
  align-self: stretch;
  max-width: 100%;
  background: #fff7ed;
  border-color: #fed7aa;
}

.message.internal_note p {
  color: #9a3412;
}

.message header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.message header strong {
  color: #111827;
  font-size: 12px;
}

.message header span,
.message-metadata {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
}

.message p {
  color: #374151;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.reply-form,
.note-form {
  background: #ffffff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 16px;
}

.conversation-compose-panel {
  padding: 18px 22px;
  border-top: 1px solid #f3f4f6;
  background: #ffffff;
}

.conversation-compose-panel .reply-form,
.conversation-compose-panel .note-form {
  margin-top: 0;
}

.conversation-compose-panel .note-form {
  margin-top: 10px;
}

.conversation-control-rail .form-panel,
.conversation-control-rail .panel {
  border-radius: 16px;
}

.conversation-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.conversation-layout > .panel:first-child {
  padding: 0;
  overflow: hidden;
}

.conversation-layout > .panel:first-child > .panel-title {
  min-height: 72px;
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid #f3f4f6;
}

.conversation-layout > .panel:first-child .quick-replies {
  padding: 18px 22px 22px;
}

.side-panels {
  display: grid;
  gap: 16px;
}

.side-panels .panel {
  padding: 20px;
}

.details {
  gap: 10px 14px;
}

.details dt {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 800;
}

.details dd {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .topbar-actions {
    gap: 8px;
  }

  .global-search {
    display: none;
  }

  .metrics,
  .workbench-grid,
  .workbench-hero-grid,
  .ledger-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body:not(.auth-body):not(.public-body) {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    height: auto;
    overflow: visible;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .nav-tree {
    flex: 0 0 auto;
    max-height: 320px;
    overflow-y: auto;
  }

  .language-switcher,
  .logout-form {
    flex: 0 0 auto;
  }

  .topbar {
    height: auto;
    min-height: 64px;
    padding: 16px 20px;
    align-items: flex-start;
  }

  .main {
    overflow: visible;
    padding: 20px;
  }

  .metrics,
  .split,
  .conversation-layout,
  .workbench-grid,
  .workbench-hero-grid,
  .bot-forms-grid,
  .bot-card-grid,
  .lead-insight-grid,
  .customer-command-grid,
  .customer-card-grid,
  .customer-detail-command,
  .customer-detail-metrics,
  .customer-detail-console,
  .bot-detail-command,
  .bot-detail-metrics,
  .bot-detail-console-grid,
  .bot-channel-console-grid,
  .bot-detail-form,
  .bot-detail-form .inline-fields,
  .conversation-command-hero,
  .conversation-command-grid,
  .commerce-command-hero,
  .commerce-money-grid,
  .service-ticket-hero,
  .service-ticket-grid,
  .order-cycle-track,
  .system-command-hero,
  .team-command-hero,
  .audit-command-panel,
  .audit-timeline-preview article,
  .system-command-metrics,
  .access-command-grid,
  .user-profile-strip,
  .team-card-grid,
  .ledger-summary-grid,
  .analysis-insight-grid,
  .security-command-grid,
  .collaboration-command-panel,
  .collaboration-card-grid,
  .dispatch-command-panel,
  .dispatch-flow-grid,
  .knowledge-command-panel,
  .knowledge-stat-grid,
  .knowledge-console-grid,
  .commerce-ledger-command,
  .commerce-flow-grid,
  .commerce-console-grid,
  .analysis-funnel-panel,
  .public-acceptance-grid {
    grid-template-columns: 1fr;
  }

  .customer-lobby-head,
  .customer-detail-identity,
  .conversation-hero-main,
  .commerce-hero-main,
  .service-ticket-main,
  .system-hero-main,
  .audit-command-copy,
  .ops-command-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-acceptance-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .message {
    max-width: 92%;
  }

  .conversation-compose-panel {
    padding: 16px;
  }

  .knowledge-create-panel,
  .customer-edit-panel,
  .bot-faq-panel,
  .bot-channel-create-panel,
  .commerce-console-grid > .form-panel {
    position: static;
  }

  .conversation-layout > .panel,
  .side-panels {
    min-width: 0;
  }

  .reception-lobby {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .lobby-list {
    border-right: 0;
    border-bottom: 1px solid #f3f4f6;
    max-height: 520px;
  }

  .lobby-console-header,
  .lobby-context-panel {
    grid-template-columns: 1fr;
  }

  .lobby-console-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .lobby-console-actions {
    justify-content: flex-start;
  }

  .lobby-message {
    max-width: 100%;
  }

  .lobby-context-panel {
    display: grid;
  }
}

/* Final screenshot fidelity overrides. Keep this block last. */
body:not(.auth-body):not(.public-body) {
  grid-template-columns: 256px minmax(0, 1fr);
  background: var(--cc-bg);
  overflow: hidden;
}

body[data-watermark]::before {
  top: 188px;
  left: 380px;
  z-index: 0;
  color: rgba(15, 23, 42, 0.04);
  font-size: 18px;
  font-weight: 800;
  text-shadow:
    520px 330px 0 currentColor,
    120px 660px 0 currentColor;
}

.sidebar,
.app-shell {
  position: relative;
  z-index: 1;
}

.nav-group.nav-flat > summary {
  display: none;
}

.nav-group.nav-flat {
  margin: 2px 0;
  padding: 0;
}

.nav-group.nav-flat a {
  margin: 2px 0;
}

.nav-root-menu {
  gap: 6px;
}

.nav-root-link,
.nav-root-group > summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #536174;
  font-size: 14px;
  font-weight: 800;
}

.nav-root-link:hover,
.nav-root-link.active,
.nav-root-group > summary:hover {
  background: #eef2ff;
  color: var(--cc-primary);
}

.nav-root-link.active {
  color: var(--cc-primary);
}

.nav-root-group {
  margin: 0;
  padding: 0;
}

.nav-root-group > summary {
  justify-content: flex-start;
}

.nav-root-group > summary::after {
  margin-left: auto;
  content: ">";
  color: #a8b2c2;
  font-size: 12px;
}

.nav-root-group[open] > summary {
  color: var(--cc-primary);
}

.nav-root-group[open] > summary::after {
  transform: rotate(90deg);
}

.nav-root-group > a {
  min-height: 36px;
  margin: 2px 0 2px 28px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.nav-root-group > a .nav-icon {
  width: 16px;
  height: 16px;
}

.nav-domain > summary,
.nav-group > summary,
.nav-group a {
  letter-spacing: 0;
}

.main {
  padding: 32px;
  background: var(--cc-bg);
}

@media (max-width: 980px) {
  body:not(.auth-body):not(.public-body) {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  body[data-watermark]::before {
    top: 360px;
    left: 32px;
    text-shadow: none;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .breadcrumbs {
    flex-wrap: wrap;
  }
}

/* Precision polish pass: visual rhythm only, no information architecture changes. */
body:not(.auth-body):not(.public-body) {
  --cc-radius: 8px;
  --cc-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 24px rgba(15, 23, 42, 0.035);
}

.brand {
  min-height: 82px;
  padding: 24px 24px 16px;
}

.nav-tree {
  padding: 14px 16px;
}

.nav-root-menu {
  gap: 4px;
}

.nav-root-link,
.nav-root-group > summary {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 13px;
}

.nav-root-group > a {
  min-height: 34px;
  margin-left: 26px;
  padding: 7px 10px;
  font-size: 12px;
}

.language-switcher {
  margin-bottom: 10px;
}

.logout-form {
  min-height: 54px;
  padding: 9px 10px;
}

.topbar {
  padding: 0 32px;
}

.topbar-actions {
  min-width: 0;
}

.global-search {
  width: clamp(280px, 28vw, 320px);
}

.main {
  padding: 30px 32px;
}

.page-header {
  min-height: 56px;
  margin-bottom: 22px;
  gap: 20px;
}

.page-header h1 {
  font-size: 26px;
  line-height: 1.08;
  font-weight: 900;
}

.page-header p {
  max-width: 680px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
}

.panel,
.form-panel,
.metric,
.row-card,
.form-section,
.reception-lobby,
.bot-summary-bar,
.bot-card,
.lead-ai-summary,
.security-command-card,
.customer-command-card,
.access-command-card,
.conversation-command-hero,
.commerce-command-hero,
.service-ticket-hero,
.system-command-hero,
.team-command-hero,
.audit-command-panel {
  border-radius: 8px;
  border-color: var(--cc-border);
  box-shadow: var(--cc-shadow);
}

.panel,
.form-panel {
  padding: 24px;
}

.panel-title {
  margin-bottom: 16px;
}

.panel-title h2,
.panel-title h3,
.replica-panel-title h2,
.replica-panel-title h3 {
  color: #07142f;
  font-weight: 900;
}

.panel-title p,
.replica-panel-title p {
  color: #7b879b;
  line-height: 1.45;
}

.replica-dashboard {
  gap: 22px;
}

.replica-kpi-grid,
.replica-analytics-grid,
.replica-bottom-grid {
  gap: 22px;
}

.replica-kpi-card {
  min-height: 128px;
  padding: 21px 22px 18px;
}

.replica-kpi-card strong {
  margin-top: 34px;
}

.replica-panel {
  padding: 24px;
}

.trend-panel,
.channel-panel {
  min-height: 372px;
}

.bot-monitor-panel,
.priority-panel {
  min-height: 320px;
}

.trend-chart {
  height: 256px;
}

.channel-list {
  gap: 20px;
  padding-top: 24px;
}

.bot-monitor-card,
.priority-ticket,
.workbench-tail-card {
  border-radius: 8px;
}

.bot-summary-bar {
  align-items: center;
  min-height: 82px;
  padding: 18px 20px;
  margin-bottom: 22px;
  background: #eef2ff;
}

.bot-summary-bar > .summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.bot-summary-bar .summary-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.bot-fleet-panel {
  margin-bottom: 22px;
}

.bot-card-grid {
  gap: 12px;
}

.bot-card {
  min-height: 118px;
  padding: 15px;
  background: #fbfcff;
}

.bot-forms-grid {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.clone-panel {
  position: static;
  align-self: start;
  margin-top: 0;
}

.bot-forms-grid > .panel,
.bot-forms-grid > .form-panel {
  margin-top: 0;
}

.clone-panel .compact-form {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.form-section {
  padding: 16px;
  margin: 0;
  background: #fbfcff;
}

.bot-create-form {
  gap: 16px;
}

.form-grid {
  gap: 11px 12px;
}

label {
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  min-height: 36px;
}

textarea {
  min-height: 76px;
}

.button {
  min-height: 36px;
}

.segmented {
  border-radius: 8px;
  padding: 4px;
}

.segmented a {
  min-height: 34px;
  border-radius: 7px;
}

.reception-lobby {
  min-height: 660px;
  margin-bottom: 22px;
}

.lobby-list-header,
.lobby-console-header {
  padding: 18px 20px;
}

.lobby-search {
  margin: 14px 18px 10px;
  min-height: 38px;
  border-radius: 8px;
}

.lobby-session-list {
  padding: 0 10px 14px;
}

.lobby-session-card {
  padding: 14px 15px;
  border-radius: 8px;
}

.lobby-session-card + .lobby-session-card {
  margin-top: 2px;
}

table {
  border-radius: 8px;
}

th,
td {
  vertical-align: middle;
}

@media (max-width: 980px) {
  .main {
    padding: 18px;
  }

  .topbar {
    min-height: auto;
    padding: 14px 18px 12px;
  }

  .topbar-title h2 {
    font-size: 15px;
    line-height: 1.25;
  }

  .sync-panel {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
    justify-content: flex-start;
  }

  .icon-button {
    width: 32px;
    height: 32px;
  }

  .page-header {
    gap: 14px;
  }

  .bot-forms-grid {
    gap: 18px;
  }
}

/* Conversation detail reply-first layout. */
.conversation-compact-hero {
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.95fr);
  margin-bottom: 22px;
  padding: 22px 24px;
}

.conversation-compact-hero .conversation-hero-avatar {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
}

.conversation-detail-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 420px);
  gap: 18px;
  align-items: start;
}

.conversation-chat-console {
  padding: 0;
  overflow: hidden;
}

.conversation-chat-console > .panel-title {
  min-height: 64px;
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid #f1f4f9;
}

.conversation-chat-console .messages {
  min-height: 260px;
  max-height: 460px;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  padding: 18px;
}

.conversation-chat-console .message {
  max-width: min(620px, 68%);
  padding: 14px;
}

.conversation-chat-console .message.internal_note {
  max-width: 100%;
}

.conversation-compose-panel {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
  border-top: 1px solid #eef2f7;
  background: #ffffff;
}

.compose-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.compose-heading h2 {
  margin: 0;
  color: #07142f;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 900;
}

.compose-heading p {
  margin: 5px 0 0;
  color: #7b879b;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.conversation-reply-form,
.conversation-note-form {
  display: grid;
  align-items: end;
  gap: 12px;
  border-radius: 8px;
}

.conversation-reply-form {
  grid-template-columns: minmax(116px, 0.22fr) minmax(0, 1fr) auto;
  padding: 14px;
  border-color: #dfe4ff;
  background: #fbfcff;
}

.conversation-reply-form textarea {
  min-height: 58px;
  resize: vertical;
}

.conversation-reply-form .button {
  min-width: 112px;
  min-height: 40px;
}

.conversation-note-form {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 14px;
  background: #ffffff;
}

.conversation-note-form textarea {
  min-height: 48px;
}

.conversation-note-form .button {
  min-width: 104px;
}

.conversation-side-rail {
  display: grid;
  gap: 10px;
  min-width: 0;
  align-self: start;
  position: static;
  overflow: visible;
}

.conversation-quick-replies {
  padding: 12px;
}

.conversation-quick-replies .panel-title {
  margin: 0 0 8px;
  align-items: center;
}

.conversation-chat-console .compact-actions .button.small,
.conversation-quick-replies .panel-title .button.small {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.conversation-quick-replies .panel-title .button.small {
  margin-right: 10px;
}

.quick-reply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-reply-grid .row-card {
  min-height: 0;
  padding: 10px 12px;
}

.conversation-side-rail .quick-reply-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.conversation-side-rail .quick-reply-grid .row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: center;
  padding: 9px 10px;
}

.conversation-side-rail .quick-reply-grid .row-card strong,
.conversation-side-rail .quick-reply-grid .row-card span {
  grid-column: 1;
}

.conversation-side-rail .quick-reply-grid .row-card strong {
  line-height: 1.2;
}

.conversation-side-rail .quick-reply-grid .row-card span {
  display: -webkit-box;
  line-height: 1.35;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.conversation-side-rail .quick-reply-grid .row-card small {
  grid-column: 1;
  font-size: 11px;
  line-height: 1.25;
}

.conversation-side-rail .quick-reply-grid .inline-action {
  grid-column: 2;
  grid-row: 1 / span 3;
  justify-self: end;
}

.conversation-side-rail .quick-reply-grid .button.small {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.conversation-side-rail .conversation-ops-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.conversation-side-rail .conversation-ops-grid > :nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.conversation-side-rail .conversation-ops-grid > :nth-child(2) {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.conversation-side-rail .conversation-ops-grid > :nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.conversation-side-rail .conversation-ops-grid .form-panel {
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 7px;
}

.conversation-side-rail .conversation-ops-grid .panel-title {
  margin-bottom: 0;
}

.conversation-side-rail .conversation-ops-grid textarea {
  min-height: 42px;
}

.conversation-side-rail .conversation-ops-grid .details {
  grid-template-columns: 76px 1fr;
  gap: 4px 8px;
  font-size: 11px;
}

.conversation-side-rail .conversation-ops-grid label {
  gap: 4px;
  font-size: 11px;
}

.conversation-side-rail .conversation-ops-grid input,
.conversation-side-rail .conversation-ops-grid select {
  min-height: 34px;
  padding: 8px 10px;
}

.conversation-side-rail .conversation-ops-grid .button {
  min-height: 34px;
  padding: 7px 10px;
}

.conversation-side-rail .conversation-ops-grid > :nth-child(2) .button[type="submit"],
.conversation-side-rail .conversation-ops-grid > :nth-child(3) .button[type="submit"] {
  margin-top: auto;
}

.conversation-side-rail .conversation-ops-grid .inline-fields {
  gap: 6px;
}

.conversation-ops-grid,
.conversation-business-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.conversation-ops-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.conversation-business-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.conversation-business-grid > * {
  height: 100%;
}

.conversation-business-grid > :nth-child(2) {
  order: 3;
}

.conversation-business-grid > :nth-child(3) {
  order: 2;
}

.conversation-business-grid > :nth-child(4) {
  order: 4;
}

.conversation-business-grid > :nth-child(5) {
  order: 5;
}

.conversation-business-grid > :nth-child(6) {
  order: 6;
}

.conversation-ops-grid .panel,
.conversation-business-grid .panel {
  margin-top: 0;
  height: auto;
}

.conversation-ops-grid .form-panel,
.conversation-business-grid .form-panel {
  align-content: start;
  gap: 12px;
}

.conversation-ops-grid .button,
.conversation-business-grid .button {
  justify-self: stretch;
}

.conversation-business-grid .details,
.conversation-ops-grid .details {
  margin: 4px 0 0;
}

.conversation-business-grid .empty {
  min-height: 92px;
  display: grid;
  place-items: center;
}

@media (max-width: 1180px) {
  .conversation-compact-hero {
    grid-template-columns: 1fr;
  }

  .conversation-detail-console,
  .conversation-business-grid {
    grid-template-columns: 1fr;
  }

  .conversation-side-rail {
    position: static;
  }

  .conversation-side-rail .conversation-ops-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .conversation-side-rail .conversation-ops-grid > * {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 980px) {
  .conversation-compact-hero {
    padding: 18px;
  }

  .conversation-command-grid,
  .conversation-ops-grid,
  .conversation-business-grid,
  .quick-reply-grid,
  .conversation-reply-form,
  .conversation-note-form {
    grid-template-columns: 1fr;
  }

  .conversation-chat-console > .panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .conversation-chat-console .messages {
    max-height: none;
    min-height: 220px;
    padding: 16px;
  }

  .conversation-compose-panel {
    padding: 16px;
  }

  .conversation-reply-form,
  .conversation-note-form {
    padding: 14px;
  }

  .conversation-side-rail .conversation-ops-grid {
    grid-template-columns: 1fr;
  }

  .conversation-side-rail .conversation-ops-grid > * {
    grid-column: auto;
    grid-row: auto;
  }

  .conversation-chat-console .message {
    max-width: 94%;
  }
}

/* Conversation lobby monitor, matched to the reference three-column service desk. */
.conversation-flow-monitor {
  grid-template-columns: 320px minmax(0, 1fr) 268px;
  height: calc(100vh - 66px);
  min-height: 700px;
  margin: -30px -32px 24px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
}

.conversation-flow-monitor .lobby-list {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  min-height: 0;
}

.conversation-flow-monitor .lobby-list-header {
  min-height: 76px;
  padding: 22px 22px 14px;
  border-bottom: 0;
}

.conversation-flow-monitor .lobby-list-header h1 {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.conversation-flow-monitor .lobby-list-header p {
  margin: 5px 0 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.conversation-flow-monitor .lobby-list-header > span {
  width: 30px;
  height: 30px;
  background: #eef2ff;
  color: #4f46e5;
}

.lobby-search-form {
  margin: 0 20px 12px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby-search-form svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #94a3b8;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.lobby-search-form input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 650;
  outline: none;
}

.lobby-search-form input::placeholder {
  color: #94a3b8;
}

.lobby-filter-tabs {
  margin: 0 20px 14px;
  padding: 4px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #f8fafc;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.lobby-filter-tabs a {
  min-height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.lobby-filter-tabs a.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.conversation-flow-monitor .lobby-session-list {
  padding: 0 10px 18px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
}

.conversation-flow-monitor .lobby-session-list::-webkit-scrollbar {
  width: 8px;
}

.conversation-flow-monitor .lobby-session-list::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-flow-monitor .lobby-session-list::-webkit-scrollbar-thumb {
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.72);
}

.conversation-flow-monitor .lobby-session-list::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.78);
}

.conversation-flow-monitor .lobby-session-card {
  margin: 0;
  padding: 15px 14px 14px 16px;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
}

.conversation-flow-monitor .lobby-session-card + .lobby-session-card {
  border-top: 1px solid #f1f5f9;
}

.conversation-flow-monitor .lobby-session-card:hover,
.conversation-flow-monitor .lobby-session-card.active {
  background: #f1f5ff;
  border-left-color: #4f46e5;
}

.conversation-flow-monitor .lobby-session-top {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
}

.conversation-flow-monitor .lobby-avatar {
  width: 38px;
  height: 38px;
  background: #eef2ff;
  color: #4f46e5;
  border-color: #ffffff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.12);
}

.conversation-flow-monitor .lobby-avatar.large {
  width: 44px;
  height: 44px;
}

.conversation-flow-monitor .lobby-session-top strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.conversation-flow-monitor .lobby-session-top small,
.conversation-flow-monitor .lobby-session-top time {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.conversation-flow-monitor .lobby-session-card p {
  margin: 10px 0 11px 49px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.conversation-flow-monitor .lobby-session-meta {
  margin-left: 49px;
}

.conversation-flow-monitor .lobby-session-meta > span:first-child {
  color: #94a3b8;
  font-size: 11px;
}

.lobby-status-tag {
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.lobby-status-tag.is-waiting {
  background: #fff7ed;
  color: #f97316;
}

.lobby-status-tag.is-done {
  background: #ecfdf5;
  color: #16a34a;
}

.conversation-flow-monitor .lobby-alert-dot {
  top: 17px;
  right: 13px;
}

.conversation-flow-monitor .lobby-console {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  min-height: 0;
}

.conversation-flow-monitor .lobby-console-header {
  min-height: 78px;
  padding: 17px 22px;
  border-bottom: 1px solid #e5e7eb;
}

.conversation-flow-monitor .lobby-console-header h2 {
  color: #0f172a;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 900;
}

.conversation-flow-monitor .lobby-console-header p {
  color: #94a3b8;
  font-size: 12px;
}

.conversation-flow-monitor .lobby-console-actions {
  gap: 8px;
}

.conversation-flow-monitor .button {
  min-height: 36px;
  border-radius: 10px;
  padding: 0 15px;
  font-size: 12px;
  font-weight: 900;
}

.conversation-flow-monitor .button.success-outline {
  background: #ffffff;
  border-color: #bbf7d0;
  color: #16a34a;
}

.conversation-flow-monitor .button.success-outline:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.conversation-flow-monitor .button.dark {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.conversation-flow-monitor .button.dark:hover {
  background: #020617;
  border-color: #020617;
}

.conversation-flow-monitor .lobby-chat-preview {
  flex: 1 1 auto;
  min-height: 0;
  padding: 26px 28px;
  background: #f8fafc;
  gap: 18px;
}

.conversation-flow-monitor .lobby-message {
  max-width: min(640px, 78%);
}

.conversation-flow-monitor .lobby-message-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  background: #ffffff;
  color: #64748b;
  border-color: #e2e8f0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.conversation-flow-monitor .lobby-message.bot .lobby-message-avatar,
.conversation-flow-monitor .lobby-message.assistant .lobby-message-avatar {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #dbe4ff;
}

.conversation-flow-monitor .lobby-message-body {
  padding: 14px 16px;
  border-radius: 16px;
  border-top-left-radius: 5px;
  border-color: #e5e7eb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.conversation-flow-monitor .lobby-message.bot .lobby-message-body,
.conversation-flow-monitor .lobby-message.assistant .lobby-message-body {
  border-top-left-radius: 16px;
  border-top-right-radius: 5px;
  background: #eef4ff;
  border-color: #dbeafe;
}

.conversation-flow-monitor .lobby-message.agent .lobby-message-body,
.conversation-flow-monitor .lobby-message.staff .lobby-message-body,
.conversation-flow-monitor .lobby-message.human .lobby-message-body {
  border-top-left-radius: 16px;
  border-top-right-radius: 5px;
}

.conversation-flow-monitor .lobby-message-body strong {
  color: #0f172a;
  font-size: 12px;
}

.conversation-flow-monitor .lobby-message-body span {
  color: #94a3b8;
  font-size: 11px;
}

.conversation-flow-monitor .lobby-message-body p {
  color: #1e293b;
  font-size: 13px;
  line-height: 1.6;
}

.conversation-flow-monitor .lobby-message.agent .lobby-message-body p,
.conversation-flow-monitor .lobby-message.staff .lobby-message-body p,
.conversation-flow-monitor .lobby-message.human .lobby-message-body p {
  color: #ffffff;
}

.lobby-handoff-panel {
  min-height: 56px;
  margin: 12px 18px 14px;
  padding: 10px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.lobby-handoff-panel p {
  margin: 0;
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-handoff-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 168px;
  min-height: 34px;
}

.lobby-visitor-panel {
  min-width: 0;
  padding: 24px 22px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.visitor-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.visitor-panel-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.visitor-detail-list {
  margin: 0;
  display: grid;
  gap: 18px;
}

.visitor-detail-list div {
  min-width: 0;
}

.visitor-detail-list dt {
  margin: 0 0 5px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 850;
}

.visitor-detail-list dd {
  margin: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.visitor-finish-form {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.visitor-finish-form .button {
  width: 100%;
}

.lobby-empty-state.compact {
  min-height: 280px;
}

.conversation-table-panel {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
}

.conversation-table-summary {
  min-height: 58px;
  padding: 0 22px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
}

.conversation-table-summary::-webkit-details-marker {
  display: none;
}

.conversation-table-summary span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.conversation-table-summary strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
}

.conversation-table-summary small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 750;
}

.conversation-table-summary::after {
  content: "展开";
  min-width: 52px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.conversation-table-panel[open] .conversation-table-summary {
  border-bottom: 1px solid #eef2f7;
}

.conversation-table-panel[open] .conversation-table-summary::after {
  content: "收起";
}

.conversation-table-body {
  padding: 22px;
}

.conversation-table-body .filter-form {
  margin-top: 0;
}

@media (max-width: 1280px) {
  .conversation-flow-monitor {
    grid-template-columns: 300px minmax(0, 1fr);
    height: auto;
    min-height: 680px;
  }

  .conversation-flow-monitor .lobby-list,
  .conversation-flow-monitor .lobby-console {
    height: calc(100vh - 66px);
    min-height: 640px;
  }

  .lobby-visitor-panel {
    grid-column: 1 / -1;
    margin: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
  }

  .visitor-finish-form {
    grid-column: 1 / -1;
  }

  .visitor-detail-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 980px) {
  .conversation-flow-monitor {
    grid-template-columns: 1fr;
    min-height: 0;
    margin: -18px -18px 22px;
  }

  .conversation-flow-monitor .lobby-list {
    height: 440px;
    max-height: 440px;
    min-height: 320px;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .conversation-flow-monitor .lobby-console {
    border-right: 0;
  }

  .conversation-flow-monitor .lobby-console-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .conversation-flow-monitor .lobby-console-actions {
    width: 100%;
    justify-content: stretch;
  }

  .conversation-flow-monitor .lobby-console-actions .button,
  .conversation-flow-monitor .lobby-console-actions .inline-action,
  .conversation-flow-monitor .lobby-console-actions .inline-action button {
    width: 100%;
  }

  .conversation-flow-monitor .lobby-chat-preview {
    min-height: 420px;
    padding: 18px;
  }

  .conversation-flow-monitor .lobby-message {
    max-width: 94%;
  }

  .lobby-handoff-panel {
    flex-direction: column;
    gap: 10px;
    margin: 12px 16px 14px;
    padding: 12px 16px;
  }

  .lobby-handoff-panel p {
    text-align: center;
    white-space: normal;
  }

  .lobby-handoff-button {
    width: min(320px, 100%);
  }

  .lobby-visitor-panel {
    margin: 14px;
    display: flex;
  }

  .visitor-detail-list {
    grid-template-columns: 1fr;
  }
}
