:root {
  --primary: #3182ce;
  --primary-strong: #1f7ae0;
  --primary-light: #e8f3ff;
  --dark: #1a365d;
  --dark-2: #0b2747;
  --dark-3: #061d37;
  --page: #f7fafc;
  --panel: #ffffff;
  --line: #e2e8f0;
  --line-soft: #edf2f7;
  --text: #0f2138;
  --muted: #6b7280;
  --success: #16b36b;
  --success-2: #25c6bf;
  --danger: #f23030;
  --warning: #ff8a1c;
  --shadow: 0 24px 70px rgba(26, 54, 93, 0.08);
  --shadow-soft: 0 12px 36px rgba(26, 54, 93, 0.06);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 1120px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: "PingFang SC", "SF Pro Text", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(49, 130, 206, 0.08), rgba(37, 198, 191, 0.08)),
    var(--page);
}

.login-card {
  width: min(430px, 100%);
  padding: 34px;
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: -6px 0 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 950;
}

.login-card label,
.role-form label,
.modal-fields label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-weight: 900;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.login-tabs button {
  min-height: 36px;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-weight: 900;
}

.login-tabs button.active {
  background: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 8px 18px rgba(26, 54, 93, 0.08);
}

.inline-input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.form-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--danger);
  font-weight: 800;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--page);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 100% 30%, rgba(49, 130, 206, 0.14), transparent 34%),
    linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 48%, var(--dark-3) 100%);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: 18%;
  width: 120px;
  height: 180px;
  border-radius: 36px;
  background: rgba(49, 130, 206, 0.16);
  transform: rotate(24deg);
}

.back-link {
  margin: 0 24px -6px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.brand {
  position: relative;
  z-index: 1;
  min-height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #ffffff;
  color: var(--dark);
  font-size: 20px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.brand p,
.brand h1 {
  margin: 0;
}

.brand p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.brand h1 {
  margin-top: 4px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 950;
}

.nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.nav-item {
  width: calc(100% - 18px);
  min-height: 56px;
  margin: 0 0 0 0;
  padding: 0 18px 0 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 0 14px 14px 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item::before {
  content: attr(data-icon);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 950;
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(135deg, #58a2ff 0%, #1677e8 100%);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 18px 34px rgba(0, 0, 0, 0.16);
}

.nav-item.active::before,
.nav-item:hover::before {
  border-color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.15);
}

.side-card {
  position: relative;
  z-index: 1;
  margin: auto 22px 0;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.86);
}

.side-card strong,
.side-card p {
  margin: 0;
}

.side-card strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.side-card p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  line-height: 1.7;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(22, 179, 107, 0.18);
}

.workspace {
  min-width: 0;
  min-height: 100vh;
  background: var(--page);
}

.workspace-header {
  height: 78px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px rgba(26, 54, 93, 0.035);
}

.workspace-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-title::before {
  content: "";
  width: 42px;
  height: 38px;
  border-radius: 11px;
  background:
    linear-gradient(135deg, #63b3ed 0 34%, transparent 35%),
    linear-gradient(135deg, #3182ce, #1f7ae0);
  box-shadow: inset 0 -8px 0 rgba(255, 255, 255, 0.18);
}

.workspace-header h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 23px;
  line-height: 1.15;
  font-weight: 950;
}

.kicker {
  margin: 0;
  color: #3182ce;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 440px;
}

.global-search {
  position: relative;
  width: min(420px, 34vw);
}

.global-search span {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: #7a8390;
  font-size: 0;
}

.global-search span::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #7a8390;
  border-radius: 50%;
}

.global-search span::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 17px;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: #7a8390;
  transform: rotate(45deg);
}

.global-search input {
  width: 100%;
  height: 44px;
  padding: 0 18px 0 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.global-search input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.1);
}

.icon-button,
.user-chip {
  height: 42px;
  min-width: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(26, 54, 93, 0.05);
}

.icon-button {
  position: relative;
}

.home-button::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 17px;
  height: 15px;
  border: 2px solid #54708f;
  border-top: 0;
  border-radius: 5px;
}

.home-button::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 10px;
  width: 17px;
  height: 17px;
  border-left: 2px solid #54708f;
  border-top: 2px solid #54708f;
  transform: rotate(45deg);
}

.notice-button::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 11px;
  width: 17px;
  height: 19px;
  border: 2px solid #54708f;
  border-radius: 12px 12px 8px 8px;
}

.notice-button::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px #fff;
}

.user-chip {
  padding: 0 14px 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 900;
}

.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 20;
  width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(26, 54, 93, 0.16);
}

.user-dropdown button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  text-align: left;
}

.user-dropdown button:hover {
  background: #f3f7fb;
}

.user-avatar,
.customer-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, #d9e5ee, #f8fafc);
  color: var(--dark);
  font-weight: 950;
}

.user-avatar {
  width: 32px;
  height: 32px;
}

.user-avatar img,
.user-list-avatar,
.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-list-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #edf4fb;
  color: var(--dark);
  font-weight: 950;
}

.avatar-upload-preview {
  min-height: 42px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #b8d4f1;
  border-radius: 12px;
  background: #f4f9ff;
  color: #365d84;
  font-weight: 850;
}

.avatar-upload-preview img {
  width: 32px;
  height: 32px;
}

.panel-view {
  padding: 20px 30px 30px;
  animation: panelIn 0.18s ease-out;
}

#workbenchPanel {
  min-height: calc(100vh - 78px);
  padding-bottom: 18px;
  display: flex;
}

