:root {
  color-scheme: light;
  --ink: #070707;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --paper: #f3f3f3;
  --surface: #ffffff;
  --teal: #0b0b0b;
  --teal-dark: #000000;
  --mint: #f7f7f7;
  --charcoal: #060606;
  --charcoal-soft: #171717;
  --red: #b42318;
  --gold: #111111;
  --gold-dark: #000000;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.12);
  --button-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

/* CRM workspace overlay and consistent interactive states. */
body.crm-shell-body.crm-chat-open {
  overflow: auto !important;
}

body.crm-shell-body.crm-chat-open::before {
  display: none !important;
}

body.crm-shell-body #chat.crm-pane.active {
  display: grid !important;
  position: fixed !important;
  inset: 18px !important;
  z-index: 100 !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(16px, 2.5vw, 34px) !important;
  overflow: auto !important;
  border: 1px solid rgba(175, 117, 230, 0.4) !important;
  border-radius: 18px !important;
  background: var(--page, #11152d) !important;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  animation: crm-chat-in 220ms cubic-bezier(.2,.8,.2,1) both;
}

body.crm-shell-body.crm-chat-open .crm-page .client-list {
  display: block !important;
  overflow: visible !important;
}

body.crm-shell-body #chat.crm-pane.active .crm-chat-workspace,
body.crm-shell-body #chat.crm-pane.active .crm-client-support-panel {
  max-width: 1240px;
  margin-inline: auto;
}

body.crm-shell-body .crm-chat-heading {
  position: relative;
}

body.crm-shell-body .crm-chat-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 12px;
  padding: 8px 14px;
  border: 1px solid rgba(237, 82, 194, 0.45);
  border-radius: 9px;
  background: rgba(237, 82, 194, 0.12);
  color: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

body.crm-shell-body .crm-chat-back:hover,
body.crm-shell-body .crm-chat-back:focus-visible {
  transform: translateX(-2px);
  border-color: #e5a847;
  background: rgba(237, 82, 194, 0.26);
  outline: none;
}

body.crm-shell-body .crm-page .crm-side-menu button,
body.crm-shell-body .crm-page .mini-tabs button,
body.crm-shell-body .crm-page .request-card,
body.crm-shell-body .crm-page .transaction-row,
body.crm-shell-body .crm-page .comments-panel,
body.crm-shell-body .crm-page input,
body.crm-shell-body .crm-page select,
body.crm-shell-body .crm-page textarea {
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease, color 160ms ease;
}

body.crm-shell-body .crm-page .crm-side-menu {
  gap: 8px !important;
}

body.crm-shell-body .crm-page .crm-side-menu button,
body.crm-shell-body .crm-page .mini-tabs button {
  border: 1px solid rgba(160, 124, 212, 0.25) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.035) !important;
}

body.crm-shell-body .crm-page .crm-side-menu button:hover,
body.crm-shell-body .crm-page .mini-tabs button:hover {
  border-color: rgba(237, 82, 194, 0.75) !important;
  background: rgba(237, 82, 194, 0.16) !important;
  color: #fff !important;
  transform: translateX(2px);
}

body.crm-shell-body .crm-page .crm-side-menu button.active,
body.crm-shell-body .crm-page .mini-tabs button.active {
  border-color: rgba(237, 82, 194, 0.82) !important;
  background: linear-gradient(135deg, rgba(106, 61, 167, 0.9), rgba(237, 82, 194, 0.78)) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(237, 82, 194, 0.18);
}

body.crm-shell-body .crm-page .request-card:hover,
body.crm-shell-body .crm-page .transaction-row:hover,
body.crm-shell-body .crm-page .comments-panel:hover {
  border-color: rgba(237, 82, 194, 0.52) !important;
  box-shadow: 0 10px 28px rgba(28, 17, 53, 0.18);
}

.crm-client-assets-panel { grid-column: 1 / -1; }
.crm-assets-note { margin: 0 0 16px; color: var(--muted); }
.crm-client-assets-panel .transaction-row { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.crm-client-assets-panel .transaction-row:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15, 29, 48, .14); border-color: rgba(39, 174, 136, .45); }
.crm-trade-meta { display: block; margin-top: 5px; }

/* Polished customer profile card, including the floating workflow view. */
body.crm-shell-body .detail-top[data-crm-client-section="overview"],
body.crm-shell-body > .detail-top.crm-workflow-active-panel {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px) !important;
  gap: 18px !important;
  align-items: stretch !important;
  padding: 22px !important;
  border: 1px solid rgba(139, 92, 246, .16) !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, #fff 0%, #fbf9ff 100%) !important;
}

body.crm-shell-body .detail-top .crm-client-identity-head {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(139, 92, 246, .12);
}

body.crm-shell-body .detail-top .crm-client-contact-grid div {
  min-height: 58px;
  padding: 11px 12px;
  border-color: rgba(93, 67, 147, .13);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(49, 35, 78, .045);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

body.crm-shell-body .detail-top .crm-client-contact-grid div:hover {
  transform: translateY(-2px);
  border-color: rgba(182, 59, 181, .35);
  box-shadow: 0 9px 22px rgba(82, 54, 120, .09);
}

body.crm-shell-body .detail-top .crm-client-quick-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

body.crm-shell-body .detail-top .crm-client-quick-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #7b46b3, #d448b9);
  color: #fff;
  box-shadow: 0 8px 18px rgba(159, 62, 175, .17);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

body.crm-shell-body .detail-top .crm-client-quick-actions button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 12px 24px rgba(159, 62, 175, .25);
}

body.crm-shell-body .detail-top .balance-pill {
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(115, 82, 169, .16);
  border-radius: 16px;
  background: linear-gradient(145deg, #f5effb, #f3fbfc) !important;
}

body.crm-shell-body .detail-top .balance-pill strong {
  font-size: 1.65rem !important;
  color: #282039;
}

body.crm-shell-body .detail-top .balance-pill small {
  color: #726783;
  line-height: 1.45;
}

@media (max-width: 680px) {
  body.crm-shell-body .detail-top[data-crm-client-section="overview"],
  body.crm-shell-body > .detail-top.crm-workflow-active-panel {
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 16px !important;
    border-radius: 14px !important;
  }
  body.crm-shell-body .detail-top .crm-client-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Purple scrollbars in both CRM themes. */
body.crm-shell-body,
body.crm-shell-body * {
  scrollbar-width: thin;
  scrollbar-color: #b832c5 rgba(126, 91, 155, .12);
}
body.crm-shell-body::-webkit-scrollbar,
body.crm-shell-body *::-webkit-scrollbar { width: 10px; height: 10px; }
body.crm-shell-body::-webkit-scrollbar-track,
body.crm-shell-body *::-webkit-scrollbar-track { background: rgba(126, 91, 155, .1); border-radius: 10px; }
body.crm-shell-body::-webkit-scrollbar-thumb,
body.crm-shell-body *::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #e24bc8, #7f3fc3); border: 2px solid transparent; border-radius: 10px; background-clip: padding-box; }
body.crm-shell-body::-webkit-scrollbar-thumb:hover,
body.crm-shell-body *::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #f062da, #9252d6); background-clip: padding-box; }

@keyframes crm-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes crm-chat-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 700px) {
  body.crm-shell-body #chat.crm-pane.active {
    inset: 8px !important;
    padding: 12px !important;
    border-radius: 14px !important;
  }
}

/* CRM messenger workspace */
body.crm-shell-body .crm-chat-workspace {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface, #fff);
  box-shadow: 0 18px 46px rgba(25, 18, 45, 0.08);
}

body.crm-shell-body .crm-side-menu button[data-crm-tab="chat"],
body.crm-shell-body .mini-tabs button[data-crm-tab="chat"] {
  position: relative;
}

body.crm-shell-body .crm-chat-unread {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: #e5a847;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1;
}

body.crm-shell-body button[data-crm-tab="chat"].has-unread {
  box-shadow: 0 0 0 2px rgba(238, 89, 196, 0.18), 0 8px 18px rgba(238, 89, 196, 0.16);
}

body.crm-shell-body .crm-chat-heading,
body.crm-shell-body .crm-chat-main-header,
body.crm-shell-body .crm-chat-section-title,
body.crm-shell-body .crm-chat-member,
body.crm-shell-body .chat-ticket {
  display: flex;
  align-items: center;
}

body.crm-shell-body .crm-chat-heading {
  justify-content: space-between;
  gap: 18px;
}

body.crm-shell-body .crm-chat-heading h2,
body.crm-shell-body .crm-chat-main-header h3 {
  margin: 3px 0;
}

body.crm-shell-body .crm-chat-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

body.crm-shell-body .crm-chat-status,
body.crm-shell-body .crm-chat-private {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

body.crm-shell-body .crm-chat-status i,
body.crm-shell-body .crm-chat-member i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #3fcf8e;
}

body.crm-shell-body .crm-chat-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.33fr) minmax(0, 1fr);
  min-height: 490px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2, #f8f7fb);
}

body.crm-shell-body .crm-chat-sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface, #fff) 86%, #e5a847 14%);
}

