:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #13201d;
  --muted: #65736f;
  --line: #dbe5e1;
  --panel: #ffffff;
  --soft: #edf6f3;
  --green: #0f766e;
  --green-dark: #0b4f49;
  --yellow: #f5bd3b;
}

@font-face {
  font-family: "Poppins";
  src: url("/fonts/poppins-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("/fonts/poppins-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f4f7f6;
}

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

button {
  border: 0;
  cursor: pointer;
}

.topbar button,
.composer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.admin-page {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

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

.brand > span {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--green);
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.metric-row small,
.topbar p,
.visitor-card small,
.profile-panel dt {
  color: var(--muted);
}

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

.metric-row div,
.search,
.profile-panel,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-row div {
  padding: 14px;
}

.metric-row strong {
  display: block;
  font-size: 28px;
}

.search {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.search span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search input,
.composer input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  outline: 0;
}

.search input:focus,
.composer input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.visitor-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.visitor-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
}

.visitor-card.active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.visitor-card strong {
  overflow-wrap: anywhere;
}

.visitor-card .row,
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--soft);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.pill.offline {
  background: #eef0f0;
  color: #6c7472;
}

.workspace {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 94px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

.topbar h1 {
  font-size: 24px;
}

.topbar button:disabled,
.composer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.content {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  min-height: 0;
  padding: 18px;
}

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

.profile-panel h2 {
  margin: 0 0 18px;
  font-size: 18px;
}

.profile-panel dl {
  display: grid;
  gap: 16px;
  margin: 0;
}

.profile-panel dt {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-panel dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.chat-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 18px;
}

.empty-state {
  margin: auto;
  max-width: 360px;
  color: var(--muted);
  text-align: center;
}

.bubble {
  width: fit-content;
  max-width: min(540px, 86%);
  border-radius: 8px;
  padding: 11px 13px;
  background: #eef4f2;
}

.bubble.admin {
  align-self: flex-end;
  background: var(--green);
  color: #fff;
}

.bubble small {
  display: block;
  margin-top: 5px;
  opacity: 0.72;
  font-size: 11px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .admin-page,
  .content {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .visitor-list {
    max-height: 360px;
  }

  .chat-panel {
    min-height: 560px;
  }

}

.admin-page {
  --admin-bg: #0b0d10;
  --admin-panel: #15181d;
  --admin-panel-2: #1d2128;
  --admin-border: #2a3038;
  --admin-text: #f5f7fb;
  --admin-muted: #97a3b6;
  --admin-accent: #f7c948;
  --admin-green: #23c483;
  --admin-blue: #35a7ff;
  grid-template-columns: 300px 1fr;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.admin-page .sidebar {
  gap: 20px;
  border-right: 1px solid var(--admin-border);
  background: #111419;
  color: var(--admin-text);
}

.admin-page .brand {
  display: grid;
  gap: 6px;
  padding: 4px 0 8px;
}

.admin-page .brand img {
  width: 184px;
  height: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.24));
}

.admin-page .brand small,
.admin-page .metric-row small,
.admin-page .topbar p,
.admin-page .visitor-card small,
.admin-page .profile-panel dt,
.admin-page .panel-title p {
  color: var(--admin-muted);
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--admin-muted);
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--admin-border);
  background: var(--admin-panel);
  color: var(--admin-text);
}

.nav-item strong {
  color: var(--admin-accent);
}

.admin-page .search,
.admin-page .profile-panel,
.admin-page .chat-panel,
.overview article,
.access-panel {
  border: 1px solid var(--admin-border);
  background: var(--admin-panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.admin-page .search span {
  color: var(--admin-muted);
}

.admin-page .search input,
.admin-page .composer input {
  border-color: var(--admin-border);
  background: #0f1216;
  color: var(--admin-text);
}

.admin-page .search input::placeholder,
.admin-page .composer input::placeholder {
  color: #717c8e;
}

.admin-page .visitor-card {
  border-color: var(--admin-border);
  background: #15181d;
  color: var(--admin-text);
}

.admin-page .visitor-card:hover {
  border-color: #3b4654;
  background: #1b2027;
}

.admin-page .visitor-card.active {
  border-color: var(--admin-accent);
  box-shadow: inset 4px 0 0 var(--admin-accent);
}

.visitor-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.visitor-origin {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-page .pill {
  background: rgba(35, 196, 131, 0.14);
  color: #7cf0bd;
}

.admin-page .pill.offline {
  background: rgba(151, 163, 182, 0.14);
  color: #bcc6d6;
}

.admin-page .pill.ended {
  background: rgba(247, 201, 72, 0.15);
  color: #ffdf78;
}

.admin-page .workspace {
  background: #0b0d10;
}

.admin-page .topbar {
  border-bottom: 1px solid var(--admin-border);
  background: #111419;
  color: var(--admin-text);
}

.admin-page .topbar h1 {
  font-size: 28px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(35, 196, 131, 0.28);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(35, 196, 131, 0.1);
  color: #7cf0bd;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-page .topbar button,
.admin-page .composer button {
  background: var(--admin-accent);
  color: #111419;
}

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

.overview article {
  border-radius: 8px;
  padding: 16px;
}

.overview span {
  display: block;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 700;
}

.overview strong {
  display: block;
  margin-top: 8px;
  color: var(--admin-text);
  font-size: 30px;
}

.access-panel {
  margin: 18px 18px 0;
  border-radius: 8px;
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--admin-border);
}

.panel-title h2,
.panel-title p {
  margin: 0;
}

.panel-title h2 {
  font-size: 18px;
}

.access-table {
  overflow: auto;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(130px, 0.8fr) minmax(220px, 1.4fr) minmax(90px, 0.45fr) minmax(120px, 0.55fr);
  gap: 14px;
  align-items: center;
  min-width: 860px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--admin-border);
}

.access-row:last-child {
  border-bottom: 0;
}

.access-row.header {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.access-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.flag-dot {
  display: inline-flex;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--admin-green);
  box-shadow: 0 0 0 4px rgba(35, 196, 131, 0.14);
}

.flag-dot.offline {
  background: #7b8493;
  box-shadow: 0 0 0 4px rgba(123, 132, 147, 0.14);
}

.flag-dot.ended {
  background: var(--admin-accent);
  box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.14);
}

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-page .content {
  grid-template-columns: 340px 1fr;
  gap: 18px;
  min-height: 0;
  padding: 18px;
}

.admin-page .profile-panel,
.admin-page .chat-panel {
  color: var(--admin-text);
}

.admin-page .profile-panel {
  background: #15181d;
}

.admin-page .profile-panel h2 {
  color: var(--admin-text);
}

.admin-page .profile-panel dd {
  color: #e8edf5;
}

.admin-page .chat-panel {
  background: #15181d;
}

.admin-page .messages {
  background:
    radial-gradient(circle at top left, rgba(53, 167, 255, 0.08), transparent 28%),
    #101318;
}

.admin-page .bubble {
  background: #242a33;
  color: #f5f7fb;
  box-shadow: none;
}

.admin-page .bubble.admin {
  background: var(--admin-accent);
  color: #111419;
}

.admin-page .bubble.system {
  align-self: center;
  background: transparent;
  color: var(--admin-muted);
  border: 1px dashed var(--admin-border);
}

.admin-page .empty-state {
  color: var(--admin-muted);
}

.admin-page .composer {
  border-top-color: var(--admin-border);
  background: #15181d;
}

@media (max-width: 1180px) {
  .admin-page {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

  .admin-page .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--admin-border);
  }

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

.admin-v2 {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --text: #14181f;
  --subtle: #687385;
  --border: #dfe5eb;
  --dark: #12151b;
  --dark-2: #1b2028;
  --accent: #f5c542;
  --success: #18a874;
  --info: #2577ff;
  --danger: #c85050;
  display: grid;
  grid-template-columns: 116px 340px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

.admin-v2 button,
.admin-v2 input,
.admin-v2 textarea {
  font: inherit;
}

.app-rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 18px 14px;
  background: var(--dark);
  color: #fff;
}

.rail-brand {
  display: grid;
  place-items: center;
  min-height: 74px;
  border-radius: 8px;
  background: #fff;
}

.rail-brand img {
  width: 78px;
  height: auto;
}

.rail-nav {
  display: grid;
  gap: 10px;
}

.rail-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: #b8c0cc;
  font-size: 13px;
  font-weight: 800;
}

.rail-button:hover,
.rail-button.active {
  border-color: rgba(245, 197, 66, 0.35);
  background: rgba(245, 197, 66, 0.12);
  color: #fff;
}

.rail-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  color: #d8dee8;
  font-size: 12px;
  font-weight: 800;
}

.rail-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(24, 168, 116, 0.16);
}

.visitor-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.visitor-column.hidden {
  display: none;
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column-head p,
.main-head p,
.settings-card p {
  margin: 0;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.column-head h2,
.main-head h1,
.panel-title h2,
.settings-card h2 {
  margin: 4px 0 0;
  color: var(--text);
  letter-spacing: 0;
}

.column-head h2 {
  font-size: 24px;
}

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

.mini-metrics article,
.clean-card,
.settings-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(20, 24, 31, 0.05);
}

.mini-metrics article {
  padding: 14px;
}

.mini-metrics span,
.clean-overview span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mini-metrics strong,
.clean-overview strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 28px;
}

.filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.filter-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.filter-tabs button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 3px 12px rgba(20, 24, 31, 0.08);
}

.clean-search {
  display: grid;
  gap: 8px;
}

.clean-search span,
.setting-field label {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.clean-search input,
.setting-field input,
.settings-card textarea,
.admin-v2 .composer input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.clean-search input,
.setting-field input {
  min-height: 42px;
  padding: 0 12px;
}

.clean-search input:focus,
.setting-field input:focus,
.settings-card textarea:focus,
.admin-v2 .composer input:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(37, 119, 255, 0.12);
}

.clean-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.admin-v2 .visitor-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.admin-v2 .visitor-card:hover {
  border-color: #c8d1db;
  background: #fbfcfd;
}

.admin-v2 .visitor-card.active {
  border-color: var(--info);
  box-shadow: inset 3px 0 0 var(--info), 0 8px 22px rgba(37, 119, 255, 0.09);
}

.admin-v2 .visitor-card .row,
.admin-v2 .visitor-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-v2 .visitor-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.visitor-origin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-v2 .visitor-card small,
.admin-v2 .panel-title p {
  color: var(--subtle);
}

.admin-v2 .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(24, 168, 116, 0.12);
  color: #08704b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-v2 .pill.neutral {
  background: #eef3f7;
  color: #526071;
}

.admin-v2 .pill.offline {
  background: #eef0f2;
  color: #697381;
}

.admin-v2 .pill.ended {
  background: rgba(245, 197, 66, 0.22);
  color: #80620a;
}

.admin-main {
  min-width: 0;
  overflow: auto;
  background: var(--bg);
}

.admin-view {
  display: none;
  min-height: 100%;
  padding: 24px;
}

.admin-view.active {
  display: block;
}

.main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.main-head h1 {
  font-size: 30px;
}

.primary-action,
.admin-v2 .composer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--dark);
  color: #fff;
  font-weight: 900;
}

.primary-action:disabled,
.admin-v2 .composer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.clean-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  margin-bottom: 14px;
}

.clean-overview article {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 24, 31, 0.05);
}

.admin-v2 .access-panel {
  margin: 0 0 14px;
  overflow: hidden;
}