#workbenchPanel.hidden {
  display: none;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.metric-card {
  position: relative;
  min-height: 104px;
  padding: 20px 24px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.metric-card span {
  display: block;
  color: #424b57;
  font-size: 15px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  color: var(--text);
  font-size: 38px;
  line-height: 0.9;
  font-weight: 950;
}

.metric-card small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.metric-card.danger strong {
  color: var(--danger);
}

.metric-card.success strong {
  color: #0ea5a8;
}

.primary-button,
.secondary-button,
.monitor-tabs button {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.primary-button,
.monitor-tabs button.active {
  background: linear-gradient(135deg, #3794f4, #096fe6);
  color: white;
  box-shadow: 0 14px 28px rgba(49, 130, 206, 0.24);
}

.secondary-button,
.monitor-tabs button {
  border: 1px solid #cfd8e3;
  background: white;
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover,
.monitor-tabs button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d6deea;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.1);
}

.card,
.queue-panel,
.chat-panel,
.profile-panel {
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.workbench {
  width: 100%;
  height: calc(100vh - 116px);
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(420px, 1fr) 320px;
  gap: 16px;
}

.queue-panel,
.chat-panel,
.profile-panel {
  min-height: 0;
  overflow: hidden;
}

.queue-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.toolbar {
  padding: 18px;
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.toolbar input {
  height: 40px;
  background: #f8fafc;
}

.segmented {
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.segmented button {
  min-height: 32px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.segmented button.active {
  background: linear-gradient(135deg, #3794f4, #096fe6);
  color: white;
  box-shadow: 0 10px 20px rgba(49, 130, 206, 0.18);
}

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

.conversation-rows {
  min-height: 0;
  overflow: auto;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.conversation-row {
  position: relative;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  background: white;
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.conversation-row:hover,
.conversation-row.active {
  z-index: 1;
  background: #f8fbff;
  box-shadow: inset 4px 0 0 var(--primary), 0 10px 24px rgba(49, 130, 206, 0.08);
}

.conversation-row.has-unread {
  background: #fff5f5;
  box-shadow: inset 4px 0 0 rgba(242, 48, 48, 0.42);
}

.conversation-row.has-unread:hover,
.conversation-row.has-unread.active {
  background: #fff0f0;
  box-shadow: inset 4px 0 0 var(--danger), 0 10px 24px rgba(242, 48, 48, 0.12);
}

.conversation-row.has-unread::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 44px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(242, 48, 48, 0.12);
}

.customer-avatar.small {
  width: 48px;
  height: 48px;
  font-size: 17px;
}

.customer-avatar.large {
  width: 64px;
  height: 64px;
  font-size: 23px;
}

.conversation-main {
  min-width: 0;
}

.row-main,
.row-meta,
.chat-title-line,
.chat-title-line > div,
.profile-summary,
.profile-value-grid,
.value-detail-grid,
.callback-field-grid,
.customer-detail-preview {
  min-width: 0;
}

.row-main,
.row-meta,
.panel-head,
.chat-title-line,
.chat-head-actions,
.value-card-head {
  display: flex;
  align-items: center;
}

.row-main {
  justify-content: space-between;
  gap: 10px;
}

.row-main strong {
  min-width: 0;
  overflow: hidden;
  color: #050f1f;
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main span {
  color: #4b5563;
  font-size: 12px;
  white-space: nowrap;
}

.row-preview {
  margin: 7px 0 10px;
  overflow: hidden;
  color: #303846;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.badge,
.tag,
.priority,
.read-state,
.unread-badge,
.message-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.pending,
.priority.high,
.unread-badge,
.message-unread {
  background: rgba(242, 48, 48, 0.1);
  color: var(--danger);
}

.badge.active,
.priority.medium {
  background: rgba(49, 130, 206, 0.12);
  color: var(--primary);
}

.badge.closed,
.priority.low,
.read-state {
  background: rgba(22, 179, 107, 0.12);
  color: var(--success);
}

.tag {
  background: #eef4fb;
  color: #45617e;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.chat-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.chat-title-line {
  gap: 12px;
  min-width: 0;
}

.chat-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-head h3,
.panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.chat-head h3 {
  margin-top: 4px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.message-stream-wrap {
  position: relative;
  min-height: 0;
  display: grid;
}

.message-stream {
  min-height: 0;
  padding: 22px 20px;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(49, 130, 206, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff, #fbfdff);
  background-size: 68px 68px, auto;
}

.message {
  max-width: 78%;
  margin-bottom: 18px;
}

.message.grouped {
  margin-top: 0;
}

.message.meta-hidden {
  margin-bottom: 12px;
}

.message.outbound {
  margin-left: auto;
  text-align: right;
}

.message-body {
  display: inline-block;
  max-width: 100%;
  padding: 13px 17px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  overflow-wrap: anywhere;
  box-shadow: 0 12px 28px rgba(26, 54, 93, 0.08);
}

.message.unread-target .message-body {
  outline: 2px solid rgba(255, 138, 28, 0.28);
  outline-offset: 2px;
}

.message.inbound .message-body {
  border: 1px solid var(--line);
  border-top-left-radius: 7px;
  background: #ffffff;
  color: var(--text);
}

.message.outbound .message-body {
  border-top-right-radius: 7px;
  background: linear-gradient(135deg, #42a2ff, #177be9);
  color: #ffffff;
}

.message-quote {
  position: relative;
  min-width: 180px;
  max-width: min(360px, 100%);
  margin: -2px -4px 10px;
  padding: 9px 12px 9px 14px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.message-quote.clickable {
  cursor: pointer;
}

.message-quote.clickable:hover {
  background: rgba(15, 23, 42, 0.1);
}

.message-quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.36);
}

.message.outbound .message-quote {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.82);
}

.message.outbound .message-quote.clickable:hover {
  background: rgba(255, 255, 255, 0.26);
}

.message.outbound .message-quote::before {
  background: rgba(255, 255, 255, 0.46);
}

.message-quote-sender {
  margin-bottom: 2px;
  font-weight: 650;
}

.message-quote-content {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-quote-media {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
}

.message-quote-main {
  color: inherit;
}

.message small {
  display: block;
  margin-top: 8px;
  color: #9aa4b2;
  font-size: 12px;
}

.message.meta-hidden small {
  display: none;
}

.message-image-link,
.message-file-link {
  color: inherit;
  text-decoration: none;
}

.message-image-link {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.message-file-card {
  min-width: min(280px, 72vw);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.message-file-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(23, 123, 233, 0.12);
  color: var(--primary-strong);
  font-size: 18px;
  font-weight: 950;
}

.message-file-main {
  min-width: 0;
}

.message-file-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.message-file-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.message-file-download {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary-strong);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.message-image {
  display: block;
  max-width: 280px;
  max-height: 220px;
  border-radius: 14px;
  object-fit: cover;
}

.chat-unread-jump,
.load-older-messages,
.scroll-latest {
  position: absolute;
  z-index: 4;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(49, 130, 206, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--primary-strong);
  cursor: pointer;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(26, 54, 93, 0.14);
}

.chat-unread-jump {
  top: 14px;
  right: 22px;
}

.load-older-messages {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  border-color: rgba(49, 130, 206, 0.22);
  color: #2563eb;
}

.load-older-messages:disabled {
  cursor: wait;
  opacity: 0.72;
}

.scroll-latest {
  right: 22px;
  bottom: 18px;
}

.message-highlight .message-body {
  animation: messagePulse 1.4s ease;
}

@keyframes messagePulse {
  0%,
  100% {
    box-shadow: 0 12px 28px rgba(26, 54, 93, 0.08);
  }
  35%,
  70% {
    box-shadow: 0 0 0 4px rgba(255, 138, 28, 0.24), 0 16px 34px rgba(26, 54, 93, 0.16);
  }
}

.reply-box {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.reply-box textarea {
  min-height: 64px;
  border-radius: 14px;
  background: #f8fafc;
  font-size: 14px;
}

.reply-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.reply-actions select {
  max-width: 190px;
}

.chat-type-tabs {
  width: 100%;
}

#statusTabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.owner-scope-tabs {
  width: 100%;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.owner-scope-tabs.hidden {
  display: none;
}

.owner-scope-tabs button {
  flex: 0 0 auto;
  min-width: 82px;
  padding: 0 10px;
  gap: 6px;
}

.owner-scope-tabs button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-scope-tabs button i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(242, 48, 48, 0.12);
  font-size: 0;
}

.owner-scope-tabs button.has-pending {
  color: var(--danger);
  background: rgba(242, 48, 48, 0.08);
}

.owner-scope-tabs button.has-pending.active {
  color: #ffffff;
  background: linear-gradient(135deg, #ff6b6b, #e83838);
}

.owner-scope-tabs button.has-pending.active i {
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.file-action {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8e3;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-preview {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #b8d4f1;
  border-radius: 12px;
  background: #f4f9ff;
  color: #365d84;
  font-weight: 850;
}

.attachment-preview em {
  color: var(--warning);
  font-style: normal;
  font-size: 12px;
}

.attachment-preview button {
  margin-left: auto;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

.profile-panel {
  padding: 18px;
  overflow: auto;
}

.panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head span {
  color: var(--muted);
  font-size: 14px;
}

.profile-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.summary-item,
.profile-value-grid div,
.value-detail-grid div,
.callback-field-grid div,
.fact-list div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f8fafc;
}

.summary-item span,
.profile-value-grid span,
.value-detail-grid span,
.callback-field-grid span,
.fact-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-item strong,
.profile-value-grid strong,
.value-detail-grid strong,
.callback-field-grid strong,
.fact-list strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form fieldset {
  margin: 0;
  padding: 14px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.profile-form legend {
  padding: 0 8px;
  color: var(--dark);
  font-weight: 950;
}

.profile-form label,
.value-form-grid label,
.callback-toolbar label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.profile-inline-actions,
.value-actions,
.ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-value-data {
  min-height: 62px;
  padding: 14px;
  border: 1px dashed #b8d4f1;
  border-radius: 14px;
  background: #f4f9ff;
  color: #45617e;
}

.profile-value-grid,
.value-detail-grid,
.callback-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-value-raw,
.raw-json {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0f2138;
  color: #e8f3ff;
}

.profile-value-raw summary,
.raw-json summary {
  cursor: pointer;
  padding: 14px;
  font-weight: 900;
}

.profile-value-raw pre,
.raw-json pre,
.operation-result pre,
.callback-payloads pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
}

.empty-state,
.empty-chat {
  margin: 0;
  padding: 44px 26px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state strong,
.empty-chat strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}

.empty-state p,
.empty-chat p {
  max-width: 420px;
  margin: 10px auto 0;
  line-height: 1.7;
}

.empty-state.compact {
  padding: 24px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.customer-table-card .table-wrap {
  max-height: 520px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: normal;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7fb;
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

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

tbody tr:hover td {
  background: #f8fbff;
}

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

.customer-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.customer-cell > div {
  min-width: 0;
}

.customer-cell strong {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-cell span {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.customer-table-card,
.customer-detail-card {
  min-height: 560px;
  padding: 20px;
}

.pagination-bar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.customer-pagination {
  justify-content: space-between;
}

.role-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
}

.role-form {
  display: grid;
  gap: 14px;
}

.role-table-wrap {
  max-height: 520px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 29, 55, 0.42);
}

.modal-card {
  width: min(420px, 100%);
  padding: 24px;
  display: grid;
  gap: 18px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(6, 29, 55, 0.28);
}

.modal-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.modal-fields {
  display: grid;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  padding: 36px;
  display: grid;
  place-items: center;
  background: rgba(8, 18, 32, 0.82);
}

.image-preview-modal img {
  max-width: min(96vw, 1280px);
  max-height: 92vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.image-preview-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.customer-detail-preview {
  padding: 16px;
  border: 2px solid #9cc9f0;
  border-radius: 18px;
  text-align: center;
}

.customer-detail-preview .customer-avatar,
.detail-avatar {
  width: 96px;
  height: 96px;
  margin: 6px auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #dce7f0, #f8fafc);
  color: var(--dark);
  font-size: 34px;
  font-weight: 950;
}

.customer-detail-preview h4 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.customer-detail-preview p {
  margin: 8px 0 16px;
  color: var(--muted);
}

.customer-detail-preview dl {
  margin: 0;
  display: grid;
  gap: 0;
  text-align: left;
}

.customer-detail-preview dl div {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
}

.customer-detail-preview dt {
  color: #111827;
  font-weight: 900;
}

.customer-detail-preview dd {
  margin: 0;
  color: #111827;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.detail-actions {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.value-layout {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 24px;
}

.value-query-card,
.value-result-card,
.card {
  padding: 28px;
}

.value-form-grid {
  display: grid;
  gap: 16px;
}

.value-actions {
  margin-top: 20px;
}

.value-result {
  display: grid;
  gap: 18px;
}

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

.value-summary div {
  padding: 18px;
  border-radius: 18px;
  background: #f8fafc;
}

.value-summary span {
  color: var(--muted);
  font-weight: 800;
}

.value-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  font-weight: 950;
}

.value-card-list {
  display: grid;
  gap: 16px;
}

.value-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
}

.value-card-head {
  gap: 12px;
}

.value-card-head div {
  display: grid;
  gap: 4px;
}

.value-company {
  margin: 16px 0;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(49, 130, 206, 0.12), rgba(37, 198, 191, 0.08));
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

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

.metrics-toolbar {
  margin-bottom: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.metrics-toolbar h3 {
  margin: 0;
  font-size: 16px;
}

.metrics-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metrics-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metrics-filters select,
.metrics-filters input {
  height: 34px;
}

.metrics-table-wrap table {
  min-width: 760px;
}

.full-card {
  grid-column: 1 / -1;
}

.fact-list,
.flow-list,
.api-grid {
  display: grid;
  gap: 14px;
}

.flow-list {
  margin: 0;
  padding: 0;
  counter-reset: flow;
  list-style: none;
}

.flow-list li {
  position: relative;
  min-height: 54px;
  padding: 16px 16px 16px 58px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: #26384c;
  font-weight: 800;
}

.flow-list li::before {
  counter-increment: flow;
  content: counter(flow);
  position: absolute;
  left: 16px;
  top: 13px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 950;
}

.api-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.api-grid code {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  color: var(--dark);
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  font-weight: 800;
}

.operation-result {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f8fafc;
  color: var(--muted);
}

.operation-result > span,
.operation-result > strong {
  display: block;
  padding: 16px;
}

.monitor-tabs button {
  min-width: 78px;
  min-height: 38px;
  border-radius: 12px;
  font-size: 14px;
}

.monitor-tabs select {
  margin-left: auto;
  width: 150px;
  height: 38px;
  border-radius: 12px;
  font-size: 13px;
}

.callback-toolbar {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.monitor-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.monitor-tabs select {
  width: 150px;
  margin-left: auto;
}

.pagination-bar {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-weight: 900;
}

.pagination-bar.customer-pagination {
  margin-top: 14px;
  justify-content: space-between;
}

.callback-monitor {
  display: grid;
  gap: 22px;
}

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

.callback-metric {
  position: relative;
  padding: 18px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.callback-metric::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.callback-metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.callback-metric strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 26px;
  font-weight: 950;
}

.callback-refresh-line {
  min-height: 34px;
  width: fit-content;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.callback-refresh-line strong {
  color: var(--text);
  font-weight: 950;
}

.callback-events {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.callback-event-card {
  border-bottom: 1px solid var(--line-soft);
  background: #ffffff;
}

.callback-event-head {
  min-height: 34px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 0.72fr 1.02fr 1.02fr 0.54fr 1.1fr 1.45fr 0.72fr;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.callback-event-card:last-child {
  border-bottom: 0;
}

.callback-event-summary {
  min-height: 60px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 0.72fr 1.02fr 1.02fr 0.54fr 1.1fr 1.45fr 0.72fr;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.callback-event-summary::-webkit-details-marker {
  display: none;
}

.callback-event-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-event-summary span {
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callback-source,
.callback-status {
  justify-self: start;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3550a8 !important;
  font-size: 11px;
  font-weight: 950;
}

.callback-source.api {
  background: #ecfeff;
  color: #087783 !important;
}

.callback-source.callback {
  background: #fef2f2;
  color: #b42318 !important;
}

.callback-status {
  background: #f0fdf4;
  color: #166534 !important;
}

.callback-message {
  margin: 0 22px 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fafc;
  color: #39485a;
}

.callback-field-grid,
.callback-payloads {
  margin: 0 22px 22px;
}

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

.callback-payloads section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.callback-payloads span {
  display: block;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 900;
}

.bar-list {
  display: grid;
  gap: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 42px;
  gap: 18px;
  align-items: center;
}

.bar-row span {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.bar-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3182ce, #25c6bf);
  box-shadow: 0 8px 18px rgba(49, 130, 206, 0.22);
}

.bar-row strong {
  color: var(--primary);
  font-size: 18px;
  font-weight: 950;
  text-align: right;
}

#workbenchPanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
}

#workbenchPanel > .owner-scope-tabs {
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #e7eaf4;
  border-radius: 0;
  background: #ffffff;
}

#workbenchPanel > .owner-scope-tabs button {
  min-width: 132px;
  min-height: 30px;
  padding: 0 14px;
}

#workbenchPanel > .owner-scope-tabs button:first-child {
  min-width: 108px;
}

#workbenchPanel > .workbench {
  height: auto;
  min-height: 0;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: visible;
}

.home-button::before,
.notice-button::before {
  content: "";
  position: static;
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 0;
  background-color: #59647d;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 17px 17px;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.home-button::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.2 12 4l9 7.2v8.3a1.5 1.5 0 0 1-1.5 1.5H15v-6H9v6H4.5A1.5 1.5 0 0 1 3 19.5v-8.3Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.2 12 4l9 7.2v8.3a1.5 1.5 0 0 1-1.5 1.5H15v-6H9v6H4.5A1.5 1.5 0 0 1 3 19.5v-8.3Z'/%3E%3C/svg%3E");
}

.notice-button::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22a2.4 2.4 0 0 0 2.25-1.6h-4.5A2.4 2.4 0 0 0 12 22Zm7-5-1.7-2.1V10a5.3 5.3 0 0 0-4-5.15V3a1.3 1.3 0 1 0-2.6 0v1.85a5.3 5.3 0 0 0-4 5.15v4.9L5 17v1.4h14V17Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22a2.4 2.4 0 0 0 2.25-1.6h-4.5A2.4 2.4 0 0 0 12 22Zm7-5-1.7-2.1V10a5.3 5.3 0 0 0-4-5.15V3a1.3 1.3 0 1 0-2.6 0v1.85a5.3 5.3 0 0 0-4 5.15v4.9L5 17v1.4h14V17Z'/%3E%3C/svg%3E");
}

.home-button::after {
  display: none;
}

.notice-button::after {
  right: 6px;
  top: 6px;
  width: 7px;
  height: 7px;
}

@media (max-width: 1500px) {
  html {
    min-width: 1040px;
  }

  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .nav-item {
    min-height: 52px;
    font-size: 15px;
  }

  .workspace-header,
  .panel-view {
    padding-left: 22px;
    padding-right: 22px;
  }

  .workbench {
    grid-template-columns: 300px minmax(390px, 1fr) 300px;
  }
}

@media (max-width: 1180px) {
  html {
    min-width: 0;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    min-height: auto;
    padding: 20px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    width: 100%;
    border-radius: 18px;
  }

  .workspace-header {
    height: auto;
    min-height: 96px;
    align-items: stretch;
    flex-direction: column;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .workspace-tools {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .global-search {
    width: min(100%, 560px);
  }

  .dashboard-metrics,
  .callback-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench,
  .customer-page-grid,
  .value-layout,
  .integration-grid,
  .metrics-grid {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .conversation-rows {
    max-height: 420px;
  }

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

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

@media (max-width: 760px) {
  .workspace-header,
  .panel-view {
    padding-left: 18px;
    padding-right: 18px;
  }

  .workspace-title {
    align-items: flex-start;
  }

  .workspace-header h2 {
    font-size: 24px;
  }

  .workspace-tools,
  .reply-actions,
  .monitor-tabs {
    flex-wrap: wrap;
  }

  .global-search {
    width: 100%;
  }

  .dashboard-metrics,
  .callback-metrics,
  .profile-summary,
  .profile-value-grid,
  .value-summary,
  .value-detail-grid,
  .callback-field-grid,
  .callback-payloads,
  .callback-toolbar,
  .callback-event-head,
  .api-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 94%;
  }

  .callback-event-head {
    display: none;
  }

  .callback-event-summary {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px;
  }
}

/* Dense console theme: compact customer-service workspace. */
:root {
  --primary: #4f6df5;
  --primary-strong: #3554e8;
  --primary-light: #eef1ff;
  --dark: #2f3652;
  --dark-2: #242b45;
  --dark-3: #1b2138;
  --page: #f3f4ff;
  --panel: #ffffff;
  --line: #dde2f0;
  --line-soft: #edf0f7;
  --text: #1d2433;
  --muted: #7a8497;
  --shadow: 0 8px 22px rgba(42, 48, 82, 0.07);
  --shadow-soft: 0 4px 14px rgba(42, 48, 82, 0.06);
  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

html {
  min-width: 1180px;
  background: #eef0ff;
}

body {
  background: #eef0ff;
  font-size: 13px;
}

input,
select,
textarea {
  min-height: 32px;
  border-radius: 7px;
}

textarea {
  min-height: 70px;
  padding: 9px 10px;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(79, 109, 245, 0.1);
}

.shell {
  min-height: 100vh;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 0;
  padding: 12px;
  background: #eef0ff;
}

.sidebar {
  height: calc(100vh - 24px);
  padding: 16px 10px 12px;
  gap: 14px;
  border: 1px solid #dfe3fb;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, #e9ebff 0%, #f3f5ff 100%);
  color: #30364a;
  box-shadow: none;
}

.sidebar::after {
  display: none;
}

.back-link {
  margin: 0 8px -2px;
  color: #7b83a0;
  font-size: 11px;
}

.brand {
  min-height: 46px;
  padding: 0 8px;
  gap: 8px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #695cff, #20c7de);
  color: #ffffff;
  font-size: 15px;
  box-shadow: 0 8px 16px rgba(79, 109, 245, 0.22);
}

.brand p {
  color: #66708e;
  font-size: 10px;
}

.brand h1 {
  margin-top: 1px;
  color: #1f2538;
  font-size: 15px;
}

.nav {
  gap: 3px;
}

.nav-item {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  gap: 8px;
  border-radius: 8px;
  color: #4b536a;
  font-size: 13px;
  font-weight: 900;
}

.nav-item::before {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 7px;
  background: rgba(79, 109, 245, 0.08);
  color: #59647d;
  font-size: 10px;
}

.nav-item.active,
.nav-item:hover {
  background: #ffffff;
  color: #24304f;
  box-shadow: inset 3px 0 0 var(--primary), 0 4px 12px rgba(42, 48, 82, 0.08);
  transform: none;
}

.nav-item.active::before,
.nav-item:hover::before {
  background: var(--primary-light);
  color: var(--primary-strong);
}

.side-card {
  margin: auto 6px 0;
  padding: 10px;
  gap: 8px;
  border: 1px solid #dfe3f4;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #30364a;
}

.side-card strong {
  font-size: 12px;
}

.side-card p {
  margin-top: 3px;
  color: #77829d;
  font-size: 11px;
  line-height: 1.45;
}

.status-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px rgba(22, 179, 107, 0.12);
}

.workspace {
  min-height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid #dfe3fb;
  border-left: 0;
  border-radius: 0 14px 14px 0;
  background: #ffffff;
}

.workspace-header {
  height: 52px;
  padding: 0 16px;
  gap: 12px;
  border-bottom-color: #e7eaf4;
  background: #ffffff;
  box-shadow: none;
}

.workspace-title {
  min-width: 180px;
  gap: 8px;
}

.workspace-title::before {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.workspace-header h2 {
  margin-top: 0;
  font-size: 15px;
  line-height: 1.1;
}

.kicker {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.workspace-tools {
  min-width: 0;
  gap: 8px;
}

.global-search {
  width: min(360px, 30vw);
}

.global-search input {
  height: 34px;
  padding-left: 36px;
  border-radius: 8px;
  font-size: 12px;
}

.global-search span {
  left: 13px;
}

.global-search span::before {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

.global-search span::after {
  left: 12px;
  top: 12px;
  width: 7px;
  height: 2px;
}

.icon-button,
.user-chip {
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
  box-shadow: none;
}

.user-chip {
  padding: 0 9px 0 4px;
  gap: 7px;
  font-size: 12px;
}

.user-avatar {
  width: 26px;
  height: 26px;
}

.user-dropdown {
  top: 38px;
  width: 134px;
  border-radius: 8px;
}

.panel-view {
  padding: 10px;
}

#workbenchPanel {
  min-height: calc(100vh - 76px);
  padding: 0;
}

.card,
.queue-panel,
.chat-panel,
.profile-panel {
  border-color: #e3e7f2;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.workbench {
  height: calc(100vh - 76px);
  grid-template-columns: 300px minmax(440px, 1fr) 300px;
  gap: 0;
}

.queue-panel,
.chat-panel,
.profile-panel {
  border-width: 0 1px 0 0;
}

.profile-panel {
  border-right: 0;
}

.toolbar {
  padding: 10px;
  gap: 8px;
  border-bottom-color: #e9edf5;
  background: #ffffff;
}

.toolbar input {
  height: 34px;
}

.segmented {
  padding: 2px;
  gap: 2px;
  border-radius: 8px;
  background: #f5f6fb;
}

.segmented button {
  min-height: 28px;
  border-radius: 6px;
  font-size: 12px;
}

.segmented button.active {
  background: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 3px 10px rgba(42, 48, 82, 0.08);
}

.filter-grid {
  gap: 6px;
}

.conversation-rows {
  background: #ffffff;
}

.conversation-row {
  min-height: 68px;
  padding: 9px 10px;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
}

.conversation-row:hover,
.conversation-row.active {
  background: #f0f2ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.conversation-row.has-unread {
  background: #fff4f4;
  box-shadow: inset 3px 0 0 rgba(242, 48, 48, 0.5);
}

.conversation-row.has-unread:hover,
.conversation-row.has-unread.active {
  background: #ffecec;
  box-shadow: inset 3px 0 0 var(--danger);
}

.conversation-row.has-unread::after {
  right: 10px;
  top: 35px;
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 4px rgba(242, 48, 48, 0.1);
}

.customer-avatar.small {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.customer-avatar.large {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.row-main strong {
  font-size: 13px;
}

.row-main span {
  font-size: 11px;
}

.row-preview {
  margin: 3px 0 5px;
  color: #596273;
  font-size: 12px;
  line-height: 1.35;
}

.row-meta {
  gap: 4px;
  font-size: 11px;
}

.badge,
.tag,
.priority,
.read-state,
.unread-badge,
.message-unread {
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
}

.chat-panel {
  grid-template-rows: 52px minmax(0, 1fr) auto;
}

.chat-head {
  padding: 7px 12px;
  gap: 8px;
}

.chat-title-line {
  gap: 9px;
}

.chat-head p {
  font-size: 11px;
}

.chat-head h3,
.panel-head h3 {
  font-size: 15px;
}

.chat-head h3 {
  margin-top: 1px;
  max-width: 280px;
}

.chat-head-actions,
.chat-tags {
  gap: 5px;
}

.message-stream {
  padding: 14px 18px 12px;
  background: #fbfcff;
  background-size: auto;
}

.message {
  max-width: 74%;
  margin-bottom: 10px;
}

.message.grouped {
  margin-top: 0;
}

.message.meta-hidden {
  margin-bottom: 8px;
}

.message-body {
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: none;
}

.message.inbound .message-body {
  border-top-left-radius: 4px;
  background: #f0f1f4;
}

.message.outbound .message-body {
  border-top-right-radius: 4px;
  background: #bcd9ff;
  color: #152238;
}

.message small {
  margin-top: 4px;
  font-size: 11px;
}

.message-image {
  max-width: 210px;
  max-height: 160px;
  border-radius: 8px;
}

.message-quote {
  min-width: 140px;
  margin-bottom: 6px;
  padding: 7px 9px 7px 11px;
  border-radius: 7px;
  font-size: 12px;
}

.chat-unread-jump,
.load-older-messages,
.scroll-latest {
  min-height: 28px;
  padding: 0 10px;
  box-shadow: 0 6px 14px rgba(42, 48, 82, 0.1);
}

.chat-unread-jump,
.load-older-messages {
  top: 10px;
}

.scroll-latest {
  right: 16px;
  bottom: 12px;
}

.reply-box {
  padding: 9px 12px 10px;
  background: #ffffff;
}

.reply-box textarea {
  min-height: 54px;
  border-radius: 8px;
  font-size: 13px;
}

.reply-actions {
  margin-top: 7px;
  gap: 6px;
}

.reply-actions select {
  max-width: 150px;
}

.file-action {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
}

.attachment-preview {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 8px;
}

.profile-panel {
  padding: 10px;
}

.panel-head {
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head span {
  font-size: 12px;
}

.panel-head .secondary-button {
  min-height: 30px;
}

.profile-summary {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.summary-item,
.profile-value-grid div,
.value-detail-grid div,
.callback-field-grid div,
.fact-list div {
  padding: 8px 9px;
  border-radius: 8px;
  background: #f8f9fd;
}

.summary-item span,
.profile-value-grid span,
.value-detail-grid span,
.callback-field-grid span,
.fact-list span {
  font-size: 11px;
}

.summary-item strong,
.profile-value-grid strong,
.value-detail-grid strong,
.callback-field-grid strong,
.fact-list strong {
  margin-top: 4px;
  font-size: 12px;
}

.profile-form {
  gap: 8px;
}

.profile-form fieldset {
  padding: 9px;
  gap: 8px;
  border-radius: 8px;
}

.profile-form legend {
  padding: 0 5px;
  font-size: 12px;
}

.profile-form label,
.value-form-grid label,
.callback-toolbar label {
  gap: 5px;
  font-size: 12px;
}

.profile-inline-actions,
.value-actions,
.ops-actions {
  gap: 7px;
}

.profile-value-data {
  min-height: 48px;
  padding: 9px;
  border-radius: 8px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: none;
}

.dashboard-metrics,
.callback-metrics {
  gap: 8px;
  margin-bottom: 10px;
}

.metric-card,
.callback-metric {
  min-height: 70px;
  padding: 11px 12px;
  border: 1px solid #e4e8f3;
  border-radius: 9px;
  box-shadow: none;
}

.metric-card::after,
.callback-metric::after {
  right: 12px;
  top: 12px;
  width: 6px;
  height: 6px;
}

.metric-card span,
.callback-metric span {
  font-size: 11px;
}

.metric-card strong,
.callback-metric strong {
  margin-top: 5px;
  font-size: 21px;
}

.metric-card small {
  margin-top: 2px;
  font-size: 11px;
}

.customer-page-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 10px;
}

.customer-table-card,
.customer-detail-card,
.value-query-card,
.value-result-card,
.card {
  min-height: auto;
  padding: 12px;
  border-radius: 9px;
}

.customer-table-card .table-wrap {
  max-height: calc(100vh - 210px);
}

.table-wrap {
  border-radius: 8px;
}

th,
td {
  padding: 8px 10px;
  font-size: 12px;
}

th {
  font-size: 12px;
}

.customer-cell {
  gap: 8px;
}

.customer-cell strong,
.customer-cell span {
  max-width: 160px;
}

.pagination-bar,
.pagination-bar.customer-pagination {
  margin-top: 8px;
  gap: 8px;
}

.customer-detail-preview {
  padding: 10px;
  border-width: 1px;
  border-radius: 9px;
}

.customer-detail-preview .customer-avatar,
.detail-avatar {
  width: 54px;
  height: 54px;
  margin: 2px auto 8px;
  font-size: 20px;
}

.customer-detail-preview h4 {
  font-size: 14px;
}

.customer-detail-preview p {
  margin: 4px 0 8px;
}

.customer-detail-preview dl div {
  padding: 8px 0;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 8px;
}

.detail-actions {
  margin-top: 12px;
  gap: 7px;
}

.value-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 10px;
}

.value-form-grid {
  gap: 9px;
}

.value-actions {
  margin-top: 10px;
}

.value-result,
.value-card-list,
.bar-list {
  gap: 9px;
}

.value-summary {
  gap: 8px;
}

.value-summary div,
.value-card,
.value-company {
  padding: 11px;
  border-radius: 9px;
}

.value-summary strong {
  margin-top: 4px;
  font-size: 19px;
}

.integration-grid,
.metrics-grid {
  gap: 10px;
}

.metrics-toolbar {
  padding: 10px 12px;
  gap: 10px;
}

.metrics-filters {
  gap: 6px;
}

.fact-list,
.flow-list,
.api-grid {
  gap: 8px;
}

.flow-list li {
  min-height: 42px;
  padding: 10px 12px 10px 44px;
  border-radius: 9px;
}

.flow-list li::before {
  left: 12px;
  top: 9px;
  width: 24px;
  height: 24px;
}

.api-grid code {
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
}

.operation-result {
  margin-top: 10px;
  border-radius: 9px;
}

.operation-result > span,
.operation-result > strong {
  padding: 10px;
}

.monitor-tabs {
  margin-bottom: 8px;
  gap: 6px;
}

.monitor-tabs button {
  min-width: 58px;
  min-height: 30px;
  border-radius: 8px;
  font-size: 12px;
}

.monitor-tabs select {
  width: 128px;
  height: 30px;
  border-radius: 8px;
}

.callback-toolbar {
  margin-bottom: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
}

.callback-monitor {
  gap: 10px;
}

.callback-events {
  border-radius: 9px;
}

.callback-event-head,
.callback-event-summary {
  min-height: 46px;
  padding: 0 10px;
  gap: 8px;
  font-size: 12px;
}

.callback-message {
  margin: 0 10px 10px;
  padding: 9px 10px;
  border-radius: 8px;
}

.callback-field-grid,
.callback-payloads {
  margin: 0 10px 10px;
}

.callback-payloads {
  gap: 8px;
}

.callback-payloads section {
  border-radius: 8px;
}

.callback-payloads span {
  padding: 9px 10px;
}

.profile-value-raw,
.raw-json {
  border-radius: 9px;
}

.profile-value-raw summary,
.raw-json summary {
  padding: 10px;
}

.profile-value-raw pre,
.raw-json pre,
.operation-result pre,
.callback-payloads pre {
  max-height: 260px;
  padding: 10px;
  font-size: 12px;
}

.bar-row {
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  gap: 10px;
}

.bar-row span,
.bar-row strong {
  font-size: 13px;
}

.bar-track {
  height: 10px;
}

.role-layout {
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 10px;
}

.modal-card {
  padding: 16px;
  gap: 12px;
  border-radius: 10px;
}

.empty-state,
.empty-chat {
  padding: 24px 16px;
}

.empty-state strong,
.empty-chat strong {
  font-size: 16px;
}

.empty-state p,
.empty-chat p {
  margin-top: 6px;
  line-height: 1.5;
}

/* Keep the consultation workspace locked to the viewport. */
#workbenchPanel {
  height: calc(100vh - 76px);
  min-height: 0;
  max-height: calc(100vh - 76px);
  overflow: hidden;
}

#workbenchPanel > .owner-scope-tabs {
  flex: 0 0 44px;
}

#workbenchPanel > .workbench {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.workbench,
.queue-panel,
.chat-panel,
.profile-panel,
.message-stream-wrap,
.message-stream,
.conversation-rows {
  min-height: 0;
}

.queue-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.conversation-rows,
.message-stream,
.profile-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (min-width: 1181px) {
  #workbenchPanel {
    height: calc(100vh - 76px);
    max-height: calc(100vh - 76px);
  }

  #workbenchPanel > .workbench {
    height: 100%;
    grid-template-columns: 300px minmax(440px, 1fr) 300px;
  }
}

@media (max-width: 1500px) {
  html {
    min-width: 1080px;
  }

  .shell {
    grid-template-columns: 146px minmax(0, 1fr);
  }

  .workbench {
    grid-template-columns: 280px minmax(400px, 1fr) 280px;
  }
}

@media (max-width: 1180px) {
  html {
    min-width: 0;
  }

  .shell {
    display: block;
    padding: 0;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 10px;
    border-radius: 0;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .workspace {
    min-height: auto;
    border: 0;
    border-radius: 0;
  }

  .workspace-header {
    height: auto;
    min-height: 58px;
    padding: 10px;
  }

  .workbench,
  .customer-page-grid,
  .value-layout,
  .integration-grid,
  .metrics-grid,
  .role-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .queue-panel,
  .chat-panel,
  .profile-panel {
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .conversation-rows {
    max-height: 360px;
  }
}

@media (max-width: 760px) {
  .workspace-header,
  .workspace-tools {
    align-items: stretch;
  }

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

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

  .workspace-header h2 {
    font-size: 16px;
  }

  .callback-toolbar,
  .callback-payloads,
  .api-grid,
  .value-summary {
    grid-template-columns: 1fr;
  }
}