body.crm-shell-body .crm-chat-section-title {
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.crm-shell-body .crm-chat-section-title b {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface, #fff) 70%, #e5a847 30%);
  text-align: center;
  font-size: 0.68rem;
}

body.crm-shell-body .crm-chat-members,
body.crm-shell-body .crm-chat-topics {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

body.crm-shell-body .crm-chat-member {
  width: 100%;
  gap: 9px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
}

body.crm-shell-body .crm-chat-member:hover,
body.crm-shell-body .crm-chat-member.active {
  border-color: rgba(225, 75, 190, 0.42);
  background: color-mix(in srgb, var(--surface, #fff) 75%, #e5a847 25%);
}

body.crm-shell-body .crm-chat-member > span:nth-child(2),
body.crm-shell-body .chat-ticket-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.crm-shell-body .crm-chat-member b,
body.crm-shell-body .crm-chat-member small,
body.crm-shell-body .chat-ticket-copy b,
body.crm-shell-body .chat-ticket-copy small,
body.crm-shell-body .chat-ticket-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.crm-shell-body .crm-chat-member small,
body.crm-shell-body .chat-ticket-copy small,
body.crm-shell-body .chat-ticket-copy p {
  color: var(--muted);
  font-size: 0.72rem;
}

body.crm-shell-body .crm-chat-avatar,
body.crm-shell-body .chat-ticket-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #ef5bc5, #7860ef);
  color: #fff;
  font-weight: 900;
}

body.crm-shell-body .crm-chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  background: var(--surface, #fff);
}

body.crm-shell-body .crm-chat-main-header {
  gap: 11px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

body.crm-shell-body .crm-chat-main-header > div {
  min-width: 0;
  flex: 1;
}

body.crm-shell-body .crm-chat-main-header small {
  color: var(--muted);
}

body.crm-shell-body .crm-internal-feed {
  min-height: 260px;
  max-height: 390px;
  overflow: auto;
  padding: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface, #fff) 92%, #ef5bc5 8%), var(--surface, #fff));
}

body.crm-shell-body .crm-internal-message {
  width: min(76%, 540px);
  margin: 0 0 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  background: var(--surface-2, #f5f3f8);
}

body.crm-shell-body .crm-internal-message span,
body.crm-shell-body .crm-internal-message small {
  display: block;
  margin-top: 4px;
}

body.crm-shell-body .crm-internal-message small {
  color: var(--muted);
  font-size: 0.7rem;
}

body.crm-shell-body .crm-internal-form,
body.crm-shell-body .crm-client-support-panel .comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface, #fff);
}

body.crm-shell-body .crm-internal-form input,
body.crm-shell-body .crm-client-support-panel input {
  min-height: 46px;
  border-radius: 12px;
}

body.crm-shell-body .crm-chat-topics .chat-ticket {
  position: relative;
  gap: 9px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

body.crm-shell-body .crm-chat-topics .chat-ticket:hover,
body.crm-shell-body .crm-chat-topics .chat-ticket.active {
  border-color: rgba(225, 75, 190, 0.42);
  background: color-mix(in srgb, var(--surface, #fff) 75%, #e5a847 25%);
}

body.crm-shell-body .chat-ticket-delete {
  display: none;
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(225, 75, 190, 0.42);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.65rem;
}

body.crm-shell-body .chat-ticket:hover .chat-ticket-delete,
body.crm-shell-body .chat-ticket.active .chat-ticket-delete {
  display: inline-block;
}

body.crm-shell-body .chat-ticket-delete:hover {
  background: #e5a847;
  color: #fff;
}

body.crm-shell-body .crm-client-support-panel {
  display: grid;
  gap: 0;
  margin-top: 18px;
  overflow: hidden;
}

body.crm-shell-body .crm-client-chat-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.3fr) minmax(0, 1fr);
  min-height: 270px;
}

body.crm-shell-body .crm-client-chat-list {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface, #fff) 88%, #e5a847 12%);
}

body.crm-shell-body .crm-client-chat-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
}

body.crm-shell-body .crm-client-chat-item:hover,
body.crm-shell-body .crm-client-chat-item.active {
  border-color: rgba(225, 75, 190, 0.42);
  background: color-mix(in srgb, var(--surface, #fff) 72%, #e5a847 28%);
}

body.crm-shell-body .crm-client-chat-item > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.crm-shell-body .crm-client-chat-item b,
body.crm-shell-body .crm-client-chat-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.crm-shell-body .crm-client-chat-item small {
  max-width: 145px;
  color: var(--muted);
  font-size: 0.68rem;
}

body.crm-shell-body .crm-client-chat-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 330px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, #151b3a 8%);
}

body.crm-shell-body .crm-client-chat-current {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

body.crm-shell-body .crm-client-chat-current > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.crm-shell-body .crm-client-chat-current small {
  color: var(--muted);
}

body.crm-shell-body .crm-client-support-panel .crm-message-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 170px;
  max-height: 300px;
  overflow: auto;
  padding: 14px 16px;
}

body.crm-shell-body .crm-client-support-panel .crm-message-feed p:not(.empty-state) {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2, #f7f5f9);
  font-size: 0.8rem;
}

body.crm-shell-body .crm-client-message-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(225, 75, 190, 0.34);
  border-radius: 10px;
  background: var(--surface-2, #f7f5f9);
  font-size: 0.78rem;
  box-shadow: 0 2px 8px rgba(10, 12, 30, 0.1);
}

body.crm-shell-body .crm-client-message-row:hover {
  border-color: #e5a847;
  background: color-mix(in srgb, var(--surface-2, #f7f5f9) 78%, #e5a847 22%);
  box-shadow: 0 5px 14px rgba(238, 89, 196, 0.12);
}

body.crm-shell-body .crm-client-chat-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: min(260px, 32vw);
  padding: 5px 9px;
  border: 1px solid rgba(225, 75, 190, 0.36);
  border-radius: 10px;
  background: var(--surface-2, #f7f5f9);
}

body.crm-shell-body .crm-client-chat-search:focus-within {
  border-color: #e5a847;
  box-shadow: 0 0 0 3px rgba(238, 89, 196, 0.14);
}

body.crm-shell-body .crm-client-chat-search input {
  min-width: 0;
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.crm-shell-body .crm-client-message-row > span {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

body.crm-shell-body .crm-client-message-row button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(225, 75, 190, 0.45);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

body.crm-shell-body .crm-client-message-row button:hover {
  background: #e5a847;
  color: #fff;
}

body.crm-shell-body .crm-page .request-card.customer-online {
  border-color: rgba(63, 207, 142, 0.65) !important;
  box-shadow: 0 0 0 2px rgba(63, 207, 142, 0.12);
}

body.crm-shell-body .crm-page .request-card > em.customer-presence {
  min-width: 4.6rem;
  text-align: center;
  cursor: help;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

body.crm-shell-body .crm-page .request-card > em.customer-presence.online {
  color: #168454 !important;
  background: rgba(63, 207, 142, 0.14) !important;
  border-color: rgba(63, 207, 142, 0.48) !important;
}

body.crm-shell-body .crm-page .request-card > em.customer-presence.offline {
  color: #7e718c !important;
  background: rgba(126, 113, 140, 0.1) !important;
  border-color: rgba(126, 113, 140, 0.28) !important;
}

body.crm-shell-body .crm-page .crm-transaction-queue {
  display: grid;
  gap: 0.65rem;
  max-height: min(68vh, 46rem);
  overflow: auto;
  padding-right: 0.25rem;
}

body.crm-shell-body .crm-page .crm-transaction-queue .transaction-row {
  min-height: 4.3rem;
}

body.crm-shell-body .crm-page .crm-transaction-search {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 0.65rem;
}

body.crm-shell-body .crm-page .crm-transaction-search span {
  color: var(--muted, #aaa0b8);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.crm-shell-body .crm-page .crm-transaction-search input {
  width: 100%;
  box-sizing: border-box;
}

body.crm-shell-body .crm-page .crm-transaction-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

body.crm-shell-body .crm-page .crm-transaction-filters button {
  min-height: 2.3rem;
  padding: 0.45rem 0.8rem;
}

body.crm-shell-body .crm-page .crm-transaction-filters button.active {
  border-color: rgba(237, 82, 194, 0.75) !important;
  background: linear-gradient(135deg, #873dca, #e5a847) !important;
  color: #fff !important;
}

body.crm-shell-body .crm-page .crm-history-subtitle {
  margin-top: 1.3rem;
}

body.crm-shell-body .crm-page .crm-past-chat-list {
  display: grid;
  gap: 0.55rem;
  max-height: 25rem;
  overflow: auto;
}

body.crm-shell-body .crm-page .crm-past-chat-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(150, 119, 218, 0.28);
  border-radius: 0.7rem;
  background: rgba(22, 25, 58, 0.72);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

body.crm-shell-body .crm-page .crm-past-chat-row:hover,
body.crm-shell-body .crm-page .crm-past-chat-row:focus-visible {
  border-color: rgba(237, 82, 194, 0.8);
  background: rgba(93, 48, 126, 0.58);
  outline: none;
}

body.crm-shell-body .crm-page .crm-past-chat-row > span:nth-child(2) {
  min-width: 0;
}

body.crm-shell-body .crm-page .crm-past-chat-row b,
body.crm-shell-body .crm-page .crm-past-chat-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.crm-shell-body .crm-page .crm-past-chat-row small {
  margin-top: 0.2rem;
  color: var(--muted, #aaa0b8);
}

body.crm-shell-body .crm-page .crm-past-chat-row em {
  color: var(--muted, #aaa0b8);
  font-size: 0.76rem;
  font-style: normal;
  white-space: nowrap;
}

body.crm-shell-body .crm-page .crm-notification-section {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(150, 119, 218, 0.24);
  border-radius: 0.75rem;
  background: rgba(18, 22, 51, 0.42);
}

body.crm-shell-body .crm-page .crm-notification-section .panel-title {
  margin: 0 0 0.75rem;
}

body.crm-shell-body .crm-page .crm-notification-section h3 {
  margin: 0;
  font-size: 1rem;
}
.crm-notification-unread {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a43bd0, #dc3fa4);
  color: #fff;
  font-size: .68rem;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(190,55,201,.28);
}

/* Notification center refresh: clear hierarchy, compact first view and an intentional expand state. */
body.crm-shell-body .crm-notification-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(167, 139, 250, .25);
  border-radius: 20px;
  background:
    radial-gradient(circle at 86% 12%, rgba(217, 70, 239, .2), transparent 36%),
    linear-gradient(135deg, rgba(30, 41, 80, .98), rgba(20, 24, 50, .92));
  box-shadow: 0 22px 45px rgba(4, 6, 24, .2);
}

body.crm-shell-body .crm-notification-hero h2 {
  margin: 8px 0 6px;
  color: #fff;
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  letter-spacing: -.03em;
}

body.crm-shell-body .crm-notification-hero p {
  max-width: 580px;
  margin: 0;
  color: rgba(238, 242, 255, .72);
  font-size: .9rem;
}

body.crm-shell-body .crm-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d8b4fe;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.crm-shell-body .crm-live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, .14);
}

body.crm-shell-body .crm-notification-retention {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  min-width: 170px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 180, 254, .25);
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  color: rgba(238, 242, 255, .62);
  font-size: .68rem;
  line-height: 1.35;
}

body.crm-shell-body .crm-notification-retention b {
  color: #f5d0fe;
  font-size: .79rem;
}

body.crm-shell-body .crm-page .crm-notification-section {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: rgba(12, 16, 38, .62);
  box-shadow: 0 12px 28px rgba(4, 6, 24, .12);
}

body.crm-shell-body .crm-page .crm-notification-section-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

body.crm-shell-body .crm-notification-section-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(216, 180, 254, .25);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(124, 58, 237, .8), rgba(217, 70, 239, .58));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(124, 58, 237, .2);
}

body.crm-shell-body .crm-icon-transfer { background: linear-gradient(145deg, rgba(20, 184, 166, .72), rgba(14, 116, 144, .75)); }
body.crm-shell-body .crm-icon-sms { background: linear-gradient(145deg, rgba(236, 72, 153, .78), rgba(124, 58, 237, .8)); }

body.crm-shell-body .crm-page .crm-notification-section-head h3 {
  margin: 0;
  color: #f7f5ff;
  font-size: 1rem;
  letter-spacing: -.01em;
}

body.crm-shell-body .crm-page .crm-notification-section-head span {
  display: block;
  margin-top: 3px;
  color: rgba(203, 213, 225, .6);
  font-size: .7rem;
}

body.crm-shell-body .crm-notification-count {
  display: grid;
  min-width: 29px;
  height: 27px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(216, 180, 254, .24);
  border-radius: 999px;
  background: rgba(124, 58, 237, .2);
  color: #e9d5ff;
  font-size: .72rem;
}

body.crm-shell-body .crm-page .crm-notification-section .crm-events-list {
  display: grid;
  gap: 9px;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
}

body.crm-shell-body .crm-page .crm-notification-section .crm-event-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(148, 163, 184, .17);
  border-radius: 14px;
  background: rgba(255, 255, 255, .045);
  box-shadow: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

body.crm-shell-body .crm-page .crm-notification-section .crm-event-row:hover,
body.crm-shell-body .crm-page .crm-notification-section .crm-event-row:focus-within {
  transform: translateY(-2px);
  border-color: rgba(216, 180, 254, .55);
  background: rgba(167, 139, 250, .1);
  box-shadow: 0 12px 24px rgba(3, 7, 18, .18);
}

body.crm-shell-body .crm-event-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(216, 180, 254, .24);
  border-radius: 12px;
  background: rgba(124, 58, 237, .24);
  color: #e9d5ff;
  font-size: 1rem;
  font-weight: 900;
}

body.crm-shell-body .crm-event-client_login .crm-event-icon { background: rgba(59, 130, 246, .2); color: #93c5fd; }
body.crm-shell-body .crm-event-client_registered .crm-event-icon { background: rgba(16, 185, 129, .2); color: #6ee7b7; }
body.crm-shell-body .crm-event-iban_deposit_request .crm-event-icon,
body.crm-shell-body .crm-event-deposit_request .crm-event-icon { background: rgba(20, 184, 166, .2); color: #5eead4; }
body.crm-shell-body .crm-event-iban_withdrawal_request .crm-event-icon,
body.crm-shell-body .crm-event-crypto_send_requested .crm-event-icon,
body.crm-shell-body .crm-event-crm_crypto_send_requested .crm-event-icon { background: rgba(245, 158, 11, .2); color: #fcd34d; }
body.crm-shell-body .crm-event-sms_received .crm-event-icon { background: rgba(236, 72, 153, .2); color: #f9a8d4; }

body.crm-shell-body .crm-event-main { min-width: 0; }
body.crm-shell-body .crm-event-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
body.crm-shell-body .crm-event-kind {
  min-width: 0;
  overflow: hidden;
  color: #f8fafc;
  font-size: .82rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.crm-shell-body .crm-event-topline time {
  flex: 0 0 auto;
  color: rgba(216, 180, 254, .82);
  font-size: .67rem;
  font-weight: 750;
}
body.crm-shell-body .crm-event-meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(203, 213, 225, .58) !important;
  font-size: .68rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.crm-shell-body .crm-event-body {
  margin: 7px 0 0;
  color: rgba(241, 245, 249, .82) !important;
  font-size: .82rem !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
body.crm-shell-body .crm-event-is-new { border-left: 3px solid #d946ef !important; }
body.crm-shell-body .crm-event-is-new .crm-event-kind::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 2px 7px;
  border-radius: 50%;
  background: #34d399;
  vertical-align: middle;
}
body.crm-shell-body .crm-event-row.has-sms-message > .crm-event-icon { display: grid !important; grid-template-columns: none !important; }
body.crm-shell-body .crm-event-row.has-sms-message > .crm-event-main { display: block !important; }
body.crm-shell-body .crm-event-row.has-sms-message .crm-event-body { grid-column: auto !important; width: auto !important; padding-top: 0 !important; border-top: 0 !important; }
body.crm-shell-body .crm-event-row.sms-content-missing .crm-event-body { color: #fbbf24 !important; }

body.crm-shell-body .crm-notification-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 10px;
  border: 1px solid rgba(216, 180, 254, .24);
  border-radius: 11px;
  background: rgba(124, 58, 237, .12);
  color: #e9d5ff;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 850;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
body.crm-shell-body .crm-notification-toggle:hover,
body.crm-shell-body .crm-notification-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(216, 180, 254, .62);
  background: rgba(168, 85, 247, .24);
  outline: none;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-notification-hero {
  border-color: rgba(124, 58, 237, .18);
  background: linear-gradient(135deg, #f7f2ff, #fff5fb);
  box-shadow: 0 18px 36px rgba(101, 64, 154, .1);
}
:root[data-theme="purple-light"] body.crm-shell-body .crm-notification-hero h2 { color: #241332; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-notification-hero p { color: #6e5a7c; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-live-pill { color: #008ba9; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-notification-retention { border-color: rgba(124, 58, 237, .18); background: rgba(255,255,255,.72); color: #766781; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-notification-retention b { color: #8b3aad; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-notification-section { border-color: #eadffc; background: #fbfaff; box-shadow: 0 12px 28px rgba(101,64,154,.07); }
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-notification-section-head h3 { color: #251b31; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-notification-section-head span { color: #8a7c96; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-notification-count { border-color: #e3cdf7; background: #f4e8ff; color: #008ba9; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-notification-section .crm-event-row { border-color: #eadffc; background: #fff; box-shadow: 0 4px 14px rgba(70,49,160,.05); }
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-notification-section .crm-event-row:hover { border-color: #c9a9ee; background: #fdf8ff; box-shadow: 0 10px 20px rgba(70,49,160,.1); }
:root[data-theme="purple-light"] body.crm-shell-body .crm-event-kind { color: #2b2036; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-event-topline time { color: #8b5bb0; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-event-meta { color: #8a7c96 !important; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-event-body { color: #51445d !important; }
:root[data-theme="purple-light"] body.crm-shell-body .crm-notification-toggle { border-color: #e3cdf7; background: #fbf2ff; color: #813ca6; }

@media (max-width: 620px) {
  body.crm-shell-body .crm-notification-hero { align-items: stretch; flex-direction: column; gap: 14px; }
  body.crm-shell-body .crm-notification-retention { min-width: 0; }
  body.crm-shell-body .crm-page .crm-notification-section { padding: 11px; }
  body.crm-shell-body .crm-page .crm-notification-section .crm-event-row { grid-template-columns: 34px minmax(0, 1fr); gap: 9px; padding: 11px; }
  body.crm-shell-body .crm-event-icon { width: 34px; height: 34px; border-radius: 10px; }
  body.crm-shell-body .crm-event-topline { align-items: flex-start; flex-direction: column; gap: 2px; }
  body.crm-shell-body .crm-event-topline time { font-size: .64rem; }
}
.crm-notification-unread[hidden] { display: none !important; }

body.crm-shell-body .crm-client-support-panel .panel-title {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

body.crm-shell-body .crm-client-support-panel .panel-title > div {
  display: grid;
  gap: 3px;
}

body.crm-shell-body .crm-client-support-panel .crm-message-feed {
  min-height: 130px;
  max-height: 280px;
  overflow: auto;
  padding: 14px 18px;
}

@media (max-width: 760px) {
  body.crm-shell-body .crm-chat-workspace { padding: 12px; }
  body.crm-shell-body .crm-chat-heading { align-items: flex-start; }
  body.crm-shell-body .crm-chat-heading p { font-size: 0.8rem; }
  body.crm-shell-body .crm-chat-layout { grid-template-columns: 1fr; min-height: 0; }
  body.crm-shell-body .crm-chat-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  body.crm-shell-body .crm-chat-members,
  body.crm-shell-body .crm-chat-topics { max-height: 150px; }
  body.crm-shell-body .crm-chat-main { min-height: 430px; }
  body.crm-shell-body .crm-client-chat-layout { grid-template-columns: 1fr; }
  body.crm-shell-body .crm-client-chat-list { max-height: 150px; border-right: 0; border-bottom: 1px solid var(--line); }
  body.crm-shell-body .crm-chat-private { display: none; }
  body.crm-shell-body .crm-internal-message { width: 88%; }
  body.crm-shell-body .crm-internal-form,
  body.crm-shell-body .crm-client-support-panel .comment-form { grid-template-columns: 1fr; }
}

/* CRM search and row geometry: keep dense customer data readable in both
   themes instead of allowing wrapped identity text to overlap the next row. */
body.crm-shell-body .crm-customer-search {
  display: block !important;
  margin: 0 0 16px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(167, 139, 250, .18) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, .035) !important;
}

body.crm-shell-body .crm-search-label {
  display: block !important;
  margin: 0 0 8px !important;
  color: #aaa0ca !important;
  font-size: .76rem !important;
  font-weight: 850 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

body.crm-shell-body .crm-search-control {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 46px !important;
  padding: 0 13px !important;
  border: 1px solid rgba(167, 139, 250, .28) !important;
  border-radius: 11px !important;
  background: rgba(5, 10, 22, .72) !important;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease !important;
}

body.crm-shell-body .crm-search-icon {
  flex: 0 0 auto !important;
  color: #2dc3d8 !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
}

body.crm-shell-body .crm-search-control:focus-within {
  border-color: #e5a847 !important;
  background: rgba(35, 17, 46, .86) !important;
  box-shadow: 0 0 0 3px rgba(239, 108, 167, .14), 0 8px 20px rgba(217, 87, 232, .12) !important;
}

body.crm-shell-body .crm-search-control input {
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.crm-shell-body .crm-page #applications .request-card {
  min-height: 88px !important;
  grid-template-columns: minmax(230px, 2.2fr) minmax(110px, 1.3fr) minmax(130px, 1.4fr) minmax(100px, 1.2fr) minmax(135px, 1.3fr) minmax(115px, 1fr) !important;
  gap: 14px !important;
  padding: 11px 18px !important;
  overflow: hidden !important;
  align-items: center !important;
}

body.crm-shell-body .crm-page #applications .request-card > span:first-child {
  display: grid !important;
  min-width: 0 !important;
  gap: 4px !important;
  align-content: center !important;
}

body.crm-shell-body .crm-page #applications .request-card > span:first-child b,
body.crm-shell-body .crm-page #applications .request-card > span:first-child small {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.crm-shell-body .crm-page #applications .request-card > span:not(:first-child),
body.crm-shell-body .crm-page #applications .request-card > strong,
body.crm-shell-body .crm-page #applications .request-card > em {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.crm-shell-body .crm-page #applications .request-card:hover,
:root[data-theme="purple-dark"] body.crm-shell-body .crm-page #applications .request-card:hover {
  background: linear-gradient(90deg, rgba(217, 87, 232, .20), rgba(239, 108, 167, .08)) !important;
  border-color: #e5a847 !important;
  box-shadow: inset 4px 0 #e5a847, 0 8px 20px rgba(217, 87, 232, .12) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-customer-search {
  border-color: #e9d3ec !important;
  background: #faf7fb !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-search-control {
  border-color: #e1cde4 !important;
  background: #ffffff !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-search-control input {
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-search-control input::placeholder {
  color: #8a7c91 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page #applications .request-card:hover {
  background: linear-gradient(90deg, #fff0fb, #ffffff) !important;
  border-color: #e5a847 !important;
  box-shadow: inset 4px 0 #e5a847, 0 8px 20px rgba(217, 87, 232, .1) !important;
}

@media (max-width: 900px) {
  body.crm-shell-body .crm-page #applications .request-card {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: auto !important;
  }
}

body.crm-shell-body .crm-page.detail-open .crm-client-progress button {
  border-color: rgba(167, 139, 250, .16) !important;
  background: rgba(255, 255, 255, .035) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

/* Consistent interaction feedback for every CRM button. */
body.crm-shell-body .crm-page button,
body.crm-shell-body .crm-manager-login button,
body.crm-shell-body .crm-manager-form button {
  cursor: pointer;
  transform-origin: center;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, filter .18s ease !important;
}

body.crm-shell-body .crm-page button:disabled,
body.crm-shell-body .crm-manager-login button:disabled,
body.crm-shell-body .crm-manager-form button:disabled {
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

@media (hover: hover) and (pointer: fine) {
  body.crm-shell-body .crm-page button:not(:disabled):hover,
  body.crm-shell-body .crm-manager-login button:not(:disabled):hover,
  body.crm-shell-body .crm-manager-form button:not(:disabled):hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, .62) !important;
    filter: brightness(1.08);
    box-shadow: 0 9px 22px rgba(15, 23, 42, .18) !important;
  }

  body.crm-shell-body .crm-page button:not(:disabled):hover > svg,
  body.crm-shell-body .crm-page button:not(:disabled):hover > img,
  body.crm-shell-body .crm-page button:not(:disabled):hover > span:first-child {
    transform: scale(1.06);
  }

  body.crm-shell-body .crm-page button.danger:not(:disabled):hover,
  body.crm-shell-body .crm-page button[data-action*="reject"]:not(:disabled):hover,
  body.crm-shell-body .crm-page button[data-action*="delete"]:not(:disabled):hover {
    border-color: rgba(244, 63, 94, .72) !important;
    box-shadow: 0 9px 22px rgba(190, 24, 93, .18) !important;
  }

  :root[data-theme="purple-light"] body.crm-shell-body .crm-page button:not(:disabled):hover,
  :root[data-theme="purple-light"] body.crm-shell-body .crm-manager-login button:not(:disabled):hover,
  :root[data-theme="purple-light"] body.crm-shell-body .crm-manager-form button:not(:disabled):hover {
    background-color: #eef6ff !important;
    border-color: #60a5fa !important;
    color: #173b67 !important;
    box-shadow: 0 9px 22px rgba(37, 99, 235, .14) !important;
  }
}

body.crm-shell-body .crm-page button:not(:disabled):active,
body.crm-shell-body .crm-manager-login button:not(:disabled):active,
body.crm-shell-body .crm-manager-form button:not(:disabled):active {
  transform: translateY(0) scale(.97) !important;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .12) !important;
}

body.crm-shell-body .crm-page button:focus-visible,
body.crm-shell-body .crm-manager-login button:focus-visible,
body.crm-shell-body .crm-manager-form button:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .28) !important;
  outline-offset: 2px;
  border-color: #60a5fa !important;
}

body.crm-shell-body .crm-page button > svg,
body.crm-shell-body .crm-page button > img,
body.crm-shell-body .crm-page button > span:first-child {
  transition: transform .18s ease;
}

@media (prefers-reduced-motion: reduce) {
  body.crm-shell-body .crm-page button,
  body.crm-shell-body .crm-manager-login button,
  body.crm-shell-body .crm-manager-form button,
  body.crm-shell-body .crm-page button > svg,
  body.crm-shell-body .crm-page button > img,
  body.crm-shell-body .crm-page button > span:first-child {
    transition: none !important;
  }
}

body.crm-shell-body .crm-page.detail-open .crm-client-progress button.active {
  border-color: rgba(96, 165, 250, .65) !important;
  background: linear-gradient(135deg, rgba(79, 134, 247, .32), rgba(128, 87, 232, .26)) !important;
  color: var(--ink) !important;
}

.crm-market-catalog-title { margin-top: 24px !important; }
.crm-market-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.crm-market-catalog article { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-width: 0; padding: 12px; border: 1px solid rgba(139, 92, 246, .14); border-radius: 12px; background: rgba(255,255,255,.04); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.crm-market-catalog article:hover { transform: translateY(-2px); border-color: rgba(212,72,185,.42); box-shadow: 0 10px 22px rgba(75,43,100,.11); }
.crm-market-catalog article div { min-width: 0; }
.crm-market-catalog b, .crm-market-catalog small { display: block; }
.crm-market-catalog small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.crm-market-catalog strong { font-size: .74rem; text-align: right; }
.crm-asset-symbol { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: linear-gradient(135deg,#24b89f,#5d78ec); color: white; font-weight: 900; }
@media (max-width: 680px) { .crm-market-catalog { grid-template-columns: minmax(0, 1fr); } }

/* Final customer-card overrides. */
body.crm-shell-body .detail-top[data-crm-client-section="overview"],
body.crm-shell-body > .detail-top.crm-workflow-active-panel {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px) !important;
  gap: 18px !important;
  align-items: stretch !important;
  padding: 22px !important;
  border: 1px solid rgba(139, 92, 246, .16) !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, #fff, #fbf9ff) !important;
}
body.crm-shell-body .detail-top .crm-client-quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
body.crm-shell-body .detail-top .balance-pill { border-radius: 16px !important; }
@media (max-width: 680px) {
  body.crm-shell-body .detail-top[data-crm-client-section="overview"],
  body.crm-shell-body > .detail-top.crm-workflow-active-panel {
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 16px !important;
  }
}

/* Final floating workflow layer: panels are moved to body to escape CRM containers. */
body.crm-workflow-modal-open {
  overflow: hidden !important;
}

body.crm-workflow-modal-open > .crm-page {
  filter: blur(9px) !important;
  pointer-events: none !important;
  user-select: none !important;
}

body.crm-shell-body > .crm-workflow-backdrop:not(.hidden) {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 30000 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(2, 6, 23, .68) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(9px) !important;
  backdrop-filter: blur(9px) !important;
}

body.crm-shell-body > .crm-workflow-active-panel {
  display: block !important;
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  z-index: 30001 !important;
  width: min(680px, calc(100vw - 32px)) !important;
  max-width: 680px !important;
  max-height: calc(100vh - 40px) !important;
  margin: 0 !important;
  overflow: auto !important;
  transform: translate(-50%, -50%) !important;
  box-shadow: 0 34px 110px rgba(0, 0, 0, .72) !important;
}

body.crm-shell-body > .crm-workflow-active-panel.crm-insight-grid,
body.crm-shell-body > .crm-workflow-active-panel.crm-action-cards,
body.crm-shell-body > .crm-workflow-active-panel.detail-top {
  display: grid !important;
}

/* Match the floating workflow UI to the current CRM magenta palette. */
body.crm-shell-body .crm-page.detail-open .crm-client-progress button.active,
body.crm-shell-body .crm-page.detail-open .crm-workflow-actions button.active {
  border-color: rgba(237, 82, 194, .82) !important;
  background: linear-gradient(135deg, rgba(106, 61, 167, .9), rgba(237, 82, 194, .78)) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(237, 82, 194, .18) !important;
}

body.crm-shell-body .crm-page.detail-open .crm-workflow-actions button,
body.crm-shell-body .crm-page.detail-open .crm-workflow-window-head {
  border-color: rgba(229, 106, 223, .28) !important;
  background: linear-gradient(145deg, rgba(27, 20, 49, .96), rgba(40, 20, 55, .94)) !important;
  color: #fdf7ff !important;
}

body.crm-shell-body .crm-page.detail-open .crm-workflow-window-head > span {
  border: 1px solid rgba(237, 82, 194, .3) !important;
  background: rgba(237, 82, 194, .14) !important;
  color: #f1a5dc !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel {
  border: 1px solid rgba(237, 82, 194, .48) !important;
  background: linear-gradient(145deg, #171127, #251432) !important;
  color: #fdf7ff !important;
  box-shadow: 0 34px 110px rgba(8, 3, 15, .78), 0 0 0 1px rgba(229, 106, 223, .08) !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel h2,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel b,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel strong,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel label {
  color: #fff !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel p,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel span,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel small {
  color: #cdbbd8 !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel input,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel textarea,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel select,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel .comment-feed,
:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel article {
  border-color: rgba(229, 106, 223, .25) !important;
  background: rgba(10, 8, 24, .82) !important;
  color: #fff !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel button:not(.crm-workflow-floating-close) {
  border: 1px solid rgba(237, 82, 194, .42) !important;
  background: linear-gradient(135deg, #6a3da7, #e5a847) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(237, 82, 194, .2) !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel .secondary-button {
  background: rgba(255, 255, 255, .055) !important;
  color: #eadff0 !important;
  box-shadow: none !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel .panel-title span {
  border: 1px solid rgba(237, 82, 194, .34) !important;
  background: rgba(237, 82, 194, .14) !important;
  color: #f1a5dc !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body > .crm-workflow-active-panel .crm-workflow-floating-close {
  border-color: rgba(237, 82, 194, .48) !important;
  background: #2b1737 !important;
  color: #f7c1e7 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel {
  border: 1px solid #e4bfdc !important;
  background: linear-gradient(145deg, #fff, #fbf3ff) !important;
  color: #241627 !important;
  box-shadow: 0 34px 90px rgba(76, 29, 83, .25) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel input,
:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel textarea,
:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel select,
:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel .comment-feed,
:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel article {
  border-color: #ead6e7 !important;
  background: #fff !important;
  color: #241627 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel button:not(.crm-workflow-floating-close) {
  border-color: rgba(184, 62, 165, .35) !important;
  background: linear-gradient(135deg, #8a4bbb, #df53ba) !important;
  color: #fff !important;
}

:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel .crm-workflow-floating-close {
  border-color: #e4bfdc !important;
  background: #f8eaf6 !important;
  color: #8a276f !important;
}

:root[data-theme="purple-light"] body.crm-shell-body > .crm-workflow-active-panel .panel-title span {
  border: 1px solid #e8c5df !important;
  background: #faeaf6 !important;
  color: #9c337e !important;
}

@media (max-width: 640px) {
  body.crm-shell-body > .crm-workflow-active-panel {
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 20px) !important;
  }
}

/* Workflow steps are discrete workspace views, not page anchors. */
body.crm-shell-body .crm-page.detail-open .client-detail .crm-workflow-hidden {
  display: none !important;
}

.crm-workflow-window-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 16px 15px;
  padding: 15px 17px;
  border: 1px solid rgba(96, 165, 250, .2);
  border-radius: 10px;
  background: rgba(15, 23, 42, .72);
}

.crm-client-topline {
  position: sticky;
  top: 0;
  z-index: 10070;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 16px 12px;
  padding: 8px;
  border: 1px solid rgba(229, 106, 223, .24);
  border-radius: 10px;
  background: rgba(17, 11, 31, .94);
  box-shadow: 0 10px 28px rgba(8, 3, 15, .3);
  backdrop-filter: blur(14px);
}

body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-client-topline .crm-back-button {
  position: static !important;
  top: auto !important;
  flex: 0 0 auto;
  margin: 0 !important;
}

.crm-client-navigation {
  display: grid;
  grid-template-columns: auto minmax(58px, auto) auto;
  align-items: center;
  gap: 8px;
}

body.crm-shell-body .crm-page.detail-open .crm-client-navigation button {
  min-height: 38px !important;
  border: 1px solid rgba(237, 82, 194, .42) !important;
  background: linear-gradient(135deg, rgba(106, 61, 167, .92), rgba(237, 82, 194, .78)) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(237, 82, 194, .14) !important;
}

.crm-client-navigation span {
  color: #d9c8e2;
  font-size: .76rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

body.crm-shell-body .crm-page.detail-open .crm-client-navigation button:disabled {
  border-color: rgba(255, 255, 255, .08) !important;
  background: rgba(255, 255, 255, .045) !important;
  color: #73677c !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: .7;
}

:root[data-theme="purple-light"] .crm-client-topline {
  border-color: #e7c9e1;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 26px rgba(76, 29, 83, .12);
}

:root[data-theme="purple-light"] .crm-client-navigation span {
  color: #6f5273;
}

.crm-workflow-window-head > span {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(79, 134, 247, .14);
  color: #93c5fd;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-workflow-window-head h2 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 1rem;
}

.crm-workflow-window-head p {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.crm-workflow-panel-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  margin-left: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.crm-workflow-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 16px 16px;
}

.crm-workflow-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, .2);
  border-radius: 8px;
  background: rgba(15, 23, 42, .7);
  color: var(--ink);
  cursor: pointer;
}

.crm-workflow-actions button span {
  font-weight: 800;
}

.crm-workflow-actions button b {
  color: #93c5fd;
  font-size: .68rem;
  text-transform: uppercase;
}

.crm-workflow-actions button.active {
  border-color: rgba(96, 165, 250, .72);
  background: linear-gradient(135deg, rgba(79, 134, 247, .25), rgba(128, 87, 232, .2));
}

body.crm-shell-body .crm-page.detail-open .client-detail .crm-workflow-active-panel {
  display: block !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 12001 !important;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  margin: 0 !important;
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .62);
  animation: crm-workflow-panel-in .16s ease-out;
}

body.crm-shell-body .crm-page.detail-open .client-detail .crm-workflow-active-panel.crm-insight-grid,
body.crm-shell-body .crm-page.detail-open .client-detail .crm-workflow-active-panel.crm-action-cards,
body.crm-shell-body .crm-page.detail-open .client-detail .crm-workflow-active-panel.detail-top {
  display: grid !important;
}

:root[data-theme="purple-light"] .crm-workflow-window-head,
:root[data-theme="purple-light"] .crm-workflow-actions button {
  border-color: #e5d5ed;
  background: #fff;
}

:root[data-theme="purple-light"] .crm-workflow-window-head h2,
:root[data-theme="purple-light"] .crm-workflow-actions button {
  color: #17121b;
}

:root[data-theme="purple-light"] .crm-workflow-window-head p {
  color: #74677c;
}

@keyframes crm-workflow-panel-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.crm-workflow-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(2, 6, 23, .7);
  backdrop-filter: blur(7px);
  cursor: default;
}

.crm-workflow-floating-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
  background: #172033;
  color: #f8fafc;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.crm-workflow-active-panel > .panel-title:first-child {
  padding-right: 42px;
}

@media (max-width: 640px) {
  .crm-client-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-workflow-window-head {
    align-items: flex-start;
    margin-inline: 10px;
  }

  .crm-client-topline {
    position: relative;
    flex-wrap: wrap;
    margin-inline: 10px;
  }

  .crm-client-navigation {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .crm-client-navigation button {
    min-width: 0;
    padding-inline: 9px !important;
  }

  .crm-workflow-actions {
    grid-template-columns: 1fr;
    margin-inline: 10px;
  }

  body.crm-shell-body .crm-page.detail-open .client-detail .crm-workflow-active-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

/* Readability pass for every secondary CRM view in light mode. */
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane h1,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane h2,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane h3,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane p,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane span,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane b,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane strong,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane small,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-pane label {
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-profile-card,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .session-list,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .support-ticket-list,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-events-list,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-internal-feed,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-message-feed {
  background: #fafafa !important;
  border-color: #e9e9e9 !important;
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .support-ticket-row,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-event-row,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-internal-message,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .chat-ticket,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .transaction-row {
  background: #ffffff !important;
  border-color: #e9e9e9 !important;
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .support-ticket-row p,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .support-ticket-row small,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-event-row p,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-event-row small,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-internal-message span,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-internal-message small,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .chat-ticket p,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .transaction-row small {
  color: #707070 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-internal-feed {
  padding: 10px !important;
  border-radius: 12px !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-internal-message {
  margin: 0 0 8px !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 10px rgba(17, 17, 17, .04) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-profile-card span,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-manager-session-list span,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .session-list span {
  color: #707070 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-profile-card b,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-manager-session-list strong,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .session-list strong {
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-manager-create-form,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-assignment-form,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-recovery-form,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .comment-form {
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-manager-create-form label,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-assignment-form label,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-recovery-form label,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .comment-form label {
  color: #4b4b4b !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-events-title,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-support-title,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .panel-title h2 {
  color: #161616 !important;
}

/* Settings is a state page, so its message belongs in the workspace center. */
body.crm-shell-body .crm-page #settings.crm-pane.active {
  min-height: calc(100vh - 150px) !important;
  align-content: center !important;
  justify-items: center !important;
  padding: 32px !important;
}

body.crm-shell-body .crm-page #settings.crm-pane.active .empty-state {
  width: min(680px, 100%) !important;
  margin: 0 !important;
  padding: 30px 34px !important;
  text-align: center !important;
  line-height: 1.5 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page #settings.crm-pane.active .empty-state {
  border: 1px solid #e3b7df !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #fff9fe, #fafafa) !important;
  color: #4b4b4b !important;
  box-shadow: 0 12px 28px rgba(217, 87, 232, .08) !important;
}

@media (max-width: 900px) {
  body.crm-shell-body .crm-page #settings.crm-pane.active {
    min-height: calc(100vh - 230px) !important;
    padding: 24px 12px !important;
  }
}

@media (min-width: 901px) {
  body.crm-shell-body .crm-page #settings.crm-pane.active {
    position: fixed !important;
    top: 50% !important;
    left: calc(292px + (100vw - 292px) / 2) !important;
    width: min(900px, calc(100vw - 360px)) !important;
    min-height: 0 !important;
    padding: 32px !important;
    transform: translate(-50%, -50%) !important;
    z-index: 20 !important;
  }
}

/* Client detail hierarchy for the light CRM theme. */
:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .client-detail {
  background: #ffffff !important;
  border-color: #e9e9e9 !important;
  box-shadow: 0 12px 30px rgba(17, 17, 17, .07) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .crm-back-button {
  border-color: #e3b7df !important;
  background: #fff5fd !important;
  color: #8a2d83 !important;
  font-weight: 850 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .detail-top {
  margin: 10px 16px 16px !important;
  padding: 24px !important;
  border-color: #e3b7df !important;
  background: linear-gradient(135deg, #fff9fe 0%, #f8f0fb 100%) !important;
  box-shadow: 0 8px 22px rgba(217, 87, 232, .08) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .detail-top .eyebrow {
  color: #b03da9 !important;
  font-weight: 900 !important;
  letter-spacing: .08em !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .detail-top h2 {
  color: #161616 !important;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .detail-top p {
  color: #707070 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .detail-top p b {
  color: #303030 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .balance-pill {
  min-width: 190px !important;
  padding: 16px !important;
  border: 1px solid #e3b7df !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #fff0fb, #f1fbf4) !important;
  text-align: left !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .balance-pill span,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .balance-pill small {
  color: #707070 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .balance-pill strong {
  color: #b03da9 !important;
  font-size: 1.7rem !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .action-grid {
  padding: 12px !important;
  border: 1px solid #e9e9e9 !important;
  border-radius: 14px !important;
  background: #fafafa !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .action-grid button {
  border-color: #e3b7df !important;
  background: #ffffff !important;
  color: #5c2459 !important;
  box-shadow: 0 4px 12px rgba(17, 17, 17, .05) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .action-grid button:hover {
  border-color: #e5a847 !important;
  background: linear-gradient(135deg, #2dc3d8, #e5a847) !important;
  color: #ffffff !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open > .comments-panel,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open > .crm-chart-panel,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open > .crm-operations-grid > .comments-panel {
  border-color: #e9e9e9 !important;
  background: #ffffff !important;
  box-shadow: 0 8px 22px rgba(17, 17, 17, .05) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open > .crm-demo-balance-panel {
  border-color: #efc6e9 !important;
  background: #fff6fd !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open > .comments-panel:nth-of-type(2) {
  background: #fafafa !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .panel-title h2 {
  color: #161616 !important;
  font-size: 1rem !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .panel-title span {
  background: #fff0fb !important;
  border-color: #efc6e9 !important;
  color: #a33b99 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .crm-insight-grid article {
  border-color: #e9e9e9 !important;
  background: #fafafa !important;
  box-shadow: none !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .crm-insight-grid article b {
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .crm-insight-grid article:first-child {
  border-top: 3px solid #2dc3d8 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .crm-insight-grid article:nth-child(2) {
  border-top: 3px solid #e5a847 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .crm-insight-grid article:nth-child(3) {
  border-top: 3px solid #5e9de6 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page.detail-open .crm-insight-grid article:nth-child(4) {
  border-top: 3px solid #46b889 !important;
}

/* Gideon-style CRM light theme. Keep this block last so dark-theme defaults
   cannot wash out headings, client rows, or navigation labels. */
:root[data-theme="purple-light"] body.crm-shell-body,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page {
  background: #ffffff !important;
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .topbar {
  background: #17121f !important;
  border-color: #30243a !important;
  box-shadow: 4px 0 18px rgba(23, 18, 31, .16) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .brand,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .brand strong,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .brand b {
  color: #ffffff !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .brand small,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .top-actions::before,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-side-menu span,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .access-badge,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .panel-title span {
  color: #c5a8d5 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .language-switch,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .theme-switch,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-side-menu {
  background: #17121f !important;
  border-color: #30243a !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .language-switch button,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .theme-switch button,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-side-menu button,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .staff-link,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .mini-tabs button {
  background: #211a2c !important;
  border-color: #3a2c49 !important;
  color: #d9c7e1 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .language-switch button.active,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .theme-switch button.active,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-side-menu button.active,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .mini-tabs button.active {
  background: linear-gradient(135deg, #c84ee8, #f06aa8) !important;
  border-color: #f06aa8 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(214, 81, 216, .22) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page #crm,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .section-head,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-list,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-detail,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .comments-panel,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-chart-panel,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-insight-grid,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-operations-grid,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .action-grid,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-profile-card,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-internal-chat {
  background: #ffffff !important;
  border-color: #e9e9e9 !important;
  color: #161616 !important;
  box-shadow: 0 10px 26px rgba(17, 17, 17, .05) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .section-head h1,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .panel-title h2,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .detail-top h2,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card b,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card strong,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .metric-row b {
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-table-head {
  background: #f7f7f7 !important;
  border-color: #e9e9e9 !important;
  color: #707070 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-list {
  background: #ffffff !important;
  border-color: #e9e9e9 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card {
  background: #ffffff !important;
  border-color: #e9e9e9 !important;
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card:nth-child(even) {
  background: #fafafa !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card span,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card small,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .detail-top p,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .comments-panel p,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .comment-feed,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .transaction-row,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .metric-row,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .support-ticket-row {
  color: #707070 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page input,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page textarea,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page select {
  background: #fafafa !important;
  border-color: #d8d8d8 !important;
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page button,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .action-grid a,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-back-button {
  border-color: #d8d8d8 !important;
  background: #ffffff !important;
  color: #161616 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page button:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .action-grid a:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-back-button:hover {
  border-color: #9f9f9f !important;
  background: #f1f1f1 !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card .status,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .status-badge,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .balance-pill {
  background: #f1fbf4 !important;
  border-color: #bce4c8 !important;
  color: #0f7a37 !important;
}

/* Pink hover states for the light CRM theme. */
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-side-menu button:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .language-switch button:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .theme-switch button:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .mini-tabs button:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .staff-link:hover {
  background: linear-gradient(135deg, #2dc3d8, #e5a847) !important;
  border-color: #e5a847 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(217, 87, 232, .2) !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .request-card:hover {
  background: linear-gradient(90deg, #fff0fb, #ffffff) !important;
  border-color: #e5a847 !important;
  box-shadow: inset 4px 0 #e5a847, 0 8px 20px rgba(217, 87, 232, .1) !important;
  cursor: pointer !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page button:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .action-grid a:hover,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-back-button:hover {
  background: linear-gradient(135deg, #2dc3d8, #e5a847) !important;
  border-color: #e5a847 !important;
  color: #ffffff !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-list,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-list,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-detail {
  scrollbar-color: #df62d9 #f1f1f1 !important;
  scrollbar-width: auto !important;
  scroll-behavior: smooth !important;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-list::-webkit-scrollbar,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-list::-webkit-scrollbar,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-detail::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-list::-webkit-scrollbar-track,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-list::-webkit-scrollbar-track,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-detail::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 8px;
}

:root[data-theme="purple-light"] body.crm-shell-body .crm-page .crm-list::-webkit-scrollbar-thumb,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-list::-webkit-scrollbar-thumb,
:root[data-theme="purple-light"] body.crm-shell-body .crm-page .client-detail::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2dc3d8, #e5a847);
  border: 3px solid #f1f1f1;
  border-radius: 8px;
}

body.crm-shell-body .crm-page .top-actions::before,
body.crm-shell-body .crm-page .client-list::before {
  content: none !important;
  display: none !important;
}

body.crm-shell-body .crm-manager-create-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: end !important;
  gap: 12px !important;
  padding: 16px !important;
  border-color: rgba(167, 139, 250, .22) !important;
  background: linear-gradient(145deg, rgba(14, 22, 45, .84), rgba(35, 29, 70, .62)) !important;
}

body.crm-shell-body .crm-manager-access-form {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-top: 14px !important;
  padding: 16px !important;
  border: 1px solid rgba(167, 139, 250, .22) !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, rgba(14, 22, 45, .84), rgba(35, 29, 70, .62)) !important;
}

body.crm-shell-body .crm-manager-access-form .panel-title,
body.crm-shell-body .crm-manager-access-form .crm-manager-client-picker,
body.crm-shell-body .crm-manager-access-form button {
  grid-column: 1 / -1;
}

body.crm-shell-body .crm-manager-access-form label {
  display: grid;
  gap: 6px;
  color: rgba(237, 233, 254, .82);
  font-size: .74rem;
  font-weight: 900;
}

body.crm-shell-body .crm-manager-access-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 10px;
  background: rgba(2, 6, 23, .48);
  color: #fff;
  padding: 8px 10px;
}

body.crm-shell-body .crm-manager-access-form select[multiple] {
  min-height: 150px;
}

body.crm-shell-body .crm-manager-create-form label {
  min-width: 0 !important;
  color: rgba(237, 233, 254, .82) !important;
  font-size: .74rem !important;
  font-weight: 900 !important;
}

body.crm-shell-body .crm-manager-create-form input,
body.crm-shell-body .crm-manager-create-form select {
  width: 100% !important;
  min-height: 44px !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  border-radius: 10px !important;
  background: rgba(2, 6, 23, .48) !important;
  color: #fff !important;
  padding: 0 12px !important;
  font-weight: 850 !important;
}

body.crm-shell-body .crm-manager-create-form select option {
  background: #111827 !important;
  color: #fff !important;
}

body.crm-shell-body .crm-manager-create-form button {
  grid-column: auto !important;
  min-height: 44px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #20b7d0, #12b8d1) !important;
  color: #fff !important;
  font-size: .82rem !important;
  font-weight: 950 !important;
  box-shadow: 0 14px 30px rgba(79, 140, 255, .18) !important;
}

body.crm-shell-body .crm-pane#profile,
body.crm-shell-body .crm-pane#profile .panel-title h2,
body.crm-shell-body .crm-pane#profile .panel-title span,
body.crm-shell-body .crm-pane#profile .session-row,
body.crm-shell-body .crm-pane#profile .session-row b,
body.crm-shell-body .crm-pane#profile .session-row small {
  color: #fff !important;
}

body.crm-shell-body .crm-pane#profile .session-row p {
  color: rgba(237, 233, 254, .72) !important;
  word-break: break-word !important;
}

body.crm-shell-body .secure-task-overlay {
  background: rgba(3, 7, 18, .68) !important;
  backdrop-filter: blur(18px) !important;
}

body.crm-shell-body .secure-task-modal {
  border: 1px solid rgba(167, 139, 250, .24) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(79, 140, 255, .22), transparent 34%),
    linear-gradient(145deg, rgba(10, 16, 34, .98), rgba(31, 24, 62, .98)) !important;
  color: #fff !important;
}

body.crm-shell-body .secure-task-head h2,
body.crm-shell-body .secure-task-fields label,
body.crm-shell-body .secure-task-field {
  color: #fff !important;
}

body.crm-shell-body .secure-task-head p,
body.crm-shell-body .secure-task-head span {
  color: rgba(237, 233, 254, .78) !important;
}

body.crm-shell-body .secure-task-fields input,
body.crm-shell-body .secure-task-fields select {
  border-color: rgba(148, 163, 184, .28) !important;
  background: rgba(2, 6, 23, .5) !important;
  color: #fff !important;
}

body.crm-shell-body .secure-task-close,
body.crm-shell-body .secure-task-cancel {
  background: rgba(255, 255, 255, .08) !important;
  color: #fff !important;
}

@media (max-width: 1080px) {
  body.crm-shell-body .crm-manager-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.crm-shell-body .crm-manager-create-form button {
    grid-column: 1 / -1 !important;
  }
}

/* Final interaction overrides. */
.toast {
  top: 18px;
  right: 18px;
  bottom: auto;
  border: 1px solid rgba(121, 85, 255, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, #1f1b46, #33256f);
  color: #fff;
  box-shadow: 0 18px 44px rgba(62, 47, 142, 0.28);
  transform: translateY(-18px);
  z-index: 1200;
}

.toast.visible {
  transform: translateY(0);
}

.task-screen.hidden,
.crypto-task-panel {
  display: none;
}

.crypto-task-panel.active {
  display: grid;
  gap: 12px;
}

.task-exit-button {
  justify-self: start;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: inherit;
  padding: 9px 12px;
}

.task-focus-head {
  border: 1px solid rgba(79,140,255,0.22);
  border-radius: 14px;
  background: rgba(79,140,255,0.08);
  padding: 12px 14px;
}

.task-focus-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.task-focus-head b {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

body.app-task-focus .mobile-product .client-header,
body.app-task-focus .mobile-product .bottom-tabs,
body.app-task-focus .mobile-product .transfer-mode-tabs,
body.app-task-focus .mobile-product .crypto-wallet-card,
body.app-task-focus .mobile-product .crypto-task-panel:not(.active) {
  display: none !important;
}

body.app-task-focus .mobile-product #crypto.mobile-screen.active {
  display: grid;
  min-height: 100vh;
  align-content: start;
}

.local-pin-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: min(260px, 100%);
}

.local-pin-control input,
.local-pin-control button {
  min-height: 42px;
  border-radius: 8px;
}

.local-pin-control input {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.local-pin-control button {
  border: 0;
  padding: 0 14px;
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(124,58,237,0.22);
}

.secure-task-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 15, 26, 0.54);
  backdrop-filter: blur(16px);
}

.secure-task-modal {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  position: relative;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 26px 70px rgba(0,0,0,0.32);
}

.secure-task-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #111827;
  font-size: 1.1rem;
  font-weight: 900;
}

.secure-task-head {
  display: grid;
  gap: 5px;
  padding-right: 32px;
}

.secure-task-head span {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(124,58,237,0.12);
  color: #6d28d9;
  font-size: 0.72rem;
  font-weight: 950;
}

.secure-task-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.secure-task-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.secure-task-fields {
  display: grid;
  gap: 10px;
}

.secure-task-fields label,
.secure-task-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.secure-task-fields input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827;
  padding: 0 14px;
  font-size: 0.98rem;
  font-weight: 850;
  text-align: center;
}

.secure-task-submit,
.secure-task-cancel {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  font-weight: 950;
}

.secure-task-submit {
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  box-shadow: 0 16px 30px rgba(124,58,237,0.24);
}

.secure-task-submit:disabled {
  opacity: 0.58;
}

.secure-task-cancel {
  background: #f3f4f6;
  color: #111827;
}

.local-pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(21, 60, 77, .9) 0, transparent 38%),
    linear-gradient(160deg, #091019, #0c1722 60%, #090b11);
  color: #f8fafc;
}

.local-pin-box {
  width: min(355px, 92vw);
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.local-pin-logo {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(145deg, #24c08b, #20b7d0);
  box-shadow: 0 18px 46px rgba(49, 94, 135, .5);
}

.local-pin-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-pin-box h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 26px;
  font-weight: 950;
}

.local-pin-box p {
  margin: 7px 0 0;
  color: #8e9aac;
  font-size: 12px;
}

.local-pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px;
}

.local-pin-dots i {
  width: 13px;
  height: 13px;
  border: 1px solid #557b76;
  border-radius: 50%;
  background: transparent;
}

.local-pin-dots i.on {
  background: #29d58a;
  border-color: #29d58a;
  box-shadow: 0 0 14px #29d58a;
}

.local-pin-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.local-pin-keys button {
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}

.local-pin-keys button:active {
  transform: scale(.985);
  filter: brightness(1.12);
}

.local-pin-error {
  min-height: 22px;
  margin-top: 12px;
  color: #ff7284;
  font-size: 11px;
}

body.crm-task-focus .crm-page .client-list,
body.crm-task-focus .crm-page .crm-nav,
body.crm-task-focus .crm-page .crm-top,
body.crm-task-focus .crm-page .crm-insight-grid,
body.crm-task-focus .crm-page .crm-chart-panel,
body.crm-task-focus .crm-page .comments-panel:not(:has(.crm-withdraw-form)),
body.crm-task-focus .crm-page #crmTransactionsList {
  display: none !important;
}

body.crm-task-focus .crm-page .client-detail {
  display: block !important;
  min-height: 100vh;
}

.crm-focus-panel {
  display: none;
}

body.crm-task-focus .crm-page .crm-focus-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.crm-task-head {
  margin-bottom: 12px;
}

.crm-login-panel {
  min-height: calc(100vh - 140px);
  display: grid;
  align-items: center;
}

.crm-login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
  gap: 18px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.crm-manager-form {
  display: grid;
}

#forgotTaskScreen,
#resetTaskScreen {
  grid-column: 2;
}

:root[data-theme="purple-dark"] .toast {
  border-color: rgba(139,92,246,0.35);
  background: linear-gradient(135deg, #151f30, #2d1f63);
  color: #fff;
}

/* Last-mile overrides: keep CRM desktop shell and client modal above legacy theme blocks. */
@media (min-width: 901px) {
  body.crm-shell-body .crm-page {
    display: grid !important;
    grid-template-columns: 276px minmax(0, 1fr) !important;
    padding: 0 !important;
    max-width: none !important;
  }

  body.crm-shell-body .crm-page .topbar {
    position: sticky !important;
    top: 0 !important;
    width: 276px !important;
    height: 100vh !important;
    display: grid !important;
    align-content: start !important;
    border-right: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
  }

  body.crm-shell-body .crm-page #crm {
    grid-column: 2 !important;
    padding: 28px 32px !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu {
    display: grid !important;
  }

  body.crm-shell-body .crm-page .client-list .mini-tabs:not(.legacy-tabs) {
    display: none !important;
  }

  body.crm-shell-body .crm-page .client-detail {
    display: none !important;
  }

  body.crm-shell-body .crm-page.detail-open::after {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    background: rgba(3,7,18,.58) !important;
    backdrop-filter: blur(14px) !important;
  }

  body.crm-shell-body .crm-page.detail-open .client-detail {
    position: fixed !important;
    inset: 32px !important;
    z-index: 9010 !important;
    display: block !important;
    width: min(1040px, calc(100vw - 64px)) !important;
    max-height: calc(100vh - 64px) !important;
    margin: auto !important;
    overflow: auto !important;
  }

  body.mobile-product .app-content {
    display: grid !important;
    grid-template-columns: 220px minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: start !important;
    width: min(1280px, 100%) !important;
    max-width: 1280px !important;
  }

  body.mobile-product .desktop-app-sidebar {
    position: sticky;
    top: 16px;
    display: grid !important;
    gap: 7px;
    min-height: calc(100vh - 32px);
    padding: 18px 12px;
    border: 1px solid rgba(148,128,255,0.14);
    border-radius: 8px;
    background: rgba(10,18,39,0.96);
    box-shadow: 0 18px 44px rgba(6,10,24,0.24);
  }

  .desktop-app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px 18px;
    color: #fff;
    font-weight: 950;
  }

  .desktop-app-sidebar button {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #9aa7bd;
    padding: 0 12px;
    font-size: .82rem;
    font-weight: 850;
    text-align: left;
  }

  .desktop-app-sidebar button.active {
    border-color: rgba(79,140,255,.22);
    background: linear-gradient(90deg, rgba(79,140,255,.18), rgba(139,92,246,.06));
    color: #fff;
    box-shadow: inset 3px 0 #20b7d0;
  }

  body.mobile-product .app-content > .mobile-screen,
  body.mobile-product .app-content > .bottom-tabs {
    grid-column: 2;
  }

  body.mobile-product .bottom-tabs {
    display: none !important;
  }
}

.crm-session-overlay {
  position: fixed;
  inset: 0;
  z-index: 9020;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3,7,18,.58);
  backdrop-filter: blur(14px);
}

.crm-session-modal {
  width: min(620px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  display: grid;
  gap: 14px;
  position: relative;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 15px;
  background: rgba(13,20,33,.98);
  color: #f5f7fb;
  box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

body.crm-shell-body,
body.crm-shell-body::before,
body.crm-shell-body::after {
  background:
    radial-gradient(circle at 15% 5%, rgba(79,140,255,.13), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(139,92,246,.10), transparent 30%),
    #071e2d !important;
}

body.crm-shell-body .crm-page,
body.crm-shell-body .product-view {
  background: transparent !important;
}

:root[data-theme="purple-dark"] .secure-task-modal,
body.mobile-product .secure-task-modal {
  border-color: rgba(148,128,255,0.18);
  background: linear-gradient(145deg, rgba(18,30,58,0.98), rgba(26,21,55,0.98));
  color: #f3fbfc;
}

:root[data-theme="purple-dark"] .secure-task-head h2,
body.mobile-product .secure-task-head h2 {
  color: #fff;
}

:root[data-theme="purple-dark"] .secure-task-fields input,
:root[data-theme="purple-dark"] .secure-choice,
body.mobile-product .secure-task-fields input,
body.mobile-product .secure-choice {
  border-color: rgba(148,128,255,0.18);
  background: rgba(8,16,35,0.92);
  color: #fff !important;
}

:root[data-theme="purple-dark"] .secure-choice b,
body.mobile-product .secure-choice b {
  color: #fff;
}

:root[data-theme="purple-dark"] .secure-choice small,
body.mobile-product .secure-choice small {
  color: #9fc8ce;
}

@media (max-width: 900px) {
  .desktop-app-sidebar {
    display: none !important;
  }
}

/* Final override: Customers owns the scroll so pagination can load at the bottom. */
.crm-page #applications .crm-list {
  height: min(70vh, 760px) !important;
  max-height: min(70vh, 760px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  /* Do not strictly contain the list: mobile WebKit can collapse the
     intrinsic heights of its grid children and paint their text on top of
     one another. */
  contain: none !important;
}

.crm-page #applications .request-card {
  content-visibility: visible !important;
  contain: none !important;
  box-sizing: border-box;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .crm-page #applications .crm-list {
    height: 62vh !important;
    max-height: 62vh !important;
  }
}

/* Final mobile profile override. */
@media (max-width: 900px) {
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail {
    position: fixed !important;
    top: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: calc(100dvh - 16px) !important;
    min-height: calc(100dvh - 16px) !important;
    max-height: none !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail > *,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .detail-top,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .action-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-insight-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-operations-grid {
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .detail-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .action-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-insight-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-operations-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-back-button {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    width: max-content !important;
    max-width: 100% !important;
  }

  /* Also cover restored sessions where crm-client-open is not on body. */
  .crm-page.detail-open .client-detail {
    position: fixed !important;
    inset: 8px !important;
    display: block !important;
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    min-height: calc(100dvh - 16px) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 10050 !important;
    background: linear-gradient(145deg, #11162b, #0b1020) !important;
  }

  .crm-page.detail-open .client-detail > *,
  .crm-page.detail-open .client-detail .detail-top {
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .crm-page.detail-open .client-detail .detail-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Last mobile override: the client profile must use the full viewport and scroll internally. */
@media (max-width: 900px) {
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail {
    position: fixed !important;
    top: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail > *,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .detail-top,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .action-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-insight-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-operations-grid {
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .detail-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .action-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-insight-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-operations-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-back-button {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    width: max-content !important;
    max-width: 100% !important;
  }
}

/* Final iPhone CRM corrections: one readable customer card per row and a real detail sheet. */
@media (max-width: 900px) {
  body.crm-shell-body .crm-page #applications .crm-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: start !important;
    gap: 8px !important;
    padding: 0 !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list > .request-card {
    display: grid !important;
    position: relative !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: auto !important;
    align-items: start !important;
    align-content: start !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 116px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 13px 12px !important;
    text-align: left !important;
    white-space: normal !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list > .request-card > span,
  body.crm-shell-body .crm-page #applications .crm-list > .request-card > strong,
  body.crm-shell-body .crm-page #applications .crm-list > .request-card > em {
    display: block !important;
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    justify-self: stretch !important;
    text-align: left !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    transform: none !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list > .request-card > span:first-child {
    display: grid !important;
    gap: 3px !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list > .request-card b {
    display: block !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list > .request-card small {
    display: block !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list > .request-card > em {
    justify-self: start !important;
    width: max-content !important;
    margin-top: 3px !important;
    font-size: 11px !important;
  }

  body.crm-shell-body.crm-client-open .crm-page .topbar {
    display: none !important;
  }

  body.crm-shell-body.crm-client-open .crm-page #crm {
    padding: 8px !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail {
    position: fixed !important;
    inset: 8px !important;
    z-index: 10050 !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: calc(100dvh - 16px) !important;
    margin: 0 !important;
    padding: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: linear-gradient(145deg, #11162b, #0b1020) !important;
    border: 1px solid rgba(167, 139, 250, .28) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .72) !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail > * {
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .detail-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 14px !important;
    margin: 0 !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .detail-top h2 {
    font-size: 24px !important;
    line-height: 1.15 !important;
    overflow-wrap: anywhere !important;
  }
}

/* Mobile CRM: keep the shell compact and prevent controls from covering content. */
@media (max-width: 900px) {
  html:has(body.crm-shell-body),
  body.crm-shell-body {
    overflow-x: hidden !important;
  }

  body.crm-shell-body .crm-page {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  body.crm-shell-body .crm-page .topbar {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 12px 8px !important;
    border-bottom: 1px solid rgba(148, 163, 184, .14) !important;
  }

  body.crm-shell-body .crm-page .brand {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    min-height: 42px !important;
    padding: 0 0 8px !important;
    overflow: hidden !important;
  }

  body.crm-shell-body .crm-page .brand img {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
  }

  body.crm-shell-body .crm-page .brand strong,
  body.crm-shell-body .crm-page .brand span {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.crm-shell-body .crm-page .top-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
    width: 100% !important;
  }

  body.crm-shell-body .crm-page .language-switch,
  body.crm-shell-body .crm-page .theme-switch {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    min-height: 34px !important;
    margin: 0 !important;
  }

  body.crm-shell-body .crm-page .language-switch button,
  body.crm-shell-body .crm-page .theme-switch button {
    min-height: 34px !important;
    padding: 7px 10px !important;
    font-size: 11px !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 6px !important;
    padding: 1px 0 3px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu::-webkit-scrollbar {
    display: none !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu button,
  body.crm-shell-body .crm-page .crm-side-menu a {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    min-height: 36px !important;
    padding: 8px 12px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  body.crm-shell-body .crm-page #crm {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 12px !important;
  }

  body.crm-shell-body .crm-page .section-head {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 0 10px !important;
    padding: 12px !important;
  }

  body.crm-shell-body .crm-page .section-head h1 {
    width: 100% !important;
    margin: 0 !important;
    font-size: 24px !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere !important;
  }

  body.crm-shell-body .crm-page .crm-layout,
  body.crm-shell-body .crm-page .crm-insight-grid,
  body.crm-shell-body .crm-page .crm-operations-grid,
  body.crm-shell-body .crm-page .action-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 10px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.crm-shell-body .crm-page .client-list,
  body.crm-shell-body .crm-page .comments-panel,
  body.crm-shell-body .crm-page .crm-chart-panel,
  body.crm-shell-body .crm-page .crm-insight-grid,
  body.crm-shell-body .crm-page .crm-operations-grid {
    width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 10px !important;
  }

  body.crm-shell-body .crm-page .mini-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  body.crm-shell-body .crm-page .mini-tabs::-webkit-scrollbar {
    display: none !important;
  }

  body.crm-shell-body .crm-page .mini-tabs button {
    flex: 0 0 auto !important;
    min-height: 36px !important;
    padding: 8px 11px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list {
    width: 100% !important;
    height: 58vh !important;
    max-height: 58vh !important;
    min-height: 260px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.crm-shell-body .crm-page .request-card,
  body.crm-shell-body .crm-page .client-row {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
    gap: 7px !important;
    padding: 12px !important;
  }

  body.crm-shell-body .crm-page .request-card > *,
  body.crm-shell-body .crm-page .client-row > * {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }

  body.crm-shell-body .crm-page input,
  body.crm-shell-body .crm-page select,
  body.crm-shell-body .crm-page textarea {
    font-size: 16px !important;
  }

  body.crm-shell-body .crm-page .client-detail {
    inset: 8px !important;
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* Absolute final desktop CRM and wallet polish. */
@media (min-width: 901px) {
  .crm-page {
    display: grid !important;
    grid-template-columns: 276px minmax(0, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh !important;
    padding: 0 !important;
    background:
      radial-gradient(circle at 15% 5%, rgba(79,140,255,.13), transparent 30%),
      radial-gradient(circle at 90% 20%, rgba(139,92,246,.10), transparent 30%),
      #071e2d !important;
  }

  .crm-page .topbar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    bottom: auto !important;
    grid-column: 1 !important;
    width: 276px !important;
    height: 100vh !important;
    display: grid !important;
    align-content: start !important;
    gap: 14px !important;
    padding: 24px 16px !important;
    border: 0 !important;
    border-right: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, #09111e, #071e2d) !important;
    box-shadow: none !important;
  }

  .crm-page #crm {
    grid-column: 2 !important;
    min-width: 0 !important;
    padding: 28px 32px !important;
  }

  .crm-page .top-actions {
    display: grid !important;
    gap: 10px !important;
  }

  .crm-side-menu {
    display: grid;
    gap: 5px;
    margin: 8px 0 10px;
  }

  .crm-side-menu span {
    padding: 13px 12px 5px;
    color: #536176;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1.8px;
    text-transform: uppercase;
  }

  .crm-side-menu button,
  .crm-page .language-switch button,
  .crm-page .theme-switch button,
  .crm-page .staff-link {
    min-height: 40px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: transparent !important;
    color: #8d99ad !important;
    padding: 0 13px !important;
    font-size: 11px !important;
    font-weight: 750 !important;
    text-align: left !important;
    justify-content: start !important;
    box-shadow: none !important;
  }

  .crm-side-menu button.active,
  .crm-page .language-switch .active,
  .crm-page .theme-switch .active {
    color: #fff !important;
    border-color: rgba(79,140,255,.18) !important;
    background: linear-gradient(90deg, rgba(79,140,255,.18), rgba(79,140,255,.04)) !important;
    box-shadow: inset 3px 0 #20b7d0 !important;
  }

  .crm-page .client-list .mini-tabs:not(.legacy-tabs) {
    display: none !important;
  }

  .crm-page .crm-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .crm-page .client-detail {
    display: none !important;
  }

  .crm-page.detail-open::after {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 7000 !important;
    background: rgba(3,7,18,.58) !important;
    backdrop-filter: blur(14px) !important;
  }

  .crm-page.detail-open .client-detail {
    position: fixed !important;
    inset: 32px !important;
    z-index: 7010 !important;
    display: block !important;
    width: min(1040px, calc(100vw - 64px)) !important;
    max-height: calc(100vh - 64px) !important;
    margin: auto !important;
    overflow: auto !important;
    border-radius: 17px !important;
    background: rgba(13,20,33,.98) !important;
    box-shadow: 0 28px 90px rgba(0,0,0,.62) !important;
  }

  .crm-page.detail-open .topbar,
  .crm-page.detail-open .section-head,
  .crm-page.detail-open .client-list {
    filter: blur(2px);
  }

  .mobile-product #crypto.mobile-screen.active {
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, .62fr);
    gap: 16px;
    align-items: start;
  }

  .mobile-product #crypto .section-head,
  .mobile-product #crypto .transfer-mode-tabs,
  .mobile-product #crypto .crypto-task-panel {
    grid-column: 1;
  }

  .mobile-product #crypto .crypto-wallet-card,
  .mobile-product #crypto .desktop-market-panel {
    grid-column: 2;
  }

  .desktop-market-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148,128,255,0.16);
    border-radius: 8px;
    background: rgba(13,20,33,.82);
    color: #fff;
    box-shadow: 0 18px 44px rgba(6,10,24,0.24);
  }

  .desktop-market-grid {
    display: grid;
    gap: 8px;
  }

  .desktop-market-grid article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 10px;
    align-items: center;
    min-height: 54px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: rgba(255,255,255,.035);
  }

  .desktop-market-grid span {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #20b7d0, #12b8d1);
    color: #fff;
    font-size: .76rem;
    font-weight: 950;
  }

  .desktop-market-grid b {
    color: #fff;
    font-size: .98rem;
  }

  .desktop-market-grid small {
    color: #7d8aa1;
    font-size: .72rem;
    font-weight: 800;
  }

  .desktop-market-grid article.up small { color: #58ea87; }
  .desktop-market-grid article.down small { color: #ff7b7b; }

  .mobile-product #crypto .transfer-mode-tabs {
    width: max-content;
    max-width: 100%;
    grid-template-columns: repeat(3, auto);
  }

  .mobile-product #crypto .transfer-mode-tabs button {
    width: auto;
    min-width: 118px;
    padding: 0 14px;
  }

  .mobile-product #crypto .crypto-form {
    width: max-content;
    min-width: 220px;
    padding: 12px;
  }
}

@media (max-width: 900px) {
  .desktop-market-panel,
  .crm-side-menu {
    display: none !important;
  }
}

/* CRM control-center skin based on the Desktop single-file CRM prototype. */
.crm-shell-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 5%, rgba(79,140,255,.13), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(139,92,246,.10), transparent 30%),
    #071e2d;
  color: #f5f7fb;
}

.crm-page {
  width: 100%;
  min-height: 100vh;
  padding: 28px 32px 28px 292px;
  background: transparent;
}

.crm-page .topbar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  width: 260px;
  display: block;
  padding: 26px 16px;
  border-right: 1px solid rgba(255,255,255,.08);
  border-bottom: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #09111e, #071e2d);
  box-shadow: none;
}

.crm-page .brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 54px;
  margin-bottom: 28px;
  padding: 4px 10px;
  color: #fff;
}

.crm-page .brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  box-shadow: none;
}

.crm-page .brand span:last-child {
  display: grid;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-page .brand span:last-child::after {
  content: "CRM CONTROL CENTER";
  margin-top: 4px;
  color: #7d8aa1;
  font-size: 8px;
  letter-spacing: 1.6px;
}

.crm-page .top-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.crm-page .top-actions::before,
.crm-page .client-list::before {
  content: "Operations";
  padding: 13px 12px 3px;
  color: #536176;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.crm-page .language-switch,
.crm-page .theme-switch {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 5px;
}

.crm-page .language-switch button,
.crm-page .theme-switch button,
.crm-page .staff-link,
.crm-page .mini-tabs button {
  min-height: 43px;
  justify-content: start;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #8d99ad;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  box-shadow: none;
}

.crm-page .staff-link {
  display: grid;
  align-items: center;
  text-decoration: none;
}

.crm-page .language-switch .active,
.crm-page .theme-switch .active,
.crm-page .mini-tabs .active {
  color: #fff;
  border-color: rgba(79,140,255,.18);
  background: linear-gradient(90deg, rgba(79,140,255,.18), rgba(79,140,255,.04));
  box-shadow: inset 3px 0 #20b7d0;
}

.crm-page .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.crm-page .section-head h1 {
  margin: 0;
  color: #f5f7fb;
  font-size: 25px;
  line-height: 1.1;
}

.crm-page .access-badge {
  border: 1px solid rgba(34,197,94,.20);
  border-radius: 7px;
  background: rgba(34,197,94,.12);
  color: #58ea87;
  padding: 9px 12px;
  font-size: 9px;
}

.crm-page .crm-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(440px, .92fr);
  gap: 14px;
  align-items: start;
}

.crm-page .client-list,
.crm-page .client-detail,
.crm-page .comments-panel,
.crm-page .crm-chart-panel,
.crm-page .crm-insight-grid article,
.crm-page .metric-row,
.crm-page .transaction-row,
.crm-page .support-ticket-row,
.crm-page .chat-ticket {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 15px;
  background: rgba(13,20,33,.82);
  color: #f5f7fb;
  box-shadow: none;
}

.crm-page .client-list {
  padding: 14px;
}

.crm-page .mini-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-bottom: 18px;
  border: 0;
  background: transparent;
}

.crm-table-head {
  display: grid;
  grid-template-columns: 2.2fr 1.3fr 1.4fr 1.2fr 1.3fr 1fr;
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 15px 15px 0 0;
  background: rgba(255,255,255,.025);
  color: #64738b;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.crm-page #applications .crm-list {
  display: grid;
  gap: 0;
  height: min(70vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  contain: strict;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-top: 0;
  border-radius: 0 0 15px 15px;
  background: rgba(13,20,33,.82);
}

/* Keep thousands of CRM rows cheap to paint while preserving native scrolling. */
.crm-page #applications .crm-list {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.crm-page #applications .request-card {
  content-visibility: auto;
  contain-intrinsic-size: 76px;
}

.crm-customer-search {
  display: block;
  margin: 0 0 12px;
}

.crm-customer-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  background: rgba(5,10,22,.72);
  color: #f5f7fb;
  outline: none;
}

.crm-customer-search input:focus {
  border-color: rgba(79,140,255,.72);
  box-shadow: 0 0 0 3px rgba(79,140,255,.12);
}

.crm-load-more {
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
}

.crm-page #unworked .crm-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 15px;
  background: rgba(13,20,33,.82);
}

.crm-page .request-card {
  display: grid;
  grid-template-columns: 2.2fr 1.3fr 1.4fr 1.2fr 1.3fr 1fr;
  align-items: center;
  min-height: 66px;
  padding: 8px 18px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.045);
  border-radius: 0;
  background: transparent;
  color: #c7d0df;
  cursor: pointer;
  transition: background 160ms ease, padding 160ms ease;
}

.crm-page .request-card:hover,
.crm-page .request-card.selected {
  padding-left: 22px;
  border-color: rgba(79,140,255,.16);
  background: rgba(79,140,255,.055);
}

.crm-page .request-card b,
.crm-page .request-card strong,
.crm-page .detail-top h2,
.crm-page .panel-title h2 {
  color: #f5f7fb;
}

.crm-page .request-card span,
.crm-page .request-card small,
.crm-page .detail-top p,
.crm-page .comments-panel p,
.crm-page .comment-feed,
.crm-page .comment-feed p {
  color: #7d8aa1;
}

.crm-page .request-card em {
  width: max-content;
  border: 1px solid rgba(79,140,255,.13);
  border-radius: 7px;
  background: rgba(79,140,255,.08);
  color: #7caaff;
  padding: 6px 8px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.crm-page .client-detail {
  padding: 0;
  overflow: hidden;
}

.crm-page .crm-back-button {
  width: auto;
  min-height: 38px;
  margin: 16px 16px 0;
}

.crm-page .detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 16px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 17px;
  background:
    radial-gradient(circle at 0 50%, rgba(79,140,255,.11), transparent 35%),
    #0d1421;
}

.crm-page .detail-top > div:first-child {
  display: grid;
  gap: 5px;
}

.crm-page .balance-pill {
  min-width: 150px;
  border: 0;
  background: transparent;
  color: #9bbcff;
  text-align: right;
}

.crm-page .balance-pill span {
  display: block;
  color: #7d8aa1;
  font-size: 8px;
}

.crm-page .balance-pill strong {
  display: block;
  color: #9bbcff;
  font-size: 25px;
}

.crm-page .action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 16px 15px;
}

.crm-page button,
.crm-page .action-grid a,
.crm-page .comment-form button,
.crm-page .crm-withdraw-form button,
.crm-page .chat-ticket button,
.crm-page .support-ticket-row button,
.crm-page .crm-back-button {
  min-height: 38px;
  border-radius: 9px;
  border: 0;
  padding: 10px 15px;
  color: #fff;
  background: linear-gradient(135deg, #20b7d0, #6366f1);
  font-size: 9px;
  font-weight: 850;
  text-decoration: none;
  box-shadow: none;
}

.crm-page .action-grid a:nth-child(1),
.crm-page .secondary-button,
.crm-page .crm-back-button {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.045);
  color: #dce6f8;
}

.crm-page .action-grid a:nth-child(2) {
  border: 1px solid rgba(34,197,94,.20);
  background: rgba(34,197,94,.12);
  color: #58ea87;
}

.crm-page .crm-insight-grid,
.crm-page .crm-operations-grid {
  margin: 0 16px 15px;
}

.crm-page .comments-panel,
.crm-page .crm-chart-panel {
  margin: 0 16px 15px;
  padding: 18px;
}

.crm-page .panel-title {
  align-items: center;
  margin-bottom: 13px;
}

.crm-page .panel-title span {
  border: 1px solid rgba(79,140,255,.13);
  border-radius: 7px;
  background: rgba(79,140,255,.08);
  color: #7caaff;
  padding: 6px 8px;
  font-size: 8px;
}

.crm-page input,
.crm-page textarea,
.crm-page select,
.crm-page .comment-feed {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  background: #111827;
  color: #fff;
}

.crm-page input::placeholder,
.crm-page textarea::placeholder {
  color: #64738b;
}

.crm-page .crm-withdraw-form label {
  color: #7d8aa1;
  font-size: 8px;
}

.crm-page .crm-login-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(circle at 15% 5%, rgba(79,140,255,.13), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(139,92,246,.10), transparent 30%),
    #071e2d;
}

.crm-page .crm-login-shell,
.crm-page .crm-login-hero,
.crm-page .crm-manager-form {
  border-color: rgba(255,255,255,.08);
  background: rgba(13,20,33,.86);
  color: #f5f7fb;
}

.crm-page .crm-login-hero .brand-mark {
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
}

@media (max-width: 900px) {
  .crm-page {
    padding: 92px 12px 18px;
  }

  .crm-page .topbar {
    right: 0;
    bottom: auto;
    width: 100%;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .crm-page .brand {
    margin: 0;
    padding: 0;
  }

  .crm-page .top-actions {
    display: none;
  }

  .crm-page .crm-layout,
  .crm-page.detail-open .crm-layout {
    grid-template-columns: 1fr;
  }

  .crm-table-head {
    display: none;
  }

  .crm-page #applications .crm-list {
    border-top: 1px solid rgba(255,255,255,.08);
    border-radius: 15px;
    height: 62vh;
  }

  .crm-page .request-card {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    padding: 14px;
  }

  .crm-page .detail-top,
  .crm-page .action-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* CRM modal workflow corrections. */
.crm-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 0;
  padding: 0;
}

.crm-page .topbar {
  position: sticky;
  grid-column: 1;
  top: 0;
  height: 100vh;
  width: 260px;
}

.crm-page #crm {
  grid-column: 2;
  min-width: 0;
  padding: 28px 32px;
}

.crm-page .crm-layout {
  grid-template-columns: minmax(0, 1fr);
}

.crm-page .client-detail {
  display: none;
}

.crm-page.detail-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(3,7,18,.58);
  backdrop-filter: blur(13px);
}

.crm-page.detail-open .topbar,
.crm-page.detail-open .section-head,
.crm-page.detail-open .client-list {
  filter: blur(2px);
}

.crm-page.detail-open .client-detail {
  position: fixed;
  inset: 32px;
  z-index: 2210;
  display: block;
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 64px);
  margin: auto;
  overflow: auto;
  border-radius: 17px;
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
}

.crm-page.detail-open .client-list {
  display: block;
}

.secure-choice-grid {
  display: grid;
  gap: 9px;
}

.secure-choice {
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: 4px 10px !important;
  align-items: center;
  min-height: 62px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827 !important;
}

.secure-choice input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: #008ba9;
}

.secure-choice b {
  color: #111827;
  font-size: .92rem;
}

.secure-choice small {
  grid-column: 2;
  color: #6b7280;
  font-size: .74rem;
  font-weight: 750;
}

@media (max-width: 900px) {
  .crm-page {
    display: block;
    padding: 0;
  }

  .crm-page .topbar {
    position: sticky;
    width: 100%;
    height: auto;
  }

  .crm-page #crm {
    padding: 18px 12px;
  }

  .crm-page.detail-open .client-detail {
    inset: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

/* Interaction polish: task screens, CRM login, top events, and animated panel transitions. */
.product-view,
.crm-pane,
.mobile-screen,
.crypto-task-panel,
.task-screen {
  animation: eyFadeUp 220ms ease both;
}

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

.task-screen {
  display: grid;
  gap: 12px;
}

.task-screen.hidden,
.crypto-task-panel {
  display: none;
}

.crypto-task-panel.active {
  display: grid;
  gap: 12px;
}

.task-back {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(121, 85, 255, 0.22);
  border-radius: 12px;
  background: rgba(121, 85, 255, 0.10);
  color: var(--ink);
  font-weight: 950;
}

.task-head {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 18px;
  border: 1px solid rgba(121, 85, 255, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(121, 85, 255, 0.10), rgba(79, 140, 255, 0.08));
  text-align: center;
}

.task-head span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  font-weight: 950;
}

.auth-hero.compact-task {
  padding: 14px;
}

.auth-hero.compact-task h1,
.auth-hero.compact-task p:last-child {
  display: none;
}

.code-box-input {
  height: 54px;
  padding: 0 7px;
  border-radius: 14px;
  letter-spacing: 13px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(121,85,255,0.12) 12% 14%, transparent 14% 28%, rgba(121,85,255,0.12) 28% 30%, transparent 30% 44%, rgba(121,85,255,0.12) 44% 46%, transparent 46% 60%, rgba(121,85,255,0.12) 60% 62%, transparent 62% 76%, rgba(121,85,255,0.12) 76% 78%, transparent 78%),
    rgba(255,255,255,0.88);
}

.transfer-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(121, 85, 255, 0.16);
  border-radius: 16px;
  background: rgba(121, 85, 255, 0.08);
}

.transfer-mode-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.transfer-mode-tabs button.active {
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  box-shadow: 0 12px 28px rgba(79, 140, 255, 0.24);
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1500;
  background: rgba(6, 9, 17, 0.58);
  backdrop-filter: blur(12px);
}

.welcome-overlay.hidden {
  display: none;
}

.welcome-overlay > div {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-width: min(320px, calc(100vw - 40px));
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  background: linear-gradient(135deg, #111b34, #2d1f63);
  color: #fff;
  box-shadow: 0 26px 80px rgba(0,0,0,0.38);
  animation: eyWelcome 900ms ease both;
}

@keyframes eyWelcome {
  0% { opacity: 0; transform: scale(0.92) translateY(18px); }
  35% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.crm-login-panel {
  min-height: calc(100vh - 140px);
  display: grid;
  align-items: center;
}

.crm-login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
  gap: 18px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.crm-login-hero,
.crm-manager-form {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  background: radial-gradient(circle at 0 0, rgba(79,140,255,0.18), transparent 38%), rgba(13,20,33,0.88);
  color: #f5f7fb;
  box-shadow: 0 24px 70px rgba(0,0,0,0.32);
}

.crm-login-hero {
  display: grid;
  align-content: end;
  gap: 14px;
  min-height: 360px;
  padding: 28px;
}

.crm-login-hero h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.crm-login-hero p:last-of-type {
  max-width: 520px;
  color: #9aa8bf;
  line-height: 1.55;
}

.crm-login-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-login-stats span {
  padding: 8px 11px;
  border: 1px solid rgba(79,140,255,0.20);
  border-radius: 999px;
  background: rgba(79,140,255,0.10);
  color: #9bbcff;
  font-size: .78rem;
  font-weight: 900;
}

.crm-manager-form {
  align-content: center;
  padding: 24px;
  background: rgba(13,20,33,0.92);
}

.crm-manager-form input {
  min-height: 52px;
  border-color: rgba(255,255,255,0.08);
  border-radius: 12px;
  background: #111827;
  color: #fff;
}

.crm-manager-form button {
  min-height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  box-shadow: 0 16px 34px rgba(79,140,255,0.28);
}

@media (max-width: 760px) {
  .crm-login-shell {
    grid-template-columns: 1fr;
  }

  .crm-login-hero {
    min-height: 230px;
  }
}

:root[data-theme="purple-dark"] .task-back,
:root[data-theme="purple-dark"] .task-head,
:root[data-theme="purple-dark"] .transfer-mode-tabs {
  border-color: rgba(139,92,246,0.24);
  background: rgba(139,92,246,0.10);
  color: #f5f7fb;
}

:root[data-theme="purple-dark"] .code-box-input {
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(139,92,246,0.28) 12% 14%, transparent 14% 28%, rgba(139,92,246,0.28) 28% 30%, transparent 30% 44%, rgba(139,92,246,0.28) 44% 46%, transparent 46% 60%, rgba(139,92,246,0.28) 60% 62%, transparent 62% 76%, rgba(139,92,246,0.28) 76% 78%, transparent 78%),
    #0d1421;
}

:root[data-theme="purple-dark"] .toast {
  border-color: rgba(139,92,246,0.35);
  background: linear-gradient(135deg, #151f30, #2d1f63);
  color: #fff;
}

:root[data-theme="purple-dark"] {
  color-scheme: dark;
  --ink: #f6f6f6;
  --muted: #a8a8a8;
  --line: #252525;
  --paper: #061b2a;
  --surface: #101010;
  --charcoal: #ffffff;
  --charcoal-soft: #dedede;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.48);
  --button-shadow: 0 14px 30px rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f6f6f6;
  --muted: #a8a8a8;
  --line: #252525;
  --paper: #061b2a;
  --surface: #101010;
  --charcoal: #ffffff;
  --charcoal-soft: #dedede;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.48);
  --button-shadow: 0 14px 30px rgba(255, 255, 255, 0.08);
}

:root[data-theme="purple-light"] {
  color-scheme: light;
  --ink: #092235;
  --muted: #746b86;
  --line: #c8e6e9;
  --paper: #f2edf9;
  --surface: #f4fbfc;
  --charcoal: #6d4aff;
  --charcoal-soft: #12b8d1;
  --shadow: 0 22px 52px rgba(109, 74, 255, 0.14);
  --button-shadow: 0 14px 30px rgba(109, 74, 255, 0.22);
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

.bot-field {
  height: 0;
  left: -10000px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  top: auto;
  width: 1px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0%, #f4f4f4 44%, #eeeeee 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="purple-dark"] body {
  background:
    linear-gradient(135deg, #071e2d 0%, #08101c 46%, #071e2d 100%);
  color: var(--ink);
}

button, input, select, a { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.topbar,
.top-actions,
.brand,
.section-head,
.detail-top,
.balance-top,
.profit-row,
.wallet-strip,
.positions article,
.operation-card,
.market-row,
.metric-row,
.request-card,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title > span:only-child {
  margin-left: auto;
}

.topbar {
  min-height: 52px;
}

.brand {
  justify-content: flex-start;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #061b2a;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 950;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

:root[data-theme="purple-dark"] .brand-mark {
  border: 1px solid rgba(255,255,255,0.24);
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
}

.top-actions {
  justify-content: flex-end;
}

.language-switch,
.theme-switch,
.product-tabs,
.mini-tabs,
.app-menu {
  display: grid;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: #eeeeee;
}

.language-switch { grid-template-columns: repeat(2, 40px); }
.theme-switch { grid-template-columns: repeat(2, minmax(64px, 1fr)); }
.product-tabs { grid-template-columns: repeat(4, 1fr); margin: 18px 0; }
.mini-tabs { grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; }
.app-menu { grid-template-columns: repeat(4, 1fr); margin: 12px 0; }

.language-switch button,
.theme-switch button,
.product-tabs button,
.mini-tabs button,
.app-menu button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.language-switch .active,
.theme-switch .active,
.product-tabs .active,
.mini-tabs .active,
.app-menu .active {
  background: var(--surface);
  color: #000;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.07);
}

:root[data-theme="purple-dark"] .language-switch,
:root[data-theme="purple-dark"] .theme-switch,
:root[data-theme="purple-dark"] .product-tabs,
:root[data-theme="purple-dark"] .mini-tabs,
:root[data-theme="purple-dark"] .app-menu {
  background: #191919;
}

:root[data-theme="purple-dark"] .language-switch .active,
:root[data-theme="purple-dark"] .theme-switch .active,
:root[data-theme="purple-dark"] .product-tabs .active,
:root[data-theme="purple-dark"] .mini-tabs .active,
:root[data-theme="purple-dark"] .app-menu .active {
  background: #fff;
  color: #061b2a;
}

.install-button,
.staff-link,
.action-grid button,
.action-grid a,
.comment-form button,
.chat-form button,
.wallet-strip button,
.bank-form button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--charcoal), var(--charcoal-soft));
  color: #fff;
  font-weight: 850;
  text-decoration: none;
  box-shadow: var(--button-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.staff-link:hover,
.action-grid button:hover,
.action-grid a:hover,
.comment-form button:hover,
.chat-form button:hover,
.wallet-strip button:hover,
.bank-form button:hover,
.auth-actions button:hover,
.verification-grid button:hover,
.verification-form button:hover,
.forgot-button:hover,
.forgot-toggle:hover,
.quick-grid button:hover,
.bottom-tabs button:hover {
  transform: translateY(-1px);
}

.install-button {
  min-height: 38px;
  padding: 0 14px;
}

.staff-link {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 0 14px;
}

.mobile-product {
  background: #dcdcdc;
}

:root[data-theme="purple-dark"] .mobile-product {
  background: #000;
}

.mobile-shell {
  position: relative;
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px 96px;
  background: #f7f7f7;
}

:root[data-theme="purple-dark"] .mobile-shell {
  background: #061b2a;
}

.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.mobile-screen {
  display: none;
}

.mobile-screen.active {
  display: block;
}

.section-head.compact {
  margin-bottom: 12px;
  padding: 4px 0 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.quick-grid button {
  display: grid;
  min-height: 82px;
  place-items: center;
  gap: 6px;
  border: 0;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quick-grid button:hover,
.asset-row:hover,
.crypto-actions button:hover,
.crypto-form button:hover {
  transform: translateY(-1px);
}

.quick-grid span,
.quick-grid em {
  display: block;
  font-style: normal;
}

.quick-grid span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0a0a0a;
  color: #fff;
  line-height: 34px;
  font-weight: 900;
}

.market-card,
.profile-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.profile-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  text-align: center;
}

.profile-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 0 auto 4px;
  place-items: center;
  border-radius: 50%;
  background: #061b2a;
  color: #fff;
  font-weight: 900;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(430px, 100%);
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.10);
  transform: translateX(-50%);
}

.bottom-tabs button {
  display: grid;
  gap: 3px;
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  place-items: center;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.bottom-tabs span {
  font-size: 1.05rem;
  line-height: 1;
}

.bottom-tabs b {
  font-size: 0.72rem;
}

.bottom-tabs .active {
  background: #061b2a;
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

:root[data-theme="purple-dark"] .bottom-tabs {
  border-color: rgba(255,255,255,0.10);
  background: rgba(8,8,8,0.96);
  box-shadow: 0 -16px 36px rgba(0,0,0,0.45);
}

:root[data-theme="purple-dark"] .bottom-tabs .active {
  background: #fff;
  color: #061b2a;
}

.hero-strip {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-strip img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 7px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: 1.02; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: 0; }
h3 { margin-bottom: 6px; font-size: 1.02rem; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.52; }

.product-view { display: none; }
.product-view.active { display: block; }

.section-head {
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 14px 0;
}

.access-badge,
.balance-pill,
.panel-title span {
  border-radius: 999px;
  white-space: nowrap;
}

.access-badge {
  padding: 7px 10px;
  background: #e8f7ee;
  color: #177245;
  font-size: 0.78rem;
  font-weight: 900;
}

.access-badge.neutral { background: #f6edda; color: #8a641d; }

.crm-layout,
.banking-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}

.client-list,
.client-detail,
.banking-summary,
.phone-frame,
.flow-grid article,
.security-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 20, 23, 0.07);
}

.client-list,
.client-detail,
.banking-summary {
  padding: 16px;
}

.crm-pane,
.app-pane { display: none; }
.crm-pane.active,
.app-pane.active { display: grid; gap: 10px; }

.request-card {
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.request-card.selected {
  border-color: rgba(0, 107, 100, 0.44);
  background: var(--mint);
}

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

.metric-row,
.chat-ticket,
.comments-panel,
.operation-card,
.market-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chat-ticket {
  display: grid;
  gap: 8px;
}

.chat-ticket > div,
.support-ticket-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-ticket button,
.support-ticket-row button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #061b2a;
  border-radius: 7px;
  background: #061b2a;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.detail-top {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.balance-pill {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  background: var(--mint);
}

.balance-pill span { color: var(--muted); font-size: 0.75rem; font-weight: 800; }
.balance-pill strong { color: var(--teal-dark); }

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.action-grid button,
.action-grid a {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 10px;
  text-align: center;
}

.crm-page .detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  text-align: center;
  gap: 14px;
}

.crm-page .detail-top > div:first-child {
  display: grid;
  justify-items: center;
  min-width: 0;
}

.crm-page .detail-top p,
.crm-page .detail-top b {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.crm-page .balance-pill {
  justify-items: center;
  text-align: center;
}

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

.comments-panel { background: #fbfcfc; }
.panel-title { align-items: flex-start; }
.panel-title span { padding: 6px 8px; background: #eef4f4; color: var(--muted); font-size: 0.75rem; font-weight: 850; }

.comment-feed {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.comment-feed p {
  margin: 0;
  padding: 10px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.comment-form,
.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.comment-form.stacked-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.comment-form.stacked-form input,
.comment-form.stacked-form select,
.comment-form.stacked-form button {
  width: 100%;
  min-height: 44px;
}

.comment-form.stacked-form button {
  grid-column: 1 / -1;
}

.comment-form input,
.chat-form input,
.bank-form input,
.bank-form select {
  min-height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
}

.bank-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.auth-panel {
  display: grid;
  gap: 16px;
  min-height: auto;
  align-content: start;
  margin-bottom: 14px;
  padding: 10px 16px 22px;
}

.auth-language-row {
  display: flex;
  justify-content: flex-end;
}

.auth-hero,
.auth-form,
.forgot-form,
.reset-form,
.auth-mode-tabs,
.auth-footnote {
  width: 100%;
}

.auth-hero {
  display: grid;
  justify-items: start;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #eef8f6 100%);
  border: 1px solid rgba(0, 107, 100, 0.16);
  box-shadow: 0 18px 42px rgba(16, 20, 23, 0.09);
}

.auth-emblem {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 16px;
  background: var(--teal);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 950;
}

.auth-hero h1 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.auth-hero p:last-child {
  margin-bottom: 0;
}

.auth-form,
.forgot-form,
.reset-form {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 20, 23, 0.06);
}

.auth-form label,
.forgot-form label,
.reset-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.auth-form label.hidden {
  display: none;
}

.settings-card,
.status-card,
.transaction-row,
.empty-state {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.asset-stack-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  color: #111;
  font-size: 0.82rem;
  font-weight: 900;
}

.asset-stack-title button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #061b2a;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.asset-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
  color: #061b2a;
  text-align: left;
  box-shadow: 0 14px 32px rgba(0,0,0,0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.address-stack-title {
  margin-top: 4px;
}

.address-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 78px;
  justify-items: center;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
  color: #061b2a;
  text-align: center;
  box-shadow: 0 14px 32px rgba(0,0,0,0.07);
}

.address-row span:nth-child(2) {
  display: grid;
  justify-items: center;
  min-width: 0;
}

.address-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.address-row button {
  min-width: 78px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #061b2a;
  border-radius: 8px;
  background: #061b2a;
  color: #fff;
  font-weight: 900;
}

.asset-row:hover {
  box-shadow: 0 18px 36px rgba(0,0,0,0.10);
}

.asset-row span:nth-child(2) {
  min-width: 0;
}

.asset-row b,
.asset-row small {
  display: block;
}

.asset-row small {
  color: var(--muted);
  font-size: 0.74rem;
}

.asset-row strong {
  white-space: nowrap;
  font-size: 0.9rem;
}

.token-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #061b2a;
  color: #fff;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
}

.settings-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-action-button {
  min-height: 42px;
  border: 1px solid #061b2a;
  border-radius: 8px;
  background: #fff;
  color: #061b2a;
  font-weight: 900;
}

.settings-row,
.transaction-row,
.ledger-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.transaction-list {
  display: grid;
  gap: 8px;
}

.transaction-row small {
  color: var(--muted);
  text-transform: uppercase;
}

.transaction-row div:first-child {
  min-width: 0;
}

.transaction-row strong {
  white-space: nowrap;
}

.tx-actions {
  display: flex;
  gap: 6px;
}

.tx-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.logout-button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--red);
  font-weight: 850;
}

.ledger-state {
  margin-top: 14px;
  color: rgba(255,255,255,0.78);
  font-size: 0.8rem;
}

.ledger-state b {
  color: #d7f7e8;
}

.auth-form input,
.forgot-form input,
.reset-form input {
  min-height: 52px;
  border: 1px solid #cbd8da;
  border-radius: 8px;
  padding: 0 14px;
  background: #fbfdfd;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
}

.auth-form input:focus,
.forgot-form input:focus,
.reset-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 107, 100, 0.12);
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: #e9f0f0;
}

.auth-mode-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-mode-tabs .active {
  background: #fff;
  color: var(--teal);
  box-shadow: 0 8px 18px rgba(16, 20, 23, 0.06);
}

.auth-actions {
  display: grid;
}

.auth-actions button {
  min-height: 50px;
  border: 1px solid #061b2a;
  border-radius: 10px;
  background: #fff;
  color: #061b2a;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.10);
  transition: transform 160ms ease, box-shadow 160ms ease;
  font-size: 1rem;
  font-weight: 950;
}

.reset-form button {
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--charcoal), var(--charcoal-soft));
  color: #fff;
  box-shadow: var(--button-shadow);
  font-weight: 950;
}

.auth-actions button:disabled,
.reset-form button:disabled,
.chat-form button:disabled,
.bank-form button:disabled,
.verification-grid button:disabled,
.verification-form button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.auth-footnote {
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.forgot-button,
.forgot-toggle {
  min-height: 42px;
  border: 1px solid rgba(0, 107, 100, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--teal-dark);
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.cf-turnstile {
  min-height: 65px;
}

.verification-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.verification-grid button,
.verification-form button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--charcoal), var(--charcoal-soft));
  color: #fff;
  font-weight: 850;
  box-shadow: var(--button-shadow);
}

.verification-form {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px;
}

.verification-form input,
.verification-form select {
  min-height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
}

.bank-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.bank-form button {
  min-height: 48px;
}

.comment-form button,
.chat-form button {
  min-width: 84px;
  padding: 0 12px;
}

.banking-layout {
  grid-template-columns: minmax(310px, 400px) 1fr;
}

.phone-frame {
  padding: 16px;
  background: #f8fbfb;
}

.phone-status,
.client-header,
.balance-top,
.profit-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.phone-status {
  padding: 0 8px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.client-header {
  align-items: flex-start;
  margin-bottom: 12px;
}

.round-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  font-weight: 900;
}

.balance-panel {
  padding: 20px;
  border-radius: 8px;
  background: linear-gradient(145deg, #1a1a1a 0%, #061b2a 100%);
  color: #fff;
  box-shadow: 0 20px 42px rgba(0,0,0,0.24);
}

.balance-panel p,
.balance-panel span { color: rgba(255,255,255,0.78); }
.balance-panel strong { display: block; margin-top: 12px; font-size: 2.15rem; letter-spacing: 0; }
.balance-panel button { border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; padding: 6px 9px; background: rgba(255,255,255,0.10); color: #fff; font-weight: 850; }
.profit-row b { color: #d7f7e8; }

.trend-line {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 7px;
  height: 70px;
  margin: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.22);
}

.trend-line span {
  height: 28px;
  border-radius: 6px 6px 0 0;
  background: rgba(255,255,255,0.7);
}
.trend-line span:nth-child(2) { height: 44px; }
.trend-line span:nth-child(3) { height: 34px; }
.trend-line span:nth-child(4) { height: 55px; }
.trend-line span:nth-child(5) { height: 49px; }
.trend-line span:nth-child(6) { height: 66px; background: #fff; }

.wallet-strip {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,0.06);
}
.wallet-strip p { margin-bottom: 0; font-size: 0.78rem; }
.wallet-strip button { min-height: 34px; padding: 0 12px; }

.wallet-strip strong,
.wallet-strip small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.crypto-address-copy {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #061b2a;
  background: #061b2a;
  color: #fff;
}

.crypto-wallet-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(140deg, #1b1b1b 0%, #061b2a 58%, #141414 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.24);
}

.desktop-capital-panel,
.desktop-finance-banners {
  display: none;
}

.crypto-wallet-card .eyebrow,
.crypto-wallet-card p {
  color: rgba(255,255,255,0.76);
}

.crypto-orbit {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 50%;
  background: #fff;
  color: #061b2a;
  font-size: 1.5rem;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.16);
}

.crypto-balance-line {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.18);
}

.crypto-balance-line span {
  color: rgba(255,255,255,0.66);
  font-weight: 850;
}

.crypto-balance-line strong {
  font-size: 1.7rem;
}

.wallet-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.wallet-meta-grid div {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
}

.wallet-meta-grid span {
  color: rgba(255,255,255,0.62);
  font-size: 0.68rem;
  font-weight: 850;
}

.wallet-meta-grid b {
  color: #fff;
  font-size: 0.82rem;
}

.crypto-address-strip {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
}

.crypto-address-strip strong {
  width: min(100%, 520px);
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: 8px;
  background: #f5f5f5;
  color: #061b2a;
  font-size: 0.92rem;
  line-height: 1.45;
}

.crypto-address-strip small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.crypto-address-strip .crypto-address-copy {
  width: min(100%, 520px);
}

.wallet-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.wallet-info-grid article {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,0.06);
}

.wallet-info-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.wallet-info-grid b {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.crypto-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 2px 8px;
  font-weight: 950;
}

.crypto-section-title b {
  padding: 5px 9px;
  border-radius: 999px;
  background: #061b2a;
  color: #fff;
  font-size: 0.72rem;
}

.crypto-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.crypto-actions button,
.crypto-actions a,
.crypto-form button {
  width: 100%;
  min-height: 42px;
  display: grid;
  place-items: center;
  justify-content: center;
  align-content: center;
  border: 0;
  border-radius: 8px;
  background: #061b2a;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  text-align: center;
}

.wallet-strip .crypto-actions button {
  min-height: 44px;
  padding: 0;
}

.crypto-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #080808;
  color: #fff;
  box-shadow: 0 18px 42px rgba(0,0,0,0.20);
}

.crypto-form label {
  display: grid;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 850;
}

.crypto-form input {
  min-height: 50px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.paste-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 50px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}

.paste-control input {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.paste-control button {
  width: auto;
  min-width: 76px;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid rgba(255,255,255,0.14);
  border-radius: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: none;
}

.crypto-form input::placeholder {
  color: rgba(255,255,255,0.48);
  text-align: center;
}

.crypto-form button {
  background: #fff;
  color: #061b2a;
}

.positions {
  display: grid;
  gap: 8px;
}
.positions article {
  min-height: 62px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}
.positions div { flex: 1; }
.asset-dot { width: 12px; height: 12px; border-radius: 50%; }
.green { background: var(--teal); }
.gold { background: var(--gold); }
.red { background: var(--red); }
.up { color: #177245; }
.down { color: var(--red); }

.fine-print {
  margin: 0;
  font-size: 0.82rem;
}

.mobile-product .client-header,
.mobile-product .section-head.compact,
.mobile-product .balance-panel,
.mobile-product .status-card,
.mobile-product .asset-stack-title,
.mobile-product .asset-row,
.mobile-product .address-row,
.mobile-product .crypto-wallet-card,
.mobile-product .wallet-strip,
.mobile-product .wallet-info-grid article,
.mobile-product .crypto-section-title,
.mobile-product .crypto-form,
.mobile-product .transaction-row,
.mobile-product .empty-state,
.mobile-product .support-heading,
.mobile-product .support-card,
.mobile-product .support-history-card,
.mobile-product .support-ticket-row,
.mobile-product .settings-card {
  text-align: center;
}

.mobile-product .client-header,
.mobile-product .section-head.compact,
.mobile-product .balance-top,
.mobile-product .ledger-state,
.mobile-product .asset-stack-title,
.mobile-product .crypto-balance-line,
.mobile-product .crypto-section-title,
.mobile-product .support-heading,
.mobile-product .settings-row,
.mobile-product .transaction-row,
.mobile-product .support-ticket-row div {
  justify-content: center;
}

.mobile-product .client-header,
.mobile-product .section-head.compact {
  display: grid;
  justify-items: center;
}

.mobile-product .balance-top,
.mobile-product .ledger-state,
.mobile-product .crypto-balance-line,
.mobile-product .crypto-section-title,
.mobile-product .support-heading,
.mobile-product .settings-row {
  flex-wrap: wrap;
}

.mobile-product .asset-row {
  grid-template-columns: 1fr;
  justify-items: center;
}

.mobile-product .asset-row span:nth-child(2) {
  display: grid;
  justify-items: center;
}

.mobile-product .crypto-wallet-card,
.mobile-product .wallet-meta-grid div,
.mobile-product .wallet-info-grid article {
  justify-items: center;
}

.mobile-product .crypto-orbit,
.mobile-product .token-mark {
  margin: 0 auto;
}

.mobile-product .crypto-form label {
  text-align: center;
}

.mobile-product .crypto-form input,
.mobile-product .support-compose input,
.mobile-product .verification-form input {
  text-align: center;
}

.mobile-product .transaction-row {
  display: grid;
  justify-items: center;
}

.support-screen {
  min-height: calc(100vh - 190px);
}

.support-heading {
  align-items: flex-start;
}

.support-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e8f7ee;
  color: #177245;
  font-size: 0.76rem;
  font-weight: 950;
  white-space: nowrap;
}

.support-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1bbf68;
  box-shadow: 0 0 0 4px rgba(27, 191, 104, 0.14);
}

.support-card {
  display: grid;
  min-height: 430px;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(16, 20, 23, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8f8 100%);
  box-shadow: 0 16px 40px rgba(16, 20, 23, 0.1);
}

.support-history-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.support-ticket-list {
  display: grid;
  gap: 8px;
}

.support-ticket-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,0.06);
}

.support-ticket-row.active,
.chat-ticket.active {
  border-color: rgba(121, 85, 255, 0.58);
  box-shadow: 0 16px 34px rgba(70, 49, 160, 0.16);
}

.session-row p {
  font-size: 0.78rem;
  line-height: 1.35;
}

.support-ticket-row p {
  margin: 0;
  color: #111;
  overflow-wrap: anywhere;
}

.support-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  padding: 14px;
  overflow-y: auto;
}

.support-chat p { margin: 0; }

.chat-bubble {
  display: grid;
  gap: 4px;
  max-width: 86%;
  padding: 11px 12px;
  border-radius: 12px;
  line-height: 1.35;
}

.chat-bubble b {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 950;
}

.chat-bubble span {
  color: inherit;
}

.support-bubble {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

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

.support-chat .client-bubble {
  color: #fff;
}

.support-compose {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(16, 20, 23, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.support-compose input {
  min-height: 52px;
  border-radius: 12px;
  background: #fff;
  font-size: 1rem;
}

.chat-form .send-button {
  display: inline-grid;
  min-width: 104px;
  min-height: 52px;
  grid-template-columns: auto auto;
  place-items: center;
  gap: 7px;
  border-radius: 12px;
  border: 1px solid #061b2a;
  background: #fff;
  color: #061b2a;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.10);
}

.chat-form .send-button span,
.chat-form .send-button b {
  color: inherit;
  line-height: 1;
}

.banking-summary ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.flow-grid,
.security-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

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

.flow-grid article,
.security-grid article {
  padding: 16px;
}

.flow-grid span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: auto;
  max-width: min(430px, calc(100vw - 32px));
  min-height: 56px;
  display: grid;
  align-items: center;
  padding: 14px 18px 14px 20px;
  border: 1px solid rgba(196, 181, 253, 0.32);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 0%, rgba(167, 139, 250, .34), transparent 36%),
    linear-gradient(135deg, rgba(18, 15, 42, .98), rgba(45, 31, 99, .98));
  color: #fff;
  font-size: .96rem;
  font-weight: 850;
  line-height: 1.35;
  box-shadow: 0 24px 70px rgba(20, 12, 55, 0.42);
  transform: translateY(-16px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 10000;
}
.toast.visible { transform: translateY(0) scale(1); opacity: 1; }

:root[data-theme="purple-dark"] .crm-shell-body {
  background: linear-gradient(135deg, #071e2d 0%, #08101c 52%, #071e2d 100%);
}

:root[data-theme="purple-dark"] .crm-page {
  width: min(1440px, calc(100% - 32px));
  padding-top: 18px;
}

:root[data-theme="purple-dark"] .crm-page .topbar {
  min-height: 68px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(9,17,30,0.96), rgba(6,11,20,0.96));
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
}

:root[data-theme="purple-dark"] .crm-page .section-head {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 15px;
  background: rgba(13,20,33,0.82);
}

:root[data-theme="purple-dark"] .crm-page .section-head h1,
:root[data-theme="purple-dark"] .crm-page .section-head .eyebrow {
  color: #f5f7fb;
}

:root[data-theme="purple-dark"] .crm-page .access-badge {
  background: rgba(79,140,255,0.12);
  color: #7badff;
}

.crm-table-head {
  display: none;
}

:root[data-theme="purple-dark"] .crm-table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.1fr .8fr;
  gap: 12px;
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
  background: rgba(255,255,255,0.025);
  color: #64738b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}

:root[data-theme="purple-dark"] .crm-page .crm-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

:root[data-theme="purple-dark"] .crm-page .client-list,
:root[data-theme="purple-dark"] .crm-page .client-detail,
:root[data-theme="purple-dark"] .crm-page .comments-panel,
:root[data-theme="purple-dark"] .crm-page .metric-row,
:root[data-theme="purple-dark"] .crm-page .chat-ticket,
:root[data-theme="purple-dark"] .crm-page .transaction-row {
  border-color: rgba(255,255,255,0.08);
  background: rgba(13,20,33,0.82);
  color: #f5f7fb;
  box-shadow: 0 18px 42px rgba(0,0,0,0.24);
}

:root[data-theme="purple-dark"] .crm-page .mini-tabs {
  margin-bottom: 0;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}

:root[data-theme="purple-dark"] .crm-page .mini-tabs .active {
  background: linear-gradient(135deg, rgba(79,140,255,0.24), rgba(139,92,246,0.18));
  color: #fff;
  box-shadow: inset 3px 0 #20b7d0;
}

:root[data-theme="purple-dark"] .crm-page .crm-list {
  display: grid;
}

:root[data-theme="purple-dark"] .crm-page #applications .crm-list {
  border: 1px solid rgba(255,255,255,0.08);
  border-top: 0;
  border-radius: 0 0 15px 15px;
  overflow: hidden;
  background: rgba(13,20,33,0.82);
}

:root[data-theme="purple-dark"] .crm-page .request-card {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.1fr .8fr;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.045);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

:root[data-theme="purple-dark"] .crm-page .request-card:hover {
  background: rgba(79,140,255,0.055);
}

:root[data-theme="purple-dark"] .crm-page .request-card.selected {
  background: linear-gradient(90deg, rgba(79,140,255,0.18), rgba(79,140,255,0.04));
  box-shadow: inset 3px 0 #20b7d0;
}

:root[data-theme="purple-dark"] .crm-page .request-card b,
:root[data-theme="purple-dark"] .crm-page .request-card strong {
  color: #f5f7fb;
}

:root[data-theme="purple-dark"] .crm-page .request-card span,
:root[data-theme="purple-dark"] .crm-page .request-card small {
  color: #7d8aa1;
}

:root[data-theme="purple-dark"] .crm-page .request-card em {
  justify-self: start;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(34,197,94,0.08);
  color: #4ade80;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

.crm-page .client-detail {
  display: none;
}

.crm-page.detail-open .client-list {
  display: none;
}

.crm-page.detail-open .client-detail {
  display: grid;
  gap: 14px;
}

.crm-back-button {
  min-height: 38px;
  justify-self: start;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
  color: #fff;
  font-weight: 850;
}

:root[data-theme="purple-dark"] .crm-page .detail-top {
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(79,140,255,0.13), rgba(13,20,33,0.88) 42%, rgba(13,20,33,0.82));
}

:root[data-theme="purple-dark"] .crm-page .balance-pill {
  border: 1px solid rgba(79,140,255,0.18);
  border-radius: 12px;
  background: rgba(79,140,255,0.08);
}

:root[data-theme="purple-dark"] .crm-page .action-grid a,
:root[data-theme="purple-dark"] .crm-page .comment-form button,
:root[data-theme="purple-dark"] .crm-page .chat-ticket button,
:root[data-theme="purple-dark"] .crm-page .support-ticket-row button {
  border-color: rgba(79,140,255,0.28);
  background: linear-gradient(135deg, #20b7d0, #6366f1);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product {
  background: #071e2d;
}

:root[data-theme="purple-dark"] .mobile-shell {
  background: linear-gradient(180deg, #08101c 0%, #071e2d 100%);
}

:root[data-theme="purple-dark"] .mobile-product .balance-panel,
:root[data-theme="purple-dark"] .mobile-product .crypto-wallet-card {
  background: linear-gradient(135deg, rgba(79,140,255,0.18), #0d1421 45%, #071e2d);
  border: 1px solid rgba(255,255,255,0.08);
}

:root[data-theme="purple-dark"] .mobile-product .quick-grid button,
:root[data-theme="purple-dark"] .mobile-product .asset-row,
:root[data-theme="purple-dark"] .mobile-product .address-row,
:root[data-theme="purple-dark"] .mobile-product .wallet-strip,
:root[data-theme="purple-dark"] .mobile-product .settings-card,
:root[data-theme="purple-dark"] .mobile-product .support-card,
:root[data-theme="purple-dark"] .mobile-product .support-history-card,
:root[data-theme="purple-dark"] .mobile-product .transaction-row {
  border-color: rgba(255,255,255,0.08);
  background: rgba(13,20,33,0.86);
  color: #f5f7fb;
}

:root[data-theme="purple-dark"] .mobile-product .quick-grid span,
:root[data-theme="purple-dark"] .mobile-product .token-mark {
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
}

:root[data-theme="purple-dark"] .auth-hero,
:root[data-theme="purple-dark"] .auth-form,
:root[data-theme="purple-dark"] .forgot-form,
:root[data-theme="purple-dark"] .reset-form,
:root[data-theme="purple-dark"] .profile-card,
:root[data-theme="purple-dark"] .settings-card,
:root[data-theme="purple-dark"] .asset-row,
:root[data-theme="purple-dark"] .address-row,
:root[data-theme="purple-dark"] .wallet-strip,
:root[data-theme="purple-dark"] .wallet-info-grid article,
:root[data-theme="purple-dark"] .transaction-row,
:root[data-theme="purple-dark"] .empty-state,
:root[data-theme="purple-dark"] .support-card,
:root[data-theme="purple-dark"] .support-history-card,
:root[data-theme="purple-dark"] .support-ticket-row,
:root[data-theme="purple-dark"] .quick-grid button,
:root[data-theme="purple-dark"] .bank-form,
:root[data-theme="purple-dark"] .client-list,
:root[data-theme="purple-dark"] .client-detail,
:root[data-theme="purple-dark"] .request-card,
:root[data-theme="purple-dark"] .metric-row,
:root[data-theme="purple-dark"] .chat-ticket,
:root[data-theme="purple-dark"] .comments-panel {
  border-color: #252525;
  background: #101010;
  color: #f6f6f6;
  box-shadow: 0 14px 34px rgba(0,0,0,0.42);
}

:root[data-theme="purple-dark"] .request-card.selected {
  border-color: #fff;
  background: #181818;
}

:root[data-theme="purple-dark"] .detail-top {
  border-bottom-color: #252525;
}

:root[data-theme="purple-dark"] .balance-pill {
  border: 1px solid #303030;
  background: #061b2a;
}

:root[data-theme="purple-dark"] .balance-pill strong {
  color: #fff;
}

:root[data-theme="purple-dark"] .comment-feed,
:root[data-theme="purple-dark"] .comment-feed p {
  border-color: #303030;
  background: #061b2a;
  color: #f6f6f6;
}

:root[data-theme="purple-dark"] .comment-feed .empty-state {
  border-color: #303030;
  background: #061b2a;
  color: #f6f6f6;
}

:root[data-theme="purple-dark"] .staff-link {
  border: 1px solid #2d2d2d;
  background: #061b2a;
  color: #fff;
  box-shadow: 0 12px 26px rgba(0,0,0,0.36);
}

:root[data-theme="purple-dark"] .comment-form input {
  border-color: #303030;
  background: #061b2a;
  color: #f6f6f6;
}

:root[data-theme="purple-dark"] .action-grid button,
:root[data-theme="purple-dark"] .action-grid a,
:root[data-theme="purple-dark"] .comment-form button,
:root[data-theme="purple-dark"] .tx-actions button,
:root[data-theme="purple-dark"] .chat-ticket button,
:root[data-theme="purple-dark"] .support-ticket-row button {
  border: 1px solid #fff;
  background: #fff;
  color: #061b2a;
  box-shadow: 0 12px 26px rgba(255,255,255,0.10);
}

:root[data-theme="purple-dark"] .auth-hero {
  background: linear-gradient(135deg, #111 0%, #061b2a 100%);
}

:root[data-theme="purple-dark"] .asset-stack-title {
  color: #f6f6f6;
}

:root[data-theme="purple-dark"] .balance-panel,
:root[data-theme="purple-dark"] .crypto-wallet-card,
:root[data-theme="purple-dark"] .crypto-form {
  border-color: #2d2d2d;
  background: #061b2a;
  color: #fff;
}

:root[data-theme="purple-dark"] input,
:root[data-theme="purple-dark"] select,
:root[data-theme="purple-dark"] textarea,
:root[data-theme="purple-dark"] .amount-control,
:root[data-theme="purple-dark"] .paste-control {
  border-color: #2c2c2c;
  background: #061b2a;
  color: #f6f6f6;
}

:root[data-theme="purple-dark"] .token-mark,
:root[data-theme="purple-dark"] .quick-grid span,
:root[data-theme="purple-dark"] .address-row button {
  background: #fff;
  color: #061b2a;
}

:root[data-theme="purple-dark"] .settings-action-button,
:root[data-theme="purple-dark"] .crypto-address-copy,
:root[data-theme="purple-dark"] .crypto-form button {
  border-color: #fff;
  background: #fff;
  color: #061b2a;
}

:root[data-theme="purple-dark"] .toast {
  background: #fff;
  color: #061b2a;
}

:root[data-theme="purple-dark"] .client-header,
:root[data-theme="purple-dark"] .section-head.compact,
:root[data-theme="purple-dark"] .support-heading {
  display: grid;
  min-height: 74px;
  align-content: center;
  justify-items: center;
  padding: 12px;
  border: 1px solid #252525;
  border-radius: 8px;
  background: #101010;
  color: #f6f6f6;
  box-shadow: 0 14px 34px rgba(0,0,0,0.34);
}

:root[data-theme="purple-dark"] .support-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: stretch;
}

:root[data-theme="purple-dark"] .support-heading > div {
  display: grid;
  justify-items: center;
}

:root[data-theme="purple-dark"] .section-head.compact .eyebrow {
  color: #fff;
}

:root[data-theme="purple-dark"] .client-detail .eyebrow {
  color: #fff;
}

:root[data-theme="purple-dark"] .panel-title span {
  background: #fff;
  color: #061b2a;
}

:root[data-theme="purple-dark"] .verification-grid button,
:root[data-theme="purple-dark"] .verification-form button,
:root[data-theme="purple-dark"] .settings-action-button,
:root[data-theme="purple-dark"] .support-compose button,
:root[data-theme="purple-dark"] .send-button {
  border: 1px solid #fff;
  background: #fff;
  color: #061b2a;
  box-shadow: 0 12px 26px rgba(255,255,255,0.10);
}

:root[data-theme="purple-dark"] .verification-grid button *,
:root[data-theme="purple-dark"] .verification-form button *,
:root[data-theme="purple-dark"] .settings-action-button *,
:root[data-theme="purple-dark"] .support-compose button *,
:root[data-theme="purple-dark"] .send-button * {
  color: #061b2a;
}

:root[data-theme="purple-dark"] .support-status {
  background: #102417;
  color: #8df0b8;
}

:root[data-theme="purple-dark"] .support-bubble,
:root[data-theme="purple-dark"] .chat-bubble {
  background: #061b2a;
  color: #f6f6f6;
}

:root[data-theme="purple-dark"] .support-compose {
  border-top-color: #303030;
  background: #242424;
}

:root[data-theme="purple-dark"] .support-compose input {
  border-color: #fff;
  background: #fff;
  color: #061b2a;
}

:root[data-theme="purple-dark"] .support-compose input::placeholder {
  color: #5f5f5f;
}

:root[data-theme="purple-dark"] .logout-button {
  border-color: #ff6b6b;
  background: linear-gradient(135deg, #b42318 0%, #7f1d1d 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(180, 35, 24, 0.28);
}

:root[data-theme="purple-dark"] .crypto-section-title {
  color: #f6f6f6;
}

:root[data-theme="purple-dark"] .crypto-section-title b {
  background: #fff;
  color: #061b2a;
}

/* Final product theme overrides inspired by the CRM control-center reference. */
:root[data-theme="dark"] body {
  background: linear-gradient(180deg, #000 0%, #070707 48%, #111 100%);
  color: #f6f6f6;
}

:root[data-theme="dark"] .brand-mark {
  border: 1px solid rgba(255,255,255,0.24);
  background: #fff;
  color: #061b2a;
}

:root[data-theme="dark"] .language-switch,
:root[data-theme="dark"] .theme-switch,
:root[data-theme="dark"] .mini-tabs,
:root[data-theme="dark"] .product-tabs,
:root[data-theme="dark"] .app-menu {
  background: #191919;
}

:root[data-theme="dark"] .language-switch .active,
:root[data-theme="dark"] .theme-switch .active,
:root[data-theme="dark"] .mini-tabs .active,
:root[data-theme="dark"] .product-tabs .active,
:root[data-theme="dark"] .app-menu .active {
  background: #fff;
  color: #061b2a;
}

:root[data-theme="dark"] .crm-shell-body,
:root[data-theme="dark"] .mobile-product {
  background: #000;
}

:root[data-theme="dark"] .mobile-shell {
  background: #061b2a;
}

:root[data-theme="dark"] .crm-page .topbar,
:root[data-theme="dark"] .crm-page .section-head,
:root[data-theme="dark"] .crm-page .client-list,
:root[data-theme="dark"] .crm-page .client-detail,
:root[data-theme="dark"] .crm-page .comments-panel,
:root[data-theme="dark"] .crm-page .metric-row,
:root[data-theme="dark"] .crm-page .chat-ticket,
:root[data-theme="dark"] .crm-page .transaction-row,
:root[data-theme="dark"] .mobile-product .quick-grid button,
:root[data-theme="dark"] .mobile-product .asset-row,
:root[data-theme="dark"] .mobile-product .address-row,
:root[data-theme="dark"] .mobile-product .wallet-strip,
:root[data-theme="dark"] .mobile-product .wallet-info-grid article,
:root[data-theme="dark"] .mobile-product .settings-card,
:root[data-theme="dark"] .mobile-product .support-card,
:root[data-theme="dark"] .mobile-product .support-history-card,
:root[data-theme="dark"] .mobile-product .transaction-row,
:root[data-theme="dark"] .mobile-product .empty-state {
  border-color: #252525;
  background: #101010;
  color: #f6f6f6;
  box-shadow: 0 14px 34px rgba(0,0,0,0.42);
}

:root[data-theme="dark"] .crm-page .detail-top,
:root[data-theme="dark"] .mobile-product .balance-panel,
:root[data-theme="dark"] .mobile-product .crypto-wallet-card,
:root[data-theme="dark"] .crypto-form {
  border-color: #2d2d2d;
  background: #061b2a;
  color: #fff;
}

:root[data-theme="dark"] .crm-page .action-grid a,
:root[data-theme="dark"] .crm-page .comment-form button,
:root[data-theme="dark"] .crm-back-button,
:root[data-theme="dark"] .verification-grid button,
:root[data-theme="dark"] .verification-form button,
:root[data-theme="dark"] .settings-action-button,
:root[data-theme="dark"] .support-compose button,
:root[data-theme="dark"] .send-button,
:root[data-theme="dark"] .crypto-address-copy,
:root[data-theme="dark"] .crypto-form button {
  border-color: #fff;
  background: #fff;
  color: #061b2a;
}

:root[data-theme="dark"] .mobile-product .quick-grid span,
:root[data-theme="dark"] .mobile-product .token-mark,
:root[data-theme="dark"] .mobile-product .crypto-orbit {
  background: #fff;
  color: #061b2a;
}

:root[data-theme="purple-light"] body {
  background: linear-gradient(180deg, #fbf9ff 0%, #f2ecff 100%);
  color: #092235;
}

:root[data-theme="purple-light"] .brand-mark,
:root[data-theme="purple-light"] .mobile-product .quick-grid span,
:root[data-theme="purple-light"] .mobile-product .token-mark,
:root[data-theme="purple-light"] .mobile-product .crypto-orbit {
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
}

:root[data-theme="purple-light"] .language-switch,
:root[data-theme="purple-light"] .theme-switch,
:root[data-theme="purple-light"] .mini-tabs,
:root[data-theme="purple-light"] .product-tabs,
:root[data-theme="purple-light"] .app-menu {
  background: #eee7ff;
}

:root[data-theme="purple-light"] .language-switch .active,
:root[data-theme="purple-light"] .theme-switch .active,
:root[data-theme="purple-light"] .mini-tabs .active,
:root[data-theme="purple-light"] .product-tabs .active,
:root[data-theme="purple-light"] .app-menu .active {
  background: #fff;
  color: #4c1d95;
}

:root[data-theme="purple-light"] .crm-shell-body,
:root[data-theme="purple-light"] .mobile-product {
  background: #f6f2ff;
}

:root[data-theme="purple-light"] .mobile-shell {
  background: linear-gradient(180deg, #ffffff 0%, #f6f2ff 100%);
}

:root[data-theme="purple-light"] .crm-page .topbar,
:root[data-theme="purple-light"] .crm-page .section-head,
:root[data-theme="purple-light"] .crm-page .client-list,
:root[data-theme="purple-light"] .crm-page .client-detail,
:root[data-theme="purple-light"] .crm-page .comments-panel,
:root[data-theme="purple-light"] .crm-page .metric-row,
:root[data-theme="purple-light"] .crm-page .chat-ticket,
:root[data-theme="purple-light"] .crm-page .transaction-row,
:root[data-theme="purple-light"] .mobile-product .quick-grid button,
:root[data-theme="purple-light"] .mobile-product .asset-row,
:root[data-theme="purple-light"] .mobile-product .address-row,
:root[data-theme="purple-light"] .mobile-product .wallet-strip,
:root[data-theme="purple-light"] .mobile-product .wallet-info-grid article,
:root[data-theme="purple-light"] .mobile-product .settings-card,
:root[data-theme="purple-light"] .mobile-product .support-card,
:root[data-theme="purple-light"] .mobile-product .support-history-card,
:root[data-theme="purple-light"] .mobile-product .transaction-row,
:root[data-theme="purple-light"] .mobile-product .empty-state {
  border-color: #ddd5ef;
  background: rgba(255,255,255,0.92);
  color: #092235;
  box-shadow: 0 14px 34px rgba(109,74,255,0.12);
}

:root[data-theme="purple-light"] .crm-page .detail-top,
:root[data-theme="purple-light"] .mobile-product .balance-panel,
:root[data-theme="purple-light"] .mobile-product .crypto-wallet-card {
  border-color: rgba(124,58,237,0.18);
  background: linear-gradient(135deg, rgba(124,58,237,0.13), #fff 42%, #f6f2ff);
  color: #092235;
}

:root[data-theme="purple-light"] .crm-page .action-grid a,
:root[data-theme="purple-light"] .crm-page .comment-form button,
:root[data-theme="purple-light"] .crm-back-button,
:root[data-theme="purple-light"] .crypto-address-copy,
:root[data-theme="purple-light"] .crypto-form button {
  border-color: rgba(124,58,237,0.28);
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
}

:root[data-theme="purple-dark"] .crm-page .topbar,
:root[data-theme="purple-dark"] .crm-page .section-head,
:root[data-theme="purple-dark"] .crm-page .client-list,
:root[data-theme="purple-dark"] .crm-page .client-detail,
:root[data-theme="purple-dark"] .crm-page .comments-panel,
:root[data-theme="purple-dark"] .crm-page .metric-row,
:root[data-theme="purple-dark"] .crm-page .chat-ticket,
:root[data-theme="purple-dark"] .crm-page .transaction-row {
  border-color: rgba(255,255,255,0.08);
  background: rgba(13,20,33,0.86);
  color: #f5f7fb;
}

:root[data-theme="purple-dark"] .crm-page .request-card {
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.1fr .8fr;
  border-color: rgba(255,255,255,0.045);
  background: transparent;
  color: #f5f7fb;
}

:root[data-theme="purple-dark"] .crm-page .request-card:hover,
:root[data-theme="purple-dark"] .crm-page .request-card.selected {
  background: linear-gradient(90deg, rgba(79,140,255,0.18), rgba(79,140,255,0.04));
  box-shadow: inset 3px 0 #20b7d0;
}

:root[data-theme="purple-dark"] .crm-page .detail-top {
  background: linear-gradient(135deg, rgba(79,140,255,0.13), rgba(13,20,33,0.88) 42%, rgba(13,20,33,0.82));
}

:root[data-theme="purple-dark"] .crm-page .action-grid a,
:root[data-theme="purple-dark"] .crm-page .comment-form button,
:root[data-theme="purple-dark"] .crm-back-button {
  border-color: rgba(79,140,255,0.28);
  background: linear-gradient(135deg, #20b7d0, #6366f1);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product .balance-panel,
:root[data-theme="purple-dark"] .mobile-product .crypto-wallet-card {
  background: linear-gradient(135deg, rgba(79,140,255,0.18), #0d1421 45%, #071e2d);
  border-color: rgba(255,255,255,0.08);
}

:root[data-theme="purple-dark"] .mobile-product .quick-grid button,
:root[data-theme="purple-dark"] .mobile-product .asset-row,
:root[data-theme="purple-dark"] .mobile-product .address-row,
:root[data-theme="purple-dark"] .mobile-product .wallet-strip,
:root[data-theme="purple-dark"] .mobile-product .wallet-info-grid article,
:root[data-theme="purple-dark"] .mobile-product .settings-card,
:root[data-theme="purple-dark"] .mobile-product .support-card,
:root[data-theme="purple-dark"] .mobile-product .support-history-card,
:root[data-theme="purple-dark"] .mobile-product .transaction-row,
:root[data-theme="purple-dark"] .mobile-product .empty-state {
  border-color: rgba(255,255,255,0.08);
  background: rgba(13,20,33,0.86);
  color: #f5f7fb;
}

:root[data-theme="purple-dark"] .mobile-product .quick-grid span,
:root[data-theme="purple-dark"] .mobile-product .token-mark,
:root[data-theme="purple-dark"] .mobile-product .crypto-orbit {
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product .auth-hero,
:root[data-theme="purple-dark"] .mobile-product .auth-form,
:root[data-theme="purple-dark"] .mobile-product .forgot-form,
:root[data-theme="purple-dark"] .mobile-product .reset-form,
:root[data-theme="purple-dark"] .mobile-product .profile-card,
:root[data-theme="purple-dark"] .mobile-product .settings-card,
:root[data-theme="purple-dark"] .mobile-product .asset-row,
:root[data-theme="purple-dark"] .mobile-product .address-row,
:root[data-theme="purple-dark"] .mobile-product .wallet-strip,
:root[data-theme="purple-dark"] .mobile-product .wallet-info-grid article,
:root[data-theme="purple-dark"] .mobile-product .transaction-row,
:root[data-theme="purple-dark"] .mobile-product .empty-state,
:root[data-theme="purple-dark"] .mobile-product .support-card,
:root[data-theme="purple-dark"] .mobile-product .support-history-card,
:root[data-theme="purple-dark"] .mobile-product .support-ticket-row,
:root[data-theme="purple-dark"] .mobile-product .quick-grid button,
:root[data-theme="purple-dark"] .mobile-product .bank-form,
:root[data-theme="purple-dark"] .mobile-product .client-header,
:root[data-theme="purple-dark"] .mobile-product .section-head.compact,
:root[data-theme="purple-dark"] .mobile-product .support-heading,
:root[data-theme="purple-dark"] .mobile-product .crypto-form {
  border-color: rgba(139,92,246,0.18);
  background: linear-gradient(145deg, rgba(18,28,52,0.96), rgba(28,20,58,0.94));
  color: #f7f4ff;
  box-shadow: 0 18px 44px rgba(22,14,54,0.34);
}

:root[data-theme="purple-dark"] .mobile-product .balance-panel,
:root[data-theme="purple-dark"] .mobile-product .crypto-wallet-card {
  border-color: rgba(139,92,246,0.24);
  background:
    radial-gradient(circle at 50% 0%, rgba(139,92,246,0.26), transparent 38%),
    linear-gradient(135deg, #17233f 0%, #20163f 52%, #0d1530 100%);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product input,
:root[data-theme="purple-dark"] .mobile-product select,
:root[data-theme="purple-dark"] .mobile-product textarea,
:root[data-theme="purple-dark"] .mobile-product .amount-control,
:root[data-theme="purple-dark"] .mobile-product .paste-control,
:root[data-theme="purple-dark"] .mobile-product .support-bubble,
:root[data-theme="purple-dark"] .mobile-product .chat-bubble {
  border-color: rgba(139,92,246,0.2);
  background: rgba(11,18,35,0.92);
  color: #f7f4ff;
}

:root[data-theme="purple-dark"] .mobile-product .support-compose {
  border-top-color: rgba(139,92,246,0.18);
  background: rgba(22,17,45,0.94);
}

:root[data-theme="purple-dark"] .mobile-product .support-compose input {
  border-color: rgba(139,92,246,0.2);
  background: #eef0ff;
  color: #151225;
}

:root[data-theme="purple-dark"] .mobile-product .section-head.compact .eyebrow,
:root[data-theme="purple-dark"] .mobile-product .crypto-section-title,
:root[data-theme="purple-dark"] .mobile-product .asset-stack-title {
  color: #f7f4ff;
}

:root[data-theme="purple-light"] .mobile-product .crypto-wallet-card h2 {
  color: #092235;
}

:root[data-theme="purple-light"] .mobile-product .crypto-wallet-card .eyebrow,
:root[data-theme="purple-light"] .mobile-product .crypto-wallet-card p,
:root[data-theme="purple-light"] .mobile-product .crypto-balance-line span,
:root[data-theme="purple-light"] .mobile-product .wallet-meta-grid span {
  color: #62557a;
}

:root[data-theme="purple-light"] .mobile-product .crypto-balance-line {
  border-top-color: rgba(124,58,237,0.16);
}

:root[data-theme="purple-light"] .mobile-product .crypto-balance-line strong,
:root[data-theme="purple-light"] .mobile-product .wallet-meta-grid b {
  color: #092235;
}

:root[data-theme="purple-dark"] .mobile-product .logout-button {
  border-color: rgba(139,92,246,0.34);
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79,140,255,0.18);
}

:root[data-theme="purple-dark"] .mobile-product {
  background:
    radial-gradient(circle at 50% -12%, rgba(89,62,196,0.26), transparent 34%),
    linear-gradient(180deg, #091226 0%, #0b1022 52%, #070b18 100%);
}

:root[data-theme="purple-dark"] .mobile-shell {
  background: transparent;
}

:root[data-theme="purple-dark"] .mobile-product .client-header,
:root[data-theme="purple-dark"] .mobile-product .section-head.compact,
:root[data-theme="purple-dark"] .mobile-product .support-heading,
:root[data-theme="purple-dark"] .mobile-product .profile-card,
:root[data-theme="purple-dark"] .mobile-product .settings-card,
:root[data-theme="purple-dark"] .mobile-product .quick-grid button,
:root[data-theme="purple-dark"] .mobile-product .asset-row,
:root[data-theme="purple-dark"] .mobile-product .address-row,
:root[data-theme="purple-dark"] .mobile-product .wallet-strip,
:root[data-theme="purple-dark"] .mobile-product .wallet-info-grid article,
:root[data-theme="purple-dark"] .mobile-product .support-card,
:root[data-theme="purple-dark"] .mobile-product .support-history-card,
:root[data-theme="purple-dark"] .mobile-product .support-ticket-row,
:root[data-theme="purple-dark"] .mobile-product .transaction-row,
:root[data-theme="purple-dark"] .mobile-product .empty-state,
:root[data-theme="purple-dark"] .mobile-product .crypto-form {
  border-color: rgba(148,128,255,0.16);
  background: linear-gradient(145deg, rgba(18,30,58,0.94), rgba(26,21,55,0.94));
  color: #f3fbfc;
  box-shadow: 0 18px 44px rgba(6,10,24,0.36);
}

:root[data-theme="purple-dark"] .mobile-product .client-header .eyebrow,
:root[data-theme="purple-dark"] .mobile-product .section-head.compact .eyebrow,
:root[data-theme="purple-dark"] .mobile-product .settings-card .eyebrow,
:root[data-theme="purple-dark"] .mobile-product .profile-card h2,
:root[data-theme="purple-dark"] .mobile-product .settings-row > span,
:root[data-theme="purple-dark"] .mobile-product .asset-stack-title,
:root[data-theme="purple-dark"] .mobile-product .crypto-section-title,
:root[data-theme="purple-dark"] .mobile-product label > span {
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product small,
:root[data-theme="purple-dark"] .mobile-product p,
:root[data-theme="purple-dark"] .mobile-product .fine-print,
:root[data-theme="purple-dark"] .mobile-product .ledger-state,
:root[data-theme="purple-dark"] .mobile-product .settings-row {
  color: #9fc8ce;
}

:root[data-theme="purple-dark"] .mobile-product .balance-panel,
:root[data-theme="purple-dark"] .mobile-product .crypto-wallet-card {
  border-color: rgba(148,128,255,0.22);
  background:
    radial-gradient(circle at 50% -10%, rgba(139,92,246,0.28), transparent 38%),
    linear-gradient(135deg, #17264a 0%, #251a52 55%, #101b39 100%);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product input,
:root[data-theme="purple-dark"] .mobile-product select,
:root[data-theme="purple-dark"] .mobile-product textarea,
:root[data-theme="purple-dark"] .mobile-product .amount-control,
:root[data-theme="purple-dark"] .mobile-product .paste-control,
:root[data-theme="purple-dark"] .mobile-product .support-bubble,
:root[data-theme="purple-dark"] .mobile-product .chat-bubble {
  border-color: rgba(148,128,255,0.18);
  background: rgba(8,16,35,0.92);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product input::placeholder,
:root[data-theme="purple-dark"] .mobile-product textarea::placeholder {
  color: #8f89ad;
}

:root[data-theme="purple-dark"] .mobile-product .language-switch,
:root[data-theme="purple-dark"] .mobile-product .theme-switch,
:root[data-theme="purple-dark"] .mobile-product .bottom-tabs {
  border: 1px solid rgba(148,128,255,0.14);
  background: rgba(10,18,39,0.96);
}

:root[data-theme="purple-dark"] .mobile-product .language-switch .active,
:root[data-theme="purple-dark"] .mobile-product .theme-switch .active,
:root[data-theme="purple-dark"] .mobile-product .bottom-tabs .active,
:root[data-theme="purple-dark"] .mobile-product .verification-grid button,
:root[data-theme="purple-dark"] .mobile-product .verification-form button,
:root[data-theme="purple-dark"] .mobile-product .settings-action-button,
:root[data-theme="purple-dark"] .mobile-product .support-compose button,
:root[data-theme="purple-dark"] .mobile-product .send-button,
:root[data-theme="purple-dark"] .mobile-product .crypto-address-copy,
:root[data-theme="purple-dark"] .mobile-product .crypto-form button,
:root[data-theme="purple-dark"] .mobile-product .address-row button,
:root[data-theme="purple-dark"] .mobile-product .logout-button {
  border-color: rgba(148,128,255,0.32);
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79,140,255,0.16);
}

:root[data-theme="purple-dark"] .mobile-product .verification-grid button *,
:root[data-theme="purple-dark"] .mobile-product .verification-form button *,
:root[data-theme="purple-dark"] .mobile-product .settings-action-button *,
:root[data-theme="purple-dark"] .mobile-product .support-compose button *,
:root[data-theme="purple-dark"] .mobile-product .send-button *,
:root[data-theme="purple-dark"] .mobile-product .crypto-form button *,
:root[data-theme="purple-dark"] .mobile-product .logout-button * {
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product .paste-control button {
  background: rgba(148,128,255,0.12);
  color: #d9d4ff;
  box-shadow: none;
}

:root[data-theme="purple-dark"] .mobile-product .quick-grid span,
:root[data-theme="purple-dark"] .mobile-product .token-mark,
:root[data-theme="purple-dark"] .mobile-product .crypto-orbit,
:root[data-theme="purple-dark"] .mobile-product .profile-avatar,
:root[data-theme="purple-dark"] .mobile-product .crypto-section-title b {
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product .support-status {
  background: rgba(79,140,255,0.14);
  color: #b8caff;
}

:root[data-theme="purple-dark"] .mobile-product .auth-panel {
  color: #f3fbfc;
}

:root[data-theme="purple-dark"] .mobile-product .auth-hero,
:root[data-theme="purple-dark"] .mobile-product .auth-form,
:root[data-theme="purple-dark"] .mobile-product .forgot-form,
:root[data-theme="purple-dark"] .mobile-product .reset-form {
  border-color: rgba(148,128,255,0.16);
  background: linear-gradient(145deg, rgba(18,30,58,0.94), rgba(26,21,55,0.94));
  color: #f3fbfc;
  box-shadow: 0 18px 44px rgba(6,10,24,0.36);
}

:root[data-theme="purple-dark"] .mobile-product .auth-emblem {
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79,140,255,0.18);
}

:root[data-theme="purple-dark"] .mobile-product .auth-mode-tabs {
  border: 1px solid rgba(148,128,255,0.14);
  background: rgba(10,18,39,0.96);
}

:root[data-theme="purple-dark"] .mobile-product .auth-mode-tabs button {
  background: transparent;
  color: #9fc8ce;
  box-shadow: none;
}

:root[data-theme="purple-dark"] .mobile-product .auth-mode-tabs .active,
:root[data-theme="purple-dark"] .mobile-product .auth-actions button,
:root[data-theme="purple-dark"] .mobile-product .forgot-button,
:root[data-theme="purple-dark"] .mobile-product .forgot-toggle,
:root[data-theme="purple-dark"] .mobile-product .reset-form button {
  border-color: rgba(148,128,255,0.32);
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79,140,255,0.16);
}

:root[data-theme="purple-dark"] .mobile-product .auth-form label,
:root[data-theme="purple-dark"] .mobile-product .forgot-form label,
:root[data-theme="purple-dark"] .mobile-product .reset-form label,
:root[data-theme="purple-dark"] .mobile-product .auth-footnote {
  color: #9fc8ce;
}

:root[data-theme="purple-dark"] .mobile-product .auth-form input,
:root[data-theme="purple-dark"] .mobile-product .forgot-form input,
:root[data-theme="purple-dark"] .mobile-product .reset-form input {
  border-color: rgba(148,128,255,0.18);
  background: rgba(8,16,35,0.92);
  color: #fff;
}

:root[data-theme="purple-dark"] .mobile-product .support-compose {
  border-top-color: rgba(148,128,255,0.16);
  background: rgba(12,20,42,0.94);
}

:root[data-theme="purple-dark"] .mobile-product .support-compose input {
  border-color: rgba(148,128,255,0.18);
  background: rgba(8,16,35,0.96);
  color: #fff;
}

.crm-page {
  width: min(1440px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.crm-page .crm-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.crm-page .client-list,
.crm-page .client-detail {
  width: 100%;
}

.crm-table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.1fr .8fr;
  gap: 12px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 15px 15px 0 0;
  background: rgba(124,58,237,0.055);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.crm-page #applications .crm-list {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 15px 15px;
  overflow: hidden;
  background: var(--surface);
}

.crm-page .request-card {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr 1.1fr .8fr;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.crm-page .request-card:hover,
.crm-page .request-card.selected {
  background: linear-gradient(90deg, rgba(124,58,237,0.11), rgba(124,58,237,0.025));
  box-shadow: inset 3px 0 #12b8d1;
}

.crm-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.crm-insight-grid article,
.crm-chart-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 20, 23, 0.07);
}

.crm-insight-grid span,
.crm-insight-grid small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.crm-insight-grid b {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 1rem;
}

.crm-activity-chart {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(124,58,237,0.055);
}

.crm-activity-chart span {
  width: min(42px, 9%);
  min-height: 12px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #12b8d1, #20b7d0);
}

.crm-activity-chart span.failed {
  background: linear-gradient(180deg, #f87171, #12b8d1);
}

.crm-activity-chart span.broadcast {
  background: linear-gradient(180deg, #60a5fa, #12b8d1);
}

.crm-operations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.crm-withdraw-form {
  display: grid;
  gap: 10px;
}

.crm-withdraw-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.crm-withdraw-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.crm-withdraw-form button {
  min-height: 44px;
  width: 100%;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(124,58,237,0.18);
}

.crm-message-feed {
  min-height: 150px;
}

.crm-recovery-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 20, 23, 0.07);
}

.crm-recovery-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.crm-recovery-form .full {
  grid-column: 1 / -1;
}

.crm-recovery-form input,
.crm-recovery-form textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.crm-recovery-form textarea {
  min-height: 82px;
  padding-top: 10px;
}

.crm-recovery-form button {
  grid-column: 1 / -1;
  min-height: 46px;
  border: 1px solid rgba(124,58,237,0.24);
  border-radius: 12px;
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(124,58,237,0.16);
}

.recovery-list {
  margin-top: 12px;
}

.recovery-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 20, 23, 0.07);
}

.recovery-card small,
.recovery-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.recovery-card button {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 10px;
  background: rgba(124,58,237,0.09);
  color: #4c1d95;
  font-weight: 850;
}

:root[data-theme="purple-light"] .mobile-product .verification-grid button,
:root[data-theme="purple-light"] .mobile-product .verification-form button,
:root[data-theme="purple-light"] .mobile-product .settings-action-button,
:root[data-theme="purple-light"] .mobile-product .support-compose button,
:root[data-theme="purple-light"] .mobile-product .send-button,
:root[data-theme="purple-light"] .mobile-product .crypto-address-copy,
:root[data-theme="purple-light"] .mobile-product .crypto-form button,
:root[data-theme="purple-light"] .mobile-product .address-row button,
:root[data-theme="purple-light"] .mobile-product .logout-button,
:root[data-theme="purple-light"] .mobile-product .paste-control button {
  border-color: rgba(124,58,237,0.24);
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  box-shadow: 0 14px 30px rgba(124,58,237,0.16);
}

:root[data-theme="purple-light"] .mobile-product .verification-grid button *,
:root[data-theme="purple-light"] .mobile-product .verification-form button *,
:root[data-theme="purple-light"] .mobile-product .settings-action-button *,
:root[data-theme="purple-light"] .mobile-product .support-compose button *,
:root[data-theme="purple-light"] .mobile-product .send-button *,
:root[data-theme="purple-light"] .mobile-product .logout-button * {
  color: #fff;
}

:root[data-theme="purple-dark"] .crm-shell-body {
  background:
    radial-gradient(circle at 50% -14%, rgba(89,62,196,0.24), transparent 34%),
    linear-gradient(180deg, #091226 0%, #0b1022 52%, #070b18 100%);
}

:root[data-theme="purple-dark"] .crm-page .topbar,
:root[data-theme="purple-dark"] .crm-page .section-head,
:root[data-theme="purple-dark"] .crm-page .client-list,
:root[data-theme="purple-dark"] .crm-page .client-detail,
:root[data-theme="purple-dark"] .crm-page .comments-panel,
:root[data-theme="purple-dark"] .crm-page .metric-row,
:root[data-theme="purple-dark"] .crm-page .chat-ticket,
:root[data-theme="purple-dark"] .crm-page .transaction-row,
:root[data-theme="purple-dark"] .crm-page .support-ticket-row {
  border-color: rgba(148,128,255,0.16);
  background: linear-gradient(145deg, rgba(18,30,58,0.94), rgba(26,21,55,0.94));
  color: #f3fbfc;
  box-shadow: 0 18px 44px rgba(6,10,24,0.34);
}

:root[data-theme="purple-dark"] .crm-page .section-head h1,
:root[data-theme="purple-dark"] .crm-page .section-head .eyebrow,
:root[data-theme="purple-dark"] .crm-page .detail-top h2,
:root[data-theme="purple-dark"] .crm-page .panel-title h2,
:root[data-theme="purple-dark"] .crm-page .panel-title span,
:root[data-theme="purple-dark"] .crm-page .request-card b,
:root[data-theme="purple-dark"] .crm-page .request-card strong {
  color: #fff;
}

:root[data-theme="purple-dark"] .crm-page .section-head p,
:root[data-theme="purple-dark"] .crm-page .request-card span,
:root[data-theme="purple-dark"] .crm-page .request-card small,
:root[data-theme="purple-dark"] .crm-page .detail-top p,
:root[data-theme="purple-dark"] .crm-page .comment-feed,
:root[data-theme="purple-dark"] .crm-page .comment-feed p {
  color: #9fc8ce;
}

:root[data-theme="purple-dark"] .crm-page .crm-table-head {
  border-color: rgba(148,128,255,0.16);
  background: rgba(79,140,255,0.08);
  color: #9fc8ce;
}

:root[data-theme="purple-dark"] .crm-page #applications .crm-list {
  border-color: rgba(148,128,255,0.16);
  background: rgba(10,18,39,0.52);
}

:root[data-theme="purple-dark"] .crm-page .request-card {
  border-top-color: rgba(148,128,255,0.12);
  background: transparent;
}

:root[data-theme="purple-dark"] .crm-page .request-card:hover,
:root[data-theme="purple-dark"] .crm-page .request-card.selected {
  background: linear-gradient(90deg, rgba(79,140,255,0.18), rgba(139,92,246,0.06));
  box-shadow: inset 3px 0 #12b8d1;
}

:root[data-theme="purple-dark"] .crm-page .detail-top,
:root[data-theme="purple-dark"] .crm-page .balance-pill,
:root[data-theme="purple-dark"] .crm-page .comment-feed,
:root[data-theme="purple-dark"] .crm-page .comment-feed p,
:root[data-theme="purple-dark"] .crm-page input,
:root[data-theme="purple-dark"] .crm-page textarea,
:root[data-theme="purple-dark"] .crm-page select {
  border-color: rgba(148,128,255,0.18);
  background: rgba(8,16,35,0.92);
  color: #fff;
}

:root[data-theme="purple-dark"] .crm-page .language-switch,
:root[data-theme="purple-dark"] .crm-page .theme-switch,
:root[data-theme="purple-dark"] .crm-page .mini-tabs {
  border: 1px solid rgba(148,128,255,0.14);
  background: rgba(10,18,39,0.96);
}

:root[data-theme="purple-dark"] .crm-page .language-switch .active,
:root[data-theme="purple-dark"] .crm-page .theme-switch .active,
:root[data-theme="purple-dark"] .crm-page .mini-tabs .active,
:root[data-theme="purple-dark"] .crm-page .action-grid a,
:root[data-theme="purple-dark"] .crm-page .comment-form button,
:root[data-theme="purple-dark"] .crm-page .chat-ticket button,
:root[data-theme="purple-dark"] .crm-page .support-ticket-row button,
:root[data-theme="purple-dark"] .crm-page .crm-back-button,
:root[data-theme="purple-dark"] .crm-page .staff-link {
  border-color: rgba(148,128,255,0.32);
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79,140,255,0.16);
}

:root[data-theme="purple-dark"] .crm-page .access-badge,
:root[data-theme="purple-dark"] .crm-page .request-card em {
  background: rgba(79,140,255,0.14);
  color: #b8caff;
}

:root[data-theme="purple-dark"] .crm-insight-grid article,
:root[data-theme="purple-dark"] .crm-chart-panel {
  border-color: rgba(148,128,255,0.16);
  background: linear-gradient(145deg, rgba(18,30,58,0.94), rgba(26,21,55,0.94));
  color: #f3fbfc;
  box-shadow: 0 18px 44px rgba(6,10,24,0.34);
}

:root[data-theme="purple-dark"] .crm-insight-grid b {
  color: #fff;
}

:root[data-theme="purple-dark"] .crm-insight-grid span,
:root[data-theme="purple-dark"] .crm-insight-grid small {
  color: #9fc8ce;
}

:root[data-theme="purple-dark"] .crm-activity-chart {
  background: rgba(8,16,35,0.72);
}

:root[data-theme="purple-dark"] .crm-page .panel-title span,
:root[data-theme="purple-dark"] .crm-page .crypto-section-title b {
  border: 1px solid rgba(148,128,255,0.2);
  background: rgba(79,140,255,0.14);
  color: #d8e2ff;
  box-shadow: none;
}

:root[data-theme="purple-dark"] .crm-page button,
:root[data-theme="purple-dark"] .crm-page .staff-link,
:root[data-theme="purple-dark"] .crm-page .action-grid a,
:root[data-theme="purple-dark"] .crm-page .comment-form button,
:root[data-theme="purple-dark"] .crm-page .crm-withdraw-form button,
:root[data-theme="purple-dark"] .crm-page .chat-ticket button,
:root[data-theme="purple-dark"] .crm-page .support-ticket-row button,
:root[data-theme="purple-dark"] .crm-page .crm-back-button {
  min-height: 40px;
  border: 1px solid rgba(148,128,255,0.24);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79,140,255,0.92), rgba(139,92,246,0.92));
  color: #fff;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(79,140,255,0.15);
}

:root[data-theme="purple-dark"] .crm-page .language-switch button,
:root[data-theme="purple-dark"] .crm-page .theme-switch button,
:root[data-theme="purple-dark"] .crm-page .mini-tabs button {
  min-height: 36px;
  background: transparent;
  color: #9fc8ce;
  box-shadow: none;
}

:root[data-theme="purple-dark"] .crm-page .language-switch .active,
:root[data-theme="purple-dark"] .crm-page .theme-switch .active,
:root[data-theme="purple-dark"] .crm-page .mini-tabs .active {
  background: linear-gradient(135deg, rgba(79,140,255,0.24), rgba(139,92,246,0.2));
  color: #fff;
  box-shadow: inset 3px 0 #12b8d1;
}

:root[data-theme="purple-dark"] .crm-page .request-card {
  color: #f3fbfc;
}

:root[data-theme="purple-dark"] .crm-page .request-card em {
  border: 1px solid rgba(79,140,255,0.18);
  background: rgba(79,140,255,0.12);
  color: #b8caff;
}

:root[data-theme="purple-dark"] .crm-page input::placeholder,
:root[data-theme="purple-dark"] .crm-page textarea::placeholder {
  color: #8f89ad;
}

:root[data-theme="purple-dark"] .crm-recovery-form,
:root[data-theme="purple-dark"] .recovery-card {
  border-color: rgba(148,128,255,0.16);
  background: linear-gradient(145deg, rgba(18,30,58,0.94), rgba(26,21,55,0.94));
  color: #f3fbfc;
  box-shadow: 0 18px 44px rgba(6,10,24,0.34);
}

:root[data-theme="purple-dark"] .crm-recovery-form label,
:root[data-theme="purple-dark"] .recovery-card small,
:root[data-theme="purple-dark"] .recovery-card p {
  color: #9fc8ce;
}

:root[data-theme="purple-dark"] .crm-recovery-form input,
:root[data-theme="purple-dark"] .crm-recovery-form textarea {
  border-color: rgba(148,128,255,0.18);
  background: rgba(8,16,35,0.92);
  color: #fff;
}

:root[data-theme="purple-dark"] .crm-recovery-form button,
:root[data-theme="purple-dark"] .recovery-card button {
  border-color: rgba(148,128,255,0.28);
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  box-shadow: 0 14px 30px rgba(79,140,255,0.16);
}

:root[data-theme="purple-dark"] .crm-page .crm-withdraw-form button,
:root[data-theme="purple-light"] .crm-page .crm-withdraw-form button {
  min-height: 46px;
  width: 100%;
  padding: 0 18px;
  border: 1px solid rgba(148,128,255,0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, #20b7d0, #12b8d1);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(79,140,255,0.16);
}

:root[data-theme="purple-light"] .crm-page .crm-withdraw-form button {
  border-color: rgba(124,58,237,0.24);
  background: linear-gradient(135deg, #008ba9, #32c9df);
  box-shadow: 0 14px 30px rgba(124,58,237,0.16);
}

:root[data-theme="purple-light"] body {
  background:
    radial-gradient(circle at 50% -12%, rgba(124,58,237,0.12), transparent 32%),
    linear-gradient(180deg, #f7f2ff 0%, #f2edf9 54%, #eee8f7 100%);
}

:root[data-theme="purple-light"] .mobile-product,
:root[data-theme="purple-light"] .crm-shell-body {
  background:
    radial-gradient(circle at 50% -12%, rgba(124,58,237,0.12), transparent 32%),
    linear-gradient(180deg, #f7f2ff 0%, #f2edf9 54%, #eee8f7 100%);
}

:root[data-theme="purple-light"] .mobile-shell {
  background: linear-gradient(180deg, #f7f3ff 0%, #f1ebf8 100%);
}

:root[data-theme="purple-light"] .crm-page .topbar,
:root[data-theme="purple-light"] .crm-page .section-head,
:root[data-theme="purple-light"] .crm-page .client-list,
:root[data-theme="purple-light"] .crm-page .client-detail,
:root[data-theme="purple-light"] .crm-page .comments-panel,
:root[data-theme="purple-light"] .crm-page .metric-row,
:root[data-theme="purple-light"] .crm-page .chat-ticket,
:root[data-theme="purple-light"] .crm-page .transaction-row,
:root[data-theme="purple-light"] .crm-page .support-ticket-row,
:root[data-theme="purple-light"] .crm-insight-grid article,
:root[data-theme="purple-light"] .crm-chart-panel,
:root[data-theme="purple-light"] .mobile-product .auth-hero,
:root[data-theme="purple-light"] .mobile-product .auth-form,
:root[data-theme="purple-light"] .mobile-product .forgot-form,
:root[data-theme="purple-light"] .mobile-product .reset-form,
:root[data-theme="purple-light"] .mobile-product .client-header,
:root[data-theme="purple-light"] .mobile-product .profile-card,
:root[data-theme="purple-light"] .mobile-product .settings-card,
:root[data-theme="purple-light"] .mobile-product .quick-grid button,
:root[data-theme="purple-light"] .mobile-product .asset-row,
:root[data-theme="purple-light"] .mobile-product .address-row,
:root[data-theme="purple-light"] .mobile-product .wallet-strip,
:root[data-theme="purple-light"] .mobile-product .wallet-info-grid article,
:root[data-theme="purple-light"] .mobile-product .support-card,
:root[data-theme="purple-light"] .mobile-product .support-history-card,
:root[data-theme="purple-light"] .mobile-product .support-ticket-row,
:root[data-theme="purple-light"] .mobile-product .transaction-row,
:root[data-theme="purple-light"] .mobile-product .empty-state,
:root[data-theme="purple-light"] .mobile-product .crypto-form {
  border-color: #c8e6e9;
  background: linear-gradient(145deg, #f4fbfc, #f4effb);
  color: #092235;
  box-shadow: 0 14px 34px rgba(109,74,255,0.11);
}

:root[data-theme="purple-light"] .mobile-product .balance-panel,
:root[data-theme="purple-light"] .mobile-product .crypto-wallet-card,
:root[data-theme="purple-light"] .crm-page .detail-top {
  border-color: rgba(124,58,237,0.18);
  background:
    radial-gradient(circle at 50% -10%, rgba(124,58,237,0.13), transparent 36%),
    linear-gradient(135deg, #f4fbfc 0%, #f2ecfb 58%, #eee8f7 100%);
  color: #092235;
}

:root[data-theme="purple-light"] input,
:root[data-theme="purple-light"] select,
:root[data-theme="purple-light"] textarea,
:root[data-theme="purple-light"] .paste-control,
:root[data-theme="purple-light"] .amount-control,
:root[data-theme="purple-light"] .crm-page .comment-feed,
:root[data-theme="purple-light"] .crm-page .comment-feed p,
:root[data-theme="purple-light"] .mobile-product .support-bubble,
:root[data-theme="purple-light"] .mobile-product .chat-bubble {
  border-color: #c8e6e9;
  background: #f7f3ff;
  color: #092235;
}

:root[data-theme="purple-light"] .language-switch,
:root[data-theme="purple-light"] .theme-switch,
:root[data-theme="purple-light"] .mini-tabs,
:root[data-theme="purple-light"] .product-tabs,
:root[data-theme="purple-light"] .app-menu,
:root[data-theme="purple-light"] .bottom-tabs {
  border: 1px solid #ded6f0;
  background: #ede6f7;
}

:root[data-theme="purple-light"] .language-switch .active,
:root[data-theme="purple-light"] .theme-switch .active,
:root[data-theme="purple-light"] .mini-tabs .active,
:root[data-theme="purple-light"] .product-tabs .active,
:root[data-theme="purple-light"] .app-menu .active,
:root[data-theme="purple-light"] .bottom-tabs .active {
  background: linear-gradient(135deg, #f4fbfc, #f4effb);
  color: #4c1d95;
  box-shadow: 0 10px 22px rgba(109,74,255,0.12);
}

:root[data-theme="purple-light"] .crm-table-head,
:root[data-theme="purple-light"] .crm-page #applications .crm-list,
:root[data-theme="purple-light"] .crm-activity-chart {
  border-color: #c8e6e9;
  background: #f4effb;
}

:root[data-theme="purple-light"] .crm-recovery-form,
:root[data-theme="purple-light"] .recovery-card {
  border-color: #c8e6e9;
  background: linear-gradient(145deg, #f4fbfc, #f4effb);
  color: #092235;
  box-shadow: 0 14px 34px rgba(109,74,255,0.11);
}

:root[data-theme="purple-light"] .mobile-product .balance-panel p,
:root[data-theme="purple-light"] .mobile-product .balance-panel span,
:root[data-theme="purple-light"] .mobile-product .balance-top,
:root[data-theme="purple-light"] .mobile-product .ledger-state {
  color: #62557a;
}

:root[data-theme="purple-light"] .mobile-product .balance-panel strong,
:root[data-theme="purple-light"] .mobile-product .ledger-state b {
  color: #092235;
}

:root[data-theme="purple-light"] .mobile-product .balance-panel button {
  border-color: rgba(124,58,237,0.22);
  background: rgba(124,58,237,0.1);
  color: #4c1d95;
}

:root[data-theme="purple-light"] .mobile-product .auth-panel {
  color: #092235;
}

:root[data-theme="purple-light"] .mobile-product .auth-hero {
  border-color: rgba(124,58,237,0.18);
  background:
    radial-gradient(circle at 0 0, rgba(124,58,237,0.16), transparent 40%),
    linear-gradient(145deg, #f8f3ff, #efe8f8);
}

:root[data-theme="purple-light"] .mobile-product .auth-emblem {
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  box-shadow: 0 14px 30px rgba(124,58,237,0.18);
}

:root[data-theme="purple-light"] .mobile-product .auth-form,
:root[data-theme="purple-light"] .mobile-product .forgot-form,
:root[data-theme="purple-light"] .mobile-product .reset-form {
  border-color: #c8e6e9;
  background: linear-gradient(145deg, #f4fbfc, #f4effb);
}

:root[data-theme="purple-light"] .mobile-product .auth-form label,
:root[data-theme="purple-light"] .mobile-product .forgot-form label,
:root[data-theme="purple-light"] .mobile-product .reset-form label {
  color: #62557a;
}

:root[data-theme="purple-light"] .mobile-product .auth-form input,
:root[data-theme="purple-light"] .mobile-product .forgot-form input,
:root[data-theme="purple-light"] .mobile-product .reset-form input {
  border-color: #c8e6e9;
  background: #f7f3ff;
  color: #092235;
}

:root[data-theme="purple-light"] .mobile-product .auth-form input:focus,
:root[data-theme="purple-light"] .mobile-product .forgot-form input:focus,
:root[data-theme="purple-light"] .mobile-product .reset-form input:focus {
  border-color: #12b8d1;
  box-shadow: 0 0 0 4px rgba(124,58,237,0.13);
}

:root[data-theme="purple-light"] .mobile-product .auth-mode-tabs {
  border: 1px solid #c8e6e9;
  background: #ede6f7;
}

:root[data-theme="purple-light"] .mobile-product .auth-mode-tabs button {
  color: #746b86;
}

:root[data-theme="purple-light"] .mobile-product .auth-mode-tabs .active {
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  box-shadow: 0 14px 30px rgba(124,58,237,0.16);
}

:root[data-theme="purple-light"] .mobile-product .auth-actions button,
:root[data-theme="purple-light"] .mobile-product .forgot-button,
:root[data-theme="purple-light"] .mobile-product .forgot-toggle,
:root[data-theme="purple-light"] .mobile-product .reset-form button {
  border-color: rgba(124,58,237,0.24);
  background: linear-gradient(135deg, #008ba9, #32c9df);
  color: #fff;
  box-shadow: 0 14px 30px rgba(124,58,237,0.16);
}

@media (max-width: 980px) {
  .hero-strip,
  .crm-layout,
  .banking-layout,
  .flow-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }
  .product-tabs { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 14px, 1240px); }
  .crm-page { width: min(100% - 14px, 1240px); padding-top: 10px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: space-between; gap: 8px; }
  .crm-page .topbar,
  .crm-page .section-head,
  .crm-page .client-list,
  .crm-page .client-detail,
  .crm-page .comments-panel {
    padding: 12px;
    border-radius: 12px;
  }
  .crm-page .brand {
    max-width: 100%;
    min-width: 0;
  }
  .crm-page .brand span:last-child,
  .crm-page .section-head h1 {
    overflow-wrap: anywhere;
    line-height: 1.15;
  }
  .crm-page .section-head {
    gap: 10px;
  }
  .crm-page .access-badge {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  .product-tabs,
  .app-menu { grid-template-columns: 1fr; }
  .mini-tabs { grid-template-columns: 1fr; }
  .crm-page .mini-tabs {
    gap: 7px;
  }
  .crm-page .mini-tabs button {
    min-height: 40px;
  }
  .action-grid { grid-template-columns: 1fr; }
  .crm-insight-grid,
  .crm-operations-grid,
  .crm-recovery-form { grid-template-columns: 1fr; }
  .detail-top,
  .section-head,
  .wallet-strip,
  .positions article { align-items: flex-start; flex-wrap: wrap; }
  .comment-form,
  .chat-form { grid-template-columns: 1fr; }
  .mobile-shell { width: 100%; }
  .verification-form { grid-template-columns: 1fr; }
  .crm-page .detail-top,
  .crm-page .action-grid { grid-template-columns: 1fr; }

  .crm-table-head {
    display: none;
  }

  .crm-page #applications .crm-list {
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .crm-page .request-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-align: center;
  }

  .crm-page .request-card > span,
  .crm-page .request-card > strong,
  .crm-page .request-card > em {
    min-width: 0;
    justify-self: center;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
  }

  .crm-page .request-card b,
  .crm-page .request-card small {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .crm-page .request-card em {
    padding: 6px 10px;
    border-radius: 999px;
  }

  .crm-page .crm-list {
    gap: 10px;
  }
}

@media (min-width: 900px) {
  .mobile-product {
    background: linear-gradient(135deg, #e8f2f1, #f8fbfb);
  }

  :root[data-theme="purple-dark"] .mobile-product {
    background:
      radial-gradient(circle at 50% -12%, rgba(89,62,196,0.26), transparent 34%),
      linear-gradient(180deg, #091226 0%, #0b1022 52%, #070b18 100%);
  }

  :root[data-theme="purple-light"] .mobile-product {
    background: #f6f2ff;
  }

  .mobile-shell {
    width: min(1180px, calc(100% - 56px));
    display: grid;
    grid-template-columns: minmax(380px, 470px) minmax(0, 1fr);
    gap: 32px;
    align-content: start;
    padding: 8px 24px 24px;
    background: transparent;
  }

  :root[data-theme="purple-dark"] .mobile-shell {
    width: min(1360px, calc(100% - 40px));
    padding-left: 10px;
    padding-right: 10px;
  }

  :root[data-theme="purple-light"] .mobile-shell,
  :root[data-theme="purple-light"] .app-shell,
  :root[data-theme="purple-light"] .auth-panel,
  :root[data-theme="purple-light"] .app-content {
    margin-left: auto;
    margin-right: auto;
  }

  :root[data-theme="purple-light"] .mobile-shell {
    width: min(1360px, calc(100% - 40px));
    padding-left: 10px;
    padding-right: 10px;
  }

  .mobile-topbar,
  .auth-panel,
  .app-content {
    grid-column: 1 / -1;
  }

  .auth-panel,
  .app-content {
    width: min(860px, 100%);
    margin: 0 auto;
  }

  .auth-panel {
    grid-template-columns: minmax(300px, 360px) minmax(340px, 390px);
    grid-template-rows: auto auto auto auto auto auto auto;
    column-gap: 22px;
    align-items: start;
    align-content: start;
    padding-top: 0;
    min-height: auto;
  }

  .auth-language-row {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .auth-hero {
    grid-column: 1;
    grid-row: 2 / span 4;
    min-height: 300px;
    align-content: center;
  }

  .auth-mode-tabs { grid-column: 2; grid-row: 2; }
  .auth-form { grid-column: 2; grid-row: 3; }
  .forgot-toggle { grid-column: 2; grid-row: 4; }
  .forgot-form { grid-column: 2; grid-row: 5; }
  .reset-form { grid-column: 2; grid-row: 6; }
  .auth-footnote { grid-column: 2; grid-row: 7; }

  .app-content {
    max-width: 1040px;
    align-self: start;
  }

  :root[data-theme="purple-dark"] .app-content {
    width: min(1280px, 100%);
    max-width: 1280px;
  }

  :root[data-theme="purple-light"] .app-content {
    width: min(1280px, 100%);
    max-width: 1280px;
  }

  .crypto-address-strip {
    display: grid !important;
    justify-content: center;
    justify-items: center;
    text-align: center;
    width: 100%;
  }

  .crypto-address-strip strong,
  .crypto-address-strip small,
  .crypto-address-strip .crypto-address-copy {
    justify-self: center;
  }

  .crypto-form {
    width: min(100%, 640px);
    justify-self: center;
    margin-left: auto;
    margin-right: auto;
  }

  .bottom-tabs {
    position: sticky;
    left: auto;
    bottom: 0;
    width: 100%;
    transform: none;
  }
}

/* Final interaction overrides. */
.toast {
  top: 18px;
  right: 18px;
  bottom: auto;
  border: 1px solid rgba(121, 85, 255, 0.24);
  border-radius: 14px;
  background: linear-gradient(135deg, #1f1b46, #33256f);
  color: #fff;
  box-shadow: 0 18px 44px rgba(62, 47, 142, 0.28);
  transform: translateY(-18px);
  z-index: 1200;
}

.toast.visible {
  transform: translateY(0);
}

.task-screen.hidden,
.crypto-task-panel {
  display: none;
}

.crypto-task-panel.active {
  display: grid;
  gap: 12px;
}

.crm-login-panel {
  min-height: calc(100vh - 140px);
  display: grid;
  align-items: center;
}

.crm-login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .75fr);
  gap: 18px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.crm-manager-form {
  display: grid;
}

:root[data-theme="purple-dark"] .toast {
  border-color: rgba(139,92,246,0.35);
  background: linear-gradient(135deg, #151f30, #2d1f63);
  color: #fff;
}

/* Tail override: production CRM desktop shell and modal profile. */
@media (min-width: 901px) {
  body.crm-shell-body .crm-page {
    display: grid !important;
    grid-template-columns: 276px minmax(0, 1fr) !important;
    padding: 0 !important;
    max-width: none !important;
  }

  body.crm-shell-body .crm-page .topbar {
    position: sticky !important;
    top: 0 !important;
    width: 276px !important;
    height: 100vh !important;
    display: grid !important;
    align-content: start !important;
    border-right: 1px solid rgba(255,255,255,.08) !important;
    border-radius: 0 !important;
  }

  body.crm-shell-body .crm-page #crm {
    grid-column: 2 !important;
    padding: 28px 32px !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu {
    display: grid !important;
  }

  body.crm-shell-body .crm-page .client-list .mini-tabs:not(.legacy-tabs) {
    display: none !important;
  }

  body.crm-shell-body .crm-page .client-detail {
    display: none !important;
  }

  body.crm-shell-body .crm-page.detail-open::after {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    background: rgba(3,7,18,.58) !important;
    backdrop-filter: blur(14px) !important;
  }

  body.crm-shell-body .crm-page.detail-open .client-detail {
    position: fixed !important;
    inset: 32px !important;
    z-index: 9010 !important;
    display: block !important;
    width: min(1040px, calc(100vw - 64px)) !important;
    max-height: calc(100vh - 64px) !important;
    margin: auto !important;
    overflow: auto !important;
  }

  body.mobile-product #crypto .transfer-mode-tabs {
    justify-self: center !important;
    width: auto !important;
    max-width: min(100%, 520px) !important;
    display: inline-grid !important;
    grid-template-columns: repeat(3, max-content) !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 12px auto 14px !important;
  }

  body.mobile-product #crypto .transfer-mode-tabs button {
    width: auto !important;
    min-width: 118px !important;
    max-width: 180px !important;
    padding: 0 14px !important;
    white-space: nowrap !important;
  }
}

body.crm-shell-body .crm-login-panel {
  min-height: calc(100vh - 118px) !important;
  place-items: center !important;
  padding: 28px 16px 44px !important;
}

body.crm-shell-body .crm-login-shell {
  width: min(920px, 100%) !important;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px) !important;
  gap: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(167, 139, 250, .18) !important;
  border-radius: 26px !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(139, 92, 246, .30), transparent 34%),
    linear-gradient(145deg, rgba(13, 12, 30, .96), rgba(26, 18, 54, .98)) !important;
  box-shadow: 0 30px 90px rgba(4, 6, 18, .48) !important;
}

body.crm-shell-body .crm-login-hero,
body.crm-shell-body .crm-manager-form {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #f8f7ff !important;
}

body.crm-shell-body .crm-login-hero {
  min-height: 420px !important;
  padding: 42px !important;
  align-content: center !important;
  gap: 16px !important;
}

body.crm-shell-body .crm-login-hero .eyebrow {
  color: #c4b5fd !important;
}

body.crm-shell-body .crm-login-hero h1 {
  max-width: 420px !important;
  font-size: clamp(2.2rem, 4vw, 4rem) !important;
  line-height: .96 !important;
  color: #fff !important;
}

body.crm-shell-body .crm-login-hero p:last-of-type {
  max-width: 430px !important;
  color: rgba(237, 233, 254, .76) !important;
}

body.crm-shell-body .crm-manager-form {
  margin: 18px !important;
  padding: 24px !important;
  align-self: center !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
  border-radius: 20px !important;
  background: rgba(8, 10, 24, .62) !important;
  backdrop-filter: blur(18px) !important;
}

body.crm-shell-body .crm-manager-form label span {
  color: rgba(237, 233, 254, .82) !important;
}

body.crm-shell-body .crm-manager-form input {
  border-color: rgba(167, 139, 250, .24) !important;
  background: rgba(255, 255, 255, .08) !important;
  color: #fff !important;
}

body.crm-shell-body .crm-manager-form input:focus {
  border-color: rgba(196, 181, 253, .70) !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .18) !important;
}

body.crm-shell-body .crm-manager-form .auth-actions button {
  background: linear-gradient(135deg, #008ba9, #a78bfa) !important;
  color: #fff !important;
  box-shadow: 0 16px 34px rgba(124, 58, 237, .30) !important;
}

@media (max-width: 760px) {
  body.crm-shell-body .crm-login-shell {
    grid-template-columns: 1fr !important;
  }

  body.crm-shell-body .crm-login-hero {
    min-height: auto !important;
    padding: 28px 24px 8px !important;
  }

  body.crm-shell-body .crm-manager-form {
    margin: 12px !important;
  }
}

body.crm-shell-body .crm-page.detail-open #crm {
  position: relative !important;
  z-index: 9020 !important;
  pointer-events: none !important;
}

body.crm-shell-body .crm-page.detail-open::after {
  z-index: 9000 !important;
  pointer-events: auto !important;
}

body.crm-shell-body .crm-page.detail-open .section-head,
body.crm-shell-body .crm-page.detail-open .client-list,
body.crm-shell-body .crm-page.detail-open .crm-insight-grid,
body.crm-shell-body .crm-page.detail-open .crm-chart-panel {
  pointer-events: none !important;
  opacity: .18 !important;
  filter: blur(4px) !important;
}

/* Client profile workspace: overview first, operational controls in dedicated views. */
.crm-client-toolbar {
  position: sticky;
  top: -16px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 10px;
  padding: 10px 0;
  background: rgba(15, 14, 32, .96);
  backdrop-filter: blur(14px);
}

.crm-client-view-tabs,
.crm-detail-search {
  display: flex;
  gap: 6px;
}

.crm-client-view-tabs button,
.crm-detail-search button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(167, 139, 250, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.crm-client-view-tabs button.active {
  border-color: #7c8cff;
  background: linear-gradient(135deg, #20b7d0, #8057e8);
  color: #fff;
}

.crm-detail-search input {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(167, 139, 250, .22);
  border-radius: 8px;
  background: rgba(5, 13, 32, .72);
  color: var(--ink);
}

.client-detail .crm-section-hidden {
  display: none !important;
}

.client-detail .crm-client-comments-panel[data-crm-client-section="overview"] { order: 1; }
.client-detail .crm-insight-grid[data-crm-client-section="overview"] { order: 2; }
.client-detail .crm-chart-panel[data-crm-client-section="overview"] { order: 3; }
.client-detail .crm-client-history-panel[data-crm-client-section="overview"] { order: 4; }
.client-detail .detail-top[data-crm-client-section="overview"] { order: 5; }

.crm-security-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: .75rem;
}

@media (max-width: 760px) {
  .crm-client-toolbar {
    top: -12px;
    grid-template-columns: 1fr;
  }

  .crm-client-view-tabs button {
    flex: 1;
    min-width: 0;
    padding: 0 7px;
    font-size: .72rem;
  }
}

body.crm-shell-body .crm-page.detail-open .client-detail {
  position: fixed !important;
  inset: 28px !important;
  z-index: 9030 !important;
  display: grid !important;
  gap: 14px !important;
  width: min(1040px, calc(100vw - 56px)) !important;
  max-height: calc(100vh - 56px) !important;
  margin: auto !important;
  overflow: auto !important;
  pointer-events: auto !important;
  border: 1px solid rgba(167, 139, 250, .20) !important;
  border-radius: 20px !important;
  background: linear-gradient(145deg, rgba(13, 12, 30, .98), rgba(20, 16, 42, .98)) !important;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .68) !important;
}

@media (max-width: 760px) {
  body.crm-shell-body .crm-page.detail-open .client-detail {
    inset: 12px !important;
    width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
  }
}

@media (min-width: 901px) {
  body.mobile-product #home.mobile-screen.active {
    display: grid !important;
    grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr) !important;
    gap: 18px !important;
    align-items: start !important;
  }

  body.mobile-product #home .client-header {
    grid-column: 1 / -1 !important;
  }

  body.mobile-product #home .quick-grid,
  body.mobile-product #home .asset-stack {
    grid-column: 1 / -1 !important;
  }

  body.mobile-product #home .balance-panel {
    min-height: 258px !important;
    padding: 26px !important;
    align-content: space-between !important;
    background:
      radial-gradient(circle at 16% 0%, rgba(167, 139, 250, .28), transparent 34%),
      linear-gradient(145deg, #0b1020 0%, #14102a 54%, #090b13 100%) !important;
    border: 1px solid rgba(167, 139, 250, .18) !important;
    box-shadow: 0 28px 82px rgba(3, 7, 18, .42) !important;
  }

  body.mobile-product #home .balance-panel strong {
    font-size: clamp(2.4rem, 5vw, 4.7rem) !important;
    line-height: .95 !important;
  }

  body.mobile-product .desktop-capital-panel {
    display: grid !important;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr) !important;
    gap: 16px !important;
    grid-column: 1 / -1 !important;
  }

  body.mobile-product .equity-curve-card,
  body.mobile-product .desktop-market-panel,
  body.mobile-product .desktop-finance-banners article {
    border: 1px solid rgba(167, 139, 250, .16) !important;
    border-radius: 10px !important;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025)),
      rgba(10, 13, 28, .86) !important;
    color: #fff !important;
    box-shadow: 0 20px 60px rgba(4, 6, 18, .28) !important;
  }

  body.mobile-product .equity-curve-card {
    display: grid !important;
    gap: 14px !important;
    min-height: 250px !important;
    padding: 18px !important;
    overflow: hidden !important;
  }

  body.mobile-product .equity-summary {
    display: flex !important;
    align-items: end !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  body.mobile-product .equity-summary strong {
    color: #fff !important;
    font-size: clamp(1.8rem, 3vw, 3rem) !important;
    line-height: 1 !important;
  }

  body.mobile-product .equity-summary span {
    color: #4ade80 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
  }

  body.mobile-product .equity-summary span.down {
    color: #fb7185 !important;
  }

  body.mobile-product .equity-chart {
    width: 100% !important;
    height: 150px !important;
    overflow: visible !important;
    background:
      linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) !important;
    background-size: 100% 37px, 84px 100% !important;
    border-radius: 8px !important;
  }

  body.mobile-product .equity-chart [data-equity-area] {
    fill: url(#equityFill) !important;
  }

  body.mobile-product .equity-chart [data-equity-line] {
    fill: none !important;
    stroke: #a78bfa !important;
    stroke-width: 4 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    filter: drop-shadow(0 8px 18px rgba(167, 139, 250, .42)) !important;
  }

  body.mobile-product #home .desktop-market-panel {
    display: grid !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  body.mobile-product #crypto .desktop-market-panel {
    display: none !important;
  }

  body.mobile-product .desktop-market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.mobile-product .desktop-market-grid article {
    min-height: 62px !important;
    border-color: rgba(255, 255, 255, .09) !important;
    background: rgba(255, 255, 255, .045) !important;
  }

  body.mobile-product .desktop-market-grid span {
    background: linear-gradient(135deg, #008ba9, #14b8a6) !important;
  }

  body.mobile-product .desktop-finance-banners {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    grid-column: 1 / -1 !important;
  }

  body.mobile-product .desktop-finance-banners article {
    display: grid !important;
    gap: 7px !important;
    min-height: 128px !important;
    padding: 18px !important;
    align-content: end !important;
    background:
      radial-gradient(circle at 88% 12%, rgba(20, 184, 166, .20), transparent 34%),
      linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(30, 21, 63, .92)) !important;
  }

  body.mobile-product .desktop-finance-banners span {
    color: #c4b5fd !important;
    font-size: .74rem !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
  }

  body.mobile-product .desktop-finance-banners b {
    color: #fff !important;
    font-size: 1.12rem !important;
  }

  body.mobile-product .desktop-finance-banners small {
    color: rgba(237, 233, 254, .70) !important;
    line-height: 1.45 !important;
  }
}

@media (min-width: 901px) {
  body.crm-shell-body.crm-login-active .crm-page .topbar {
    display: none !important;
  }

  body.crm-shell-body.crm-login-active .crm-page {
    display: grid !important;
    place-items: stretch center !important;
    min-height: 100vh !important;
    padding: 0 !important;
  }

  body.crm-shell-body.crm-login-active .crm-page #crm {
    display: none !important;
  }

  body.crm-shell-body.crm-login-active .crm-login-panel {
    display: grid !important;
    min-height: 100vh !important;
    width: 100% !important;
    padding: 18px !important;
    place-items: center !important;
  }

  body.crm-shell-body.crm-login-active .crm-login-shell {
    width: calc(100vw - 36px) !important;
    min-height: calc(100vh - 36px) !important;
    grid-template-columns: minmax(520px, 1fr) minmax(430px, 520px) !important;
    align-items: center !important;
    border-radius: 18px !important;
  }

  body.crm-shell-body.crm-login-active .crm-login-hero {
    min-height: calc(100vh - 92px) !important;
    padding: 48px !important;
  }

  body.crm-shell-body.crm-login-active .crm-manager-form {
    width: min(520px, 100%) !important;
    margin: 0 34px 0 0 !important;
    justify-self: end !important;
    align-self: center !important;
    transform: translateY(-18px) !important;
  }

  body.crm-shell-body:not(.crm-authenticated) .crm-page .topbar {
    display: none !important;
  }

  body.crm-shell-body.crm-client-open::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 5000 !important;
    background: rgba(3, 7, 18, .62) !important;
    backdrop-filter: blur(14px) !important;
    pointer-events: none !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open::after {
    content: none !important;
  }

  body.crm-shell-body {
    overflow-x: hidden !important;
    background:
      radial-gradient(circle at 18% 0%, rgba(124, 58, 237, .24), transparent 34%),
      linear-gradient(180deg, #070914 0%, #090b16 100%) !important;
  }

  body.crm-shell-body .crm-page {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  body.crm-shell-body .crm-page .topbar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 1200 !important;
    width: 292px !important;
    height: 100vh !important;
    overflow-y: auto !important;
    display: grid !important;
    grid-template-rows: auto 1fr !important;
    align-content: start !important;
    gap: 18px !important;
    padding: 22px 16px !important;
    border: 0 !important;
    border-right: 1px solid rgba(167, 139, 250, .16) !important;
    border-radius: 0 !important;
    background:
      linear-gradient(180deg, rgba(18, 15, 42, .98), rgba(7, 9, 20, .98)) !important;
    box-shadow: 18px 0 60px rgba(0, 0, 0, .28) !important;
  }

  body.crm-shell-body .crm-page .brand {
    width: 100% !important;
    padding: 10px 8px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  }

  body.crm-shell-body .crm-page .top-actions {
    display: grid !important;
    align-content: start !important;
    gap: 14px !important;
    width: 100% !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu {
    display: grid !important;
    gap: 8px !important;
    padding: 8px !important;
    border: 1px solid rgba(167, 139, 250, .14) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .045) !important;
  }

  body.crm-shell-body .crm-side-menu span {
    margin: 8px 6px 2px !important;
    color: rgba(196, 181, 253, .78) !important;
    font-size: .68rem !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
  }

  body.crm-shell-body .crm-side-menu button {
    justify-content: flex-start !important;
    width: 100% !important;
    min-height: 42px !important;
    padding: 0 12px !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    background: transparent !important;
    color: rgba(237, 233, 254, .78) !important;
    text-align: left !important;
  }

  body.crm-shell-body .crm-side-menu button.active {
    border-color: rgba(167, 139, 250, .24) !important;
    background: linear-gradient(135deg, rgba(124, 58, 237, .32), rgba(20, 184, 166, .12)) !important;
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(4, 6, 18, .22) !important;
  }

  body.crm-shell-body .crm-page #crm {
    margin-left: 292px !important;
    width: calc(100% - 292px) !important;
    min-height: 100vh !important;
    padding: 28px 34px 64px !important;
    overflow: visible !important;
  }

  body.crm-shell-body .crm-page .section-head,
  body.crm-shell-body .crm-page .client-list,
  body.crm-shell-body .crm-page .comments-panel,
  body.crm-shell-body .crm-page .metric-row,
  body.crm-shell-body .crm-page .transaction-row,
  body.crm-shell-body .crm-page .chat-ticket,
  body.crm-shell-body .crm-page .support-ticket-row {
    border-radius: 12px !important;
  }

  body.crm-shell-body .crm-page .section-head h1 {
    font-size: clamp(2rem, 3vw, 3.2rem) !important;
  }

  body.crm-shell-body .crm-page .crm-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
  }

  body.crm-shell-body .crm-page .client-list {
    min-height: auto !important;
    padding: 18px !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list {
    min-height: 520px !important;
  }

  body.crm-shell-body .crm-login-panel {
    min-height: 100vh !important;
    padding: 38px 44px 44px 336px !important;
  }

  body.crm-shell-body .crm-login-shell {
    width: min(1120px, 100%) !important;
    grid-template-columns: minmax(420px, 1fr) minmax(380px, 460px) !important;
  }

  body.crm-shell-body .crm-page.detail-open #crm {
    position: static !important;
    z-index: auto !important;
    pointer-events: auto !important;
  }

  body.crm-shell-body .crm-page.detail-open::after {
    content: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 5000 !important;
    background: rgba(3, 7, 18, .62) !important;
    backdrop-filter: blur(14px) !important;
    pointer-events: none !important;
  }

  body.crm-shell-body .crm-page.detail-open .client-detail {
    position: fixed !important;
    top: 28px !important;
    right: 32px !important;
    bottom: 28px !important;
    left: max(324px, calc(50vw - 430px)) !important;
    z-index: 5010 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-content: start !important;
    gap: 14px !important;
    width: auto !important;
    max-width: 980px !important;
    max-height: none !important;
    padding: 16px !important;
    overflow: auto !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    border: 1px solid rgba(167, 139, 250, .22) !important;
    border-radius: 18px !important;
    background:
      radial-gradient(circle at 18% 0%, rgba(124, 58, 237, .24), transparent 32%),
      linear-gradient(145deg, rgba(13, 12, 30, .99), rgba(18, 21, 40, .99)) !important;
    box-shadow: 0 34px 110px rgba(0, 0, 0, .72) !important;
  }

  body.crm-shell-body .crm-page.detail-open .client-detail > * {
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.crm-shell-body .crm-page.detail-open .detail-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    margin: 0 !important;
    padding: 22px !important;
  }

  body.crm-shell-body .crm-page.detail-open .action-grid,
  body.crm-shell-body .crm-page.detail-open .crm-insight-grid,
  body.crm-shell-body .crm-page.detail-open .crm-operations-grid {
    display: grid !important;
  }

  body.crm-shell-body .crm-manager-create-form {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    padding: 14px !important;
    margin-bottom: 14px !important;
    border: 1px solid rgba(167, 139, 250, .14) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .045) !important;
  }

  body.crm-shell-body .crm-manager-create-form.hidden {
    display: none !important;
  }

  body.crm-shell-body .crm-manager-create-form label {
    display: grid !important;
    gap: 6px !important;
  }

  body.crm-shell-body .crm-manager-create-form button {
    grid-column: 1 / -1 !important;
  }

  body.crm-shell-body .crm-profile-card {
    display: grid !important;
    gap: 8px !important;
    min-height: 150px !important;
    padding: 20px !important;
    margin-bottom: 14px !important;
    align-content: end !important;
    border: 1px solid rgba(167, 139, 250, .18) !important;
    border-radius: 14px !important;
    background:
      radial-gradient(circle at 88% 10%, rgba(20, 184, 166, .22), transparent 34%),
      linear-gradient(145deg, rgba(15, 23, 42, .96), rgba(30, 21, 63, .92)) !important;
    color: #fff !important;
  }

  body.crm-shell-body .crm-profile-card span {
    color: #c4b5fd !important;
    font-size: .72rem !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
  }

  body.crm-shell-body .crm-profile-card h2 {
    margin: 0 !important;
    color: #fff !important;
    font-size: 1.8rem !important;
  }

  body.crm-shell-body .crm-profile-card p {
    color: rgba(237, 233, 254, .74) !important;
  }

  body.mobile-product #crypto.mobile-screen.active {
    justify-items: center !important;
  }

  body.mobile-product #crypto .section-head,
  body.mobile-product #crypto .crypto-task-panel {
    justify-self: stretch !important;
    width: 100% !important;
  }

  body.mobile-product #crypto .transfer-mode-tabs {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
    place-self: center !important;
    width: fit-content !important;
    max-width: calc(100vw - 360px) !important;
    margin: 16px auto !important;
    display: inline-grid !important;
    grid-template-columns: repeat(3, max-content) !important;
    justify-content: center !important;
  }

  body.mobile-product #crypto .transfer-mode-tabs button {
    width: auto !important;
    min-width: 132px !important;
    max-width: 190px !important;
    text-align: center !important;
  }

  body.mobile-product #appContent #crypto .transfer-mode-tabs {
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

body.crm-shell-body.crm-client-open::before,
body.crm-shell-body .crm-page.detail-open::after {
  content: none !important;
  display: none !important;
  backdrop-filter: none !important;
  background: transparent !important;
}

body.crm-shell-body .crm-page.detail-open .section-head,
body.crm-shell-body .crm-page.detail-open .client-list,
body.crm-shell-body .crm-page.detail-open .crm-insight-grid,
body.crm-shell-body .crm-page.detail-open .crm-chart-panel {
  opacity: 1 !important;
  filter: none !important;
}

body.crm-shell-body.crm-login-active {
  background:
    radial-gradient(circle at 18% 8%, rgba(124, 58, 237, .28), transparent 34%),
    linear-gradient(135deg, #070914 0%, #100b24 52%, #060812 100%) !important;
}

@media (min-width: 901px) {
  body.crm-shell-body.crm-login-active .crm-login-panel {
    padding: 0 !important;
    min-height: 100vh !important;
    width: 100vw !important;
    place-items: stretch !important;
  }

  body.crm-shell-body.crm-login-active .crm-login-shell {
    width: 100vw !important;
    min-height: 100vh !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 560px) !important;
    gap: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    background:
      radial-gradient(circle at 18% 12%, rgba(124, 58, 237, .32), transparent 34%),
      linear-gradient(135deg, rgba(13, 12, 30, .98), rgba(9, 11, 22, .98)) !important;
  }

  body.crm-shell-body.crm-login-active .crm-login-hero {
    min-height: 100vh !important;
    padding: 70px 76px !important;
    align-content: center !important;
  }

  body.crm-shell-body.crm-login-active .crm-login-hero h1 {
    max-width: 520px !important;
    font-size: clamp(4rem, 7vw, 7rem) !important;
  }

  body.crm-shell-body.crm-login-active .crm-manager-form {
    align-self: center !important;
    justify-self: center !important;
    width: min(430px, calc(100% - 64px)) !important;
    margin: 0 !important;
    padding: 30px !important;
    transform: none !important;
    border: 1px solid rgba(167, 139, 250, .18) !important;
    border-radius: 18px !important;
    background: rgba(8, 10, 24, .74) !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .42) !important;
  }

  body.crm-shell-body.crm-login-active .crm-manager-form .auth-actions,
  body.crm-shell-body.crm-login-active .crm-manager-form .auth-actions button {
    display: grid !important;
    width: 100% !important;
  }

  body.crm-shell-body.crm-login-active .crm-manager-form .auth-actions button {
    min-height: 52px !important;
    margin-top: 2px !important;
    border-radius: 12px !important;
  }
}

.toast {
  top: 24px !important;
  right: 24px !important;
  max-width: min(430px, calc(100vw - 32px)) !important;
  min-height: 56px !important;
  display: grid !important;
  align-items: center !important;
  padding: 14px 18px 14px 20px !important;
  border: 1px solid rgba(196, 181, 253, .32) !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(167, 139, 250, .34), transparent 36%),
    linear-gradient(135deg, rgba(18, 15, 42, .98), rgba(45, 31, 99, .98)) !important;
  color: #fff !important;
  font-size: .96rem !important;
  font-weight: 850 !important;
  line-height: 1.35 !important;
  box-shadow: 0 24px 70px rgba(20, 12, 55, .42) !important;
  transform: translateY(-16px) scale(.98) !important;
  opacity: 0;
  pointer-events: none;
  z-index: 10000 !important;
}

.toast.visible {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
}

body.crm-shell-body:not(.crm-authenticated) .crm-login-panel,
body.crm-shell-body.crm-login-active .crm-login-panel {
  position: fixed !important;
  inset: 0 !important;
  z-index: 3000 !important;
  display: grid !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  padding: 0 !important;
  place-items: stretch !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 18% 8%, rgba(124, 58, 237, .28), transparent 34%),
    linear-gradient(135deg, #070914 0%, #100b24 52%, #060812 100%) !important;
}

body.crm-shell-body:not(.crm-authenticated) .crm-login-shell,
body.crm-shell-body.crm-login-active .crm-login-shell {
  position: relative !important;
  z-index: 3001 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 560px) !important;
  align-items: center !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  gap: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.crm-shell-body:not(.crm-authenticated) .crm-login-hero,
body.crm-shell-body.crm-login-active .crm-login-hero {
  display: grid !important;
  min-height: 100vh !important;
  padding: 70px 76px !important;
  align-content: center !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.crm-shell-body:not(.crm-authenticated) .crm-manager-form,
body.crm-shell-body.crm-login-active .crm-manager-form {
  position: fixed !important;
  top: 50% !important;
  right: clamp(32px, 7vw, 110px) !important;
  z-index: 3002 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  align-self: auto !important;
  justify-self: auto !important;
  width: min(430px, calc(100% - 64px)) !important;
  min-height: auto !important;
  margin: 0 !important;
  padding: 30px !important;
  transform: translateY(-50%) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  border: 1px solid rgba(167, 139, 250, .18) !important;
  border-radius: 18px !important;
  background: rgba(8, 10, 24, .84) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42) !important;
}

body.crm-shell-body:not(.crm-authenticated) .crm-manager-form label,
body.crm-shell-body.crm-login-active .crm-manager-form label,
body.crm-shell-body:not(.crm-authenticated) .crm-manager-form input,
body.crm-shell-body.crm-login-active .crm-manager-form input,
body.crm-shell-body:not(.crm-authenticated) .crm-manager-form .auth-actions,
body.crm-shell-body.crm-login-active .crm-manager-form .auth-actions,
body.crm-shell-body:not(.crm-authenticated) .crm-manager-form button,
body.crm-shell-body.crm-login-active .crm-manager-form button {
  display: grid !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.crm-shell-body:not(.crm-authenticated) .crm-manager-form input,
body.crm-shell-body.crm-login-active .crm-manager-form input {
  width: 100% !important;
  min-height: 52px !important;
}

body.crm-shell-body:not(.crm-authenticated) .crm-manager-form button,
body.crm-shell-body.crm-login-active .crm-manager-form button {
  width: 100% !important;
  min-height: 52px !important;
  border-radius: 12px !important;
}

@media (max-width: 760px) {
  body.crm-shell-body:not(.crm-authenticated) .crm-login-shell,
  body.crm-shell-body.crm-login-active .crm-login-shell {
    grid-template-columns: 1fr !important;
  }

  body.crm-shell-body:not(.crm-authenticated) .crm-login-hero,
  body.crm-shell-body.crm-login-active .crm-login-hero {
    min-height: auto !important;
    padding: 28px 22px 0 !important;
  }

  body.crm-shell-body:not(.crm-authenticated) .crm-manager-form,
  body.crm-shell-body.crm-login-active .crm-manager-form {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: calc(100% - 28px) !important;
    transform: none !important;
  }
}

@media (min-width: 900px) {
  body.mobile-product #home .desktop-account-brief {
    display: grid !important;
    gap: 14px !important;
    min-height: 258px !important;
    padding: 22px !important;
    border: 1px solid rgba(167, 139, 250, .18) !important;
    border-radius: 10px !important;
    background:
      radial-gradient(circle at 90% 0%, rgba(20, 184, 166, .18), transparent 34%),
      linear-gradient(145deg, rgba(13, 20, 42, .94), rgba(31, 24, 62, .88)) !important;
    color: #fff !important;
    box-shadow: 0 28px 82px rgba(3, 7, 18, .34) !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-head {
    display: flex !important;
    align-items: start !important;
    justify-content: space-between !important;
    gap: 14px !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-head span,
  body.mobile-product #home .desktop-account-brief .brief-status-list span {
    color: #c4b5fd !important;
    font-size: .72rem !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-head b {
    padding: 6px 10px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .10) !important;
    color: #fff !important;
    font-size: .76rem !important;
    white-space: nowrap !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-metric-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-metric-grid article {
    display: grid !important;
    gap: 7px !important;
    min-height: 92px !important;
    padding: 14px !important;
    align-content: end !important;
    border: 1px solid rgba(255, 255, 255, .09) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, .055) !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-metric-grid span {
    color: rgba(237, 233, 254, .68) !important;
    font-size: .74rem !important;
    font-weight: 850 !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-metric-grid strong {
    min-width: 0 !important;
    color: #fff !important;
    font-size: clamp(1.25rem, 1.7vw, 1.85rem) !important;
    line-height: 1 !important;
    overflow-wrap: anywhere !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-status-list {
    display: grid !important;
    gap: 8px !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-status-list div {
    display: grid !important;
    grid-template-columns: 110px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  }

  body.mobile-product #home .desktop-account-brief .brief-status-list b {
    min-width: 0 !important;
    color: rgba(255, 255, 255, .92) !important;
    font-size: .86rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.mobile-product #home .desktop-account-brief button {
    min-height: 46px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: linear-gradient(135deg, #20b7d0, #12b8d1) !important;
    color: #fff !important;
    font-weight: 950 !important;
    box-shadow: 0 14px 32px rgba(79, 140, 255, .20) !important;
  }
}

@media (max-width: 899px) {
  body.mobile-product #home .desktop-account-brief {
    display: none !important;
  }

  body.mobile-product #home .desktop-fee-asset {
    display: none !important;
  }
}

/* Final CRM readability pass: larger, sharper operator UI. */
body.crm-shell-body,
body.crm-shell-body .crm-page {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: geometricPrecision !important;
}

body.crm-shell-body .crm-page {
  font-size: 16px !important;
}

body.crm-shell-body .crm-page .crm-side-menu button,
body.crm-shell-body .crm-page .language-switch button,
body.crm-shell-body .crm-page .theme-switch button,
body.crm-shell-body .crm-page .staff-link,
body.crm-shell-body .crm-page .mini-tabs button {
  font-size: .9rem !important;
  line-height: 1.25 !important;
}

@media (min-width: 901px) {
  body.crm-shell-body .crm-page .topbar {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
  }

  body.crm-shell-body .crm-page .top-actions {
    min-height: 0 !important;
    padding-bottom: 24px !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu {
    max-height: none !important;
    overflow: visible !important;
    gap: 6px !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu button {
    min-height: 38px !important;
    flex-shrink: 0 !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu [data-crm-tab="settings"] {
    display: flex !important;
  }
}

@media (max-width: 900px) {
  body.crm-shell-body {
    overflow-x: hidden !important;
    background: linear-gradient(180deg, #080b14, #0b1020) !important;
  }

  body.crm-shell-body .crm-page {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }

  body.crm-shell-body.crm-login-active .crm-page .topbar,
  body.crm-shell-body:not(.crm-authenticated) .crm-page .topbar {
    display: none !important;
  }

  body.crm-shell-body .crm-page .topbar {
    position: sticky !important;
    inset: auto !important;
    top: 0 !important;
    z-index: 1200 !important;
    width: 100% !important;
    height: auto !important;
    max-height: 52vh !important;
    overflow-y: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 14px !important;
    border-right: 0 !important;
    border-bottom: 1px solid rgba(167, 139, 250, .16) !important;
    background: rgba(8, 11, 20, .98) !important;
  }

  body.crm-shell-body .crm-page .brand {
    order: 1 !important;
    width: 100% !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 0 0 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
  }

  body.crm-shell-body .crm-page .top-actions {
    order: 2 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body.crm-shell-body .crm-page .language-switch,
  body.crm-shell-body .crm-page .theme-switch {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu {
    display: flex !important;
    gap: 8px !important;
    padding: 8px 0 2px !important;
    overflow-x: auto !important;
    border: 0 !important;
    background: transparent !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu span {
    display: none !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu button {
    flex: 0 0 auto !important;
    min-width: 112px !important;
    min-height: 42px !important;
    justify-content: center !important;
    text-align: center !important;
    border: 1px solid rgba(167, 139, 250, .16) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .045) !important;
  }

  body.crm-shell-body .crm-page .staff-link {
    display: none !important;
  }

  body.crm-shell-body .crm-page #crm {
    width: 100% !important;
    margin: 0 !important;
    padding: 14px !important;
  }

  body.crm-shell-body .crm-page .section-head {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 16px !important;
  }

  body.crm-shell-body .crm-page .section-head h1 {
    font-size: clamp(1.55rem, 8vw, 2.35rem) !important;
    line-height: 1.05 !important;
  }

  body.crm-shell-body .crm-page .crm-layout,
  body.crm-shell-body .crm-page.detail-open .crm-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  body.crm-shell-body .crm-page .client-list,
  body.crm-shell-body .crm-page .client-detail,
  body.crm-shell-body .crm-page .comments-panel,
  body.crm-shell-body .crm-page .crm-chart-panel {
    border-radius: 14px !important;
    padding: 14px !important;
  }

  body.crm-shell-body .crm-table-head {
    display: none !important;
  }

  body.crm-shell-body .crm-page #applications .crm-list {
    border: 0 !important;
    background: transparent !important;
  }

  body.crm-shell-body .crm-page .request-card {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    min-height: auto !important;
    padding: 14px !important;
    border-radius: 14px !important;
    text-align: left !important;
  }

  body.crm-shell-body .crm-page .request-card > span,
  body.crm-shell-body .crm-page .request-card > strong,
  body.crm-shell-body .crm-page .request-card > em {
    justify-self: stretch !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }

  body.crm-shell-body .crm-page .crm-insight-grid,
  body.crm-shell-body .crm-page .crm-operations-grid,
  body.crm-shell-body .crm-page .action-grid,
  body.crm-shell-body .crm-page .detail-top,
  body.crm-shell-body .crm-page .comment-form.stacked-form {
    grid-template-columns: 1fr !important;
  }

  body.crm-shell-body.crm-client-open::before {
    content: none !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-list {
    display: none !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail {
    display: block !important;
  }
}

body.crm-shell-body .crm-side-menu span,
body.crm-shell-body .crm-page .top-actions::before,
body.crm-shell-body .crm-page .client-list::before,
body.crm-shell-body .crm-page .access-badge,
body.crm-shell-body .crm-page .request-card em,
body.crm-shell-body .crm-page .panel-title span,
body.crm-shell-body .crm-page .crm-withdraw-form label {
  font-size: .78rem !important;
  letter-spacing: .08em !important;
}

body.crm-shell-body .crm-table-head {
  font-size: .76rem !important;
  line-height: 1.25 !important;
}

body.crm-shell-body .crm-page .request-card span,
body.crm-shell-body .crm-page .request-card small,
body.crm-shell-body .crm-page .detail-top p,
body.crm-shell-body .crm-page .comments-panel p,
body.crm-shell-body .crm-page .comment-feed,
body.crm-shell-body .crm-page .comment-feed p,
body.crm-shell-body .crm-page .support-ticket-row,
body.crm-shell-body .crm-page .support-ticket-row p,
body.crm-shell-body .crm-page .transaction-row,
body.crm-shell-body .crm-page .chat-ticket,
body.crm-shell-body .crm-page .metric-row,
body.crm-shell-body .crm-page input,
body.crm-shell-body .crm-page textarea,
body.crm-shell-body .crm-page select {
  font-size: .95rem !important;
  line-height: 1.45 !important;
}

body.crm-shell-body .crm-page .request-card b,
body.crm-shell-body .crm-page .request-card strong,
body.crm-shell-body .crm-page .detail-top h2,
body.crm-shell-body .crm-page .panel-title h2,
body.crm-shell-body .crm-page .metric-row b {
  font-size: 1.08rem !important;
  line-height: 1.25 !important;
}

body.crm-shell-body .crm-page button,
body.crm-shell-body .crm-page .action-grid a,
body.crm-shell-body .crm-page .comment-form button,
body.crm-shell-body .crm-page .crm-withdraw-form button,
body.crm-shell-body .crm-page .chat-ticket button,
body.crm-shell-body .crm-page .support-ticket-row button,
body.crm-shell-body .crm-page .crm-back-button {
  font-size: .86rem !important;
  line-height: 1.2 !important;
}

body.crm-shell-body .crm-page .section-head h1 {
  font-size: clamp(2.35rem, 3.4vw, 3.6rem) !important;
}

body.crm-shell-body .crm-page .balance-pill span {
  font-size: .78rem !important;
}

body.crm-shell-body .crm-page .balance-pill strong {
  font-size: clamp(1.9rem, 2.4vw, 2.55rem) !important;
}

body.crm-shell-body .crm-manager-create-form label {
  font-size: .86rem !important;
}

body.crm-shell-body .crm-manager-create-form button {
  font-size: .9rem !important;
}

body.crm-shell-body .crm-profile-card span {
  font-size: .82rem !important;
}

body.crm-shell-body .crm-assignment-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-items: end !important;
  margin: 0 0 16px !important;
  padding: 14px !important;
  border: 1px solid rgba(167, 139, 250, .18) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .045) !important;
}

body.crm-shell-body .crm-assignment-form.hidden {
  display: none !important;
}

body.crm-shell-body .webrtc-phone-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 31001;
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid rgba(237, 82, 194, .52);
  border-radius: 16px;
  background: linear-gradient(145deg, #171127, #251432);
  box-shadow: 0 32px 100px rgba(8, 3, 15, .78);
  color: #fff;
  overflow: auto;
  transform: translate(-50%, -50%);
}

body.crm-shell-body .webrtc-phone-panel.hidden {
  display: none !important;
}

body.crm-shell-body.sip-phone-open {
  overflow: hidden;
}

body.crm-shell-body.sip-phone-open > .crm-page {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

body.crm-shell-body .sip-phone-backdrop {
  position: fixed;
  inset: 0;
  z-index: 31000;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(4, 2, 12, .7);
  box-shadow: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

body.crm-shell-body .sip-phone-backdrop.hidden {
  display: none !important;
}

/* Explicit light-theme surface overrides for the banking app and Prime shell. */
:root[data-theme="purple-light"] body {
  background: linear-gradient(180deg, #ffffff 0%, #f4f1fa 100%) !important;
  color: #092235 !important;
}

:root[data-theme="purple-light"] .mobile-product,
:root[data-theme="purple-light"] .mobile-shell,
:root[data-theme="purple-light"] .app-shell,
:root[data-theme="purple-light"] .product-view {
  background: transparent !important;
  color: #092235 !important;
}

:root[data-theme="purple-light"] .settings-card,
:root[data-theme="purple-light"] .profile-card,
:root[data-theme="purple-light"] .asset-row,
:root[data-theme="purple-light"] .address-row,
:root[data-theme="purple-light"] .wallet-strip,
:root[data-theme="purple-light"] .transaction-row,
:root[data-theme="purple-light"] .support-card,
:root[data-theme="purple-light"] .support-history-card,
:root[data-theme="purple-light"] .quick-grid button,
:root[data-theme="purple-light"] .bank-form,
:root[data-theme="purple-light"] .client-list,
:root[data-theme="purple-light"] .client-detail,
:root[data-theme="purple-light"] .comments-panel {
  background: #ffffff !important;
  border-color: #c8e6e9 !important;
  color: #092235 !important;
  box-shadow: 0 12px 30px rgba(109, 74, 255, .08) !important;
}

:root[data-theme="purple-light"] .settings-card p,
:root[data-theme="purple-light"] .settings-card span,
:root[data-theme="purple-light"] .profile-card p,
:root[data-theme="purple-light"] .asset-row small,
:root[data-theme="purple-light"] .transaction-row small,
:root[data-theme="purple-light"] .support-history-card small {
  color: #746b86 !important;
}

:root[data-theme="purple-light"] .settings-card input,
:root[data-theme="purple-light"] .settings-card select,
:root[data-theme="purple-light"] .settings-card textarea,
:root[data-theme="purple-light"] .bank-form input,
:root[data-theme="purple-light"] .bank-form select,
:root[data-theme="purple-light"] .bank-form textarea {
  background: #f4fbfc !important;
  border-color: #c8e6e9 !important;
  color: #092235 !important;
}

:root[data-theme="purple-light"] .app-menu,
:root[data-theme="purple-light"] .bottom-tabs,
:root[data-theme="purple-light"] .language-switch,
:root[data-theme="purple-light"] .theme-switch {
  background: #ffffff !important;
  border-color: #c8e6e9 !important;
}

:root[data-theme="purple-light"] .app-menu button,
:root[data-theme="purple-light"] .bottom-tabs button,
:root[data-theme="purple-light"] .language-switch button,
:root[data-theme="purple-light"] .theme-switch button {
  color: #746b86 !important;
}

:root[data-theme="purple-light"] .app-menu .active,
:root[data-theme="purple-light"] .bottom-tabs .active,
:root[data-theme="purple-light"] .language-switch .active,
:root[data-theme="purple-light"] .theme-switch .active {
  background: #ede6f7 !important;
  color: #4c1d95 !important;
}

:root[data-theme="purple-light"] body.mobile-product .desktop-app-sidebar {
  background: #ffffff !important;
  border-color: #c8e6e9 !important;
  box-shadow: 0 18px 44px rgba(109, 74, 255, .08) !important;
}

:root[data-theme="purple-light"] .desktop-app-brand,
:root[data-theme="purple-light"] .desktop-app-sidebar button {
  color: #092235 !important;
}

:root[data-theme="purple-light"] .prime-app,
:root[data-theme="purple-light"] .prime-shell,
:root[data-theme="purple-light"] .prime-page,
:root[data-theme="purple-light"] .prime-card,
:root[data-theme="purple-light"] .prime-history,
:root[data-theme="purple-light"] .prime-position,
:root[data-theme="purple-light"] .prime-asset,
:root[data-theme="purple-light"] .prime-mini,
:root[data-theme="purple-light"] .prime-quick button {
  background: #ffffff !important;
  color: #092235 !important;
  border-color: #c8e6e9 !important;
}

:root[data-theme="purple-light"] .prime-app small,
:root[data-theme="purple-light"] .prime-app .prime-muted,
:root[data-theme="purple-light"] .prime-app .prime-subtitle {
  color: #746b86 !important;
}

body.crm-shell-body .webrtc-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

body.crm-shell-body .webrtc-phone-head span,
body.crm-shell-body .webrtc-phone-head strong {
  display: block;
}

body.crm-shell-body .webrtc-phone-head span {
  font-size: .78rem;
  font-weight: 900;
  color: #f1a5dc;
  text-transform: uppercase;
}

body.crm-shell-body .webrtc-phone-head strong {
  margin-top: 3px;
  font-size: 1rem;
  color: #fff;
}

body.crm-shell-body #webrtcPhoneClose {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(237, 82, 194, .38);
  border-radius: 9px;
  background: rgba(237, 82, 194, .1);
  color: #f7c1e7;
  font-size: 1.35rem;
  line-height: 1;
}

body.crm-shell-body .webrtc-phone-body {
  display: grid;
  gap: 14px;
  min-height: 54px;
  padding: 16px;
  background: rgba(7, 4, 18, .42);
}

body.crm-shell-body .sip-phone-contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(229, 106, 223, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
}

body.crm-shell-body .sip-phone-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #6a3da7, #e5a847);
  color: #fff;
  font-weight: 900;
}

body.crm-shell-body .sip-phone-contact b,
body.crm-shell-body .sip-phone-contact small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.crm-shell-body .sip-phone-contact b {
  color: #fff;
  font-size: .95rem;
}

body.crm-shell-body .sip-phone-contact small {
  margin-top: 3px;
  color: #cdbbd8;
  font-size: .72rem;
}

body.crm-shell-body .sip-phone-online {
  padding: 5px 7px;
  border: 1px solid rgba(52, 211, 153, .28);
  border-radius: 6px;
  background: rgba(16, 185, 129, .1);
  color: #6ee7b7;
  font-size: .66rem;
  font-weight: 900;
}

body.crm-shell-body .sip-phone-number {
  position: relative;
  display: grid;
  gap: 6px;
}

body.crm-shell-body .sip-phone-number > span {
  color: #cdbbd8;
  font-size: .7rem;
  font-weight: 850;
  text-transform: uppercase;
}

body.crm-shell-body .sip-phone-number input {
  width: 100%;
  min-height: 52px;
  padding: 0 48px 0 14px;
  border: 1px solid rgba(229, 106, 223, .28);
  border-radius: 9px;
  outline: none;
  background: rgba(9, 6, 22, .88);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}

body.crm-shell-body .sip-phone-number input:focus {
  border-color: #e5a847;
  box-shadow: 0 0 0 3px rgba(237, 82, 194, .14);
}

body.crm-shell-body #sipPhoneClear {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #cdbbd8;
  font-size: 1.1rem;
}

body.crm-shell-body .sip-phone-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.crm-shell-body .sip-phone-keypad button {
  display: grid;
  min-height: 52px;
  padding: 6px;
  place-items: center;
  border: 1px solid rgba(229, 106, 223, .18);
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  color: #fff;
  box-shadow: none;
}

body.crm-shell-body .sip-phone-keypad button:hover {
  border-color: rgba(237, 82, 194, .56);
  background: rgba(237, 82, 194, .12);
}

body.crm-shell-body .sip-phone-keypad.is-live button {
  border-color: rgba(58, 220, 154, .32);
}

body.crm-shell-body .sip-phone-keypad.is-live button:hover {
  border-color: rgba(58, 220, 154, .75);
  background: rgba(58, 220, 154, .12);
}

body.crm-shell-body .sip-phone-keypad b {
  font-size: 1.05rem;
  line-height: 1;
}

body.crm-shell-body .sip-phone-keypad small {
  color: #9f8cab;
  font-size: .56rem;
  letter-spacing: .08em;
}

body.crm-shell-body .sip-dtmf-history {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(58, 220, 154, .3);
  border-radius: 8px;
  background: rgba(58, 220, 154, .08);
}

body.crm-shell-body .sip-dtmf-history span {
  flex: 0 0 auto;
  color: #75dcb1;
  font-size: .66rem;
  font-weight: 800;
}

body.crm-shell-body .sip-dtmf-history output {
  min-width: 0;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  font-weight: 850;
  overflow-x: auto;
  text-align: right;
  white-space: nowrap;
}

body.crm-shell-body .sip-phone-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
}

body.crm-shell-body .sip-phone-actions a,
body.crm-shell-body .sip-phone-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(237, 82, 194, .4);
  border-radius: 9px;
  background: linear-gradient(135deg, #6a3da7, #e5a847);
  color: #fff;
  font-size: .8rem;
  font-weight: 850;
  text-decoration: none;
}

body.crm-shell-body .sip-phone-actions button {
  background: linear-gradient(135deg, #6a3da7, #e5a847);
  box-shadow: none;
}

body.crm-shell-body .sip-phone-actions #sipPhoneHangup {
  border-color: rgba(255, 103, 153, .55);
  background: linear-gradient(135deg, #79235d, #d83c86);
}

body.crm-shell-body .sip-phone-actions .disabled {
  opacity: .45;
  cursor: not-allowed;
}

body.crm-shell-body .sip-phone-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #9f8cab;
  font-size: .65rem;
}

body.crm-shell-body .sip-phone-meta b {
  min-width: 0;
  overflow: hidden;
  color: #cdbbd8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  body.crm-shell-body .webrtc-phone-panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  body.crm-shell-body .sip-phone-keypad button {
    min-height: 46px;
  }
}

body.crm-shell-body #zdrmWPhI.zdrm-fixed,
body.crm-shell-body #zdrmWPhI {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: 24px !important;
  bottom: 154px !important;
  margin: 0 !important;
  z-index: 12100 !important;
}

body.crm-shell-body #zdrmWPhI .zdrm-webphone {
  max-width: min(348px, calc(100vw - 28px)) !important;
}

body.crm-shell-body #zdrmWPhI .zdrm-webphone-box,
body.crm-shell-body #zdrmWPhI .zdrm-webphone-call-btn {
  box-shadow: 0 16px 36px rgba(0, 0, 0, .28) !important;
}

@media (max-width: 640px) {
  body.crm-shell-body #zdrmWPhI.zdrm-fixed,
  body.crm-shell-body #zdrmWPhI {
    right: 14px !important;
    bottom: 132px !important;
  }
}

body.crm-shell-body .crm-assignment-form label {
  display: grid !important;
  gap: 7px !important;
  color: rgba(237, 233, 254, .82) !important;
  font-size: .84rem !important;
  font-weight: 900 !important;
}

body.crm-shell-body .crm-assignment-form select {
  min-height: 44px !important;
  border: 1px solid rgba(148, 163, 184, .24) !important;
  border-radius: 10px !important;
  background: rgba(2, 6, 23, .48) !important;
  color: #fff !important;
  padding: 0 12px !important;
}

body.crm-shell-body .crm-assignment-form button {
  min-height: 44px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #20b7d0, #12b8d1) !important;
  color: #fff !important;
  font-weight: 950 !important;
}

body.crm-shell-body .crm-events-title {
  margin-top: 18px !important;
}

body.crm-shell-body .crm-event-row p {
  color: rgba(237, 233, 254, .74) !important;
  word-break: break-word !important;
}

body.crm-shell-body .crm-event-row.has-sms-message > div {
  display: grid !important;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr) !important;
  align-items: start !important;
}

body.crm-shell-body .crm-event-row.has-sms-message p {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  margin-top: 6px !important;
  padding-top: 9px !important;
  border-top: 1px solid rgba(167, 139, 250, .18) !important;
  white-space: pre-wrap !important;
  line-height: 1.45 !important;
}

body.crm-shell-body .crm-event-row.sms-content-missing p {
  color: #f59e0b !important;
}

body.crm-shell-body .crm-internal-chat {
  display: grid !important;
  gap: 12px !important;
  margin-bottom: 18px !important;
  padding: 16px !important;
  border: 1px solid rgba(167, 139, 250, .18) !important;
  border-radius: 10px !important;
  background:
    radial-gradient(circle at 92% 0%, rgba(20, 184, 166, .14), transparent 34%),
    rgba(255, 255, 255, .045) !important;
}

body.crm-shell-body .crm-internal-feed {
  display: grid !important;
  gap: 10px !important;
  max-height: 320px !important;
  overflow: auto !important;
  padding: 10px !important;
  border: 1px solid rgba(148, 163, 184, .16) !important;
  border-radius: 10px !important;
  background: rgba(2, 6, 23, .35) !important;
}

body.crm-shell-body .crm-internal-message {
  display: grid !important;
  align-self: start !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 11px 12px !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, .055) !important;
  color: #fff !important;
}

body.crm-shell-body .crm-internal-feed {
  align-content: start !important;
  grid-auto-rows: max-content !important;
  min-height: 0 !important;
  height: 260px !important;
}

body.crm-shell-body .crm-internal-message b {
  color: #fff !important;
}

body.crm-shell-body .crm-internal-message span {
  color: rgba(237, 233, 254, .88) !important;
  line-height: 1.45 !important;
  word-break: break-word !important;
}

body.crm-shell-body .crm-internal-message small {
  color: rgba(237, 233, 254, .54) !important;
}

body.crm-shell-body .crm-support-title {
  margin-top: 4px !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body .crm-client-support-panel,
:root[data-theme="purple-dark"] body.crm-shell-body .crm-client-chat-main,
:root[data-theme="purple-dark"] body.crm-shell-body .crm-client-message-row {
  background: rgba(9, 15, 31, 0.96) !important;
  color: #f3fbfc !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body .crm-client-message-row {
  border-color: rgba(238, 89, 196, 0.38) !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body .crm-client-message-row:hover {
  border-color: #e5a847 !important;
  background: rgba(74, 28, 83, 0.7) !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body .crm-client-message-row > span {
  color: #e9e4ff !important;
}

:root[data-theme="purple-dark"] body.crm-shell-body .crm-client-message-row button {
  border-color: rgba(238, 89, 196, 0.55) !important;
  color: #f5b5e7 !important;
}

/* CRM shell final layout guard: keeps brand, switches and navigation separated. */
@media (min-width: 901px) {
  body.crm-shell-body .crm-page .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "brand" "actions" !important;
    align-content: start !important;
    align-items: start !important;
    gap: 14px !important;
    padding-top: 18px !important;
  }

  body.crm-shell-body .crm-page .brand {
    grid-area: brand !important;
    position: relative !important;
    z-index: 2 !important;
    min-height: 66px !important;
    margin: 0 !important;
    padding: 8px 8px 14px !important;
  }

  body.crm-shell-body .crm-page .top-actions {
    grid-area: actions !important;
    position: relative !important;
    z-index: 1 !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    margin: 0 !important;
    padding-bottom: 20px !important;
  }

  body.crm-shell-body .crm-page .language-switch,
  body.crm-shell-body .crm-page .theme-switch {
    min-height: 42px !important;
    margin: 0 !important;
  }
}

@media (max-width: 900px) {
  body.crm-shell-body .crm-page .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1200 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas: "brand" "actions" !important;
    gap: 10px !important;
    padding: 12px !important;
    overflow: visible !important;
  }

  body.crm-shell-body .crm-page .brand {
    grid-area: brand !important;
    min-height: 56px !important;
    padding: 0 0 10px !important;
  }

  body.crm-shell-body .crm-page .top-actions {
    grid-area: actions !important;
    position: static !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  body.crm-shell-body .crm-page .language-switch,
  body.crm-shell-body .crm-page .theme-switch {
    min-height: 40px !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 2px 0 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity !important;
  }

  body.crm-shell-body .crm-page .crm-side-menu button {
    flex: 0 0 auto !important;
    min-width: 118px !important;
    min-height: 42px !important;
    scroll-snap-align: start !important;
  }

  body.crm-shell-body .crm-page #crm {
    margin: 0 !important;
    width: 100% !important;
    padding: 12px !important;
  }

  body.crm-shell-body .crm-page .crm-table-head {
    display: none !important;
  }

  body.crm-shell-body .crm-page .request-card {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }
}

/* Keep the Customers list scrollable after all theme and responsive rules. */
.crm-page #applications .crm-list {
  height: min(70vh, 760px) !important;
  max-height: min(70vh, 760px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

@media (max-width: 900px) {
  .crm-page #applications .crm-list {
    height: 62vh !important;
    max-height: 62vh !important;
  }

  /* Final fallback for restored mobile CRM sessions. */
  .crm-page.detail-open .client-detail {
    position: fixed !important;
    inset: 8px !important;
    display: block !important;
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    min-height: calc(100dvh - 16px) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 10050 !important;
    background: linear-gradient(145deg, #11162b, #0b1020) !important;
  }

  .crm-page.detail-open .client-detail > *,
  .crm-page.detail-open .client-detail .detail-top {
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

@media (max-width: 900px) {
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail {
    position: fixed !important;
    top: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: calc(100dvh - 16px) !important;
    min-height: calc(100dvh - 16px) !important;
    max-height: none !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail > *,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .detail-top,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .action-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-insight-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-operations-grid {
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .detail-top {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .action-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-insight-grid,
  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-operations-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-back-button {
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
    width: max-content !important;
    max-width: 100% !important;
  }
}
/* Wide messenger layout: the chat is a workspace, not a narrow card. */
body.crm-shell-body.crm-client-open .crm-page.detail-open .client-detail .crm-back-button {
  position: sticky !important;
  top: 0 !important;
  z-index: 10060 !important;
  width: max-content !important;
  max-width: 100% !important;
  pointer-events: auto !important;
}

/* Must remain last: legacy detail-open rules force several grids to display. */
body.crm-shell-body .crm-page.detail-open .client-detail .crm-section-hidden {
  display: none !important;
}

body.crm-shell-body .crm-page.detail-open .client-detail {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

body.crm-shell-body .crm-page.detail-open .crm-client-progress button {
  border-color: rgba(167, 139, 250, .16) !important;
  background: rgba(255, 255, 255, .035) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

body.crm-shell-body .crm-page.detail-open .crm-client-progress button.active {
  border-color: rgba(96, 165, 250, .65) !important;
  background: linear-gradient(135deg, rgba(79, 134, 247, .32), rgba(128, 87, 232, .26)) !important;
  color: var(--ink) !important;
}

/* Friendly client workspace additions. */
.client-detail .crm-client-comments-panel[data-crm-client-section="overview"] { order: 1; }
.client-detail .detail-top[data-crm-client-section="overview"] { order: 2; }
.client-detail .crm-insight-grid[data-crm-client-section="overview"] { order: 3; }
.client-detail .crm-chart-panel[data-crm-client-section="overview"] { order: 4; }
.client-detail .crm-client-history-panel[data-crm-client-section="overview"] { order: 5; }

.crm-client-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  order: 0;
}

.crm-client-progress button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(167, 139, 250, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.crm-client-progress button.active {
  border-color: rgba(96, 165, 250, .55);
  color: var(--ink);
  background: rgba(79, 134, 247, .12);
}

.crm-client-progress b {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(139, 92, 246, .2);
  color: #c4b5fd;
}

.crm-client-identity {
  min-width: 0;
}

.crm-client-identity-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.crm-client-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, .34);
  border-radius: 50%;
  background: linear-gradient(135deg, #29b8a6, #5579eb);
  color: #fff;
  font-weight: 900;
}

.crm-client-identity-head h2,
.crm-client-identity-head p {
  margin: 0;
}

.crm-client-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.crm-client-badges span {
  padding: 4px 7px;
  border: 1px solid rgba(167, 139, 250, .2);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
}

.crm-client-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.crm-client-contact-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(167, 139, 250, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}

.crm-client-contact-grid span,
.crm-client-contact-grid b {
  display: block;
}

.crm-client-contact-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-client-contact-grid b {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: .78rem;
}

.crm-client-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.crm-client-quick-actions button {
  min-height: 38px;
  border: 1px solid rgba(96, 165, 250, .32);
  border-radius: 8px;
  background: rgba(79, 134, 247, .1);
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.crm-action-cards button {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 62px;
  text-align: left;
}

.crm-action-cards button b,
.crm-action-cards button small {
  display: block;
}

.crm-action-cards button small {
  color: rgba(255, 255, 255, .7);
  font-size: .68rem;
}

.stacked-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

.stacked-form label input,
.stacked-form label select {
  width: 100%;
}

.crm-page .tx-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.crm-page .tx-actions button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 7px;
}

@media (max-width: 760px) {
  .crm-client-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-client-contact-grid,
  .crm-client-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#crm-chat-portal {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  left: 310px;
  z-index: 100;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(175, 117, 230, 0.4);
  border-radius: 18px;
  background: var(--page, #11152d);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
#crm-chat-portal > #chat.crm-pane.active {
  display: block !important;
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  min-height: 100%;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-top: 0 !important;
}
#crm-chat-portal .crm-chat-workspace,
#crm-chat-portal .crm-client-support-panel {
  visibility: visible !important;
  opacity: 1 !important;
}
@media (min-width:701px) {
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active {
    display: block !important;
    padding: 0 18px 18px !important;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-workspace,
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-client-support-panel {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 22px !important;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-workspace {
    min-height: 620px;
    padding: 26px;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-layout {
    min-height: 520px;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-members,
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-topics {
    max-height: none;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-internal-feed {
    min-height: 0;
    max-height: 430px;
  }
}

body.crm-shell-body .crm-chat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface, #fff) 88%, #e5a847 12%);
  color: var(--muted);
}
body.crm-shell-body .crm-chat-search:focus-within {
  border-color: #e5a847;
  box-shadow: 0 0 0 3px rgba(238, 89, 196, 0.16);
}
body.crm-shell-body .crm-chat-search input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}
body.crm-shell-body .crm-internal-message,
body.crm-shell-body .crm-client-message-row {
  max-width: min(78%, 620px);
  border-color: rgba(126, 94, 231, 0.28);
  border-radius: 16px 16px 16px 5px;
  background: color-mix(in srgb, var(--surface, #fff) 88%, #8d5bea 12%);
  box-shadow: 0 4px 14px rgba(32, 23, 74, 0.08);
}
body.crm-shell-body .crm-internal-message:hover,
body.crm-shell-body .crm-client-message-row:hover {
  border-color: #e5a847;
  transform: translateY(-1px);
}
body.crm-shell-body .crm-client-support-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface, #fff);
  min-height: 560px;
}
body.crm-shell-body .crm-internal-message.is-own,
body.crm-shell-body .crm-client-message-row.is-own {
  margin-left: auto;
  border-radius: 16px 16px 5px 16px;
  border-color: rgba(238, 89, 196, 0.48);
  background: linear-gradient(135deg, #694de1, #e5a847);
  color: #fff;
}
body.crm-shell-body .crm-internal-message.is-own small {
  color: rgba(255, 255, 255, 0.78);
}
@media (max-width:700px) {
  #crm-chat-portal {
    inset: 8px;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-workspace {
    width: 100% !important;
    min-height: 0;
    padding: 14px;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-internal-feed {
    max-height: 52vh;
  }
}

/* Final chat sizing and readable light theme overrides. */
@media (min-width:701px) {
  body.crm-shell-body #crm-chat-portal {
    top: 18px;
    right: 18px;
    bottom: 18px;
    left: 310px;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active {
    padding: 18px 22px !important;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-workspace {
    min-height: 0;
    margin-top: 0 !important;
    padding: 18px;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-chat-layout {
    min-height: 430px;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-internal-feed {
    max-height: 330px;
    padding: 14px;
  }
  body.crm-shell-body #crm-chat-portal > #chat.crm-pane.active .crm-client-support-panel {
    min-height: 0;
  }
}

:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal {
  background: #f0edf5;
  color: #272033;
}
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-chat-workspace,
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-client-support-panel {
  background: #fff !important;
  color: #272033 !important;
  border-color: #d9c9e8 !important;
}
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-chat-sidebar {
  background: #f8eaf7 !important;
  border-color: #dcc9e7 !important;
}
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-chat-main {
  background: #f7f8fc !important;
}
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-internal-feed,
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-message-feed {
  background: #eef1f7 !important;
}
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-internal-message,
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-client-message-row {
  background: #fff !important;
  color: #272033 !important;
  border-color: #cdb8df !important;
}
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-internal-message.is-own,
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-client-message-row.is-own {
  background: linear-gradient(135deg, #7458e8, #e252c1) !important;
  color: #fff !important;
  border-color: #e252c1 !important;
}
:root[data-theme="purple-light"] body.crm-shell-body #crm-chat-portal .crm-chat-search {
  background: #fff;
  color: #6d607a;
  border-color: #d2c2e4;
}

/* Chat lives in the main CRM column so the sidebar cannot affect its layout. */
body.crm-shell-body.crm-chat-open #crm {
  display: block !important;
  min-width: 0 !important;
  padding: 18px 24px !important;
}
body.crm-shell-body.crm-chat-open #crm > .crm-layout,
body.crm-shell-body.crm-chat-open #crm .client-detail {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
body.crm-shell-body.crm-chat-open #crm > .client-list {
  display: none !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active {
  display: block !important;
  position: static !important;
  width: 100% !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-chat-workspace {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 0 18px !important;
  padding: 16px !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-chat-layout {
  min-height: 420px !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-chat-main {
  grid-template-rows: auto auto auto !important;
  align-content: start;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-internal-feed {
  height: 320px !important;
  min-height: 0 !important;
  max-height: 320px !important;
  align-content: start !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-internal-message {
  max-width: min(64%, 480px);
  margin-bottom: 7px;
  padding: 8px 11px;
  font-size: 0.86rem;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-internal-message span {
  margin-top: 2px;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-internal-message.is-own {
  margin-left: auto !important;
  margin-right: 0 !important;
  align-self: end !important;
}
body.crm-shell-body.crm-chat-open #crm-chat-portal {
  display: none !important;
}

body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-client-support-panel {
  display: block !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-client-chat-main {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  min-height: 0 !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-client-support-panel .crm-message-feed {
  min-height: 300px !important;
  height: 380px !important;
  max-height: 380px !important;
  align-content: start !important;
  overflow-y: auto !important;
}
body.crm-shell-body.crm-chat-open #crm > #chat.crm-pane.active .crm-client-message-row {
  max-width: min(78%, 640px);
  margin-bottom: 5px;
  padding: 7px 10px;
}
:root .mobile-topbar .brand-logo-full,
:root .welcome-overlay .brand-logo-full,
:root .auth-emblem.auth-logo-full {
  width: 210px !important;
  height: 82px !important;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

:root .mobile-topbar .brand-logo-full img,
:root .welcome-overlay .brand-logo-full img,
:root .auth-emblem.auth-logo-full img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  object-position: center !important;
}

body.mobile-product:not(.client-authenticated) #appContent,
body.mobile-product #appContent.hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.mobile-product:not(.client-authenticated) .mobile-shell {
  min-height: 100vh;
  padding-bottom: 32px;
}

body.mobile-product:not(.client-authenticated) .mobile-topbar {
  display: none !important;
  margin: 0 !important;
}

body.mobile-product:not(.client-authenticated) .auth-emblem.auth-logo-full {
  margin-bottom: 16px;
  box-shadow: 0 18px 36px rgba(79, 140, 255, .18);
}

:root[data-theme="purple-dark"] .mobile-product .auth-emblem.auth-logo-full,
:root[data-theme="purple-light"] .mobile-product .auth-emblem.auth-logo-full {
  background: #ffffff !important;
  color: inherit !important;
}

/* Final visibility guard for the tabbed CRM client profile. */
body.crm-shell-body .crm-page.detail-open .client-detail .crm-section-hidden {
  display: none !important;
}

body.crm-shell-body .crm-page.detail-open .client-detail {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

body.crm-shell-body .crm-page.detail-open .crm-client-progress button {
  border-color: rgba(167, 139, 250, .16) !important;
  background: rgba(255, 255, 255, .035) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}

body.crm-shell-body .crm-page.detail-open .crm-client-progress button.active {
  border-color: rgba(96, 165, 250, .65) !important;
  background: linear-gradient(135deg, rgba(79, 134, 247, .32), rgba(128, 87, 232, .26)) !important;
  color: var(--ink) !important;
}

/* Keep this card polish last so older responsive CRM rules cannot override it. */
body.crm-shell-body .detail-top[data-crm-client-section="overview"],
body.crm-shell-body > .detail-top.crm-workflow-active-panel {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px) !important;
  gap: 18px !important;
  align-items: stretch !important;
  padding: 22px !important;
  border: 1px solid rgba(139, 92, 246, .16) !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, #fff, #fbf9ff) !important;
}
body.crm-shell-body .detail-top .crm-client-quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 680px) {
  body.crm-shell-body .detail-top[data-crm-client-section="overview"],
  body.crm-shell-body > .detail-top.crm-workflow-active-panel { grid-template-columns: minmax(0, 1fr) !important; padding: 16px !important; }
}

/* CRM investments mirrors the wallet market and holdings layout. */
.crm-client-assets-panel .transaction-list { display: grid; gap: 8px; }
.crm-client-assets-panel .crm-holding-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 11px 14px;
  border-radius: 16px;
}
.crm-client-assets-panel .crm-wallet-base-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
.crm-market-tools { display: grid; gap: 10px; margin: 12px 0; }
.crm-market-tools > input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(116, 134, 158, .28);
  border-radius: 16px;
  background: rgba(255,255,255,.5);
  color: var(--ink);
}
.crm-market-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.crm-market-filters button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(116, 134, 158, .25);
  border-radius: 10px;
  background: rgba(255,255,255,.45);
  color: var(--muted);
  cursor: pointer;
}
.crm-market-filters button.active { border-color: #259f8b; background: rgba(37,159,139,.1); color: #176c5e; }
.crm-market-catalog { grid-template-columns: minmax(0, 1fr) !important; }
.crm-market-catalog .crm-market-row {
  grid-template-columns: 46px minmax(180px, 1fr) minmax(100px, auto) auto;
  min-height: 66px;
  padding: 10px 14px;
  border-radius: 16px;
}
.crm-asset-symbol { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; }
.crm-asset-symbol img { width: 100%; height: 100%; object-fit: contain; }
.crm-market-name b { font-size: .83rem; }
.crm-market-price { display: grid; justify-items: end; gap: 2px; }
.crm-market-price small { margin: 0; font-size: .66rem; }
.crm-market-actions { display: flex; gap: 7px; }
.crm-market-actions button {
  min-width: 58px;
  min-height: 38px;
  border: 1px solid rgba(116,134,158,.2);
  border-radius: 11px;
  background: rgba(255,255,255,.7);
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.crm-market-actions button:first-child { color: #147044; }
.crm-market-actions button:last-child { color: #b51d52; }
.crm-market-actions button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(24,39,62,.12); }
@media (max-width: 680px) {
  .crm-market-catalog .crm-market-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .crm-market-row .crm-market-price { grid-column: 2; justify-items: start; }
  .crm-market-row .crm-market-actions { grid-column: 3; grid-row: 1 / span 2; }
  .crm-market-actions { flex-direction: column; }
  .crm-client-assets-panel .crm-holding-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .crm-client-assets-panel .crm-holding-row .tx-actions { grid-column: 2 / -1; }
}

.crm-client-assets-panel,
.crm-client-assets-panel .crm-market-catalog,
.crm-client-assets-panel .crm-market-row,
.crm-client-assets-panel .crm-market-actions,
.crm-client-assets-panel .crm-market-actions button {
  pointer-events: auto !important;
  touch-action: manipulation;
}
.crm-market-row { cursor: pointer; -webkit-tap-highlight-color: rgba(187, 52, 196, .14); }
.crm-market-row:active { transform: scale(.992); }
.crm-market-row:focus-visible { outline: 3px solid rgba(190, 55, 201, .38); outline-offset: 2px; }
.crm-asset-details-overlay { position: fixed; inset: 0; z-index: 40000; display: grid; place-items: center; padding: 18px; background: rgba(13, 10, 23, .7); backdrop-filter: blur(8px); }
.crm-asset-details { position: relative; width: min(520px, 100%); padding: 24px; border: 1px solid rgba(210, 82, 204, .35); border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: 0 28px 90px rgba(0,0,0,.45); }
.crm-asset-details-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border: 1px solid rgba(139,92,246,.2); border-radius: 50%; background: rgba(139,92,246,.08); color: var(--ink); cursor: pointer; }
.crm-asset-details-head { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding-right: 38px; }
.crm-asset-details-head h2, .crm-asset-details-head p { margin: 0; }
.crm-asset-details-head p { margin-top: 4px; color: var(--muted); }
.crm-asset-details-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.crm-asset-quantity { display: grid; gap: 7px; margin-top: 22px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.crm-asset-quantity input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid rgba(139,92,246,.25); border-radius: 13px; background: rgba(255,255,255,.72); color: var(--ink); font: inherit; font-size: 1rem; outline: none; }
.crm-asset-quantity input:focus { border-color: #be37c9; box-shadow: 0 0 0 4px rgba(190,55,201,.12); }
.crm-asset-details-actions button { min-height: 48px; border: 1px solid rgba(139,92,246,.2); border-radius: 13px; background: rgba(31,157,111,.12); color: #168052; font-weight: 900; cursor: pointer; touch-action: manipulation; }
.crm-asset-details-actions button:last-child { background: rgba(197,35,90,.1); color: #bd2457; }
.crm-asset-details-note { display: block; margin-top: 13px; color: var(--muted); text-align: center; }
/* E-finans identity: deep navy, electric cyan, and warm gold. */
body.crm-shell-body:not(.crm-authenticated) .crm-login-panel,
body.crm-shell-body.crm-login-active .crm-login-panel {
  background: radial-gradient(circle at 18% 10%, rgba(18, 184, 209, .24), transparent 36%),
    linear-gradient(135deg, #061b2a, #082d40 55%, #041521) !important;
}
body.crm-shell-body:not(.crm-authenticated) .crm-manager-form,
body.crm-shell-body.crm-login-active .crm-manager-form {
  border-color: rgba(18, 184, 209, .3) !important;
  background: rgba(4, 22, 34, .88) !important;
}
body.crm-shell-body .crm-manager-form .auth-actions button {
  background: linear-gradient(135deg, #008ba9, #12b8d1) !important;
  box-shadow: 0 16px 34px rgba(18, 184, 209, .2) !important;
}
body.crm-shell-body .crm-manager-form input:focus {
  border-color: #12b8d1 !important;
  box-shadow: 0 0 0 4px rgba(18, 184, 209, .18) !important;
}
body.crm-shell-body .crm-page .crm-side-menu button.active,
body.crm-shell-body .crm-page .mini-tabs button.active {
  border-color: #12b8d1 !important;
  background: linear-gradient(135deg, #087d98, #12b8d1) !important;
  box-shadow: 0 8px 22px rgba(18, 184, 209, .18) !important;
}

/* Transparent E-finans wordmark: no white card or frame. */
:root .mobile-topbar .brand-logo-full,
:root .welcome-overlay .brand-logo-full,
:root .auth-emblem.auth-logo-full {
  width: 210px !important; height: 66px !important;
  background: transparent !important; border: 0 !important;
  box-shadow: none !important; border-radius: 0 !important;
  overflow: visible !important;
}
:root[data-theme="purple-dark"] .mobile-product .auth-emblem.auth-logo-full,
:root[data-theme="purple-light"] .mobile-product .auth-emblem.auth-logo-full {
  background: transparent !important; box-shadow: none !important;
}
:root .auth-emblem.auth-logo-full img {
  width: 100% !important; height: 100% !important;
  object-fit: contain !important; object-position: left center !important;
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