.admin-v2 .panel-title {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.admin-v2 .access-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 0.9fr) minmax(260px, 1.5fr) 80px 110px;
  gap: 14px;
  align-items: center;
  min-width: 860px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-v2 .access-row.header {
  background: var(--surface-2);
  color: var(--subtle);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-v2 .access-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-v2 .flag-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(24, 168, 116, 0.14);
}

.admin-v2 .flag-dot.offline {
  background: #8d96a4;
  box-shadow: 0 0 0 4px rgba(141, 150, 164, 0.14);
}

.admin-v2 .flag-dot.ended {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.18);
}

.conversation-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  min-height: 430px;
}

.admin-v2 .profile-panel {
  padding: 18px;
  overflow: auto;
  color: var(--text);
}

.admin-v2 .profile-panel h2,
.admin-v2 .settings-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.admin-v2 .profile-panel dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.admin-v2 .profile-panel dt {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-v2 .profile-panel dd {
  margin: 4px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.admin-v2 .chat-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.admin-v2 .messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 18px;
  background: #fbfcfd;
}

.admin-v2 .conversation-history-content {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 100%;
}

.admin-v2 .bubble {
  width: fit-content;
  max-width: min(560px, 86%);
  border-radius: 8px;
  padding: 11px 13px;
  background: #eef3f7;
  color: var(--text);
}

.admin-v2 .bubble.admin {
  align-self: flex-end;
  background: var(--dark);
  color: #fff;
}

.admin-v2 .bubble.system {
  align-self: center;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--subtle);
}

.admin-v2 .bubble small {
  display: block;
  margin-top: 5px;
  opacity: 0.68;
  font-size: 11px;
}

.admin-v2 .composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.admin-v2 .composer input {
  min-height: 42px;
  padding: 0 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.settings-card {
  padding: 20px;
}

.settings-card p {
  margin: -6px 0 16px;
  text-transform: none;
  font-weight: 600;
}

.settings-card textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.settings-actions span {
  color: #08704b;
  font-size: 13px;
  font-weight: 800;
}

.setting-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.empty-state.compact {
  margin: 0;
  padding: 18px;
}

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .admin-v2 {
    grid-template-columns: 92px minmax(280px, 340px) minmax(0, 1fr);
  }

  .conversation-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .clean-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .admin-v2 {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-rail {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 12px;
  }

  .rail-brand {
    width: 74px;
    min-height: 48px;
  }

  .rail-brand img {
    width: 58px;
  }

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

  .rail-status {
    margin-top: 0;
  }

  .visitor-column {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .clean-list {
    max-height: 330px;
  }

  .admin-view {
    padding: 18px;
  }

  .main-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-v2 .access-table {
    overflow-x: auto;
  }
}

.support-admin {
  --sa-bg: #f6f8fb;
  --sa-card: #ffffff;
  --sa-line: #dfe6ee;
  --sa-text: #121722;
  --sa-muted: #627089;
  --sa-green: #08a66a;
  --sa-green-2: #0bc985;
  --sa-dark: #07111d;
  --sa-dark-2: #0b1826;
  --sa-blue: #2f7df6;
  --sa-blue-2: #2f7df6;
  --sa-blue-deep: #0a2f8f;
  --sa-orange: #f59e0b;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
  overflow: hidden;
  background: var(--sa-bg);
  color: var(--sa-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.support-admin * {
  box-sizing: border-box;
}

.support-admin button,
.support-admin input,
.support-admin textarea {
  font: inherit;
}

.support-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  min-height: 100vh;
  padding: 20px 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(11, 201, 133, .16), transparent 28%),
    linear-gradient(180deg, #091624, #040b13);
  color: #eef5fb;
}

.support-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 8px;
}

.support-logo img {
  width: 54px;
  height: 42px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 12px 22px rgba(47, 125, 246, .3));
}

.support-logo strong {
  font-size: 20px;
  letter-spacing: 0;
}

.support-nav {
  display: grid;
  gap: 6px;
}

.support-nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: transparent;
  color: #c9d5e2;
  text-align: left;
  font-weight: 750;
}

.support-nav button:hover,
.support-nav button.active {
  background: linear-gradient(135deg, #0ecf8b, #079863);
  color: #fff;
  box-shadow: 0 12px 28px rgba(8, 166, 106, .24);
}

.support-nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  background: rgba(11, 201, 133, .16);
  color: #8cf5cc;
  font-size: 12px;
}

.support-nav #navSupportCount:not([hidden]) {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .14);
}

.support-nav button.active span {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.support-nav button.active #navSupportCount:not([hidden]) {
  background: #fff;
  color: #ef4444;
}

.agent-status,
.agent-card {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(206, 223, 238, .13);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, .04);
}

.agent-card {
  width: 100%;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.agent-card.profile-entry {
  border: 1px solid rgba(206, 223, 238, .16);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.agent-card.profile-entry:hover,
.agent-card.profile-entry.active {
  border-color: rgba(47, 125, 246, .58);
  background: rgba(47, 125, 246, .16);
  transform: translateY(-1px);
}

.profile-entry-arrow {
  margin-left: auto;
  color: #8ea7c2;
  font-size: 22px;
  line-height: 1;
}

.agent-status {
  width: 100%;
  margin-top: auto;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.agent-status:hover {
  border-color: rgba(47, 125, 246, .46);
  background: rgba(47, 125, 246, .12);
  transform: translateY(-1px);
}

.agent-status .availability-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sa-green-2);
  box-shadow: 0 0 0 4px rgba(11, 201, 133, .14);
  flex: 0 0 auto;
}

.agent-status.offline .availability-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .16);
}

.availability-switch {
  position: relative;
  margin-left: auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(47, 125, 246, .32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  flex: 0 0 auto;
}

.availability-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.availability-switch::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .26);
  transform: translateX(18px);
  transition: transform .18s ease;
}

.agent-status.offline .availability-switch {
  background: rgba(245, 158, 11, .24);
}

.agent-status.offline .availability-switch::before {
  transform: translateX(0);
}

.agent-status strong,
.agent-card strong {
  display: block;
  font-size: 14px;
}

.agent-status small,
.agent-card small,
.admin-version {
  color: #91a2b5;
}

.agent-avatar,
.conversation-avatar,
.inbox-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #20d68d, #08a66a);
  color: #fff;
  font-weight: 900;
}

.support-shell {
  height: 100vh;
  min-width: 0;
  overflow: auto;
  padding: 22px 24px;
}

.support-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.support-top h1 {
  display: inline-flex;
  align-items: center;
  margin: 0 12px 0 0;
  font-size: 27px;
  letter-spacing: 0;
}

.online-chip,
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(8, 166, 106, .12);
  color: #087c50;
  font-size: 12px;
  font-weight: 900;
}

.online-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sa-green);
}

.online-chip.offline {
  background: rgba(100, 116, 139, .12);
  color: #64748b;
}

.online-chip.offline i {
  background: #94a3b8;
}

.status-label.offline {
  background: #eef2f6;
  color: #68768a;
}

.status-label.ended {
  background: #eef2f6;
  color: #68768a;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search input,
.inbox-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--sa-line);
  border-radius: 10px;
  background: #fff;
  color: var(--sa-text);
  outline: 0;
}

.global-search input {
  width: min(320px, 36vw);
  padding: 0 14px;
}

.inbox-search input {
  padding: 0 12px;
}

.global-search input:focus,
.inbox-search input:focus,
.agent-composer textarea:focus {
  border-color: var(--sa-green);
  box-shadow: 0 0 0 4px rgba(8, 166, 106, .1);
}

.top-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--sa-line);
}

.top-icon::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid #1f2b3b;
  border-radius: 8px 8px 4px 4px;
}

.top-icon span {
  position: absolute;
  right: -6px;
  top: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4d5f;
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  font-weight: 900;
}

.support-view {
  display: none;
}

.support-view.active {
  display: block;
}

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

.metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  border: 1px solid var(--sa-line);
  border-radius: 14px;
  padding: 18px;
  background: var(--sa-card);
  box-shadow: 0 12px 30px rgba(17, 31, 44, .04);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(8, 166, 106, .12);
}

.metric-card.waiting .metric-icon {
  background: rgba(245, 158, 11, .14);
}

.metric-card.time .metric-icon {
  background: rgba(43, 124, 255, .12);
}

.metric-card small,
.metric-card p {
  color: var(--sa-muted);
}

.metric-card strong {
  display: block;
  margin: 4px 0;
  font-size: 28px;
}

.metric-card p {
  margin: 0;
}

.support-layout {
  display: grid;
  grid-template-columns: 420px minmax(450px, 1fr) 340px;
  gap: 18px;
  min-height: calc(100vh - 202px);
}

@media (min-width: 1051px) {
  .support-shell {
    display: flex;
    height: 100vh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .support-top,
  .support-metrics {
    flex: 0 0 auto;
  }

  .support-view.active {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
  }

  #supportView.active {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  #supportView .support-layout {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
  }

  #supportView .inbox-panel,
  #supportView .conversation-panel,
  #supportView .visitor-panel {
    height: 100%;
    min-height: 0;
  }

  #supportView .message-timeline,
  #supportView .inbox-list,
  #supportView .visitor-side.active {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.inbox-panel,
.conversation-panel,
.visitor-panel,
.page-card {
  border: 1px solid var(--sa-line);
  border-radius: 14px;
  background: var(--sa-card);
  box-shadow: 0 12px 30px rgba(17, 31, 44, .04);
}

.inbox-panel,
.conversation-panel,
.visitor-panel {
  min-height: 0;
  overflow: hidden;
}

.conversation-panel {
  position: relative;
}

.conversation-panel.drag-over::before {
  content: "Solte o arquivo para enviar";
  position: absolute;
  inset: 88px 18px 96px;
  z-index: 8;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(47, 125, 246, .58);
  border-radius: 22px;
  background: rgba(239, 246, 255, .9);
  color: var(--sa-blue-deep);
  font-size: 15px;
  font-weight: 950;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.inbox-panel {
  display: flex;
  flex-direction: column;
}

.inbox-head,
.conversation-head,
.page-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--sa-line);
}

.inbox-head h2,
.page-card h2 {
  margin: 0;
  font-size: 19px;
}

.inbox-head h2 span {
  display: inline-flex;
  min-width: 28px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(8, 166, 106, .12);
  color: #087c50;
  font-size: 14px;
}

.small-action {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #f6f9fb;
  box-shadow: inset 0 0 0 1px var(--sa-line);
}

.inbox-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 18px;
  border-bottom: 1px solid var(--sa-line);
}

.inbox-tabs button {
  min-height: 46px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4d5a70;
  font-size: 13px;
  font-weight: 800;
}

.inbox-tabs button.active {
  border-color: var(--sa-green);
  color: var(--sa-green);
}

.inbox-search {
  display: block;
  padding: 14px 18px;
}

.inbox-list {
  flex: 1;
  overflow: auto;
}

.inbox-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 116px;
  border: 0;
  border-bottom: 1px solid var(--sa-line);
  padding: 16px 18px;
  background: #fff;
  color: var(--sa-text);
  text-align: left;
}

.inbox-item.active {
  background: linear-gradient(90deg, rgba(8, 166, 106, .13), #fff);
  box-shadow: inset 3px 0 0 var(--sa-green);
}

.inbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.inbox-copy strong,
.inbox-copy p,
.inbox-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-copy p {
  margin: 8px 0 6px;
  color: #263348;
}

.inbox-copy small {
  color: var(--sa-muted);
}

.unread-dot {
  align-self: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sa-green);
  color: #fff;
  text-align: center;
  line-height: 24px;
  font-size: 12px;
  font-weight: 900;
}

