:root {
  color-scheme: light;
  --ink: #132a25;
  --muted: #66746f;
  --line: #e3e9e6;
  --soft: #f4f7f5;
  --paper: #ffffff;
  --green: #16836f;
  --green-dark: #0f6658;
  --green-soft: #e8f4f0;
  --lime: #c9f05c;
  --danger: #b44747;
  --shadow: 0 18px 55px rgba(16, 49, 41, 0.12);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

.policy-page {
  min-height: 100vh;
  margin: 0;
  background: #f5f7f8;
  color: #172126;
}

.policy-content {
  width: min(760px, calc(100% - 40px));
  margin: 48px auto;
  padding: 48px;
  border: 1px solid #dce4e7;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 45, 55, 0.08);
}

.policy-content h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.policy-content h2 {
  margin-top: 30px;
  font-size: 1.15rem;
}

.policy-content p {
  line-height: 1.75;
}

.policy-content a {
  color: #087c6d;
}

.policy-content .eyebrow {
  margin: 0;
  color: #087c6d;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .policy-content {
    width: calc(100% - 24px);
    margin: 12px auto;
    padding: 28px 22px;
    border-radius: 14px;
  }
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; color: var(--ink); background: var(--soft); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.55; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  color: #0b3c33;
  background: var(--lime);
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
.aud-logo { display: block; max-width: 100%; height: auto; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(38px, 6vw, 82px);
  color: #f5fffb;
  background:
    radial-gradient(circle at 83% 21%, rgba(201, 240, 92, .18), transparent 26%),
    linear-gradient(145deg, #0b2c25, #0c4a3e 64%, #0a372f);
}
.login-brand::after {
  position: absolute;
  right: -15%;
  bottom: -28%;
  width: 65%;
  aspect-ratio: 1;
  border: 1px solid rgba(201, 240, 92, .18);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 70px rgba(201, 240, 92, .035), 0 0 0 140px rgba(201, 240, 92, .025);
}
.login-aud-logo { position: relative; z-index: 1; width: min(270px, 72%); }
.login-brand .eyebrow { color: var(--lime); }
.login-brand h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.03;
}
.login-copy { max-width: 530px; margin: 28px 0 0; color: #b9d0c9; font-size: 17px; line-height: 1.7; }
.trust-row { z-index: 1; display: flex; gap: 14px; flex-wrap: wrap; }
.trust-row span { padding: 9px 14px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 999px; color: #cce0da; font-size: 12px; }
.login-panel { display: grid; padding: 30px; place-items: center; background: #f8faf9; }
.login-card { width: min(430px, 100%); padding: 44px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
.login-card > .muted { margin: 10px 0 28px; font-size: 14px; }
.login-method-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #f3f7f5; }
.login-method-toggle button { min-height: 38px; border: 0; border-radius: 8px; color: #60716c; background: transparent; font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.login-method-toggle button.active { color: var(--green-dark); background: var(--paper); box-shadow: 0 1px 3px rgba(14, 43, 36, .12); }
.mobile-brand { display: none; align-items: center; width: fit-content; margin-bottom: 32px; padding: 11px 14px; border-radius: 12px; background: #0d2923; }
.mobile-aud-logo { width: 154px; }
label { display: grid; gap: 8px; margin: 16px 0; color: #32453f; font-size: 13px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid #d7dfdb;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input, select { height: 44px; padding: 0 13px; }
textarea { padding: 12px 14px; resize: none; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 131, 111, .11); }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; border: 0; border-radius: 10px; font-weight: 750; transition: transform .15s, background .15s; }
.button:active { transform: translateY(1px); }
.button[aria-busy="true"] { cursor: wait; opacity: .72; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { border: 1px solid var(--line); color: var(--ink); background: white; }
.button.danger { color: white; background: var(--danger); }
.button.wide { width: 100%; justify-content: space-between; margin-top: 8px; }
.form-error { min-height: 18px; margin: 4px 0; color: var(--danger); font-size: 12px; }
.security-note { margin: 24px 0 0; color: #8a9692; font-size: 11px; line-height: 1.55; text-align: center; }
.otp-hint { margin: 4px 0 10px; color: var(--green-dark); font-size: 12px; line-height: 1.55; }
.otp-resend { display: block; margin: 14px auto 0; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 750; }
.otp-resend:hover { color: var(--green-dark); text-decoration: underline; }
#otpCode { font-size: 22px; font-weight: 750; letter-spacing: .28em; text-align: center; }
#loginPhone[readonly] { color: #65736e; background: #f1f5f3; }
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  width: 226px;
  flex: 0 0 226px;
  flex-direction: column;
  padding: 20px 14px 14px;
  color: #dce9e5;
  background: #0d2923;
}
.app-brand { display: flex; align-items: center; min-height: 62px; padding: 0 9px 25px; }
.sidebar-aud-logo { width: 172px; }
nav { display: grid; gap: 5px; }
.nav-item {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #98b2aa;
  background: transparent;
  text-align: left;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: #19463b; }
.nav-item b { margin-left: auto; padding: 2px 7px; border-radius: 10px; color: #15372f; background: var(--lime); font-size: 10px; }
.nav-icon { width: 18px; font-size: 17px; text-align: center; }
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 5px 15px;
  padding: 13px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
}
.sidebar-status > div { display: grid; gap: 3px; }
.sidebar-status strong { color: white; font-size: 11px; }
.sidebar-status span:last-child { color: #77978e; font-size: 9px; }
.status-dot, .sync-state i, .online-dot { width: 8px; height: 8px; border-radius: 50%; background: #d49c53; }
.status-dot.connected, .sync-state i, .online-dot { background: #45c58b; box-shadow: 0 0 0 3px rgba(69,197,139,.12); }
.profile-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 8px;
  border: 0;
  color: white;
  background: transparent;
  text-align: left;
}
.profile-button > span:nth-child(2) { display: grid; flex: 1; }
.profile-button small { color: #78978e; font-size: 10px; }
.profile-menu {
  position: absolute;
  right: 14px;
  bottom: 63px;
  left: 14px;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  color: white;
  background: #153b32;
  box-shadow: 0 16px 40px rgba(2,14,11,.32);
}
.profile-menu[hidden] { display: none; }
.profile-menu > span, .profile-menu > small { color: #93aca5; font-size: 10px; }
.profile-menu > strong { font-size: 13px; }
.profile-menu-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.profile-menu-meta span { padding: 4px 7px; border-radius: 10px; color: #cfe8e1; background: rgba(255,255,255,.07); font-size: 9px; }
.profile-menu button { padding: 9px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: white; background: rgba(255,255,255,.06); text-align: left; }
.avatar {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #215146;
  background: #d8eee7;
  font-size: 12px;
  font-weight: 800;
}
.avatar.large { width: 40px; height: 40px; border-radius: 13px; font-size: 14px; }
.avatar.xl { width: 64px; height: 64px; border-radius: 20px; font-size: 22px; }
.logout-link { border: 0; color: #78978e; background: transparent; font-size: 11px; }
.workspace {
  --inbox-list-width: 310px;
  --contact-panel-width: 300px;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.topbar h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.sync-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.sync-state i { display: inline-block; width: 7px; height: 7px; }
.mobile-menu { display: none; border: 0; background: transparent; }
.inbox-shell {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: var(--inbox-list-width) minmax(360px, 1fr) var(--contact-panel-width);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.stats-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}
.stats-row article { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; padding: 14px 22px; background: #fbfcfb; }
.stats-row article:first-child { padding-left: 28px; }
.stats-row span { color: var(--muted); font-size: 11px; }
.stats-row strong { font-size: 20px; }
.inbox-layout {
  display: grid;
  min-height: 0;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  overflow: hidden;
}
.conversation-panel { display: flex; min-height: 0; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); background: var(--paper); }
.search-wrap { position: relative; margin: 15px; }
.search-wrap span { position: absolute; top: 10px; left: 12px; color: #87938f; }
.search-wrap input { height: 39px; padding-left: 35px; border: 0; background: var(--soft); font-size: 12px; }
.filter-row { display: flex; align-items: center; gap: 7px; padding: 0 15px 11px; }
.filter-row > span { margin-left: auto; color: #8a9692; font-size: 10px; }
.chip { padding: 5px 10px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 10px; }
.chip.active { color: var(--green-dark); background: var(--green-soft); font-weight: 700; }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; }
.conversation-list .conversation-empty-state { position: relative; inset: auto; min-height: 240px; }
.conversation-item {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0,1fr) auto;
  gap: 10px;
  padding: 14px 15px;
  border: 0;
  border-top: 1px solid #f0f3f1;
  color: var(--ink);
  background: white;
  text-align: left;
}
.conversation-item:hover, .conversation-item.active { background: #f2f7f5; }
.conversation-item.active { box-shadow: inset 3px 0 var(--green); }
.conversation-copy { min-width: 0; }
.conversation-copy > div { display: flex; gap: 8px; align-items: center; }
.conversation-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy small, .conversation-copy p { overflow: hidden; color: #82908b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy p { margin: 7px 0 0; font-size: 11px; }
.conversation-meta { display: grid; align-content: start; justify-items: end; gap: 8px; color: #8b9793; font-size: 9px; }
.unread-badge { display: grid; min-width: 18px; height: 18px; place-items: center; border-radius: 9px; color: white; background: var(--green); font-size: 9px; }
.chat-panel { position: relative; min-width: 0; min-height: 0; background: #f7f9f8; }
.empty-state { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; padding: 30px; text-align: center; }
.empty-state h3 { margin: 16px 0 5px; font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.empty-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 18px; color: var(--green); background: var(--green-soft); font-size: 24px; }
.chat-content { display: flex; height: 100%; flex-direction: column; }
.chat-header { display: flex; min-height: 68px; align-items: center; gap: 11px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: white; }
.chat-header > div:nth-child(3) { display: grid; }
.chat-header strong { font-size: 13px; }
.chat-header span { color: #82908b; font-size: 10px; }
.online-dot { display: inline-block; width: 5px; height: 5px; margin-right: 5px; }
.chat-owner { display: flex; margin-left: auto; align-items: center; gap: 8px; }
.chat-owner select { width: 130px; height: 34px; font-size: 10px; }
.back-button { display: none; border: 0; background: transparent; }
.insight-mobile-button { display: none; min-height: 34px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--green-dark); background: white; font-size: 10px; font-weight: 750; }
.insight-mobile-button span { display: grid; min-width: 18px; height: 18px; place-items: center; border-radius: 9px; color: white; background: var(--green); font-size: 9px; }
.insight-mobile-button span.empty { color: var(--muted); background: #edf1ef; }
.messages { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 7px; overflow-y: auto; padding: 24px 5%; }
.conversation-loading { margin: auto; color: var(--muted); font-size: 12px; }
.message { display: grid; max-width: min(72%, 540px); gap: 5px; align-self: flex-start; }
.message.outbound { align-self: flex-end; justify-items: end; }
.message-bubble { padding: 10px 13px; border: 1px solid var(--line); border-radius: 4px 14px 14px; background: white; font-size: 12px; line-height: 1.55; box-shadow: 0 2px 4px rgba(24,55,47,.04); white-space: pre-wrap; }
.message.outbound .message-bubble { border-color: #cfe9e1; border-radius: 14px 4px 14px 14px; background: #dff3ec; }
.audio-message { display: grid; gap: 7px; min-width: min(250px, 65vw); white-space: normal; }
.audio-message strong { font-size: 10px; }
.audio-message audio { width: 100%; height: 32px; }
.message-meta { color: #8b9793; font-size: 8px; }
.composer { position: relative; display: flex; gap: 10px; padding: 13px 16px 28px; border-top: 1px solid var(--line); background: white; }
.composer textarea { min-height: 44px; max-height: 120px; border-radius: 12px; background: #f7f9f8; }
.send-button { width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 12px; color: white; background: var(--green); }
.composer p { position: absolute; right: 70px; bottom: 6px; margin: 0; color: #97a19e; font-size: 8px; }
.contact-panel { position: relative; min-height: 0; overflow-x: hidden; overflow-y: auto; border-left: 1px solid var(--line); background: white; }
.contact-panel-close { display: none; position: absolute; top: 10px; right: 12px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--muted); background: #f3f6f5; font-size: 22px; }
.contact-hero { display: grid; justify-items: center; padding: 28px 18px 22px; border-bottom: 1px solid var(--line); text-align: center; }
.contact-hero h3 { margin: 11px 0 3px; font-size: 14px; }
.contact-hero p { margin: 0 0 9px; color: var(--muted); font-size: 10px; }
.lifecycle { padding: 5px 9px; border-radius: 12px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 700; }
.contact-details { display: grid; gap: 18px; margin: 0; padding: 22px; }
.contact-details div { display: grid; gap: 4px; }
.contact-details dt { color: #8b9793; font-size: 9px; }
.contact-details dd { margin: 0; font-size: 11px; }
.editable-contact-field {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
}
.editable-contact-field > span { overflow: hidden; text-overflow: ellipsis; }
.editable-contact-field small { color: var(--green); font-size: 9px; font-weight: 700; white-space: nowrap; }
.editable-contact-field.missing { padding: 5px 8px; border-radius: 7px; color: var(--green-dark); background: var(--green-soft); }
.editable-contact-field:hover { color: var(--green); }
.editable-contact-field:focus-visible { border-radius: 6px; outline: 2px solid var(--green); outline-offset: 2px; }
.missing-contact-value { color: var(--green); font-weight: 700; }
.note-box { margin: 3px 15px; padding: 14px; border-radius: 10px; background: var(--soft); }
.note-box span { color: #85918d; font-size: 9px; }
.note-box p { margin: 7px 0 0; color: #4f625c; font-size: 10px; line-height: 1.55; }
.insight-panel { padding: 18px 15px 20px; border-bottom: 1px solid var(--line); }
.insight-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.insight-heading span { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.insight-heading h4 { margin: 4px 0 0; font-size: 14px; }
.insight-heading > b { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 13px; color: white; background: var(--green); font-size: 10px; }
.insight-summary { margin: 10px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.insight-list { display: grid; gap: 10px; }
.insight-card { padding: 12px; border: 1px solid #dce7e3; border-radius: 11px; background: #fbfdfc; }
.insight-card.confirmed { border-color: #e4e9e7; background: #f7f9f8; }
.insight-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.insight-card-heading span { color: var(--green-dark); font-size: 9px; font-weight: 800; }
.insight-card-heading small { color: var(--muted); font-size: 8px; }
.insight-card > strong { display: block; margin-top: 7px; font-size: 12px; overflow-wrap: anywhere; }
.insight-card blockquote { margin: 9px 0 0; padding: 8px 9px; border-left: 2px solid #badbd1; color: #5f706b; background: white; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.insight-card blockquote span { display: block; margin-bottom: 3px; color: #8a9894; font-size: 8px; font-weight: 750; }
.insight-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.insight-actions button { min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 9px; font-weight: 750; }
.insight-actions .confirm { border-color: var(--green); color: white; background: var(--green); }
.insight-empty { display: grid; gap: 5px; padding: 18px 12px; border: 1px dashed #d5dfdc; border-radius: 10px; color: var(--muted); text-align: center; }
.insight-empty strong { color: var(--ink); font-size: 11px; }
.insight-empty span { font-size: 9px; line-height: 1.45; }
.insight-rescan { width: 100%; min-height: 34px; margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--green-dark); background: white; font-size: 9px; font-weight: 750; }
.data-view { min-height: 0; flex: 1; overflow: auto; padding: 22px 28px; }
.customer-master-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.table-card, .user-management-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.user-management-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 24px 18px; border-bottom: 1px solid var(--line); }
.section-kicker { margin: 0 0 6px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.user-management-copy { margin: 0; color: var(--muted); font-size: 12px; }
.user-management-actions, .user-summary { display: flex; align-items: center; }
.user-management-actions { gap: 16px; }
.user-summary { gap: 14px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.user-summary span + span { padding-left: 14px; border-left: 1px solid var(--line); }
.user-summary b { margin-right: 3px; color: var(--ink); font-size: 14px; }
.user-filters { display: grid; grid-template-columns: minmax(240px, 1fr) 168px 150px; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.user-search-field { position: relative; }
.user-search-field > span { position: absolute; top: 11px; left: 12px; color: #84928d; font-size: 15px; }
.user-filters input, .user-filters select { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; color: var(--ink); background: white; }
.user-filters input { padding-left: 34px; }
.filter-select { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-select select { min-width: 0; }
.role-admin { background: #173e34; color: white; }
.role-channel_manager { background: #e8f3ed; color: #16745f; }
.role-sales_manager { background: #eaf1fb; color: #315f9c; }
.role-tender_manager { background: #f7efe3; color: #8a5e20; }
.user-table { table-layout: fixed; }
.user-col-member { width: 29%; }
.user-col-access { width: 20%; }
.user-col-assets { width: 19%; }
.user-col-login { width: 15%; }
.user-col-actions { width: 17%; }
.user-table th, .user-table td { vertical-align: middle; white-space: normal; }
.user-member strong, .user-assets strong { font-size: 12px; }
.user-access { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.user-table small { display: block; line-height: 1.45; }
.user-assets > strong, .user-login { display: block; color: var(--ink); font-weight: 750; }
.user-login { font-size: 11px; }
.user-login small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.user-actions .text-button { padding: 6px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; }
.user-actions .offboard-button { border-color: #f0d2d1; color: var(--danger); }
.table-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.table-heading h3 { margin: 0 0 4px; font-size: 16px; }
.table-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 20px; border-bottom: 1px solid #edf1ef; font-size: 11px; text-align: left; white-space: nowrap; }
th { color: #81908b; background: #fafbfa; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
td strong { display: block; margin-bottom: 3px; font-size: 12px; }
td small { color: var(--muted); }
.contact-identity small { display: block; line-height: 1.55; }
.customer-list-button { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.customer-row { transition: background .15s; }
.customer-row:hover, .customer-row.selected { background: #f2f7f5; }
.customer-row.selected { box-shadow: inset 3px 0 var(--green); }
.customer-list-button:focus-visible { border-radius: 4px; outline: 2px solid var(--green); outline-offset: 3px; }
.customer-master-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.customer-master-panel .contact-details { gap: 15px; padding: 20px 22px; }
.customer-master-panel .note-box { margin: 0 16px 16px; }
.customer-master-summary strong { display: inline; margin-right: 7px; color: var(--ink); font-size: inherit; }
.table-empty { height: 150px; color: var(--muted); text-align: center; }
.table-empty strong { color: var(--ink); font-size: 14px; }
.table-empty span { display: block; margin-top: 7px; font-size: 10px; }
.status-pill { padding: 5px 8px; border-radius: 10px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; }
.status-pill.inactive { color: #6b7572; background: #edf0ef; }
.text-button { border: 0; color: var(--danger); background: transparent; font-size: 10px; font-weight: 700; }
dialog { width: min(470px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 17px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(7,24,20,.54); backdrop-filter: blur(2px); }
.dialog-card { position: relative; padding: 28px; }
.dialog-card h3 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.dialog-close { position: absolute; top: 15px; right: 15px; border: 0; color: #84918d; background: transparent; font-size: 22px; }
.danger-icon { display: grid; width: 42px; height: 42px; margin-bottom: 18px; place-items: center; border-radius: 12px; color: var(--danger); background: #faeaea; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; padding: 12px 16px; border-radius: 10px; color: white; background: #123d33; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.compact-card { margin-top: 18px; }
.wide-dialog { width: min(720px, calc(100% - 30px)); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.form-grid .full-row { grid-column: 1 / -1; }
.dialog-card label { display: grid; gap: 6px; margin-top: 14px; color: var(--ink); font-size: 11px; font-weight: 700; }
.dialog-card input, .dialog-card select, .dialog-card textarea { width: 100%; border: 1px solid #d6dfdc; border-radius: 9px; padding: 9px 10px; color: var(--ink); background: #fff; font: inherit; font-size: 12px; }
.dialog-card textarea { resize: vertical; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 4px; padding: 11px; border: 1px solid #d6dfdc; border-radius: 9px; }
.checkbox-group legend { padding: 0 5px; color: var(--muted); font-size: 10px; }
.checkbox-group label { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12px; }
.checkbox-group input { width: auto; }
.note-box p + p { margin-top: 9px; }

@media (max-width: 1080px) {
  .workspace { --inbox-list-width: 290px; }
  .inbox-shell { grid-template-columns: var(--inbox-list-width) minmax(350px, 1fr); }
  .stats-row { grid-template-columns: var(--inbox-list-width) minmax(0, 1fr) minmax(180px, .55fr); }
  .insight-mobile-button { display: inline-flex; }
  .contact-panel { position: fixed; inset: 0 0 0 auto; z-index: 45; display: block; width: min(360px, calc(100vw - 24px)); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(14,43,35,.18); transform: translateX(105%); transition: transform .2s ease; }
  .contact-panel.open { transform: translateX(0); }
  .contact-panel-close { display: grid; place-items: center; }
  .customer-master-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 18px; }
  .login-card { padding: 30px 24px; }
  .mobile-brand { display: flex; }
  .app-shell { height: 100dvh; }
  .workspace { overflow-x: hidden; }
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .topbar { min-height: 72px; padding: 12px 16px; }
  .mobile-menu { display: inline-block; margin-right: 8px; }
  .topbar > div:first-child { display: flex; align-items: center; }
  .topbar .eyebrow { display: none; }
  .topbar h2 { font-size: 18px; }
  .sync-state, .topbar-actions .button { display: none; }
  .inbox-shell { display: flex; flex-direction: column; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-row article, .stats-row article:first-child { padding: 10px 13px; }
  .stats-row span { font-size: 9px; }
  .stats-row strong { font-size: 16px; }
  .inbox-layout { display: block; min-height: 0; flex: 1; }
  .conversation-panel { height: 100%; border: 0; }
  .conversation-list { height: calc(100dvh - 217px); }
  .chat-panel { position: absolute; inset: 72px 0 0; z-index: 5; display: none; }
  .chat-panel.mobile-open { display: block; }
  .chat-header { gap: 7px; padding-inline: 10px; }
  .chat-header > div:nth-child(3) { min-width: 0; }
  .chat-header > div:nth-child(3) strong, .chat-header > div:nth-child(3) span { display: block; max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-owner { display: none; }
  .insight-mobile-button { margin-left: auto; flex: 0 0 auto; }
  .back-button { display: inline-block; }
  .messages { padding: 20px 14px; }
  .message { max-width: 84%; }
  .data-view { padding: 14px; }
  .user-management-header { align-items: flex-start; flex-direction: column; padding: 20px 16px 16px; }
  .user-management-actions { width: 100%; align-items: flex-start; flex-direction: column; gap: 14px; }
  .user-summary { width: 100%; justify-content: space-between; gap: 8px; }
  .user-summary span + span { padding-left: 8px; }
  .user-management-actions .button { width: 100%; }
  .user-filters { grid-template-columns: 1fr; padding: 12px 14px; }
  .filter-select { grid-template-columns: 44px minmax(0, 1fr); }
  .user-management-card .table-scroll { overflow: visible; }
  .user-table, .user-table tbody { display: block; width: 100%; }
  .user-table { min-width: 0; }
  .user-table thead { display: none; }
  .user-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "member login"
      "access assets"
      "actions actions";
    gap: 10px 14px;
    padding: 16px 14px;
    border-bottom: 1px solid #edf1ef;
  }
  .user-table tr:last-child { border-bottom: 0; }
  .user-table td { min-width: 0; padding: 0; border: 0; }
  .user-table td:nth-child(1) { grid-area: member; }
  .user-table td:nth-child(2) { grid-area: access; }
  .user-table td:nth-child(3) { grid-area: assets; }
  .user-table td:nth-child(4) { grid-area: login; text-align: right; }
  .user-table td:nth-child(5) { grid-area: actions; }
  .user-table .user-member small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-table .user-access { margin: 0; }
  .user-table .user-assets { text-align: right; }
  .user-table .user-actions { padding-top: 2px; border-top: 1px solid #edf1ef; }
  .customer-master-layout { grid-template-columns: 1fr; }
  .customer-master-panel .contact-hero { padding: 36px 24px 30px; }
  .customer-master-panel .avatar.xl { width: 92px; height: 92px; border-radius: 28px; font-size: 28px; }
  .customer-master-panel .contact-hero h3 { margin: 16px 0 5px; font-size: 24px; }
  .customer-master-panel .contact-hero p { margin-bottom: 14px; font-size: 15px; }
  .customer-master-panel .lifecycle { padding: 7px 12px; border-radius: 15px; font-size: 12px; }
  .customer-master-panel .contact-details { gap: 26px; padding: 30px 38px; }
  .customer-master-panel .contact-details dt { font-size: 14px; }
  .customer-master-panel .contact-details dd { font-size: 19px; line-height: 1.45; white-space: normal; }
  .customer-master-panel .note-box { margin: 0 30px 30px; padding: 22px; border-radius: 16px; }
  .customer-master-panel .note-box span { font-size: 15px; }
  .customer-master-panel .note-box p { margin-top: 14px; font-size: 17px; line-height: 1.6; }
  .customer-master-summary strong { margin-right: 9px; font-size: 17px; }
  th, td { padding: 12px 14px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Supplied AUD CRM workspace visual system. The existing IDs and data bindings
   remain unchanged so every screen continues to use the live CRM APIs. */
:root {
  --ink: #132a25;
  --green: #16836f;
  --green-dark: #0f6658;
  --green-soft: #e8f4f0;
  --soft: #f4f7f5;
  --line: #e3e9e6;
  --paper: #ffffff;
  --muted: #66746f;
  --lime: #c9f05c;
  --shadow: 0 14px 36px rgba(20, 47, 39, .08);
}

body {
  min-width: 320px;
  color: var(--ink);
  background: var(--soft);
  font-family: "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell { min-height: 100dvh; height: 100dvh; background: var(--soft); }
.sidebar {
  width: 236px;
  flex-basis: 236px;
  padding: 22px 16px 16px;
  color: #dbe8e3;
  background: #0c211c;
}
.app-brand { padding: 2px 8px 26px; }
.sidebar-aud-logo { width: 150px; max-width: 100%; }
nav { gap: 2px; }
.nav-item {
  height: 44px;
  gap: 12px;
  padding: 0 12px;
  border-radius: 10px;
  color: #9db3ac;
  font-size: 14px;
  font-weight: 600;
}
.nav-item:hover { color: white; background: #12302a; }
.nav-item.active { color: white; background: #164034; box-shadow: inset -3px 0 var(--lime); }
.nav-item.active .nav-icon { color: var(--lime); }
.nav-icon { width: 18px; color: inherit; font-size: 14px; }
.nav-item b { min-width: 20px; padding: 2px 6px; color: white; background: var(--green); }
.sidebar-status {
  margin: auto 0 10px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: #12302a;
}
.sidebar-status strong { font-size: 13px; letter-spacing: .2px; }
.sidebar-status span:last-child { color: #8ea69e; font-size: 11px; }
.profile-button {
  padding: 10px 12px;
  border: 1px solid #1d3f37;
  border-radius: 12px;
}
.profile-button:hover { background: #12302a; }
.profile-button small, .logout-link { color: #8ea69e; }
.profile-menu { right: 16px; bottom: 72px; left: 16px; border-color: #1d3f37; border-radius: 12px; background: #12302a; }
.logout-link { margin-top: 8px; padding: 9px 12px; text-align: left; }

.workspace { overflow: hidden auto; background: var(--soft); }
.topbar {
  min-height: 76px;
  height: 76px;
  padding: 0 28px;
  border-bottom-color: var(--line);
  background: var(--paper);
}
.topbar h2 { margin-top: 3px; color: var(--ink); font-size: 23px; font-weight: 900; letter-spacing: -.3px; }
.topbar .eyebrow { margin: 0; color: var(--green); font-size: 11px; letter-spacing: 1.6px; }
.view-description { margin: 2px 0 0; font-size: 11px; }
.topbar-actions { gap: 12px; }
.sync-state { padding: 7px 12px; border-radius: 20px; color: #4a5e58; background: var(--soft); font-size: 12px; font-weight: 600; }
.sync-state i { width: 7px; height: 7px; }
.topbar-actions .button.primary {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(22, 131, 111, .25);
  font-size: 13px;
}

.inbox-shell { display: flex; min-height: 0; flex: 1; flex-direction: column; padding: 0; }
.stats-row { display: none; }
.inbox-layout { grid-template-columns: 318px minmax(360px, 1fr) 282px; min-height: 0; flex: 1; background: var(--soft); }
.conversation-panel { border-right-color: var(--line); background: var(--paper); }
.search-wrap { margin: 16px 16px 12px; }
.search-wrap span { top: 10px; color: #8b9a95; }
.search-wrap input {
  height: 40px;
  border: 1px solid #e8edea;
  border-radius: 10px;
  background: var(--soft);
  font-size: 13px;
}
.filter-row { gap: 6px; padding: 0 16px 12px; }
.filter-row > span { display: none; }
.chip { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.chip.active { color: var(--green-dark); background: var(--green-soft); }
.conversation-list { height: auto; padding: 0 10px 12px; }
.conversation-item { gap: 11px; padding: 12px 10px; border: 0; border-radius: 12px; background: transparent; }
.conversation-item:hover, .conversation-item.active { background: var(--soft); box-shadow: none; }
.conversation-item.active { border: 1px solid #cfe7df; background: var(--green-soft); }
.conversation-item .avatar { width: 38px; height: 38px; border-radius: 11px; color: var(--lime); background: #0c211c; }
.conversation-copy > div { gap: 8px; }
.conversation-copy strong { font-size: 13.5px; }
.conversation-copy p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.conversation-meta { gap: 4px; color: #8b9a95; font-size: 11px; }
.conversation-tags { display: flex; gap: 6px; margin-top: 7px; overflow: hidden; }
.conversation-tags span { overflow: hidden; padding: 2px 7px; border-radius: 6px; color: #4a5e58; background: #f0f3f1; font-size: 10.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge { min-width: 18px; height: 18px; background: var(--green); }

.chat-panel { background: var(--soft); }
.empty-state { color: var(--ink); }
.empty-icon { color: var(--green-dark); background: var(--green-soft); }
.chat-header { min-height: 64px; padding: 0 22px; border-bottom-color: var(--line); }
.chat-header .avatar { width: 36px; height: 36px; border-radius: 10px; color: var(--lime); background: #0c211c; }
.chat-header strong { font-size: 14px; }
.chat-owner select { border-color: #e3e9e6; border-radius: 8px; }
.messages { padding: 24px 6%; }
.message { max-width: min(72%, 560px); }
.message-bubble { border-color: #e3e9e6; border-radius: 4px 14px 14px; box-shadow: 0 2px 6px rgba(20, 47, 39, .04); }
.message.outbound .message-bubble { border-color: #cfe7df; background: var(--green-soft); }
.composer { padding: 13px 22px 24px; border-top-color: var(--line); }
.composer textarea { border: 1px solid #e3e9e6; border-radius: 10px; background: var(--paper); }
.send-button { border-radius: 10px; background: var(--green); }

.contact-panel { border-left-color: var(--line); background: var(--paper); }
.contact-hero { padding: 24px 18px 20px; border-bottom-color: var(--line); }
.contact-hero .avatar { color: var(--lime); background: #0c211c; }
.contact-hero h3 { font-size: 15px; }
.contact-details { gap: 16px; padding: 20px; }
.contact-details dt { color: #8b9a95; font-size: 10px; }
.contact-details dd { font-size: 12px; }
.note-box { border-radius: 10px; background: var(--soft); }

.data-view { padding: 24px 28px 32px; }
.table-card, .customer-master-panel, .user-directory, .user-role-guide {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(20, 47, 39, .035);
}
.table-heading { padding: 18px 20px; border-bottom-color: var(--line); }
.table-heading h3 { font-size: 17px; }
.table-heading p { color: var(--muted); font-size: 12px; }
th, td { padding: 14px 16px; border-bottom-color: #edf1ef; font-size: 12px; }
th { color: #8b9a95; background: #fbfcfb; font-size: 10px; }
td strong { font-size: 12px; }
.status-pill { border-radius: 6px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; }
.button.secondary { border-color: #e3e9e6; }

.workspace[data-view="team"] { background: var(--soft); }
.workspace[data-view="team"] .topbar { min-height: 76px; height: 76px; padding: 0 28px; }
.workspace[data-view="team"] .topbar .eyebrow,
.workspace[data-view="team"] .sync-state { display: flex; }
.workspace[data-view="team"] .data-view { padding: 24px 28px 32px; }
.workspace[data-view="team"] .user-management-card { background: transparent; }
.workspace[data-view="team"] .user-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(20, 47, 39, .035);
}
.workspace[data-view="team"] .user-summary span,
.workspace[data-view="team"] .user-summary span + span { min-height: 88px; align-items: flex-start; justify-content: center; gap: 5px; padding: 18px; border: 0; border-left: 1px solid var(--line); }
.workspace[data-view="team"] .user-summary span:first-child { border-left: 0; }
.workspace[data-view="team"] .user-summary small { color: #66746f; font-size: 11px; }
.workspace[data-view="team"] .user-summary b { font-size: 24px; }
.workspace[data-view="team"] .user-management-body { grid-template-columns: minmax(0, 1fr) 262px; gap: 18px; padding: 20px 0 0; }
.workspace[data-view="team"] .user-directory { overflow: hidden; }
.workspace[data-view="team"] .user-filters { grid-template-columns: minmax(240px, 1fr) 160px 150px; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.workspace[data-view="team"] .user-search-field,
.workspace[data-view="team"] .filter-select { margin: 0; }
.workspace[data-view="team"] .filter-select { display: grid; }
.workspace[data-view="team"] .filter-select > span { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.workspace[data-view="team"] .user-filters input,
.workspace[data-view="team"] .user-filters select { min-height: 40px; border-color: #e3e9e6; border-radius: 8px; background: var(--paper); font-size: 12px; }
.workspace[data-view="team"] .user-table th { padding: 12px 16px; color: #8b9a95; background: #fbfcfb; font-size: 10px; }
.workspace[data-view="team"] .user-table td { height: 64px; padding: 12px 16px; font-size: 12px; }
.workspace[data-view="team"] .user-member strong { font-size: 12px; }
.workspace[data-view="team"] .user-member small { font-size: 10px; }
.workspace[data-view="team"] .role-admin,
.workspace[data-view="team"] .role-channel_manager,
.workspace[data-view="team"] .role-sales_manager,
.workspace[data-view="team"] .role-tender_manager { padding: 4px 7px; border-radius: 6px; font-size: 10px; }
.workspace[data-view="team"] .user-role-guide { padding: 18px; }
.workspace[data-view="team"] .user-role-guide dl div { padding: 12px; border: 1px solid #edf1ef; border-radius: 10px; background: #fbfcfb; }

dialog { border-radius: 16px; box-shadow: 0 24px 60px rgba(12, 33, 28, .22); }
.dialog-card { padding: 28px; }

@media (max-width: 1240px) {
  .inbox-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .contact-panel { border-left-color: var(--line); }
  .workspace[data-view="team"] .user-management-body { grid-template-columns: 1fr; }
  .workspace[data-view="team"] .user-role-guide { display: none; }
}

@media (max-width: 760px) {
  .sidebar { width: 236px; }
  .topbar, .workspace[data-view="team"] .topbar { min-height: 72px; height: 72px; padding: 0 16px; }
  .topbar h2 { font-size: 19px; }
  .topbar .eyebrow, .view-description, .sync-state, .topbar-actions { display: none !important; }
  .inbox-layout { display: block; }
  .conversation-panel { height: 100%; }
  .conversation-list { height: calc(100dvh - 196px); }
  .chat-panel { inset: 72px 0 0; }
  .data-view, .workspace[data-view="team"] .data-view { padding: 14px; }
  .workspace[data-view="team"] .user-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace[data-view="team"] .user-summary span,
  .workspace[data-view="team"] .user-summary span + span { min-height: 70px; padding: 12px 9px; }
  .workspace[data-view="team"] .user-summary span:nth-child(3n + 1) { border-left: 0; }
  .workspace[data-view="team"] .user-summary span:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .workspace[data-view="team"] .user-management-body { padding-top: 14px; }
  .workspace[data-view="team"] .user-filters { grid-template-columns: 1fr; padding: 12px 14px 14px; }
  .workspace[data-view="team"] .user-table td { height: auto; }
}

/* Focused inbox and account directory redesign. */
.topbar {
  min-height: 82px;
  padding: 15px 30px;
}
.topbar h2 { font-size: 25px; }
.topbar-actions { min-width: 118px; justify-content: flex-end; }

.inbox-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 14px 20px 20px;
  background: #f5f8f6;
  overflow: hidden;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  background: transparent;
}
.stats-row article,
.stats-row article:first-child {
  min-height: 64px;
  align-items: center;
  padding: 12px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.stats-row span { font-size: 11px; font-weight: 650; }
.stats-row strong { font-size: 23px; letter-spacing: -.04em; }
.inbox-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(270px, 310px) minmax(440px, 1fr) minmax(270px, 310px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  overflow: hidden;
}
.conversation-panel { border-right: 1px solid var(--line); }
.search-wrap { margin: 16px 16px 10px; }
.search-wrap input { height: 40px; border: 1px solid transparent; border-radius: 10px; }
.search-wrap input:focus { border-color: var(--green); }
.filter-row { min-height: 38px; padding: 0 16px 12px; }
.filter-row > span { font-size: 10px; }
.chip { padding: 6px 10px; }
.conversation-item { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 14px 16px; }
.conversation-item.active { box-shadow: inset 3px 0 var(--green); }
.chat-panel { background: #f7faf8; }
.chat-header { min-height: 72px; padding: 12px 18px; }
.chat-header strong { font-size: 14px; }
.messages { gap: 11px; padding: 28px clamp(22px, 6%, 72px); }
.message-bubble { padding: 11px 14px; border-radius: 6px 15px 15px; font-size: 12px; }
.message.outbound .message-bubble { border-radius: 15px 6px 15px 15px; }
.composer { padding: 14px 18px 27px; }
.contact-panel { border-left: 1px solid var(--line); }
.contact-hero {
  grid-template-columns: 52px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  gap: 0 12px;
  padding: 19px 18px;
  text-align: left;
}
.contact-hero .avatar { grid-row: span 3; }
.contact-hero h3 { margin: 0; font-size: 15px; }
.contact-hero p { margin: 3px 0 7px; }
.contact-hero .lifecycle { padding: 4px 8px; }
.insight-panel { padding: 18px; }
.contact-details { gap: 15px; padding: 18px; }
.note-box { margin: 3px 18px 18px; }

.user-management-card { border-radius: 16px; box-shadow: 0 10px 26px rgba(17, 48, 39, .04); }
.user-management-header { min-height: 106px; padding: 22px 26px; }
.user-management-header h3 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.025em; }
.user-management-copy { font-size: 12px; }
.user-management-actions { gap: 12px; }
.user-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}
.user-summary span,
.user-summary span + span {
  display: grid;
  min-height: 78px;
  align-content: center;
  gap: 4px;
  padding: 0 18px;
  border: 0;
  border-left: 1px solid var(--line);
  white-space: normal;
}
.user-summary span:first-child { padding-left: 0; border-left: 0; }
.user-summary small { color: var(--muted); font-size: 10px; font-weight: 650; }
.user-summary b { margin: 0; color: var(--ink); font-size: 20px; letter-spacing: -.03em; }
.user-management-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; min-height: 0; }
.user-directory { min-width: 0; }
.user-filters { grid-template-columns: minmax(220px, 1fr) 170px 150px; gap: 12px; padding: 16px 20px; background: var(--paper); }
.user-filters input, .user-filters select { min-height: 42px; border-radius: 10px; }
.filter-select { grid-template-columns: 1fr; gap: 5px; }
.filter-select > span { padding-left: 1px; }
.user-table { table-layout: fixed; }
.user-col-member { width: 23%; }
.user-col-access { width: 18%; }
.user-col-phone { width: 17%; }
.user-col-assets { width: 14%; }
.user-col-login { width: 16%; }
.user-col-actions { width: 12%; }
.user-table th { padding: 12px 16px; background: #fafcfb; }
.user-table td { padding: 15px 16px; }
.user-member strong { font-size: 12px; }
.user-phone { color: var(--ink); font-size: 11px; font-weight: 700; }
.user-phone small { margin-top: 4px; font-size: 9px; font-weight: 400; }
.user-actions { gap: 5px; }
.user-actions .text-button { padding: 6px 7px; font-size: 9px; }
.user-role-guide { padding: 21px 18px; border-left: 1px solid var(--line); background: #fbfcfb; }
.user-role-guide h4 { margin: 0 0 18px; font-size: 14px; }
.user-role-guide dl { display: grid; gap: 12px; margin: 0; }
.user-role-guide dl div { padding: 12px; border: 1px solid #e7eeeb; border-radius: 10px; background: var(--paper); }
.user-role-guide dt { margin-bottom: 5px; color: var(--green-dark); font-size: 11px; font-weight: 800; }
.user-role-guide dd { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

@media (max-width: 1240px) {
  .inbox-layout { grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); }
  .contact-panel { position: fixed; inset: 0 0 0 auto; z-index: 45; width: min(360px, calc(100vw - 24px)); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(14,43,35,.18); transform: translateX(105%); transition: transform .2s ease; }
  .contact-panel.open { transform: translateX(0); }
  .contact-panel-close { display: grid; place-items: center; }
  .insight-mobile-button { display: inline-flex; }
  .user-management-body { grid-template-columns: 1fr; }
  .user-role-guide { display: none; }
}

@media (max-width: 760px) {
  .topbar { min-height: 72px; padding: 12px 16px; }
  .topbar-actions { min-width: 0; }
  .inbox-shell { gap: 8px; padding: 8px 10px 10px; }
  .stats-row { gap: 7px; }
  .stats-row article,
  .stats-row article:first-child { min-height: 58px; padding: 9px 10px; border-radius: 10px; }
  .stats-row strong { font-size: 18px; }
  .inbox-layout { display: block; border-radius: 12px; }
  .conversation-panel { height: 100%; border: 0; }
  .conversation-list { height: calc(100dvh - 226px); }
  .chat-panel { inset: 72px 0 0; }
  .user-management-header { padding: 20px 16px; }
  .user-management-actions { width: 100%; }
  .user-management-actions .button { width: 100%; }
  .user-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 16px; }
  .user-summary span,
  .user-summary span + span { min-height: 66px; padding: 0 9px; border-left: 1px solid var(--line); }
  .user-summary span:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  .user-summary span:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .user-summary b { font-size: 18px; }
  .user-filters { grid-template-columns: 1fr; padding: 14px; }
  .filter-select { grid-template-columns: 44px minmax(0, 1fr); align-items: center; }
  .user-table tr { grid-template-areas: "member login" "access phone" "assets assets" "actions actions"; }
  .user-table td:nth-child(1) { grid-area: member; }
  .user-table td:nth-child(2) { grid-area: access; }
  .user-table td:nth-child(3) { grid-area: phone; text-align: right; }
  .user-table td:nth-child(4) { grid-area: assets; text-align: left; }
  .user-table td:nth-child(5) { grid-area: login; text-align: right; }
  .user-table td:nth-child(6) { grid-area: actions; }
  .user-table .user-assets { text-align: left; }
}

/* Account directory: source-aligned desktop composition. */
.view-description { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.workspace[data-view="team"] { background: #f7f9f8; }
.workspace[data-view="team"] .topbar { min-height: 130px; padding: 24px 34px; }
.workspace[data-view="team"] .topbar h2 { font-size: 25px; }
.workspace[data-view="team"] .topbar .eyebrow,
.workspace[data-view="team"] .sync-state { display: none; }
.workspace[data-view="team"] .topbar-actions { min-width: auto; }
.workspace[data-view="team"] .topbar-actions .button { min-width: 144px; min-height: 54px; border-radius: 12px; font-size: 15px; }
.workspace[data-view="team"] .data-view { padding: 0; overflow: hidden auto; }
.workspace[data-view="team"] .user-management-card { min-height: 100%; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.workspace[data-view="team"] .user-summary { padding: 0 34px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.workspace[data-view="team"] .user-summary span,
.workspace[data-view="team"] .user-summary span + span { min-height: 108px; gap: 6px; padding: 0 26px; }
.workspace[data-view="team"] .user-summary span:first-child { padding-left: 6px; }
.workspace[data-view="team"] .user-summary small { font-size: 11px; font-weight: 700; }
.workspace[data-view="team"] .user-summary b { font-size: 24px; }
.workspace[data-view="team"] .user-management-body { grid-template-columns: minmax(0, 1fr) 262px; gap: 18px; padding: 26px 34px 30px; }
.workspace[data-view="team"] .user-directory { overflow: hidden; border: 1px solid #e3eae7; border-radius: 11px; background: var(--paper); }
.workspace[data-view="team"] .user-filters { grid-template-columns: minmax(280px, 1fr) 168px 168px; gap: 20px; padding: 0; border: 0; background: transparent; }
.workspace[data-view="team"] .user-search-field,
.workspace[data-view="team"] .filter-select { margin: 16px 0; }
.workspace[data-view="team"] .user-search-field { margin-left: 16px; }
.workspace[data-view="team"] .filter-select { display: block; }
.workspace[data-view="team"] .filter-select > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.workspace[data-view="team"] .user-filters input,
.workspace[data-view="team"] .user-filters select { min-height: 42px; border-color: #dfe7e3; border-radius: 8px; font-size: 11px; }
.workspace[data-view="team"] .user-table th { padding: 13px 16px; color: #7b8985; background: #fbfcfb; font-size: 9px; }
.workspace[data-view="team"] .user-table td { height: 62px; padding: 11px 16px; font-size: 11px; }
.workspace[data-view="team"] .user-col-member { width: 28%; }
.workspace[data-view="team"] .user-col-role { width: 13%; }
.workspace[data-view="team"] .user-col-status { width: 9%; }
.workspace[data-view="team"] .user-col-phone { width: 17%; }
.workspace[data-view="team"] .user-col-assets { width: 10%; }
.workspace[data-view="team"] .user-col-login { width: 16%; }
.workspace[data-view="team"] .user-col-actions { width: 7%; }
.workspace[data-view="team"] .user-member strong { margin-bottom: 4px; font-size: 11px; }
.workspace[data-view="team"] .user-member small { font-size: 9px; }
.workspace[data-view="team"] .role-admin,
.workspace[data-view="team"] .role-channel_manager,
.workspace[data-view="team"] .role-sales_manager,
.workspace[data-view="team"] .role-tender_manager { display: inline-block; padding: 4px 7px; border-radius: 4px; font-size: 9px; }
.workspace[data-view="team"] .role-admin { color: #357948; background: #edf8ee; }
.workspace[data-view="team"] .user-status { display: inline-flex; align-items: center; gap: 7px; color: #21463c; font-size: 10px; }
.workspace[data-view="team"] .user-status i { width: 7px; height: 7px; border-radius: 50%; background: #16a368; }
.workspace[data-view="team"] .user-status.inactive { color: #69746f; }
.workspace[data-view="team"] .user-status.inactive i { background: #a7b0ad; }
.workspace[data-view="team"] .user-phone { color: #1d4b41; font-weight: 650; }
.workspace[data-view="team"] .user-assets strong { display: inline; margin: 0; font-size: 11px; }
.workspace[data-view="team"] .user-assets small { display: none; }
.workspace[data-view="team"] .user-login { font-size: 10px; font-weight: 500; }
.workspace[data-view="team"] .user-action-menu { position: relative; }
.workspace[data-view="team"] .user-action-menu summary { width: 28px; padding: 4px 2px; border: 0; color: #183930; background: transparent; font-size: 15px; font-weight: 800; letter-spacing: 1px; list-style: none; }
.workspace[data-view="team"] .user-action-menu summary::-webkit-details-marker { display: none; }
.workspace[data-view="team"] .user-action-menu[open] .user-actions { position: absolute; z-index: 12; top: 26px; right: 0; display: grid; width: 116px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); box-shadow: 0 12px 28px rgba(14, 43, 35, .14); }
.workspace[data-view="team"] .user-action-menu:not([open]) .user-actions { display: none; }
.workspace[data-view="team"] .user-actions .text-button { width: 100%; padding: 7px; border: 0; border-radius: 6px; color: var(--ink); background: transparent; text-align: left; }
.workspace[data-view="team"] .user-actions .text-button:hover { background: var(--soft); }
.workspace[data-view="team"] .user-actions .offboard-button { color: var(--danger); }
.workspace[data-view="team"] .user-role-guide { align-self: start; padding: 19px 16px; border: 1px solid #e3eae7; border-radius: 11px; background: var(--paper); }
.workspace[data-view="team"] .user-role-guide h4 { margin: 0 0 16px; font-size: 14px; }
.workspace[data-view="team"] .user-role-guide dl { gap: 8px; }
.workspace[data-view="team"] .user-role-guide dl div { padding: 11px 12px; border: 0; border-radius: 9px; background: #fbfcfb; }

@media (max-width: 1240px) {
  .workspace[data-view="team"] .user-management-body { grid-template-columns: 1fr; }
  .workspace[data-view="team"] .user-role-guide { display: none; }
  .workspace[data-view="team"] .user-filters { grid-template-columns: minmax(240px, 1fr) 160px 160px; }
}

@media (max-width: 760px) {
  .workspace[data-view="team"] .topbar { min-height: 76px; padding: 12px 16px; }
  .workspace[data-view="team"] .topbar h2 { font-size: 19px; }
  .workspace[data-view="team"] .view-description,
  .workspace[data-view="team"] .topbar-actions { display: none; }
  .workspace[data-view="team"] .user-summary { padding: 0 16px; }
  .workspace[data-view="team"] .user-summary span,
  .workspace[data-view="team"] .user-summary span + span { min-height: 64px; padding: 0 9px; }
  .workspace[data-view="team"] .user-management-body { padding: 14px; }
  .workspace[data-view="team"] .user-filters { grid-template-columns: 1fr; gap: 0; padding: 0 14px 10px; }
  .workspace[data-view="team"] .user-search-field,
  .workspace[data-view="team"] .filter-select { margin: 10px 0 0; }
  .workspace[data-view="team"] .user-search-field { margin-left: 0; }
  .workspace[data-view="team"] .filter-select > span { position: static; width: auto; height: auto; clip: auto; }
  .workspace[data-view="team"] .user-table tr { grid-template-areas: "member login" "role status" "phone assets" "actions actions"; }
  .workspace[data-view="team"] .user-table td:nth-child(1) { grid-area: member; }
  .workspace[data-view="team"] .user-table td:nth-child(2) { grid-area: role; }
  .workspace[data-view="team"] .user-table td:nth-child(3) { grid-area: status; text-align: right; }
  .workspace[data-view="team"] .user-table td:nth-child(4) { grid-area: phone; text-align: left; }
  .workspace[data-view="team"] .user-table td:nth-child(5) { grid-area: assets; text-align: right; }
  .workspace[data-view="team"] .user-table td:nth-child(6) { grid-area: login; text-align: right; }
  .workspace[data-view="team"] .user-table td:nth-child(7) { grid-area: actions; }
}

/* Final precedence for the supplied standalone workspace composition. */
.topbar { min-height: 76px; height: 76px; padding: 0 28px; }
.topbar h2 { font-size: 23px; }
.inbox-shell { gap: 0; padding: 0; background: var(--soft); }
.stats-row { display: none !important; }
.inbox-layout {
  grid-template-columns: 318px minmax(360px, 1fr) 282px;
  border: 0;
  border-radius: 0;
  background: var(--soft);
}
.conversation-panel { border-right: 1px solid var(--line); background: var(--paper); }
.search-wrap { margin: 16px 16px 12px; }
.search-wrap input { border: 1px solid #e8edea; background: var(--soft); }
.filter-row { min-height: 0; padding: 0 16px 12px; }
.filter-row > span { display: none; }
.conversation-list { padding: 0 10px 12px; }
.conversation-item { padding: 12px 10px; border: 0; border-radius: 12px; }
.conversation-item.active { border: 1px solid #cfe7df; background: var(--green-soft); box-shadow: none; }
.conversation-item .avatar { color: var(--lime); background: #0c211c; }
.conversation-copy p { margin-top: 3px; font-size: 12px; }
.chat-panel { background: var(--soft); }
.chat-header { min-height: 64px; padding: 0 22px; }
.chat-header .avatar { color: var(--lime); background: #0c211c; }
.messages { padding: 24px 6%; }
.composer { padding: 13px 22px 24px; }
.contact-panel { border-left: 1px solid var(--line); background: var(--paper); }

.workspace[data-view="team"] .topbar { min-height: 76px; height: 76px; padding: 0 28px; }
.workspace[data-view="team"] .data-view { padding: 24px 28px 32px; }
.workspace[data-view="team"] .user-summary { padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.workspace[data-view="team"] .user-summary span,
.workspace[data-view="team"] .user-summary span + span { min-height: 88px; padding: 18px; }
.workspace[data-view="team"] .user-management-body { gap: 18px; padding: 20px 0 0; }
.workspace[data-view="team"] .user-filters { gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.workspace[data-view="team"] .user-search-field,
.workspace[data-view="team"] .filter-select { margin: 0; }

@media (max-width: 1240px) {
  .inbox-layout { grid-template-columns: 300px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .topbar, .workspace[data-view="team"] .topbar { min-height: 72px; height: 72px; padding: 0 16px; }
  .topbar h2 { font-size: 19px; }
  .inbox-shell { padding: 0; }
  .inbox-layout { display: block; }
  .conversation-list { height: calc(100dvh - 196px); }
  .chat-panel { inset: 72px 0 0; }
  .workspace[data-view="team"] .data-view { padding: 14px; }
  .workspace[data-view="team"] .user-summary { padding: 0; }
  .workspace[data-view="team"] .user-summary span,
  .workspace[data-view="team"] .user-summary span + span { min-height: 70px; padding: 12px 9px; }
  .workspace[data-view="team"] .user-management-body { padding: 14px 0 0; }
  .workspace[data-view="team"] .user-filters { gap: 0; padding: 12px 14px 14px; }
  .workspace[data-view="team"] .user-search-field,
  .workspace[data-view="team"] .filter-select { margin: 10px 0 0; }
}

/* Cross-object relationship navigation */
.relation-context-bar {
  display: flex;
  min-height: 62px;
  flex: 0 0 auto;
  align-items: center;
  gap: 20px;
  padding: 10px 28px;
  border-bottom: 1px solid #d9e5e1;
  background: #f2f8f5;
}
.relation-context-copy { display: grid; min-width: 180px; gap: 2px; }
.relation-context-copy > span {
  color: var(--green);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
}
.relation-context-copy > strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.relation-context-copy > small { color: var(--muted); font-size: 9px; }
.relation-context-actions {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}
.relation-context-actions::-webkit-scrollbar { display: none; }
.relation-context-actions button {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid #d5e5df;
  border-radius: 9px;
  color: #28584d;
  background: rgba(255, 255, 255, .86);
  font-size: 10px;
  font-weight: 750;
}
.relation-context-actions button:hover,
.relation-context-actions button:focus-visible { border-color: var(--green); color: var(--green-dark); background: white; }
.relation-context-actions button.active {
  border-color: #85c6b3;
  color: var(--green-dark);
  background: #dcefe8;
  box-shadow: inset 0 0 0 1px rgba(20, 126, 101, .08);
}
.relation-context-actions b {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 9px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 9px;
}
.relation-context-clear {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  color: #74837e;
  background: transparent;
  font-size: 20px;
}
.relation-context-clear:hover { color: var(--ink); background: #e3efea; }

.object-link {
  display: inline-flex;
  max-width: 100%;
  align-items: baseline;
  gap: 6px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}
.object-link > span { color: var(--ink); font-weight: 750; }
.object-link > small { color: var(--muted); font-size: 9px; font-weight: 500; }
.object-link:hover > span,
.object-link:focus-visible > span { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.object-link:focus-visible { border-radius: 4px; outline: 2px solid var(--green); outline-offset: 3px; }
.object-link-static { cursor: default; }
.object-link-static:hover > span { color: var(--ink); text-decoration: none; }
td .object-link { display: flex; width: fit-content; }
td .object-link + .object-link { margin-top: 5px; }
.contact-details .object-link { font-size: inherit; }

.relationship-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.relationship-summary-heading > .object-link {
  padding: 5px 8px;
  border-radius: 7px;
  background: white;
}
.relationship-group { display: grid; gap: 6px; margin-top: 10px; }
.relationship-group > strong,
.note-box > p > strong,
.note-box > div > strong { color: var(--ink); font-size: 10px; }
.relationship-group .object-link,
.note-box > p .object-link {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid #e0e9e5;
  border-radius: 8px;
  background: white;
}
.inline-create-link {
  width: fit-content;
  padding: 0;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  text-align: left;
}
.inline-create-link:hover,
.inline-create-link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.relationship-empty { color: var(--muted); font-size: 10px; }

.object-focused {
  position: relative;
  z-index: 1;
  background: #eef8f4 !important;
  box-shadow: inset 4px 0 var(--green), inset 0 0 0 1px #b9ded2 !important;
}
.user-assets button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
}
.user-assets button:hover,
.user-assets button:focus-visible { border-color: #cfe5de; color: var(--green-dark); background: var(--green-soft); }
.user-assets button small { display: none; }

@media (max-width: 760px) {
  .relation-context-bar {
    min-height: 68px;
    gap: 12px;
    padding: 9px 14px;
  }
  .relation-context-copy { min-width: 118px; max-width: 38vw; }
  .relation-context-copy > strong { font-size: 12px; }
  .relation-context-actions button { min-height: 36px; padding: 0 10px; }
  .relation-context-clear { width: 28px; }
  .relation-context-bar:not(.hidden) ~ .inbox-shell .chat-panel { inset: 140px 0 0; }
  .customer-master-panel .relationship-group > strong { font-size: 14px; }
  .customer-master-panel .relationship-group .object-link,
  .customer-master-panel .inline-create-link { font-size: 14px; }
}

/* Unified WhatsApp and WeCom communication context. */
.sidebar-status { align-items: flex-start; }
.sidebar-status > div { min-width: 0; }
.sidebar-status #apiStatus {
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.status-dot.partial { background: #d49c53; box-shadow: 0 0 0 3px rgba(212, 156, 83, .14); }
.sync-state i.integration-warning { background: #d49c53; box-shadow: 0 0 0 3px rgba(212, 156, 83, .14); }

.channel-badge {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.channel-badge.compact { padding: 2px 6px; font-size: 9px; }
.channel-badge.channel-whatsapp {
  border-color: #c9e8d9;
  color: #16754d;
  background: #eaf7f0;
}
.channel-badge.channel-wecom {
  border-color: #d4e4fa;
  color: #316ead;
  background: #edf5ff;
}
.channel-badge:not(.channel-whatsapp):not(.channel-wecom) {
  border-color: var(--line);
  color: var(--muted);
  background: var(--soft);
}

.conversation-title-row { min-width: 0; }
.conversation-title-row > strong { min-width: 0; }
.conversation-title-row .channel-badge { flex: 0 0 auto; }
.conversation-title-row .conversation-company {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-heading { min-width: 0; }
.chat-channel-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.chat-channel-line #chatPhone {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-header .channel-badge { color: inherit; font-size: 9px; }
.chat-header .channel-badge.channel-whatsapp { color: #16754d; }
.chat-header .channel-badge.channel-wecom { color: #316ead; }

.external-reply-panel {
  display: flex;
  min-height: 84px;
  flex: 0 0 auto;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.external-reply-panel > div { display: grid; min-width: 180px; flex: 1; gap: 4px; }
.external-reply-panel strong { font-size: 13px; }
.external-reply-panel p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.external-reply-panel .button { flex: 0 0 auto; text-decoration: none; white-space: nowrap; }
.external-reply-unavailable {
  max-width: 260px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.identity-list { display: grid; gap: 7px; }
.identity-chip {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
}
.identity-chip > span:last-child { display: grid; min-width: 0; gap: 2px; }
.identity-chip strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
}
.identity-chip small { color: var(--muted); font-size: 8px; }
.identity-empty { color: var(--muted); font-size: 10px; font-weight: 500; }

.wecom-context-card {
  margin: 0 18px 18px;
  padding: 13px;
  border: 1px solid #dbe8f7;
  border-radius: 11px;
  background: #f7faff;
}
.wecom-context-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.wecom-context-heading strong { font-size: 11px; }
.wecom-context-card dl { display: grid; gap: 10px; margin: 0; }
.wecom-context-row { display: grid; gap: 5px; }
.wecom-context-row dt { color: #72859a; font-size: 9px; }
.wecom-context-row dd { min-width: 0; margin: 0; }
.wecom-value-list { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
.wecom-value-list > span {
  overflow: hidden;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 6px;
  color: #3c6289;
  background: #e9f2fd;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-master-panel .identity-list { gap: 8px; }
.customer-master-panel .identity-chip strong { font-size: 11px; }
.customer-master-panel .wecom-context-card { margin: 0 16px 16px; }

@media (max-width: 760px) {
  .conversation-title-row .conversation-company { display: none; }
  .chat-heading { flex: 1; }
  .chat-channel-line { max-width: min(48vw, 260px); }
  .external-reply-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
  }
  .external-reply-panel .button { width: 100%; justify-content: center; }
  .external-reply-unavailable { max-width: none; text-align: left; }
  .wecom-context-card { margin-right: 14px; margin-left: 14px; }
  .identity-chip strong { font-size: 11px; }
}