.conversation-panel {
  display: flex;
  flex-direction: column;
}

.conversation-head {
  min-height: 86px;
}

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

.conversation-title h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 19px;
}

.conversation-title p {
  margin: 6px 0 0;
  color: var(--sa-muted);
}

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

.secondary-action {
  min-height: 40px;
  border: 1px solid var(--sa-line);
  border-radius: 10px;
  padding: 0 14px;
  background: #fff;
  color: #152032;
  font-weight: 850;
}

.conversation-actions select {
  min-height: 40px;
  max-width: 190px;
  border: 1px solid var(--sa-line);
  border-radius: 10px;
  padding: 0 34px 0 12px;
  background: #fff;
  color: #152032;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.conversation-actions select:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.close-action {
  color: var(--sa-green);
}

.secondary-action:disabled,
.send-action:disabled,
.attach-action:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.message-timeline {
  flex: 1;
  overflow: auto;
  padding: 22px 18px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.chat-date,
.system-event {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.chat-date::before,
.chat-date::after,
.system-event::before,
.system-event::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sa-line);
}

.message-line {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.message-line.agent {
  justify-items: end;
}

.message-sender {
  display: inline-flex;
  align-items: center;
  max-width: min(420px, 72%);
  overflow: hidden;
  color: #53657a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble {
  max-width: min(420px, 72%);
  border: 1px solid var(--sa-line);
  border-radius: 13px;
  padding: 13px 15px;
  background: #f7f9fb;
  color: var(--sa-text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.message-line.agent .message-bubble {
  border-color: transparent;
  background: linear-gradient(135deg, var(--sa-blue), #1558cf);
  color: #fff;
  box-shadow: 0 12px 26px rgba(47, 125, 246, .28);
}

.message-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.message-attachment.is-image {
  display: grid;
  gap: 8px;
}

.message-attachment img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
}

.message-attachment small {
  display: block;
  margin-top: 2px;
  color: inherit;
  opacity: .72;
}

.message-attachment-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(7, 26, 47, .08);
  color: var(--sa-blue);
  font-size: 12px;
  font-weight: 900;
}

.message-line small {
  color: var(--sa-muted);
  font-size: 12px;
}

.message-line { cursor: pointer; }
.message-actions { display: none; gap: 6px; max-width: min(420px,72%); }
.message-line.agent .message-actions { justify-content: flex-end; }
.message-line.actions-open .message-actions { display: flex; }
.message-actions button { border: 1px solid #dce7f2; border-radius: 8px; padding: 5px 9px; background: #fff; color: #52657a; font-size: 11px; }
.message-reply-quote { display: grid; gap: 2px; margin: -5px -7px 9px; border-left: 3px solid #58a9ff; border-radius: 8px; padding: 7px 9px; background: rgba(7,26,47,.07); font-size: 12px; }
.message-reply-quote strong { color: #287cdc; }
.message-reply-quote span { overflow: hidden; opacity: .8; text-overflow: ellipsis; white-space: nowrap; }
.message-line.agent .message-reply-quote { background: rgba(255,255,255,.14); }
.agent-reply-preview { order: 0; flex: 0 0 100%; display: none; align-items: center; justify-content: space-between; border-left: 3px solid #2f7df6; border-radius: 10px; padding: 7px 9px; background: #eef6ff; }
.agent-reply-preview.show { display: flex; }
.agent-reply-preview span { display: grid; min-width: 0; }
.agent-reply-preview small { overflow: hidden; color: #66788d; text-overflow: ellipsis; white-space: nowrap; }
.agent-reply-preview button { border: 0; background: transparent; color: #607089; font-size: 20px; }
.admin-emoji-action { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #eef5fb; color: #47627c; font-size: 19px; }
.admin-emoji-menu { position: absolute; bottom: 58px; left: 12px; z-index: 8; display: none; grid-template-columns: repeat(7, 30px); gap: 3px; border: 1px solid #dce7f2; border-radius: 14px; padding: 8px; background: #fff; box-shadow: 0 16px 38px rgba(7,26,47,.16); }
.admin-emoji-menu.open { display: grid; }
.admin-emoji-menu button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; font-size: 18px; }
.admin-emoji-menu button:hover { background: #eef6ff; }

.agent-composer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 0 18px 18px;
  border: 1px solid rgba(158, 204, 235, .68);
  border-radius: 24px;
  padding: 9px 9px 9px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,252,255,.96));
  box-shadow: 0 18px 42px rgba(7, 26, 47, .08), 0 1px 0 rgba(255,255,255,.95) inset;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.agent-composer:focus-within {
  border-color: rgba(47, 125, 246, .62);
  background: #fff;
  box-shadow: 0 20px 48px rgba(7, 26, 47, .12), 0 0 0 4px rgba(47, 125, 246, .14);
}

.agent-composer textarea {
  order: 1;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 24px;
  max-height: 118px;
  border: 0;
  resize: none;
  padding: 7px 0;
  background: transparent;
  outline: 0;
  color: var(--sa-text);
  line-height: 1.38;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  scrollbar-width: none;
  box-shadow: none;
}

.agent-composer textarea::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.agent-composer textarea:focus,
.agent-composer textarea:focus-visible {
  outline: 0;
  box-shadow: none;
}

.spell-suggest {
  order: 3;
  flex: 0 0 100%;
  display: none;
  max-height: 170px;
  margin: 2px 0 0;
  overflow: hidden;
  border: 1px solid rgba(216, 228, 238, .95);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 26, 47, .1);
}

.spell-suggest.show {
  display: block;
  overflow-y: auto;
}

.spell-suggest-title {
  padding: 10px 13px 8px;
  border-bottom: 1px solid #eef3f8;
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 900;
}

.spell-preview {
  margin: 10px 12px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
  color: #18263a;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.spell-preview mark {
  background: transparent;
  color: #b91c1c;
  font-weight: 900;
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #ef4444;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.spell-preview .insert-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 12px;
  text-decoration: none;
  vertical-align: middle;
}

.spell-suggest button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  background: #fff;
  color: var(--sa-text);
  font-weight: 850;
  text-align: left;
}

.spell-suggest button em {
  max-width: 160px;
  overflow: hidden;
  color: var(--sa-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spell-suggest button:hover {
  background: #eef5ff;
}

.spell-suggest small {
  color: #dc2626;
  font-weight: 900;
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #dc2626;
}

.composer-footer {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 8px;
  padding: 0 0 1px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.attach-action {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  min-height: 29px;
  border-radius: 50%;
  background: rgba(238, 245, 255, .78);
  color: var(--sa-blue);
}

.attach-action::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16.5 6.5v9.2a4.5 4.5 0 1 1-9 0V6.8a6.5 6.5 0 1 1 13 0v8.7a8.5 8.5 0 1 1-17 0V7h2v8.5a6.5 6.5 0 1 0 13 0V6.8a4.5 4.5 0 1 0-9 0v8.9a2.5 2.5 0 1 0 5 0V6.5h2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M16.5 6.5v9.2a4.5 4.5 0 1 1-9 0V6.8a6.5 6.5 0 1 1 13 0v8.7a8.5 8.5 0 1 1-17 0V7h2v8.5a6.5 6.5 0 1 0 13 0V6.8a4.5 4.5 0 1 0-9 0v8.9a2.5 2.5 0 1 0 5 0V6.5h2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.attach-action:hover {
  background: #e8f1ff;
  color: var(--sa-blue-deep);
}

.send-action {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--sa-blue), #1768ee);
  box-shadow: 0 12px 24px rgba(47, 125, 246, .26);
}

.send-action::before {
  content: "";
  display: block;
  width: 21px;
  height: 21px;
  margin: 0;
  background: currentColor;
  color: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m22 2-7 20-4-9-9-4 20-7Zm-5.4 5.4-9.2 3.2 4.2 1.8 1.8 4.2 3.2-9.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m22 2-7 20-4-9-9-4 20-7Zm-5.4 5.4-9.2 3.2 4.2 1.8 1.8 4.2 3.2-9.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.agent-attachment-preview {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(100% + 8px);
  z-index: 7;
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid #d8e4ef;
  border-radius: 16px;
  padding: 8px 10px;
  background: #f7fbff;
  box-shadow: 0 14px 34px rgba(7, 26, 47, .12);
}

.agent-attachment-preview.show {
  display: flex;
}

.agent-preview-thumb {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 12px;
  background: #e8f1ff;
  color: var(--sa-blue-deep);
  font-size: 11px;
  font-weight: 950;
}

.agent-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-preview-info {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.agent-preview-info strong {
  overflow: hidden;
  color: var(--sa-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-preview-info small {
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 780;
}

.agent-preview-remove {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef4fb;
  color: #60708a;
  font-size: 18px;
  line-height: 1;
}

.visitor-panel {
  display: flex;
  flex-direction: column;
}

.visitor-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--sa-line);
}

.visitor-tabs button {
  min-height: 54px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4d5a70;
  font-weight: 850;
}

.visitor-tabs button.active {
  border-color: var(--sa-green);
  color: var(--sa-green);
}

.visitor-side {
  display: none;
  overflow: auto;
  padding: 18px;
}

.visitor-side.active {
  display: block;
}

.side-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.side-profile h3,
.side-profile p {
  margin: 0;
}

.side-profile p {
  margin-top: 4px;
  color: var(--sa-green);
  font-size: 13px;
  font-weight: 800;
}

.contact-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.contact-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  border: 1px solid var(--sa-line);
  border-radius: 10px;
  padding: 12px;
}

.contact-list span,
.info-list dt,
.visitor-side h4 {
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-list strong {
  color: #25334a;
  font-size: 13px;
}

.contact-list button,
.note-button {
  border: 1px solid var(--sa-line);
  border-radius: 9px;
  background: #fff;
  color: #40506a;
  font-weight: 800;
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.info-list div {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
}

.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tag-list span {
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(8, 166, 106, .12);
  color: #087c50;
  font-size: 12px;
  font-weight: 900;
}

.note-button {
  width: 100%;
  min-height: 40px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-list div {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  color: #263348;
}

.history-list strong {
  color: var(--sa-muted);
}

.page-card {
  padding: 0;
  overflow: hidden;
}

.page-card > h2,
.page-card > p {
  margin-left: 20px;
  margin-right: 20px;
}

.page-card-head p {
  margin: 6px 0 0;
  color: var(--sa-muted);
}

.live-table {
  overflow: auto;
  border: 1px solid #dce7f2;
  border-radius: 0 0 18px 18px;
  background: #f3f7fb;
}

.live-page-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.05fr) 88px minmax(180px, 1.35fr) 92px minmax(140px, .95fr) 68px minmax(135px, .95fr) 102px;
  column-gap: 8px;
  align-items: center;
  min-width: 1040px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e7eef6;
  padding: 14px 16px;
  background: #fff;
  color: var(--sa-text);
  text-align: left;
}

button.live-row {
  position: relative;
  margin: 0;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

button.live-row:hover {
  z-index: 1;
  background: linear-gradient(90deg, #f4f9ff, #fff 42%);
  box-shadow: inset 4px 0 0 #2f7df6, 0 10px 24px rgba(30, 82, 140, .08);
  transform: translateY(-1px);
}

.live-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 52px;
  background: linear-gradient(180deg, #f9fbfe, #eff5fb);
  color: #526985;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.live-head > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-head-icon {
  width: 15px;
  height: 15px;
  color: #5e82ad;
  flex: 0 0 auto;
}

button.live-row > span {
  min-width: 0;
}

.live-visitor-cell,
.live-data-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.live-visitor-cell strong,
.live-data-cell > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-visitor-cell strong {
  color: #10213a;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 13px;
  font-weight: 650;
}

.live-visitor-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(47, 125, 246, .16);
  border-radius: 11px;
  background: linear-gradient(145deg, #edf5ff, #dbeaff);
  color: #1768d8;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  box-shadow: 0 6px 16px rgba(47, 125, 246, .12);
}

.live-data-cell > .live-head-icon {
  width: 16px;
  height: 16px;
  color: #7892af;
}

.live-browser-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #7188a3;
  filter: grayscale(1) saturate(0) opacity(.82);
}

.live-browser-icon.generic {
  color: #7188a3;
  filter: none;
}

.live-ip-cell span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: -.025em;
}

.live-access-cell strong {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  border-radius: 9px;
  background: #eaf3ff;
  color: #1768d8;
  font-weight: 600;
}

.live-time-cell {
  color: #536781;
}

.live-status-cell .status-label {
  min-width: 78px;
  min-height: 28px;
  justify-content: center;
  border: 1px solid rgba(24, 195, 126, .16);
  box-shadow: 0 5px 14px rgba(24, 195, 126, .08);
}

.live-title-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  border-radius: 11px;
  background: #eaf3ff;
  color: #2f7df6;
  vertical-align: middle;
}

.live-title-icon svg { width: 19px; height: 19px; }

.status-label.inactive {
  background: #fff4d8;
  color: #9a6700;
}

.status-label.online i,
.status-label.inactive i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.inbox-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px 12px;
  border-bottom: 1px solid #e8eef5;
}

.inbox-bulk-actions label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #607088;
  font-size: 12px;
  cursor: pointer;
}

.inbox-bulk-actions input,
.inbox-select {
  width: 16px;
  height: 16px;
  accent-color: #2f7df6;
}

.inbox-bulk-actions button {
  min-height: 30px;
  border: 1px solid #ffd0d0;
  border-radius: 9px;
  padding: 0 9px;
  background: #fff6f6;
  color: #c73535;
  font-size: 11px;
  font-weight: 650;
}

.inbox-bulk-actions button:disabled { opacity: .45; cursor: not-allowed; }

.inbox-item {
  grid-template-columns: 18px 48px minmax(0, 1fr) auto;
  cursor: pointer;
}

.inbox-select { align-self: start; margin-top: 15px; cursor: pointer; }
.inbox-select-placeholder { width: 16px; height: 16px; flex: 0 0 16px; }

.ban-action {
  border-color: #f4c979 !important;
  background: #fff9ea !important;
  color: #9a6500 !important;
}

.delete-action {
  border-color: #ffcaca !important;
  background: #fff4f4 !important;
  color: #c62f3c !important;
}

.admin-table {
  overflow: auto;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(150px, 1fr) minmax(170px, 1fr) 120px 82px 112px;
  gap: 16px;
  align-items: center;
  min-width: 930px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--sa-line);
  padding: 16px 20px;
  background: #fff;
  color: var(--sa-text);
  text-align: left;
}

.admin-row:not(.admin-row-head):hover {
  background: #f5f9ff;
}

.admin-row-head {
  background: #f8fafc;
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-row strong,
.admin-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row small {
  margin-top: 4px;
  color: var(--sa-muted);
  font-size: 12px;
}

.admin-config-grid,
.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px;
}

.reports-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.report-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.report-custom-date[hidden] {
  display: none;
}

.report-filters label {
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.report-filters select,
.report-filters input {
  height: 40px;
  border: 1px solid #d8e4ee;
  border-radius: 11px;
  padding: 0 11px;
  background: #fff;
  color: #0c1628;
  font: inherit;
}

.report-filters select:focus,
.report-filters input:focus {
  border-color: #2f7df6;
  outline: 3px solid rgba(47, 125, 246, .12);
}

/* Visual refinement: calm typography, clearer settings and team forms. */
.support-admin {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  letter-spacing: -.01em;
}

.support-admin :is(h1, h2, h3, h4, strong) { font-weight: 650; }
.support-admin :is(p, small, label, input, select, textarea, button) { font-weight: 450; }
.support-nav button.active, .support-admin .primary-action { font-weight: 600; }
.page-card-head h2 { font-size: 22px; letter-spacing: -.025em; }
.page-card-head p { max-width: 680px; line-height: 1.55; }

.settings-page-head {
  margin: 18px 20px 0;
  border: 1px solid #e3ebf3;
  border-radius: 18px 18px 0 0;
  background: #fff;
}

.widget-settings {
  gap: 18px;
  padding-top: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
}

.widget-settings .settings-card {
  border: 1px solid #e1e9f1;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 12px 35px rgba(30, 64, 175, .055);
}

.settings-eyebrow {
  color: #2563eb;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.widget-install-card h2 { margin: 7px 0 5px; font-size: 21px; }
.widget-install-card p { margin-bottom: 16px; line-height: 1.55; }
.widget-install-card code { color: #2563eb; font-weight: 550; }

.install-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.install-steps span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f5f8fc;
  color: #52627a;
  font-size: 12px;
}

.install-steps i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e4edff;
  color: #2563eb;
  font-style: normal;
  font-weight: 650;
}

#widgetCode {
  min-height: 112px;
  resize: none;
  border: 1px solid #24334a;
  border-radius: 13px;
  padding: 14px 16px;
  background: #111827;
  color: #dbeafe;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.action-feedback:empty, .page-action-feedback:empty { display: none !important; }
.page-action-feedback { margin-left: 10px; color: #137052; font-size: 13px; }

#teamView .admin-config-grid { padding: 18px 20px 24px; }
.team-list-panel { border-radius: 18px; box-shadow: 0 12px 35px rgba(30, 64, 175, .055); }
.team-list-toolbar { padding: 20px 22px; }
.team-list-toolbar h3 { font-size: 18px; font-weight: 650; }
.team-list-toolbar p, .team-widget-strip { font-weight: 450; }
.team-list-stats span { border-radius: 10px; font-weight: 450; }
.team-list-stats strong { font-weight: 650; }
.team-list-head { display: none; }
.team-list-body { gap: 12px; padding: 14px; background: #f7f9fc; }
.team-list-row {
  grid-template-columns: minmax(260px, 1.3fr) minmax(150px, .7fr) minmax(240px, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e1e9f1;
  border-radius: 14px;
  background: #fff;
}
.team-list-row:last-child { border-bottom: 1px solid #e1e9f1; }
.team-list-row input, .team-list-row select { min-height: 42px; font-weight: 450; }
.team-status-cell, .team-visible-cell, .team-actions-cell { align-self: stretch; }
.team-visible-cell { min-height: 42px; padding: 0 12px; border: 1px solid #d8e4ee; border-radius: 12px; font-weight: 450; }
.team-actions-cell { grid-column: 2 / 4; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; }
.team-actions-cell > div { justify-content: flex-end; }
.team-access-cell small { font-weight: 450; }
.team-empty-state { padding: 52px 20px; text-align: center; color: #64748b; }
.team-empty-state .config-icon { margin: 0 auto 12px; }
.team-empty-state h3 { margin: 0 0 6px; color: #172033; }
.team-empty-state p { margin: 0; }

@media (max-width: 1100px) {
  .team-list-row { grid-template-columns: 1fr 1fr; }
  .team-person-cell { grid-column: 1 / -1; }
  .team-actions-cell { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .widget-settings, .team-list-row, .install-steps { grid-template-columns: 1fr; }
  .team-person-cell, .team-actions-cell { grid-column: auto; }
  .team-actions-cell { grid-template-columns: 1fr; }
  .team-actions-cell > div { justify-content: flex-start; flex-wrap: wrap; }
}

/* Professional typography system */
.support-admin,
.support-admin * {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Premium sidebar typography */
.support-admin .support-nav button {
  min-height: 50px;
  padding-inline: 15px;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 15px;
  font-weight: 560;
  line-height: 1.22;
  letter-spacing: -.018em;
}

.support-admin .support-nav button.active {
  font-weight: 650;
  letter-spacing: -.022em;
}

.support-admin .support-nav button::before {
  width: 19px;
  height: 19px;
}

/* Professional team management */
#teamView .team-list-body {
  gap: 14px;
  padding: 16px;
  background: #f5f8fc;
}

#teamView .team-list-row {
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(0, 2fr);
  align-items: start;
  gap: 18px;
  padding: 18px;
  border: 1px solid #dce6f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(22, 55, 94, .055);
}

#teamView .team-list-row:last-child {
  border-bottom: 1px solid #dce6f0;
}

#teamView .team-person-cell {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 2px 0;
}

#teamView .team-list-photo {
  width: 52px;
  height: 52px;
}

.team-person-fields {
  display: grid;
  gap: 2px;
}

.team-person-fields strong,
.team-owner-copy strong {
  overflow: hidden;
  color: #10213a;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-person-fields small,
.team-owner-copy small {
  overflow: hidden;
  color: #748397;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-kicker,
.team-field > span {
  color: #718299;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.team-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(135px, 1fr));
  gap: 11px;
  min-width: 0;
}

.team-field {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

#teamView .team-field input,
#teamView .team-field select {
  min-height: 37px;
  border-radius: 10px;
  padding-inline: 10px;
  font-size: 12px;
  font-weight: 450;
}

.team-field > small {
  color: #8491a2;
  font-size: 9px;
  line-height: 1.3;
}

.team-card-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #edf2f7;
  padding-top: 14px;
}

.team-card-footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

#teamView .team-visible-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.team-visible-copy {
  display: grid;
  gap: 1px;
}

.team-visible-copy strong {
  color: #26384f;
  font-size: 11px;
  font-weight: 600;
}

.team-visible-copy small {
  color: #8190a3;
  font-size: 9px;
}

#teamView .team-card-footer :is(button, .avatar-upload) {
  min-height: 34px;
  border-radius: 9px;
  padding-inline: 11px;
  font-size: 11px;
}

.team-save-button {
  border-color: #bcd5f5;
  background: #eaf3ff;
  color: #155dcc;
}

.team-owner-row {
  display: grid;
  grid-template-columns: 52px minmax(210px, 1fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid #cfe0f5;
  border-radius: 16px;
  padding: 15px 18px;
  background: radial-gradient(circle at 0 0, rgba(47, 125, 246, .1), transparent 36%), #fff;
}

.team-owner-copy,
.team-owner-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.team-owner-copy > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-owner-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eaf3ff;
  color: #1768d8;
  font-size: 9px;
  font-weight: 650;
}

.team-owner-meta span {
  color: #2d4058;
  font-size: 11px;
  font-weight: 600;
}

.team-owner-meta small {
  color: #7a899b;
  font-size: 10px;
}

.team-edit-button {
  min-height: 36px;
  border-radius: 10px;
  border-color: #c9dcf3;
  background: #f4f8fe;
  color: #155dcc;
  font-size: 11px;
}

@media (max-width: 1380px) {
  .team-edit-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 980px) {
  #teamView .team-list-row { grid-template-columns: minmax(0, 1fr); }
  .team-card-footer { grid-column: auto; }
  .team-owner-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .team-owner-meta { display: none; }
}

@media (max-width: 620px) {
  .team-edit-grid { grid-template-columns: minmax(0, 1fr); }
  .team-card-footer { align-items: flex-start; flex-direction: column; }
  .team-card-footer > div { flex-wrap: wrap; width: 100%; }
  .team-owner-row { grid-template-columns: 44px minmax(0, 1fr); }
  .team-owner-row .team-list-photo { width: 44px; height: 44px; }
  .team-owner-badge { display: none; }
  .team-edit-button { grid-column: 1 / -1; width: 100%; }
}

/* Clear conversation header hierarchy. */
.support-admin .conversation-head {
  grid-template-columns: minmax(280px, 1fr) minmax(0, auto);
  align-items: center;
  gap: 20px;
  min-height: 86px;
  padding: 18px 20px;
}

.support-admin .conversation-title {
  min-width: 0;
}

.support-admin .conversation-title > div:only-child {
  grid-column: 1 / -1;
}

.support-admin .conversation-title h2 {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.support-admin .conversation-title > div > p:not(.conversation-meta) {
  max-width: 560px;
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-admin .conversation-actions,
.support-admin .conversation-action-main,
.support-admin .conversation-action-manage {
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-admin .conversation-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  max-width: none;
}

.support-admin .conversation-action-main {
  padding-right: 8px;
  border-right: 1px solid #e2e9f1;
}

.support-admin .conversation-actions :is(button, select) {
  min-height: 40px;
  white-space: nowrap;
}

.support-admin .conversation-actions :disabled {
  display: none;
}

.support-admin .sidebar-wordmark,
.support-admin .sidebar-wordmark span {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: #f8fbff;
  font-family: "Poppins", "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.055em;
  white-space: nowrap;
  text-shadow: 0 2px 14px rgba(255, 255, 255, .08);
}

.support-admin .sidebar-wordmark span:first-child {
  color: #f8fbff;
}

.support-admin .sidebar-wordmark span:last-child {
  color: #4da3ff;
  text-shadow: 0 0 22px rgba(77, 163, 255, .3);
}

.support-admin #assignButton:not(:disabled) {
  padding-inline: 17px;
}

.support-admin #endButton:not(:disabled) {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b42318;
}

@media (max-width: 1280px) {
  .support-admin .conversation-head { grid-template-columns: 1fr; align-items: start; }
  .support-admin .conversation-actions { justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .support-admin .conversation-head { padding: 16px; }
  .support-admin .conversation-actions,
  .support-admin .conversation-action-main,
  .support-admin .conversation-action-manage { width: 100%; flex-wrap: wrap; }
  .support-admin .conversation-action-main { padding: 0 0 8px; border-right: 0; border-bottom: 1px solid #e2e9f1; }
  .support-admin .conversation-actions :is(button, select) { flex: 1 1 auto; }
}

.support-admin :is(
  .metric-card strong,
  .talkto-value strong,
  .talkto-value span,
  .talkto-row strong,
  .report-card > div > strong,
  .team-list-stats strong,
  .unread-dot,
  .online-chip,
  #inboxCount,
  #totalCount,
  #unreadCount,
  #endedCount,
  #navSupportCount,
  #topUnreadBadge,
  .live-row span:nth-child(6),
  .message-time,
  .ls-time
) {
  font-family: "Poppins", Inter, sans-serif;
  font-variant-numeric: tabular-nums;
}
.support-admin { font-size: 14px; line-height: 1.45; }
.support-admin :is(h1, h2, h3, h4) { color: #111827; font-weight: 650; letter-spacing: -.025em; }
.support-admin strong { font-weight: 600; }
.support-admin :is(p, small) { font-weight: 400; line-height: 1.5; }
.support-admin :is(button, label, input, select, textarea) { font-weight: 450; letter-spacing: 0; }
.support-admin :is(.primary-action, .send-action, .support-nav button.active) { font-weight: 600; }
.support-admin :is(.metric-card strong, .talkto-value strong) { font-weight: 650; letter-spacing: -.03em; }
.support-admin :is(.status-label, .online-chip, .unread-dot) { font-weight: 550; }

.talkto-report-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
}

.talkto-card {
  display: grid;
  gap: 10px;
  min-height: 160px;
  border: 1px solid #d8e4ee;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  color: #0c1628;
  box-shadow: 0 12px 30px rgba(30, 64, 175, .07);
}

.talkto-card header,
.talkto-value,
.talkto-split {
  display: flex;
  align-items: center;
}

.talkto-card header {
  gap: 10px;
}

.talkto-card header a {
  margin-left: auto;
  color: #0b63f6;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.talkto-divider {
  height: 1px;
  background: #e7eef5;
}

.talkto-icon {
  width: 18px;
  height: 18px;
  background: #2f7df6;
  mask: var(--icon) center / contain no-repeat;
}

.talkto-icon.team { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11a4 4 0 1 0-3.6-5.7 5 5 0 1 0-6.8 6.8A7 7 0 0 0 2 18v2h2v-2a5 5 0 0 1 10 0v2h2v-2a7 7 0 0 0-3.6-6.1A4 4 0 0 0 16 11Zm0 2c-.7 0-1.4.1-2 .4a8.8 8.8 0 0 1 2 2.8V20h6v-2a5 5 0 0 0-6-5Z'/%3E%3C/svg%3E"); }
.talkto-icon.chat { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16v11H7l-3 3V4Zm2 2v7h12V6H6Z'/%3E%3C/svg%3E"); }
.talkto-icon.page { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16v16H4V4Zm2 2v3h12V6H6Zm0 5v7h12v-7H6Z'/%3E%3C/svg%3E"); }
.talkto-icon.chart { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 20V9h3v11H5Zm6 0V4h3v16h-3Zm6 0v-7h3v7h-3Z'/%3E%3C/svg%3E"); }

.talkto-card small {
  color: #64748b;
  font-weight: 780;
}

.talkto-value {
  gap: 10px;
}

.talkto-value strong {
  color: #0c1628;
  font-size: 34px;
  line-height: 1;
}

.talkto-value span,
.talkto-row strong {
  color: #16a34a;
  font-weight: 900;
}

.talkto-value span.down,
.talkto-row strong.down {
  color: #dc2626;
}

.talkto-card p {
  margin: 0;
  color: #64748b;
}

.talkto-split {
  justify-content: space-between;
  gap: 18px;
}

.talkto-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #52627a;
}

.config-card,
.integration-card,
.report-card,
.report-wide {
  border: 1px solid rgba(216, 228, 238, .92);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f9fcff);
  box-shadow: 0 16px 38px rgba(7, 26, 47, .05);
}

.config-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.config-card header,
.integration-card,
.report-card {
  display: flex;
  align-items: center;
  gap: 13px;
}

.config-card header {
  min-width: 0;
}

.config-card header > div {
  min-width: 0;
  flex: 1;
}

.config-card input,
.config-card select,
.config-card textarea,
.config-field input,
.config-field select,
.config-field textarea {
  width: 100%;
  border: 1px solid #d8e4ee;
  border-radius: 12px;
  background: #fff;
  color: var(--sa-text);
  outline: 0;
}

.config-card header input {
  height: 36px;
  padding: 0 11px;
  font-weight: 950;
}

.config-card select,
.config-field select,
.config-field input {
  min-height: 40px;
  padding: 0 11px;
}

.config-card textarea,
.config-field textarea {
  resize: vertical;
  min-height: 92px;
  padding: 12px;
  line-height: 1.45;
}

.config-field {
  display: grid;
  gap: 7px;
}

.config-field span,
.config-card small,
.report-card small {
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.config-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action.compact {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sa-blue), #1768ee);
  box-shadow: 0 12px 24px rgba(47, 125, 246, .22);
}

.add-config-card {
  min-height: 224px;
  place-items: center;
  text-align: center;
  border-style: dashed;
  border-color: rgba(47, 125, 246, .38);
  background:
    radial-gradient(circle at 50% 0%, rgba(47, 125, 246, .13), transparent 38%),
    linear-gradient(180deg, #fff, #f4f9ff);
  color: var(--sa-blue-deep);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.add-config-card:hover {
  border-color: var(--sa-blue);
  box-shadow: 0 18px 42px rgba(47, 125, 246, .14);
  transform: translateY(-1px);
}

.add-config-card .config-icon {
  width: 48px;
  height: 48px;
  background: rgba(47, 125, 246, .14);
}

.add-config-card strong {
  font-size: 17px;
  font-weight: 950;
}

.add-config-card small {
  max-width: 300px;
  text-transform: none;
  font-size: 13px;
  line-height: 1.45;
}

.ghost-action {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 13px;
  background: #eef5ff;
  color: var(--sa-blue-deep);
  font-weight: 900;
}

.ghost-action.danger {
  background: #fff1f2;
  color: #be123c;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #d8e4ee;
  transition: background .18s ease;
}

.switch span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 12px rgba(7, 26, 47, .18);
  transition: transform .18s ease;
}

.switch input:checked + span {
  background: linear-gradient(135deg, var(--sa-blue), #0b63f6);
}

.switch input:checked + span::before {
  transform: translateX(20px);
}

.config-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e7f1ff, #d9ebff);
  color: var(--sa-blue);
}

.config-icon::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--config-icon) center / contain no-repeat;
  mask: var(--config-icon) center / contain no-repeat;
}

.config-icon.bolt { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m13 2-9 12h7l-1 8 10-13h-7l0-7Z'/%3E%3C/svg%3E"); }
.config-icon.sync { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.7 6.3A8 8 0 0 0 4.3 10H2l3.5 3.5L9 10H6.4a6 6 0 0 1 9.9-2.3l1.4-1.4ZM18.5 10.5 15 14h2.6a6 6 0 0 1-9.9 2.3l-1.4 1.4A8 8 0 0 0 19.7 14H22l-3.5-3.5Z'/%3E%3C/svg%3E"); }
.config-icon.user { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a5 5 0 1 0-5-5 5 5 0 0 0 5 5Zm0 2c-4.4 0-8 2.2-8 5v1h16v-1c0-2.8-3.6-5-8-5Z'/%3E%3C/svg%3E"); }
.config-icon.radar { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m13.4 11.2 5.3-5.3-1.4-1.4-5.3 5.3a2.5 2.5 0 1 0 1.4 1.4ZM12 20a8 8 0 1 1 0-16V2a10 10 0 1 0 10 10h-2a8 8 0 0 1-8 8Z'/%3E%3C/svg%3E"); }
.config-icon.chat { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 4H4a2 2 0 0 0-2 2v14l4-4h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Z'/%3E%3C/svg%3E"); }
.config-icon.chart { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 19h16v2H3V3h2v16Zm4-2H7v-6h2v6Zm5 0h-2V7h2v10Zm5 0h-2v-8h2v8Z'/%3E%3C/svg%3E"); }
.config-icon.link { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M10.6 13.4a1 1 0 0 1 0-1.4l4-4a3 3 0 1 1 4.2 4.2l-2 2 1.4 1.4 2-2a5 5 0 1 0-7.1-7.1l-4 4a3 3 0 0 0 0 4.2l1.5-1.3Zm2.8-2.8a1 1 0 0 1 0 1.4l-4 4a3 3 0 1 1-4.2-4.2l2-2-1.4-1.4-2 2a5 5 0 1 0 7.1 7.1l4-4a3 3 0 0 0 0-4.2l-1.5 1.3Z'/%3E%3C/svg%3E"); }
.config-icon.team { --config-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8.5 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm7 1a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7ZM8.5 13C4.9 13 2 14.8 2 17.1V20h13v-2.9C15 14.8 12.1 13 8.5 13Zm7 1c-.8 0-1.6.1-2.3.4 1.2.8 2 1.8 2 3.1V20H22v-2.4c0-2-2.9-3.6-6.5-3.6Z'/%3E%3C/svg%3E"); }

/* Quick replies */
#quickView {
  background: linear-gradient(180deg, #fff, #f7faff);
}

#quickView .quick-page-head {
  min-height: 112px;
  padding: 24px 26px;
  background: radial-gradient(circle at 4% 0%, rgba(47, 125, 246, .1), transparent 34%), #fff;
}

.quick-page-title,
.quick-page-title > div {
  min-width: 0;
}

.quick-page-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

.quick-title-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  box-shadow: 0 10px 24px rgba(47, 125, 246, .14);
}

.quick-eyebrow,
.quick-card-label,
.quick-message-field > span {
  color: #6b7e96;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.quick-page-title h2 {
  margin: 2px 0 1px;
}

.quick-add-button {
  gap: 8px;
  min-width: 144px;
  justify-content: center;
}

.quick-add-button > span {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

#quickReplies {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
  padding: 18px 20px 22px;
}

.quick-reply-card {
  gap: 12px;
  min-width: 0;
  border-color: #dce7f2;
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(22, 55, 94, .065);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.quick-reply-card:hover,
.quick-reply-card:focus-within {
  border-color: rgba(47, 125, 246, .38);
  box-shadow: 0 20px 44px rgba(30, 74, 126, .1);
  transform: translateY(-1px);
}

.quick-card-head {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px !important;
}

.quick-card-head .config-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.quick-card-head .config-icon::before {
  width: 17px;
  height: 17px;
}

.quick-card-identity {
  display: grid;
  gap: 4px;
}

.quick-reply-card .quick-card-identity input {
  height: auto;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.02em;
  box-shadow: none;
}

.quick-reply-card .quick-card-identity input:focus {
  color: #155dcc;
}

.quick-saved-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #638074;
  font-size: 10px;
  white-space: nowrap;
}

.quick-saved-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20b97a;
}

.quick-message-field {
  display: grid;
  gap: 8px;
}

.quick-reply-card .quick-message-field textarea {
  min-height: 82px;
  border-color: #e0e8f1;
  border-radius: 13px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #26384f;
  font-size: 13px;
  line-height: 1.55;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.quick-reply-card .quick-message-field textarea:focus {
  border-color: #73a8f4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 125, 246, .1);
}

.quick-card-footer {
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #edf2f7;
  padding-top: 10px;
}

.quick-card-footer > small {
  color: #8391a3;
  font-size: 10px;
  text-transform: none;
}

.quick-card-footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-remove,
.quick-use {
  min-height: 32px;
  border-radius: 10px;
  padding-inline: 12px;
  font-size: 12px;
}

.quick-remove {
  border-color: transparent;
  background: transparent !important;
  color: #8a5963 !important;
}

.quick-remove:hover {
  background: #fff1f2 !important;
  color: #be123c !important;
}

.quick-use {
  border-color: #cfe0f4;
  background: #eef5ff;
  color: #155dcc;
}

.quick-create-card {
  min-height: 244px;
  border-radius: 18px;
}

.quick-create-plus {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #cde0fa;
  border-radius: 16px;
  background: #fff;
  color: #2f7df6;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 24px;
  font-weight: 350;
  box-shadow: 0 12px 26px rgba(47, 125, 246, .14);
}

@media (max-width: 1180px) {
  #quickReplies { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  #quickView .quick-page-head { align-items: flex-start; gap: 16px; }
  .quick-page-title { align-items: flex-start; }
  .quick-add-button { width: 100%; }
  #quickReplies { padding: 14px; }
  .quick-card-footer { align-items: flex-start; }
  .quick-card-footer > div { width: 100%; }
  .quick-use { flex: 1; }
}

.report-card {
  padding: 18px;
}

.report-card strong {
  display: block;
  margin: 4px 0;
  font-size: 26px;
}

.report-card p,
.integration-card p,
.config-note {
  margin: 0;
  color: var(--sa-muted);
}

.report-wide {
  grid-column: span 2;
  padding: 18px;
}

.report-wide h3 {
  margin: 0 0 14px;
}

.source-bars {
  display: grid;
  gap: 12px;
}

.source-bar {
  display: grid;
  gap: 7px;
}

.source-bar div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #263348;
  font-size: 13px;
}

.source-bar i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f0f8;
}

.source-bar i::before {
  content: "";
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sa-blue), #0b63f6);
}

.agent-photo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sa-blue), var(--sa-blue-deep));
  color: #fff;
  font-weight: 950;
}

.mini-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.mini-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid #edf3f8;
  padding-top: 10px;
}

.mini-list dt,
.mini-list dd {
  margin: 0;
}

.mini-list dt {
  color: var(--sa-muted);
  font-weight: 800;
}

.mini-list dd {
  color: var(--sa-text);
  font-weight: 950;
}

.agent-preview-stack {
  display: flex;
}

.agent-preview-stack .agent-photo + .agent-photo {
  margin-left: -10px;
  box-shadow: 0 0 0 3px #fff;
}

.team-summary-card,
.team-widget-card {
  border: 1px solid rgba(216, 228, 238, .92);
  border-radius: 18px;
  padding: 18px;
  background: radial-gradient(circle at 92% 8%, rgba(47, 125, 246, .14), transparent 34%), linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 18px 42px rgba(7, 26, 47, .06);
}

.team-summary-card {
  grid-column: span 2;
  display: grid;
  gap: 18px;
}

.team-summary-card > div,
.team-widget-card header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.team-summary-card h3 {
  margin: 0;
  font-size: 22px;
}

.team-summary-card p {
  margin: 4px 0 0;
  color: var(--sa-muted);
}

.team-summary-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0;
}

.team-summary-list div {
  border: 1px solid #e3edf6;
  border-radius: 14px;
  padding: 13px;
  background: #fff;
}

.team-summary-list dt,
.team-summary-list dd {
  margin: 0;
}

.team-summary-list dt {
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-summary-list dd {
  margin-top: 6px;
  color: var(--sa-text);
  font-size: 18px;
  font-weight: 950;
}

.team-widget-card {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.agent-preview-stack.large .agent-photo {
  width: 54px;
  height: 54px;
  border: 3px solid #fff;
  box-shadow: 0 12px 28px rgba(47, 125, 246, .18);
}

.team-member-card {
  background: linear-gradient(180deg, #fff, #fbfdff);
}

#teamView .admin-config-grid {
  grid-template-columns: repeat(2, minmax(380px, 1fr));
}

.team-create-card {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 245px;
  border: 1.5px dashed rgba(47, 125, 246, .42);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(239, 246, 255, .82), #fff);
  color: var(--sa-blue-deep);
  text-align: center;
  box-shadow: 0 18px 42px rgba(47, 125, 246, .08);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.team-create-card:hover {
  border-color: rgba(47, 125, 246, .8);
  box-shadow: 0 22px 52px rgba(47, 125, 246, .14);
  transform: translateY(-1px);
}

.team-create-card strong {
  font-size: 18px;
  font-weight: 950;
}

.team-create-card small {
  max-width: 280px;
  color: var(--sa-muted);
  font-weight: 800;
  line-height: 1.45;
}

.team-member-head {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: stretch !important;
  gap: 16px !important;
  border-bottom: 1px solid #edf3f8;
  padding-bottom: 16px;
}

.team-member-photo {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 4px solid #eef6ff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sa-blue), #1558cf);
  color: #fff;
  font-size: 24px;
  font-weight: 950;
  box-shadow: 0 18px 34px rgba(47, 125, 246, .18);
}

.team-member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.team-member-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.team-member-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.team-member-title-row input {
  min-height: 42px;
  border: 1px solid #d8e4ee;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--sa-text);
  font-weight: 950;
}

.team-member-main strong {
  color: #0c1628;
  font-size: 13px;
  font-weight: 950;
}

.team-member-main small {
  min-width: 0;
  overflow: hidden;
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.team-photo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
}

.team-photo-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-card-footer {
  align-items: center;
  justify-content: space-between;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sa-text);
  font-weight: 850;
}

.check-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--sa-blue);
}

.muted-text {
  color: var(--sa-muted);
  font-weight: 850;
}

.is-attendant .page-card:not(#supportView),
.is-attendant [data-view]:not([data-view="supportView"]) {
  display: none !important;
}

#teamView .admin-config-grid {
  display: block;
  padding: 20px;
}

.team-list-panel {
  overflow: hidden;
  border: 1px solid rgba(216, 228, 238, .96);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(7, 26, 47, .06);
}

.team-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid #e8f0f8;
}

.team-list-toolbar > div {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.team-list-toolbar h3 {
  margin: 0;
  color: var(--sa-text);
  font-size: 20px;
  font-weight: 950;
}

.team-list-toolbar p {
  margin: 3px 0 0;
  color: var(--sa-muted);
  font-weight: 750;
}

.team-list-stats,
.team-widget-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid #edf3f8;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
}

.team-list-stats span {
  border: 1px solid #dbe8f5;
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--sa-muted);
  font-size: 13px;
  font-weight: 850;
}

.team-list-stats strong {
  color: var(--sa-blue);
  font-weight: 950;
}

.team-widget-strip {
  justify-content: space-between;
  color: var(--sa-muted);
  font-size: 13px;
  font-weight: 800;
}

.team-list-head,
.team-list-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.45fr) minmax(155px, .8fr) minmax(260px, 1.25fr) minmax(190px, .9fr) minmax(120px, .55fr) minmax(220px, 1fr);
  align-items: center;
  gap: 14px;
}

.team-list-head {
  padding: 11px 20px;
  border-bottom: 1px solid #e8f0f8;
  background: #f8fbff;
  color: var(--sa-muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.team-list-body {
  display: grid;
}

.team-list-row {
  padding: 14px 20px;
  border-bottom: 1px solid #edf3f8;
}

.team-list-row:last-child {
  border-bottom: 0;
}

.team-list-row input,
.team-list-row select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d8e4ee;
  border-radius: 12px;
  background: #fff;
  color: var(--sa-text);
  font: inherit;
  font-weight: 750;
  outline: none;
  padding: 0 12px;
}

.team-list-row input:focus,
.team-list-row select:focus {
  border-color: rgba(47, 125, 246, .7);
  box-shadow: 0 0 0 3px rgba(47, 125, 246, .12);
}

.team-person-cell {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.team-list-photo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sa-blue), #1558cf);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(47, 125, 246, .18);
}

.team-list-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.team-person-fields,
.team-role-cell,
.team-status-cell,
.team-actions-cell {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.team-access-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.team-access-cell small {
  color: var(--sa-muted);
  font-size: 12px;
  font-weight: 850;
}

.team-visible-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sa-text);
  font-weight: 850;
}

.team-visible-cell input {
  width: 16px;
  height: 16px;
  min-height: auto;
  accent-color: var(--sa-blue);
}

.team-actions-cell > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-upload.small {
  min-height: 38px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
}

.integration-card {
  padding: 16px;
}

.integration-card > div {
  min-width: 0;
  flex: 1;
}

.integration-card strong {
  display: block;
  margin-bottom: 4px;
}

.support-settings {
  align-items: start;
}

.empty-state.compact {
  margin: 0;
  padding: 20px;
}

@media (max-width: 980px) {
  .support-admin {
    grid-template-columns: 86px minmax(0, 1fr);
  }

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

  .support-logo strong,
  .support-nav button,
  .agent-status div,
  .agent-card div,
  .availability-switch,
  .admin-version {
    display: none;
  }

  .support-logo {
    justify-content: center;
  }

  .support-nav button {
    display: grid;
    place-items: center;
    padding: 0;
  }

  .support-nav button::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 5px;
  }

  .support-layout {
    grid-template-columns: 360px minmax(420px, 1fr);
  }

  .admin-config-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .team-summary-card {
    grid-column: span 2;
  }

  .reports-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .visitor-panel {
    display: none;
  }
}

@media (max-width: 620px) {
  .talkto-report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1050px) {
  .support-admin {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .support-sidebar {
    display: none;
  }

  .support-metrics,
  .support-layout {
    grid-template-columns: 1fr;
  }

  .support-shell {
    padding: 16px;
  }

  .admin-config-grid,
  .reports-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .account-card {
    grid-column: auto;
  }

  .settings-split {
    grid-template-columns: 1fr;
  }

  .report-wide {
    grid-column: auto;
  }

  .team-summary-card {
    grid-column: auto;
  }

  .team-summary-list,
  .team-form-grid {
    grid-template-columns: 1fr;
  }
}

/* AstraHosting blue polish */
.support-admin {
  --sa-bg: #f4f8fc;
  --sa-card: #ffffff;
  --sa-line: #d8e4ee;
  --sa-text: #0c1628;
  --sa-muted: #63718a;
  --sa-green: #18c37e;
  --sa-green-2: #24d892;
  --sa-dark: #061426;
  --sa-dark-2: #0a213a;
  --sa-blue: #2f7df6;
  --sa-blue-2: #2f7df6;
  --sa-blue-deep: #0a2f8f;
  --sa-navy: #071a2f;
  --sa-cyan-soft: #e8f7ff;
  grid-template-columns: 284px minmax(0, 1fr);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.support-sidebar {
  width: 284px;
  min-width: 284px;
  max-width: 284px;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 0%, rgba(56, 189, 248, .2), transparent 30%),
    linear-gradient(180deg, #071a2f 0%, #050d19 78%);
}

.support-nav button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.support-nav button {
  white-space: normal;
}

.support-nav button {
  line-height: 1.18;
}

.support-nav button::before,
.metric-icon::before,
.top-icon::before,
.small-action::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
}

.support-nav [data-icon="flow"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='6' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3Cpath d='M8 6h4a4 4 0 0 1 4 4v6'/%3E%3Cpath d='M6 8v10h8'/%3E%3C/svg%3E"); }
.support-nav [data-icon="radar"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 12 19 5'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M20 12a8 8 0 1 1-8-8'/%3E%3Cpath d='M16 12a4 4 0 1 1-4-4'/%3E%3C/svg%3E"); }
.support-nav [data-icon="user"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.support-nav [data-icon="chat"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E"); }
.support-nav [data-icon="bolt"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m13 2-9 13h7l-1 7 10-14h-7z'/%3E%3C/svg%3E"); }
.support-nav [data-icon="sync"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 12a9 9 0 0 0-15-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M3 12a9 9 0 0 0 15 6.7L21 16'/%3E%3Cpath d='M16 16h5v5'/%3E%3C/svg%3E"); }
.support-nav [data-icon="chart"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 19V5'/%3E%3Cpath d='M4 19h16'/%3E%3Cpath d='M8 16v-5'/%3E%3Cpath d='M12 16V8'/%3E%3Cpath d='M16 16v-7'/%3E%3C/svg%3E"); }
.support-nav [data-icon="team"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 21a6 6 0 0 1 12 0'/%3E%3Cpath d='M16 11a3 3 0 1 0 0-6'/%3E%3Cpath d='M18 21a5 5 0 0 0-3-4.6'/%3E%3C/svg%3E"); }
.support-nav [data-icon="gear"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1-2 3.4-.2-.1a1.7 1.7 0 0 0-2 .1 1.7 1.7 0 0 0-.8 1.7V22H9.2v-.2a1.7 1.7 0 0 0-.8-1.7 1.7 1.7 0 0 0-2-.1l-.2.1-2-3.4.1-.1A1.7 1.7 0 0 0 4.6 15 1.7 1.7 0 0 0 3 14H2v-4h1a1.7 1.7 0 0 0 1.6-1 1.7 1.7 0 0 0-.3-1.9l-.1-.1 2-3.4.2.1a1.7 1.7 0 0 0 2-.1A1.7 1.7 0 0 0 9.2 2V2h5.6v.2a1.7 1.7 0 0 0 .8 1.7 1.7 1.7 0 0 0 2 .1l.2-.1 2 3.4-.1.1a1.7 1.7 0 0 0-.3 1.9 1.7 1.7 0 0 0 1.6 1h1v4h-1a1.7 1.7 0 0 0-1.6 1Z'/%3E%3C/svg%3E"); }
.support-nav [data-icon="link"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.1 0l2-2a5 5 0 0 0-7.1-7.1l-1.1 1.1'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.1 0l-2 2A5 5 0 0 0 12 20.1l1.1-1.1'/%3E%3C/svg%3E"); }

.support-nav button:hover,
.support-nav button.active {
  background: linear-gradient(135deg, var(--sa-blue), #1768ee);
  box-shadow: 0 12px 28px rgba(47, 125, 246, .24);
}

.support-nav span {
  min-width: 28px;
  justify-self: end;
  background: rgba(56, 189, 248, .14);
  color: #a7e8ff;
}

.agent-avatar,
.conversation-avatar,
.inbox-avatar {
  background: linear-gradient(135deg, var(--sa-blue), #1558cf);
}

.agent-avatar img,
.agent-photo img,
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-photo img { border-radius: 50%; }

.account-card {
  grid-column: span 2;
}

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

.account-page {
  overflow: hidden;
}

.account-page .account-form {
  padding: 22px;
}

.account-hero-card {
  border: 1px solid rgba(47, 125, 246, .2);
  border-radius: 22px;
  padding: 20px;
  background:
    radial-gradient(circle at 15% 0%, rgba(47, 125, 246, .18), transparent 36%),
    linear-gradient(135deg, #fff, #f3f8ff);
}

.account-profile-row strong {
  display: block;
  color: #06142a;
  font-size: 18px;
  font-weight: 950;
}

.account-profile-row small {
  display: block;
  margin-top: 3px;
  color: #607086;
}

.account-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  gap: 14px;
}

.account-professional-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(150px, .75fr);
  gap: 12px;
}

.account-professional-grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e4ee;
  border-radius: 12px;
  padding: 0 11px;
  background: #fff;
  color: var(--sa-text);
  outline: 0;
}

.account-professional-grid select:focus {
  border-color: #73a8f4;
  box-shadow: 0 0 0 3px rgba(47, 125, 246, .1);
}

@media (max-width: 620px) {
  .account-professional-grid { grid-template-columns: minmax(0, 1fr); }
}

.password-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 125, 246, .14), transparent 34%),
    #fff;
}

.alert-card {
  grid-column: 1 / -1;
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 125, 246, .11), transparent 34%),
    linear-gradient(180deg, #fff, #f8fbff);
}

.account-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  border: 1px solid #dbe8f5;
  border-radius: 18px;
  padding: 14px 16px;
  background: #fff;
}

.account-toggle-row strong,
.account-toggle-row small {
  display: block;
}

.account-toggle-row strong {
  color: var(--sa-text);
  font-weight: 950;
}

.account-toggle-row small {
  margin-top: 3px;
  color: var(--sa-muted);
  font-weight: 750;
}

.account-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid rgba(206, 223, 238, .72);
  background: linear-gradient(180deg, rgba(255, 255, 255, .86), #fff);
}

.account-save-bar .primary-action {
  min-width: 190px;
  background: linear-gradient(135deg, var(--sa-blue), #1768ee);
  box-shadow: 0 14px 26px rgba(47, 125, 246, .24);
}

.widget-settings {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
}

.widget-settings .settings-card {
  min-height: 0;
}

.account-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--sa-blue), var(--sa-blue-deep));
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 16px 32px rgba(47, 125, 246, .2);
}

.avatar-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #d8e4ee;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: var(--sa-blue-deep);
  cursor: pointer;
  font-weight: 900;
}

.branding-logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.branding-logo-preview {
  display: grid;
  place-items: center;
  width: 82px;
  height: 58px;
  overflow: hidden;
  border: 1px solid rgba(47, 125, 246, .14);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f5f9ff);
  box-shadow: 0 12px 24px rgba(47, 125, 246, .1);
}

.branding-logo-preview img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

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

.global-search input:focus,
.inbox-search input:focus {
  border-color: var(--sa-blue);
  box-shadow: 0 0 0 4px rgba(47, 125, 246, .16);
}

.agent-composer textarea:focus,
.agent-composer textarea:focus-visible {
  outline: 0;
  box-shadow: none;
}

.bell-icon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 7h18s-3 0-3-7'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E"); }
.logout-icon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E"); }
.top-icon::before {
  border: 0;
  border-radius: 0;
  background: #15243a;
}

.metric-icon {
  display: grid;
  place-items: center;
  color: var(--sa-blue-2);
  background: rgba(47, 125, 246, .14);
}

.metric-card.waiting .metric-icon { color: #f59e0b; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6l4 2'/%3E%3C/svg%3E"); }
.metric-card.service .metric-icon { color: #5468ff; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 13v-2a8 8 0 0 1 16 0v2'/%3E%3Cpath d='M5 13h3v6H5zM16 13h3v6h-3z'/%3E%3C/svg%3E"); }
.metric-card.unread .metric-icon { color: #10a66f; --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E"); }
.metric-card.time .metric-icon { color: var(--sa-blue-2); background: rgba(47, 125, 246, .14); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v5l3 2'/%3E%3Cpath d='M9 2h6'/%3E%3C/svg%3E"); }

.inbox-tabs button.active,
.visitor-tabs button.active,
.close-action {
  border-color: var(--sa-blue-2);
  color: var(--sa-blue-2);
}

.inbox-item.active {
  background: linear-gradient(90deg, rgba(47, 125, 246, .14), #fff);
  box-shadow: inset 3px 0 0 var(--sa-blue-2);
}

.unread-dot {
  background: var(--sa-blue-2);
}

.message-line.agent .message-bubble,
.send-action {
  background: linear-gradient(135deg, var(--sa-blue), #1768ee);
}

.send-action {
  box-shadow: 0 12px 24px rgba(47, 125, 246, .26);
}

.tag-list span {
  background: rgba(47, 125, 246, .14);
  color: var(--sa-blue-deep);
}

.sound-permission {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(430px, calc(100vw - 44px));
  padding: 12px 12px 12px 14px;
  border: 1px solid rgba(47, 125, 246, .24);
  border-radius: 18px;
  color: #06142a;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 48px rgba(11, 33, 68, .16);
  backdrop-filter: blur(18px);
}

.sound-permission div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sound-permission strong {
  font-size: 14px;
  line-height: 1.2;
}

.sound-permission span {
  color: #607086;
  font-size: 12px;
  line-height: 1.35;
}

.sound-permission button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sa-blue), #1768ee);
  box-shadow: 0 10px 22px rgba(47, 125, 246, .28);
}

.support-admin .settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.support-admin .settings-actions .primary-action,
.support-admin .settings-actions button.primary-action,
.support-admin .primary-action {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--sa-blue), #1768ee);
  box-shadow: 0 12px 24px rgba(47, 125, 246, .22);
  font-weight: 900;
  text-decoration: none;
}

.support-admin .settings-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 10px;
  color: #076749;
  background: rgba(24, 195, 126, .12);
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 980px) {
  .support-nav button {
    grid-template-columns: 1fr;
    place-items: center;
    gap: 0;
  }

  .support-nav button::before {
    width: 20px;
    height: 20px;
  }
}

/* Admin polish */
.support-admin {
  --sa-bg: #f4f8fd;
  --sa-card: #ffffff;
  --sa-line: #d9e5f1;
  --sa-text: #07172d;
  --sa-muted: #61718a;
  background:
    radial-gradient(circle at 78% -12%, rgba(47, 125, 246, .13), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
  min-height: 100vh;
}

.support-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(47, 125, 246, .2), transparent 27%),
    linear-gradient(180deg, #09233d 0%, #061421 52%, #040b13 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.07);
  overflow: hidden;
}

.support-admin .conversation-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 22px 24px;
  border-bottom: 1px solid #d9e5f1;
  background:
    radial-gradient(circle at 12% 0%, rgba(47, 125, 246, .08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.support-admin .conversation-title {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.support-admin .conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 12px 28px rgba(47, 125, 246, .2);
}

.support-admin .conversation-title h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #07172d;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 950;
}

.support-admin .conversation-title p {
  max-width: 100%;
  margin: 5px 0 0;
  color: #61718a;
  font-size: 13px;
  line-height: 1.35;
}

.support-admin .conversation-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  overflow: visible;
  white-space: normal;
}

.support-admin .conversation-meta span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-admin .conversation-meta span:not(:last-child)::after {
  content: "";
  flex: 0 0 4px;
  width: 4px;
  height: 4px;
  margin-left: 10px;
  border-radius: 50%;
  background: #a8b5c7;
}

.support-admin .conversation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 430px;
}

.support-admin .secondary-action,
.support-admin .conversation-actions select {
  min-height: 40px;
  border: 1px solid #d8e5f2;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  color: #14345d;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(7, 26, 47, .045);
}

.support-admin .conversation-actions select {
  width: 190px;
  max-width: 100%;
}

.support-admin .secondary-action:not(:disabled):hover,
.support-admin .conversation-actions select:not(:disabled):hover {
  border-color: #9fc9ff;
  box-shadow: 0 12px 26px rgba(47, 125, 246, .12);
}

.support-admin #assignButton:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(135deg, #2f7df6, #135fdf);
  color: #fff;
}

.support-admin #leaveButton:not(:disabled) {
  color: #0f766e;
}

.support-admin .close-action:not(:disabled) {
  color: #dc2626;
}

.support-admin .conversation-actions .secondary-action:disabled,
.support-admin .conversation-actions select:disabled {
  opacity: .58;
  box-shadow: none;
}

@media (max-width: 1220px) {
  .support-admin .conversation-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .support-admin .conversation-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

.support-nav button:hover,
.support-nav button.active {
  background: linear-gradient(135deg, #2f7df6, #135fdf);
  box-shadow: 0 16px 34px rgba(47, 125, 246, .28);
}

.support-shell {
  padding: 18px 24px 24px;
}

.support-top {
  margin-bottom: 16px;
}

.support-top h1 {
  color: #06142a;
  font-size: 25px;
  font-weight: 950;
}

.online-chip {
  background: #e8f7f1;
  color: #07845a;
}

.global-search input,
.inbox-search input {
  border-color: #d8e5f2;
  border-radius: 12px;
  background: rgba(255,255,255,.92);
}

.top-icon,
.small-action {
  border: 1px solid #d8e5f2;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 24px rgba(7, 26, 47, .05);
}

.support-metrics {
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  min-height: 92px;
  border-color: rgba(216, 229, 242, .92);
  border-radius: 16px;
  padding: 16px 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(47, 125, 246, .08), transparent 34%),
    rgba(255,255,255,.94);
  box-shadow: 0 16px 38px rgba(7, 26, 47, .055);
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.metric-card strong {
  margin: 3px 0 2px;
  font-size: 26px;
  letter-spacing: 0;
}

.metric-card small {
  color: #52647d;
  font-weight: 850;
}

.metric-card p {
  font-weight: 750;
}

.support-layout {
  grid-template-columns: 420px minmax(520px, 1fr) 340px;
  gap: 16px;
  min-height: calc(100vh - 176px);
}

.inbox-panel,
.conversation-panel,
.visitor-panel,
.page-card {
  border-color: rgba(216, 229, 242, .92);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 46px rgba(7, 26, 47, .06);
}

.inbox-head,
.conversation-head,
.page-card-head {
  min-height: 70px;
  padding: 16px 18px;
  border-bottom-color: #e6eef7;
}

.inbox-head h2,
.page-card h2 {
  font-size: 18px;
  font-weight: 950;
}

.inbox-head h2 span {
  min-width: 24px;
  height: 24px;
  background: #e8f3ff;
  color: #1e6ee8;
  font-size: 12px;
}

.inbox-tabs {
  padding: 0 14px;
}

.inbox-tabs button {
  min-height: 42px;
  font-size: 12px;
}

.inbox-list {
  background: #fbfdff;
}

.inbox-item {
  min-height: 94px;
  padding: 14px 18px;
  background: #fff;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.inbox-item:hover {
  background: #f7fbff;
}

.inbox-item.active {
  background: linear-gradient(90deg, rgba(47, 125, 246, .13), rgba(255,255,255,.98));
  box-shadow: inset 3px 0 0 #2f7df6;
}

.inbox-avatar,
.conversation-avatar {
  background: linear-gradient(135deg, #2f7df6, #135fdf);
  box-shadow: 0 12px 24px rgba(47, 125, 246, .22);
}

.inbox-copy strong {
  color: #07172d;
  font-size: 15px;
  font-weight: 950;
}

.inbox-copy p {
  margin: 7px 0 5px;
  color: #23344d;
  font-size: 14px;
}

.conversation-head {
  align-items: flex-start;
  min-height: 82px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.conversation-title h2 {
  align-items: center;
  color: #07172d;
  font-size: 18px;
  line-height: 1.15;
}

.conversation-title p {
  max-width: 620px;
  overflow: hidden;
  color: #61718a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-actions {
  gap: 8px;
}

.secondary-action,
.conversation-actions select {
  min-height: 38px;
  border-radius: 12px;
  border-color: #d8e5f2;
  background: #fff;
  color: #31435c;
}

.secondary-action:not(:disabled):hover,
.conversation-actions select:not(:disabled):hover {
  border-color: rgba(47, 125, 246, .55);
  color: #0f5fd6;
}

.close-action:not(:disabled) {
  color: #0f5fd6;
}

.message-timeline {
  padding: 26px 20px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.message-bubble {
  border-color: #dfe8f2;
  border-radius: 16px;
  padding: 12px 15px;
  background: #f7f9fc;
  box-shadow: 0 8px 20px rgba(7, 26, 47, .035);
}

.message-line.agent .message-bubble {
  background: linear-gradient(135deg, #2f7df6, #0f63e8);
  box-shadow: 0 14px 28px rgba(47, 125, 246, .24);
}

.system-event,
.chat-date {
  color: #6c7c92;
}

.agent-composer {
  margin: 0 18px 18px;
  border-color: #cfe2f4;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(7, 26, 47, .08);
}

.send-action {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.visitor-tabs {
  background: #fbfdff;
}

.visitor-tabs button {
  min-height: 52px;
  color: #44556e;
  font-weight: 900;
}

.visitor-side {
  padding: 18px;
}

.side-profile {
  margin-bottom: 16px;
  border: 1px solid #e1ebf5;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-list div {
  border: 1px solid #e1ebf5;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.contact-list strong,
.info-list dd {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-list button {
  width: auto;
  min-width: 110px;
  border-radius: 10px;
  color: #0f5fd6;
  background: #f5f9ff;
}

.visitor-side h4 {
  margin: 18px 0 10px;
  color: #405169;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.info-list {
  gap: 0;
  border: 1px solid #e1ebf5;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.info-list div {
  grid-template-columns: 120px minmax(0, 1fr);
  padding: 10px 12px;
  border-bottom: 1px solid #edf3f8;
}

.info-list div:last-child {
  border-bottom: 0;
}

.info-list dt {
  color: #536781;
  font-size: 11px;
}

.info-list dd {
  color: #10213a;
  font-weight: 800;
}

@media (max-width: 1360px) {
  .support-layout {
    grid-template-columns: 380px minmax(460px, 1fr) 320px;
  }
}

/* Final cascade overrides for the refreshed admin UI. */
.support-admin :is(h1, h2, h3, h4, strong) { font-weight: 650; }
.support-admin :is(p, small, label, input, select, textarea, button) { font-weight: 450; }
.support-admin :is(.primary-action, .support-nav button.active) { font-weight: 600; }
.support-admin .page-card-head h2 { font-weight: 650; }
.support-admin .team-list-toolbar h3 { font-weight: 650; }
.support-admin .team-list-toolbar p,
.support-admin .team-widget-strip,
.support-admin .team-access-cell small,
.support-admin .team-visible-cell,
.support-admin .team-list-row input,
.support-admin .team-list-row select { font-weight: 450; }
.support-admin .team-list-stats strong { font-weight: 650; }
.support-admin .team-list-head { display: none; }
.support-admin .team-list-body { gap: 12px; padding: 14px; background: #f7f9fc; }
.support-admin .team-list-row {
  grid-template-columns: minmax(260px, 1.3fr) minmax(150px, .7fr) minmax(240px, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e1e9f1;
  border-radius: 14px;
  background: #fff;
}
.support-admin .team-actions-cell { grid-column: 2 / 4; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; }
.support-admin #widgetCode { min-height: 92px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 1100px) {
  .support-admin .team-list-row { grid-template-columns: 1fr 1fr; }
  .support-admin .team-person-cell, .support-admin .team-actions-cell { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .support-admin { display: block; width: 100%; min-width: 0; overflow-x: hidden; }
  .support-admin .support-sidebar { display: none; }
  .support-admin .support-shell { width: 100%; min-width: 0; padding: 12px; }
  .support-admin .support-topbar { min-width: 0; gap: 8px; }
  .support-admin .support-topbar h1 { font-size: 22px; line-height: 1.05; }
  .support-admin .global-search { display: none; }
  .support-admin .settings-page-head { margin: 8px 0 0; border-radius: 16px; }
  .support-admin .settings-grid { width: 100%; min-width: 0; padding: 12px 0; }
  .support-admin .widget-settings { display: grid; grid-template-columns: minmax(0, 1fr); }
  .support-admin .widget-settings .settings-card { min-width: 0; padding: 18px; }
  .support-admin .install-steps { grid-template-columns: 1fr; }
  .support-admin #widgetCode { width: 100%; min-width: 0; }
  .support-admin .branding-logo-row { align-items: flex-start; }
  .support-admin .team-list-row { grid-template-columns: minmax(0, 1fr); }
  .support-admin .team-person-cell, .support-admin .team-actions-cell { grid-column: auto; }
  .support-admin .team-actions-cell { grid-template-columns: 1fr; }
}

.support-admin,
.support-admin * {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
