:root {
  --bg: #f2f5f3;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --surface-strong: #e6ece8;
  --line: #dbe4de;
  --line-strong: #b9c8c0;
  --text: #13211d;
  --muted: #62716b;
  --muted-2: #8b9993;
  --teal: #0d8e82;
  --teal-dark: #065f5a;
  --amber: #bb8428;
  --amber-soft: #fff1d5;
  --blue: #3f63b7;
  --blue-soft: #e9efff;
  --green: #2e9666;
  --green-soft: #e5f4eb;
  --red: #c84f5f;
  --red-soft: #fde9ec;
  --shadow: 0 24px 70px rgba(19, 33, 29, 0.14);
  --shadow-soft: 0 14px 32px rgba(19, 33, 29, 0.08);
  --shadow-hairline: 0 1px 0 rgba(255, 255, 255, 0.74) inset;
  --radius: 8px;
  --sidebar: 280px;
  --topbar: 76px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, var(--bg) 42%, #e7edea 100%),
    linear-gradient(90deg, rgba(13, 142, 130, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(19, 33, 29, 0.04) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  color: var(--text);
  font-family:
    "Aptos Display", Aptos, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  font-feature-settings: "cv02", "cv03", "tnum";
}

::selection {
  background: rgba(187, 132, 40, 0.24);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-width: 0;
  overflow-x: clip;
  transition: grid-template-columns 0.2s ease;
}

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

.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#sidebarCollapseToggle span {
  transition: transform 0.2s ease;
}

.app-shell.sidebar-collapsed #sidebarCollapseToggle span {
  transform: rotate(180deg);
}

body.theme-dark,
.app-shell.dark {
  --bg: #151b21;
  --surface: #1f2730;
  --surface-soft: #182029;
  --line: #2d3844;
  --line-strong: #405061;
  --text: #edf3f7;
  --muted: #a7b2c0;
  --muted-2: #7f8b9a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.18);
  --shadow-hairline: 0 1px 0 rgba(255, 255, 255, 0.055) inset;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: var(--sidebar);
  max-width: var(--sidebar);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background:
    linear-gradient(90deg, rgba(13, 142, 130, 0.07), rgba(13, 142, 130, 0) 82%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 247, 0.9) 54%, rgba(236, 243, 240, 0.94));
  border-right: 1px solid rgba(185, 200, 192, 0.68);
  box-shadow: none;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(13, 142, 130, 0), rgba(13, 142, 130, 0.06));
}

.brand,
.operator-card,
.user-chip,
.queue-item,
.wallet-row,
.tariff-row,
.method-row {
  display: flex;
  align-items: center;
}

.brand {
  display: grid;
  gap: 4px;
  min-height: 80px;
  padding: 8px 10px 14px;
  align-content: center;
  justify-items: start;
}

.brand-logo {
  width: 205px;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.3));
}

.operator-card strong,
.user-chip strong {
  display: block;
  font-size: 14px;
}

.brand-subtitle {
  display: block;
  margin-left: 77px;
  color: rgba(226, 239, 235, 0.64);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.operator-card span,
.user-chip small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.operator-card {
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.avatar,
.user-chip > span {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #eaf4f5;
  color: var(--teal-dark);
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item,
.switch-row {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
  text-align: left;
}

.nav-item:hover,
.switch-row:hover {
  background: color-mix(in srgb, var(--surface-soft) 80%, var(--teal) 20%);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--teal-dark), var(--teal));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--amber);
}

.nav-item.ghost {
  color: var(--muted);
}

.nav-icon {
  width: 22px;
  min-width: 22px;
  text-align: center;
  font-weight: 800;
}

.nav-count {
  margin-left: auto;
  min-width: 24px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #e5eef5;
  color: #436070;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-count.warn {
  background: var(--amber-soft);
  color: #91630c;
}

.nav-count.danger {
  background: var(--red-soft);
  color: var(--red);
}

.nav-divider {
  margin: 12px 12px 4px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  flex: 0 0 auto;
}

.sidebar .brand,
.sidebar .operator-card,
.sidebar .sidebar-footer {
  position: relative;
}

.sidebar .brand {
  min-height: 78px;
  padding: 8px 10px 14px;
  border-bottom: 1px solid rgba(185, 200, 192, 0.56);
}

.sidebar .brand-logo {
  filter: drop-shadow(0 10px 16px rgba(19, 33, 29, 0.14));
}

.sidebar .brand-subtitle {
  color: var(--teal-dark);
}

.sidebar .operator-card {
  border-color: rgba(185, 200, 192, 0.7);
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.74) inset,
    0 10px 26px rgba(19, 33, 29, 0.045);
}

.sidebar .operator-card strong {
  color: var(--text);
}

.sidebar .operator-card span,
.sidebar .nav-divider {
  color: var(--muted);
}

.sidebar .avatar {
  background: linear-gradient(135deg, #f5dfaa, #b98528);
  color: #2d2310;
}

.sidebar .nav-item,
.sidebar .switch-row {
  color: #5e6e67;
}

.sidebar .nav-item:hover,
.sidebar .switch-row:hover {
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
}

.sidebar .nav-item.active {
  background:
    linear-gradient(90deg, rgba(187, 132, 40, 0.18), transparent 62%),
    linear-gradient(90deg, rgba(13, 142, 130, 0.14), rgba(13, 142, 130, 0.07));
  color: var(--teal-dark);
  box-shadow:
    inset 3px 0 0 var(--amber),
    0 10px 24px rgba(13, 95, 90, 0.07);
}

.sidebar .nav-count {
  background: rgba(255, 255, 255, 0.76);
  color: #53666f;
}

.sidebar .nav-count.warn {
  background: rgba(187, 132, 40, 0.14);
  color: #8c5f14;
}

.sidebar .nav-count.danger {
  background: rgba(200, 79, 95, 0.14);
  color: #b24353;
}

.sidebar .sidebar-footer {
  border-top-color: rgba(185, 200, 192, 0.56);
  padding-bottom: 4px;
}

.switch-row input {
  margin-left: auto;
  accent-color: var(--amber);
}

.switch-row input[type="checkbox"] {
  position: relative;
  width: 50px;
  height: 28px;
  min-width: 50px;
  min-height: 28px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: linear-gradient(180deg, #c8d2da, #aebbc6);
  box-shadow:
    inset 0 1px 3px rgba(19, 33, 29, 0.18),
    0 0 0 4px rgba(13, 142, 130, 0.08);
  padding: 0;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.switch-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform 0.16s ease;
}

.switch-row input[type="checkbox"]:checked {
  border-color: var(--teal);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.18),
    0 0 0 4px rgba(13, 142, 130, 0.16);
}

.switch-row input[type="checkbox"]:checked::before {
  transform: translateX(21px);
}

.workspace {
  min-width: 0;
  padding: 0 24px 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 -24px 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.topbar > * {
  min-width: 0;
}

.global-search {
  min-width: 220px;
  max-width: 420px;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
}

.global-search input,
.chat-search input,
.message-form input,
input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 250, 0.98)),
    var(--surface);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
  box-shadow: var(--shadow-hairline);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

select {
  appearance: none;
  padding-right: 36px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 17px / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 17px / 5px 5px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 250, 0.98)),
    var(--surface);
}

select option {
  background: var(--surface);
  color: var(--text);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(13, 142, 130, 0.38);
}

.global-search input {
  border: 0;
  background: transparent;
  padding-left: 0;
  box-shadow: none;
}

.global-search input:focus {
  box-shadow: none;
  outline: none;
}

.global-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(77, 182, 189, 0.16);
}

.global-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.global-search-clear:hover,
.global-search-clear:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--teal) 30%);
}

.global-search-clear[hidden] {
  display: none;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 90;
  display: grid;
  gap: 4px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.global-search-results[aria-hidden="true"],
.global-search-results:empty {
  display: none;
}

.global-search-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.global-search-results button:hover,
.global-search-results button:focus {
  background: var(--surface-muted);
  outline: none;
}

.global-search-results span,
.global-search-empty {
  color: var(--muted);
  font-size: 12px;
}

.global-search-empty {
  padding: 10px;
}

#leadSearchDropdown,
#orderSearchDropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 90;
  display: grid;
  gap: 2px;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

#leadSearchDropdown[aria-hidden="true"],
#leadSearchDropdown:empty,
#orderSearchDropdown[aria-hidden="true"],
#orderSearchDropdown:empty {
  display: none;
}

#leadSearchDropdown button,
#orderSearchDropdown button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

#leadSearchDropdown button:hover,
#leadSearchDropdown button:focus,
#orderSearchDropdown button:hover,
#orderSearchDropdown button:focus {
  background: var(--surface-muted);
  outline: none;
}

#leadSearchDropdown button strong,
#orderSearchDropdown button strong {
  grid-column: 1 / -1;
  font-size: 13px;
}

#leadSearchDropdown button span {
  color: var(--muted);
  font-size: 12px;
}

#leadSearchDropdown .lead-search-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(77, 182, 189, 0.16);
}

.market-strip {
  flex: 0 1 380px;
  min-width: 140px;
  overflow: hidden;
  position: relative;
  display: block;
  cursor: default;
}

.market-strip-track {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  animation: market-scroll 60s linear infinite;
}

.market-strip:hover .market-strip-track {
  animation-play-state: paused;
}

@keyframes market-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.clock-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker,
.clock-strip span,
.polling-pill,
.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.ticker b {
  color: var(--text);
}

.up {
  color: var(--green);
  font-style: normal;
}

.down {
  color: var(--red);
  font-style: normal;
}

.user-chip {
  gap: 9px;
  margin-left: auto;
  padding-left: 8px;
  max-width: 180px;
  min-width: 150px;
  overflow: hidden;
}

.user-chip div {
  min-width: 0;
}

.user-chip strong,
.user-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.mobile-only {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-head,
.panel-head,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-head {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.head-actions,
.drawer-actions,
.admin-perm-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.bulk-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.perm-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.perm-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-muted, var(--surface-soft));
  border-bottom: 1px solid var(--line);
}

.perm-group-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.perm-group-all {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.perm-group-all:hover {
  background: var(--surface);
  color: var(--text);
}

.perm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
}

.export-column-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.export-col-chip {
  position: relative;
  cursor: pointer;
}

.export-col-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.export-col-chip span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  user-select: none;
}

.export-col-chip span::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
  transition: background 0.15s;
}

.export-col-chip input:checked + span {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, var(--surface));
  color: var(--teal);
}

.export-col-chip input:checked + span::before {
  background: var(--teal);
}

.export-col-chip:hover span {
  border-color: var(--teal);
}

.export-modal-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.export-modal-controls button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.export-modal-controls button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.modal-actions,
.action-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 750;
  text-decoration: none;
}

.button {
  min-height: 40px;
  padding: 9px 14px;
}

.small-button {
  min-height: 32px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--line);
  font-size: 12px;
}

.small-button.accent {
  background: color-mix(in srgb, var(--teal) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--teal) 42%, var(--line));
  color: var(--teal-dark);
}

.button.primary {
  background: linear-gradient(180deg, #1fa69c, var(--teal));
  color: #fff;
}

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.button.danger,
.small-button.danger {
  background: var(--red);
  color: #fff;
}

.small-button.amber {
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
}

.button:hover,
.small-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

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

.metric-card,
.panel,
.chat-layout {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--blue));
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  color: var(--muted-2);
}

.metric-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 800;
}

.metric-icon.teal {
  background: var(--teal);
}

.metric-icon.amber {
  background: var(--amber);
}

.metric-icon.red {
  background: var(--red);
}

.metric-icon.blue {
  background: var(--blue);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.panel {
  position: relative;
  padding: 16px;
}

.panel-head {
  margin-bottom: 14px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented button,
.tabs button {
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
}

.segmented button.active,
.tabs button.active {
  background: var(--amber);
  color: #fff;
}

.calendar-board {
  min-width: 0;
  overflow: auto;
}

.calendar-days,
.calendar-grid {
  display: grid;
  grid-template-columns: 54px repeat(6, minmax(96px, 1fr));
  min-width: 680px;
}

.calendar-days {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.calendar-days b {
  padding: 8px;
  font-size: 12px;
  text-align: center;
}

.calendar-grid {
  grid-auto-rows: 58px;
}

.calendar-days-day,
.calendar-grid-day {
  grid-template-columns: 54px minmax(260px, 1fr);
  min-width: 360px;
}

.time-label,
.calendar-cell {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.time-label {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.calendar-cell {
  padding: 5px;
}

.calendar-cell.event {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.amber-event {
  background: #f0c45d;
}

.green-event {
  background: #8fd17f;
}

.red-event {
  background: #e27683;
}

.blue-event {
  background: #7ca0e4;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 8px;
  min-width: 680px;
  padding: 8px;
}

.month-grid > b {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.month-day,
.muted-day {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 9px;
  text-align: left;
}

.month-day {
  display: grid;
  align-content: start;
  gap: 8px;
  cursor: pointer;
}

.month-day span {
  font-weight: 900;
}

.month-day small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.month-day.has-event {
  border-color: rgba(13, 142, 130, 0.34);
  background: linear-gradient(180deg, rgba(13, 142, 130, 0.09), rgba(255, 255, 255, 0.96));
}

.muted-day {
  color: var(--muted-2);
  background: var(--surface-soft);
}

.month-day:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.queue-list,
.dictionary-list,
.tariff-list,
.wallet-grid {
  display: grid;
  gap: 10px;
}

.dictionary-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 12px 0 10px;
}

.manager-add-form {
  grid-template-columns: minmax(220px, 420px) auto;
  align-items: center;
}

.dictionary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.danger-icon {
  color: var(--red);
}

.queue-item {
  gap: 10px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.queue-item div {
  min-width: 0;
  flex: 1;
}

.queue-item strong,
.queue-item small {
  display: block;
}

.queue-item small {
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted-2);
}

.status-dot.red {
  background: var(--red);
}

.status-dot.amber {
  background: var(--amber);
}

.status-dot.blue {
  background: var(--blue);
}

.status-dot.green {
  background: var(--green);
}

.filter-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 12px;
}

.orders-filter-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

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

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

label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--muted);
  font-weight: 750;
}

.toggle-line input {
  width: 16px;
  height: 16px;
  min-height: auto;
  flex-shrink: 0;
  padding: 0;
  border-radius: 4px;
  background: none;
  box-shadow: none;
  accent-color: var(--teal);
}

.toggle-line span {
  margin: 0;
}

.table-toolbar {
  margin: 14px 0;
  color: var(--muted);
}

.leads-view .page-head {
  margin-bottom: 8px;
}

.leads-view .page-head h1 {
  font-size: 25px;
}

.leads-panel {
  padding-top: 12px;
}

.leads-panel .filter-grid {
  gap: 10px;
}

.leads-panel label span {
  margin-bottom: 4px;
}

.leads-panel .table-toolbar {
  margin: 10px 0 12px;
}

.leads-view .section-extension {
  margin: 0 0 14px;
}

.leads-view .lead-workflow-grid {
  gap: 14px;
}

.table-note {
  color: var(--muted-2);
  font-size: 12px;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

.table-scroll-shadow {
  position: sticky;
  bottom: 0;
  height: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 5;
}

.table-scroll-shadow > div {
  height: 1px;
}

.table-scroll-shadow.is-hidden {
  display: none;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.table-pagination:empty {
  display: none;
}

.pag-btn {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.pag-btn:hover:not(:disabled) {
  background: var(--surface-muted);
}

.pag-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pag-info {
  font-size: 13px;
  color: var(--muted);
  min-width: 100px;
  text-align: center;
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  background: var(--surface-soft);
}

.data-table th:first-child,
.data-table td:first-child {
  width: 46px;
  text-align: center;
}

.data-table input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 2px solid rgba(102, 122, 135, 0.7);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff, #f2f6f8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  cursor: pointer;
  vertical-align: middle;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.data-table input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 0.14s ease;
}

.data-table input[type="checkbox"]:checked {
  border-color: #2f7f8d;
  background: linear-gradient(135deg, #2f7f8d, #4db6bd);
  box-shadow:
    0 0 0 3px rgba(47, 127, 141, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.28) inset;
}

.data-table input[type="checkbox"]:checked::before {
  transform: rotate(-45deg) scale(1);
}

.data-table input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(47, 127, 141, 0.22);
  outline-offset: 2px;
}

.data-table tbody tr.is-selected {
  background: rgba(47, 127, 141, 0.1);
}

.data-table tbody tr.is-selected td {
  border-bottom-color: rgba(47, 127, 141, 0.28);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sort-button:hover,
.sort-button.active {
  color: var(--teal-dark);
}

.sort-button span {
  min-width: 10px;
  color: var(--amber);
  font-weight: 900;
}

.quick-cell-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.quick-assign-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.quick-assign-chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.quick-assign-chip:hover,
.quick-assign-chip:focus-visible {
  border-color: var(--teal-dark);
  color: var(--teal-dark);
}

.quick-cell-action .badge {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.quick-cell-action:hover .badge,
.quick-cell-action:focus-visible .badge {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 24, 35, 0.12);
}

.quick-cell-action.text-action {
  color: var(--ink);
  font-weight: 800;
}

.quick-cell-action.text-action:hover,
.quick-cell-action.text-action:focus-visible {
  color: var(--teal-dark);
}

.quick-cell-action[aria-expanded="true"] .badge,
.quick-cell-action[aria-expanded="true"] {
  color: var(--teal-dark);
}

.quick-action-popover {
  position: fixed;
  z-index: 90;
  min-width: 180px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, var(--amber) 26%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, white 4%);
  box-shadow: 0 16px 34px rgba(10, 24, 34, 0.18);
}

.quick-action-popover--wide {
  min-width: min(320px, calc(100vw - 24px));
  max-width: min(360px, calc(100vw - 24px));
}

.quick-action-popover__title {
  padding: 4px 8px 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.quick-action-popover__hint {
  padding: 1px 8px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.quick-action-empty {
  margin: 2px 0 4px;
  padding: 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-soft) 72%, white 28%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.quick-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 4px;
}

.quick-action-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.quick-action-option--status:hover,
.quick-action-option--status:focus-visible {
  background: var(--status-bg);
  color: var(--status-fg);
}

.status-swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: var(--status-fg, var(--muted));
  box-shadow: 0 0 0 4px var(--status-bg, var(--surface-soft));
}

.quick-action-delete {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.quick-action-option:hover,
.quick-action-option:focus-visible,
.quick-action-delete:hover,
.quick-action-delete:focus-visible {
  outline: 0;
  background: color-mix(in srgb, var(--teal) 14%, transparent);
  color: var(--teal-dark);
}

.quick-action-delete:hover,
.quick-action-delete:focus-visible {
  color: var(--red);
}

.quick-action-option--status {
  color: var(--status-fg);
}

.quick-action-option--status:hover,
.quick-action-option--status:focus-visible {
  background: var(--status-bg);
  color: var(--status-fg);
}

.quick-action-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
}

.quick-manager-add {
  grid-template-columns: 1fr;
}

.quick-action-add input {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.quick-action-add button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.quick-action-add button:hover,
.quick-action-add button:focus-visible {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.quick-action-note {
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.quick-action-manage {
  width: 100%;
  min-height: 32px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.quick-action-manage:hover,
.quick-action-manage:focus-visible {
  outline: 0;
  border-color: var(--teal);
  color: var(--teal-dark);
}

.quick-action-popover.is-loading {
  pointer-events: none;
  opacity: 0.72;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--teal) 22%);
}

.data-table tbody tr.row-highlight {
  animation: rowHighlightFlash 2.2s ease-out;
}

@keyframes rowHighlightFlash {
  0% { background: rgba(183, 152, 91, 0.42); }
  100% { background: transparent; }
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 0;
  font-weight: 800;
}

.badge.success {
  background: var(--green-soft);
  color: var(--green);
}

.badge.pending,
.badge.warning {
  background: var(--amber-soft);
  color: #a06b05;
}

.badge.danger {
  background: var(--red-soft);
  color: var(--red);
}

.badge.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.trade-action {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background: var(--surface-soft);
  color: var(--muted);
}

.trade-action.trade-buy {
  background: #dff4eb;
  color: #247c66;
}

.trade-action.trade-sell {
  background: #ffe3e7;
  color: #b94b62;
}

.badge[class*="status-tone-"] {
  background: var(--status-bg, var(--surface-soft));
  color: var(--status-fg, var(--muted));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-fg, var(--muted)) 10%, transparent);
}

.status-tone-active {
  --status-bg: #dff4eb;
  --status-fg: #247c66;
}

.status-tone-new {
  --status-bg: #dcecff;
  --status-fg: #2f64a5;
}

.status-tone-progress {
  --status-bg: #e7e2ff;
  --status-fg: #6750a4;
}

.status-tone-documents {
  --status-bg: #fff0cf;
  --status-fg: #8a650d;
}

.status-tone-verified {
  --status-bg: #dcf7f1;
  --status-fg: #197c75;
}

.status-tone-rejected {
  --status-bg: #ffe3e7;
  --status-fg: #b94b62;
}

.status-tone-disabled {
  --status-bg: #f7dde4;
  --status-fg: #ac445e;
}

.status-tone-neutral {
  --status-bg: #e8eef3;
  --status-fg: #5d7180;
}

.status-tone-custom-0 {
  --status-bg: #e2f1ff;
  --status-fg: #2d6d91;
}

.status-tone-custom-1 {
  --status-bg: #ece6ff;
  --status-fg: #6255a3;
}

.status-tone-custom-2 {
  --status-bg: #e4f4dd;
  --status-fg: #557a32;
}

.status-tone-custom-3 {
  --status-bg: #f7e5ff;
  --status-fg: #8a4d96;
}

.status-tone-custom-4 {
  --status-bg: #dff3f5;
  --status-fg: #247884;
}

.payment-pane,
.order-form-pane {
  display: none;
}

.payment-pane.active,
.order-form-pane.active {
  display: block;
}

.wallet-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(160px, 1fr) repeat(4, minmax(92px, auto));
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.wallet-row strong {
  min-width: 0;
}

.wallet-row span {
  min-width: 0;
  color: var(--muted);
}

.provider-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.provider-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 750;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-strip div {
  min-height: 74px;
  display: grid;
  align-content: start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(13, 142, 130, 0.055), rgba(187, 132, 40, 0.04)),
    var(--surface);
  padding: 10px;
}

.summary-strip span {
  color: var(--muted);
  font-size: 12px;
}

.summary-strip strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

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

.wizard-step {
  min-height: 84px;
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.wizard-step span {
  width: 34px;
  height: 34px;
  display: grid;
  grid-row: span 2;
  place-items: center;
  border-radius: 50%;
  background: #e3e9ef;
  font-weight: 900;
}

.wizard-step b {
  align-self: end;
}

.wizard-step small {
  align-self: start;
  color: var(--muted);
}

.wizard-step.done span,
.wizard-step.active span {
  background: var(--teal);
  color: #fff;
}

.wizard-step.active {
  border-color: var(--teal);
}

.chat-layout {
  min-height: calc(100vh - 170px);
  min-height: calc(100dvh - 170px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
}

.conversation-list,
.chat-sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.chat-search {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.conversation-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.conversation-item.active {
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--amber);
}

.conversation-item small,
.chat-head span {
  display: block;
  color: var(--muted);
}

.unread {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.chat-window {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
}

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

.messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 260px;
  padding: 16px;
  overflow: auto;
}

.message {
  max-width: min(620px, 86%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-soft);
}

.message.admin {
  justify-self: end;
  background: #ecf8f9;
  border-color: rgba(77, 182, 189, 0.32);
}

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

.message small {
  margin-top: 5px;
  color: var(--muted);
}

.message-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(92, 128, 145, 0.24);
  border-radius: 8px;
  background: rgba(235, 241, 244, 0.72);
  color: var(--ink);
}

.message-file svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.message-form {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.message-form input {
  min-width: 0;
}

.message-form .icon-button {
  width: 38px;
  min-width: 38px;
}

.message-form .button {
  width: auto;
  min-width: 108px;
  white-space: nowrap;
}

.polling-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(74, 157, 95, 0.55);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(74, 157, 95, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 157, 95, 0);
  }
}

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

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

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

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

.tariff-row,
.method-row,
.dict-row {
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.dict-row.premium-plan-row {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto;
  align-items: center;
}

.dict-row.premium-plan-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dict-row.premium-plan-row b {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(185, 200, 192, 0.64);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  padding: 5px 10px;
  font-variant-numeric: tabular-nums;
}

.tariff-row div,
.method-row span:nth-child(3) {
  min-width: 0;
  flex: 1;
}

.tariff-row small,
.dict-row b {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

.plan-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-heading .badge {
  transform: translateY(1px);
}

.plan-medallion {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(183, 152, 91, 0.45);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 38%),
    linear-gradient(145deg, #22313d, #0d1a24 58%, #2b2112);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -10px 18px rgba(0, 0, 0, 0.18),
    0 10px 22px rgba(10, 22, 32, 0.12);
}

.plan-medallion::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-left-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(45deg);
}

.plan-medallion::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.plan-standard {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 38%),
    linear-gradient(145deg, #22313d, #0d1a24 58%, #2b2112);
}

.plan-silver {
  border-color: rgba(151, 169, 181, 0.58);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 38%),
    linear-gradient(145deg, #2a3540, #131f2a 56%, #4c5661);
}

.plan-gold {
  border-color: rgba(183, 152, 91, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent 38%),
    linear-gradient(145deg, #40321a, #161d22 48%, #8a6a32);
}

.plan-vip {
  border-color: rgba(216, 189, 123, 0.8);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 36%),
    linear-gradient(145deg, #2d2a22, #071018 54%, #000);
}

.plan-pill {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 10px 4px 5px;
  border: 1px solid rgba(185, 200, 192, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 250, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-hairline);
}

.plan-pill .plan-medallion {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 6px 14px rgba(19, 33, 29, 0.12);
}

.plan-pill .plan-medallion::before {
  width: 9px;
  height: 9px;
  border-width: 2px;
}

.plan-pill strong {
  font-size: 13px;
  font-weight: 850;
}

.asset-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.asset-chip-list-large {
  min-height: 92px;
  padding: 10px;
  border: 1px solid rgba(185, 200, 192, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 250, 0.96)),
    var(--surface);
}

.asset-chip-list.compact {
  gap: 6px;
}

.asset-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(185, 200, 192, 0.78);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 243, 0.96)),
    var(--surface);
  color: #172520;
  padding: 6px 11px;
  font-weight: 820;
  white-space: nowrap;
  box-shadow: var(--shadow-hairline);
}

.asset-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  box-shadow: 0 0 0 3px rgba(13, 142, 130, 0.08);
}

.value-field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.value-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.premium-value,
.money-value {
  font-variant-numeric: tabular-nums;
}

.premium-value {
  min-height: 54px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(185, 200, 192, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(13, 142, 130, 0.08), rgba(187, 132, 40, 0.08)),
    var(--surface);
  color: var(--text);
  padding: 11px 14px;
  font-size: 17px;
  font-weight: 850;
  box-shadow: var(--shadow-hairline);
}

.money-value {
  color: #172520;
  font-weight: 850;
}

.data-table .money-value,
.data-table .plan-pill,
.data-table .asset-chip {
  white-space: nowrap;
}

.data-table .plan-pill {
  min-height: 30px;
  padding: 3px 9px 3px 4px;
}

.data-table .plan-pill .plan-medallion {
  width: 22px;
  height: 22px;
}

.data-table .plan-pill .plan-medallion::before {
  width: 7px;
  height: 7px;
  border-width: 1.5px;
}

.data-table .asset-chip {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 12px;
}

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

.premium-summary .asset-chip-list {
  margin-top: 2px;
}

.summary-strip .asset-chip-list {
  min-height: 0;
  display: flex;
  align-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.premium-summary .asset-chip {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.tariff-row {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) minmax(240px, 0.85fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border-color: rgba(185, 200, 192, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 250, 0.97)),
    var(--surface);
  box-shadow: var(--shadow-hairline), 0 10px 22px rgba(19, 33, 29, 0.055);
}

.tariff-row.is-active {
  border-color: rgba(201, 148, 56, 0.58);
  box-shadow:
    0 0 0 3px rgba(201, 148, 56, 0.1),
    var(--shadow-hairline),
    0 16px 34px rgba(19, 33, 29, 0.09);
}

.plan-main {
  display: grid;
  gap: 2px;
}

.plan-main strong {
  font-size: 16px;
}

.plan-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 8px;
}

.plan-metrics span {
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(185, 200, 192, 0.62);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.64);
  padding: 7px 9px;
}

.plan-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.plan-metrics b {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.quote-box strong,
.trade-preview-grid strong,
.detail-field strong,
.pipeline strong,
.mini-table b,
.data-table td strong {
  font-variant-numeric: tabular-nums;
}

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

.permission-grid,
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.permission-grid label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
  font-weight: 750;
}

.permission-grid input {
  width: auto;
  min-height: auto;
  accent-color: var(--teal);
}

.method-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) 80px minmax(120px, 1fr) auto;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 25, 35, 0.52);
}

.drawer.open {
  display: grid;
}

.drawer-card {
  width: min(1040px, 100%);
  max-height: min(880px, 92vh);
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-actions .small-button {
  width: auto;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

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

.detail-field {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.detail-field span,
.detail-field small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-field strong {
  display: block;
  margin-top: 4px;
}

.detail-field.wide {
  grid-column: 1 / -1;
}

.detail-field.wide strong {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.5;
}

.lead-general-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.lead-about-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lead-about-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-about-head strong {
  display: block;
}

.lead-about-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.lead-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf4f5;
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 18px;
}

.detail-grid.one-col {
  grid-template-columns: 1fr;
}

.login-history-rows {
  display: grid;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}

.login-history-row {
  display: grid;
  grid-template-columns: 160px 190px 130px 1fr;
  gap: 10px;
  font-size: 12px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.login-history-row--head {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  border-bottom: 2px solid var(--line);
}

.login-history-tag-agent {
  color: var(--amber, #b8860b);
  font-weight: 700;
}

.login-history-tag-client {
  color: var(--teal-dark);
  font-weight: 700;
}

.login-history-ua {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-history-empty {
  color: var(--muted);
  font-size: 12px;
}

.reason-detail-text {
  width: 100%;
  resize: vertical;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
}

.lead-activity-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
  min-height: 0;
}

.lead-activity-panel .comment-feed {
  max-height: none;
}

@media (max-width: 780px) {
  .lead-general-layout {
    grid-template-columns: 1fr;
  }
}

.comment-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  margin-top: 4px;
}

.comment-feed-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.comment-feed-time {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.comment-feed-item p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.sales-pipeline-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sales-pipeline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sales-pipeline-form textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
}

.sales-pipeline-form button {
  align-self: flex-end;
}

.sales-pipeline-panel .comment-feed {
  max-height: none;
}

.comment-feed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-feed-head .comment-feed-time {
  margin-bottom: 0;
}

.comment-feed-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.comment-feed-actions .icon-button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  font-size: 13px;
}

.pipeline-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pipeline-edit-form textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
}

.pipeline-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.section-extension {
  margin-top: 18px;
}

.ops-grid,
.lead-workflow-grid,
.payments-grid,
.trading-workspace,
.documents-grid,
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.rule-list,
.flow-steps,
.compact-filter-list,
.document-stack,
.asset-list {
  display: grid;
  gap: 10px;
}

.rule-list span,
.flow-steps span,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px 12px;
  color: var(--muted);
}

.rule-list b {
  color: var(--text);
}

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

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

.pipeline div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.pipeline strong {
  font-size: 24px;
}

.pipeline span {
  color: var(--muted);
  font-size: 12px;
}

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

.timeline article {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

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

.timeline small {
  color: var(--muted);
}

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

.kanban-column {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kanban-column:hover {
  border-color: rgba(13, 142, 130, 0.4);
}

.kanban-column.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(77, 182, 189, 0.16);
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.kanban-column header span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.kanban-card {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.kanban-card strong,
.kanban-card small {
  display: block;
}

.kanban-card small {
  margin-top: 4px;
  color: var(--muted);
}

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

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

.method-grid.detailed {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
}

.method-card,
.asset-list article,
.document-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.method-card small,
.asset-list small,
.document-card small {
  display: block;
  color: var(--muted);
}

code {
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--line) 30%);
  color: var(--muted);
  padding: 2px 5px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.market-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.market-tabs span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 6px 10px;
  font-weight: 800;
}

.asset-list article {
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.7fr) auto;
  align-items: center;
}

.disabled-asset {
  opacity: 0.62;
}

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

.mini-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  margin-top: 12px;
}

.mini-table > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 9px 10px;
}

.mini-table > div:first-child {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
}

.mini-table > div:last-child {
  border-bottom: 0;
}

.mini-table.cols-5 > div {
  grid-template-columns: 150px 170px minmax(90px, 1fr) minmax(110px, 1fr) minmax(120px, 2fr);
}

.mini-table.cols-5 > div > span,
.mini-table.cols-5 > div > b {
  min-width: 0;
  overflow-wrap: break-word;
}

.document-card {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
}

.doc-thumb {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.compact-table {
  min-width: 760px;
}

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

.error-code-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 8px;
}

.error-code-grid code {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 8px;
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 25, 35, 0.52);
}

.modal.open {
  display: grid;
}

.admin-login {
  z-index: 80;
}

.admin-login-card {
  width: min(440px, 100%);
}

body.admin-locked #appShell {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.auth-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.auth-status.error {
  color: var(--red);
}

.auth-status.success {
  color: var(--teal-dark);
}

.credential-box {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid rgba(184, 145, 70, 0.35);
  border-radius: var(--radius);
  background: rgba(184, 145, 70, 0.12);
  color: var(--text);
}

.credential-box span {
  color: var(--muted);
  font-weight: 800;
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(880px, 92vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal-card.large {
  width: min(980px, 100%);
}

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

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

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

.local-tabs {
  padding: 0;
  margin-top: 12px;
  margin-bottom: 14px;
  border-bottom: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.category-select {
  width: 100%;
  padding: 6px 32px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.local-tabs::-webkit-scrollbar {
  display: none;
}

.order-target-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 42px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  color: var(--muted);
  font-weight: 700;
}

.order-target-summary strong {
  color: var(--text);
}

.order-target-summary span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 24, 35, 0.55);
  backdrop-filter: blur(2px);
  transition: opacity 0.25s ease;
}

.app-loading-overlay[hidden] {
  display: none;
}

.app-loading-overlay.is-fading {
  opacity: 0;
  pointer-events: none;
}

.app-loading-spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: app-loading-spin 0.8s linear infinite;
}

@keyframes app-loading-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading-spinner {
    animation-duration: 2s;
  }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 48px));
  min-height: 42px;
  display: none;
  align-items: center;
  border: 1px solid rgba(77, 182, 189, 0.38);
  border-radius: var(--radius);
  background: #f0fbfc;
  color: #145c65;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  font-weight: 750;
}

.toast.show {
  display: flex;
}

.auth-grid,
.trading-terminal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 16px;
}

.auth-grid .panel:first-child {
  grid-row: span 2;
}

.client-ticker,
.market-category-grid,
.document-status-grid,
.trade-preview-grid,
.asset-selector-list,
.tariff-card-grid {
  display: grid;
  gap: 10px;
}

.client-ticker {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin: 0 0 16px;
}

.client-ticker article,
.market-category,
.document-status,
.trade-preview-grid div,
.asset-row,
.tariff-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.client-ticker article,
.market-category,
.document-status,
.trade-preview-grid div,
.tariff-card {
  padding: 12px;
}

.asset-row {
  padding: 8px 12px;
}

.client-ticker article.active,
.market-category .asset-pills button.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(77, 182, 189, 0.14);
}

.client-ticker b,
.market-category b,
.document-status b,
.asset-row b,
.tariff-card b {
  display: block;
}

.client-ticker span,
.market-category span,
.document-status span,
.asset-row span,
.tariff-card span,
.tradingview-frame span,
.wizard-grid span,
.trade-preview-grid span {
  color: var(--muted);
  font-size: 12px;
}

.client-ticker span,
.client-ticker strong { margin-right: 6px; }


.chart-panel {
  min-height: 620px;
}

.terminal-main {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.terminal-main > *,
.trading-terminal > *,
.user-terminal-grid > * {
  min-width: 0;
}

.tradingview-frame {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(22, 143, 134, 0.08), transparent 42%),
    var(--surface-soft);
}

.tradingview-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 560px;
  display: block;
  border: 0;
}

.order-ticket {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.order-ticket h2 {
  font-size: 24px;
}

.quote-box {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.quote-box span,
.order-ticket span {
  color: var(--muted);
  font-size: 12px;
}

.quote-box strong {
  font-size: 26px;
}

.ticket-form {
  display: grid;
  gap: 10px;
}

.market-category-grid,
.document-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.market-category .asset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.market-category .asset-pills button,
.provider-row button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 6px 10px;
  font-weight: 700;
}

.trade-preview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.trade-preview-grid span {
  display: block;
}

.asset-selector-list {
  margin-top: 14px;
  max-height: 52vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 4px;
  margin-left: -4px;
  margin-right: -4px;
}

.asset-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.asset-selector-list .asset-row:hover {
  transform: none;
  border-color: rgba(13, 142, 130, 0.34);
  box-shadow: 0 0 0 3px rgba(77, 182, 189, 0.1);
}

.asset-row .small-button {
  min-height: 0;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.5;
}

.asset-row .small-button:hover {
  transform: none;
}

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

.wizard-grid label {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.tariff-card {
  display: grid;
  gap: 10px;
  border-top: 4px solid var(--teal);
}

.tariff-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.tariff-card-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
}

.tariff-card {
  position: relative;
  overflow: hidden;
  gap: 14px;
  border-top: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 250, 0.98)),
    var(--surface);
  box-shadow: var(--shadow-hairline), 0 12px 26px rgba(19, 33, 29, 0.06);
}

.tariff-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(13, 142, 130, 0.64), rgba(201, 148, 56, 0.74), rgba(46, 150, 102, 0.5));
}

.tariff-card.is-active {
  border-color: rgba(201, 148, 56, 0.56);
  box-shadow:
    0 0 0 3px rgba(201, 148, 56, 0.1),
    var(--shadow-hairline),
    0 18px 38px rgba(19, 33, 29, 0.1);
}

.tariff-card-head,
.tariff-card-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tariff-card-head {
  justify-content: space-between;
}

.tariff-card-title {
  min-width: 0;
}

.tariff-card-title div {
  min-width: 0;
}

.tariff-card-title b {
  font-size: 17px;
  line-height: 1.15;
}

.tariff-card-title span {
  display: block;
  margin-top: 3px;
}

.tariff-card .badge {
  font-size: 12px;
}

.tariff-card .badge.success {
  color: var(--green);
}

.tariff-card .badge.info {
  color: var(--blue);
}

.plan-benefits {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.plan-benefits li::marker {
  color: var(--amber);
}

.client-chat-layout {
  min-height: 620px;
}

.user-shell {
  --sidebar: 250px;
}

.user-portal .workspace {
  background: var(--bg);
}

.user-portal .topbar {
  flex-wrap: wrap;
}

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

.user-terminal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.user-chart-panel {
  min-height: 680px;
}

.market-watch {
  min-height: 680px;
}

.market-watch .asset-selector-list {
  max-height: 560px;
}

.user-portal .terminal-main {
  min-height: 610px;
}

.user-portal .tradingview-frame,
.user-portal .tradingview-frame iframe {
  min-height: 610px;
}

.message.incoming strong {
  color: var(--teal-dark);
}

.message.outgoing strong {
  color: var(--amber);
}

body.theme-dark .sidebar,
.app-shell.dark .sidebar {
  background:
    linear-gradient(90deg, rgba(103, 209, 200, 0.06), rgba(103, 209, 200, 0) 82%),
    linear-gradient(180deg, rgba(25, 34, 42, 0.98), rgba(19, 26, 32, 0.98));
  border-right-color: rgba(96, 116, 130, 0.32);
}

body.theme-dark .sidebar::after,
.app-shell.dark .sidebar::after {
  background: linear-gradient(90deg, rgba(103, 209, 200, 0), rgba(103, 209, 200, 0.06));
}

body.theme-dark .sidebar .brand,
.app-shell.dark .sidebar .brand {
  border-bottom-color: rgba(96, 116, 130, 0.28);
}

body.theme-dark .sidebar .operator-card strong,
.app-shell.dark .sidebar .operator-card strong {
  color: #f5faf7;
}

body.theme-dark .sidebar .operator-card span,
body.theme-dark .sidebar .nav-divider,
.app-shell.dark .sidebar .operator-card span,
.app-shell.dark .sidebar .nav-divider {
  color: rgba(226, 239, 235, 0.62);
}

body.theme-dark .sidebar .brand-logo,
.app-shell.dark .sidebar .brand-logo {
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.32));
}

body.theme-dark .sidebar .brand-subtitle,
.app-shell.dark .sidebar .brand-subtitle {
  color: rgba(226, 239, 235, 0.68);
}

body.theme-dark .sidebar .operator-card,
.app-shell.dark .sidebar .operator-card {
  border-color: rgba(96, 116, 130, 0.28);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body.theme-dark .sidebar .avatar,
.app-shell.dark .sidebar .avatar {
  background: rgba(255, 255, 255, 0.1);
  color: #f4c96e;
}

body.theme-dark .sidebar .nav-item,
body.theme-dark .sidebar .switch-row,
.app-shell.dark .sidebar .nav-item,
.app-shell.dark .sidebar .switch-row {
  color: rgba(236, 246, 242, 0.66);
}

body.theme-dark .sidebar .nav-item:hover,
body.theme-dark .sidebar .switch-row:hover,
.app-shell.dark .sidebar .nav-item:hover,
.app-shell.dark .sidebar .switch-row:hover {
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
}

body.theme-dark .sidebar .nav-item.active,
.app-shell.dark .sidebar .nav-item.active {
  background:
    linear-gradient(90deg, rgba(187, 132, 40, 0.18), transparent 62%),
    linear-gradient(90deg, rgba(15, 130, 119, 0.38), rgba(10, 98, 93, 0.18));
  color: #f7fffc;
  box-shadow:
    inset 3px 0 0 #f2c76b,
    0 10px 24px rgba(4, 72, 67, 0.18);
}

body.theme-dark .sidebar .nav-count,
.app-shell.dark .sidebar .nav-count {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.84);
}

body.theme-dark .sidebar .nav-count.warn,
.app-shell.dark .sidebar .nav-count.warn {
  background: rgba(242, 199, 107, 0.18);
  color: #f2c76b;
}

body.theme-dark .sidebar .nav-count.danger,
.app-shell.dark .sidebar .nav-count.danger {
  background: rgba(200, 79, 95, 0.2);
  color: #ff9ba7;
}

body.theme-dark .sidebar .sidebar-footer,
.app-shell.dark .sidebar .sidebar-footer {
  border-top-color: rgba(96, 116, 130, 0.28);
}

.workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0)),
    transparent;
}

.topbar {
  border-bottom-color: rgba(185, 200, 192, 0.58);
  background: rgba(252, 254, 252, 0.86);
  box-shadow: 0 12px 36px rgba(19, 33, 29, 0.055);
}

.global-search,
.icon-button,
.ticker,
.clock-strip span,
.user-chip {
  box-shadow: var(--shadow-hairline);
}

.global-search {
  border-color: rgba(185, 200, 192, 0.76);
  background: rgba(255, 255, 255, 0.88);
}

.icon-button:hover,
.small-button:hover,
.provider-row button:hover,
.market-category .asset-pills button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.page-head {
  padding-bottom: 2px;
}

.eyebrow {
  color: var(--teal-dark);
}

h1 {
  color: #101c18;
  font-size: 30px;
  font-weight: 820;
  letter-spacing: 0;
}

h2 {
  color: #16231f;
  font-weight: 790;
  letter-spacing: 0;
}

.button,
.small-button,
.icon-button,
.nav-item,
.switch-row,
.client-ticker article,
.panel,
.metric-card,
.queue-item,
.wallet-row,
.summary-strip div,
.data-table tbody tr,
.conversation-item,
.market-category,
.document-status,
.trade-preview-grid div,
.asset-row,
.tariff-card,
.kanban-card,
.method-card,
.asset-list article,
.document-card {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.panel,
.metric-card,
.chat-layout,
.summary-strip div,
.client-ticker article,
.market-category,
.document-status,
.trade-preview-grid div,
.asset-row,
.tariff-card,
.method-card,
.asset-list article,
.document-card,
.wallet-row,
.queue-item,
.wizard-step,
.permission-grid label,
.rule-list span,
.flow-steps span,
.pipeline div,
.timeline article,
.kanban-column,
.mini-table {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 253, 251, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-hairline), 0 12px 26px rgba(19, 33, 29, 0.055);
}

.panel,
.metric-card,
.chat-layout {
  border-color: rgba(185, 200, 192, 0.72);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, rgba(13, 142, 130, 0.72), rgba(187, 132, 40, 0.34), transparent 72%);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.panel:hover::before {
  opacity: 1;
}

.metric-card {
  min-height: 142px;
}

.metric-card::before {
  height: 4px;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal), var(--amber));
}

.metric-card:hover,
.client-ticker article:hover,
.queue-item:hover,
.wallet-row:hover,
.kanban-card:hover,
.asset-row:hover,
.tariff-card:hover,
.method-card:hover,
.asset-list article:hover,
.document-card:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 142, 130, 0.34);
  box-shadow: var(--shadow-hairline), 0 20px 44px rgba(19, 33, 29, 0.11);
}

.metric-icon {
  box-shadow: 0 10px 22px rgba(19, 33, 29, 0.12);
}

.button.primary {
  border-color: rgba(6, 95, 90, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent),
    linear-gradient(135deg, #0fa093, #06635d);
  box-shadow: 0 12px 24px rgba(6, 95, 90, 0.18);
}

.button.secondary,
.small-button,
.icon-button {
  background: rgba(255, 255, 255, 0.86);
}

.small-button {
  color: #23302c;
}

.button.danger,
.small-button.danger {
  border-color: rgba(200, 79, 95, 0.3);
  background: linear-gradient(180deg, #d75b6a, #b93d4f);
}

.segmented {
  background: #eef4f1;
  box-shadow: var(--shadow-hairline);
}

.segmented button.active,
.tabs button.active {
  background: linear-gradient(180deg, #c99438, var(--amber));
  box-shadow: 0 8px 16px rgba(187, 132, 40, 0.18);
}

.ticker,
.clock-strip span,
.polling-pill,
.badge {
  border-color: rgba(185, 200, 192, 0.72);
  background: rgba(255, 255, 255, 0.82);
}

.client-ticker article.active,
.market-category .asset-pills button.active {
  border-color: rgba(13, 142, 130, 0.72);
  background:
    linear-gradient(180deg, rgba(13, 142, 130, 0.1), rgba(255, 255, 255, 0.96)),
    var(--surface);
  box-shadow:
    0 0 0 3px rgba(13, 142, 130, 0.1),
    0 16px 34px rgba(19, 33, 29, 0.09);
}

.data-table {
  border-spacing: 0;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom-color: rgba(185, 200, 192, 0.88);
  background: #eef4f1;
  color: #4f615b;
}

.data-table td {
  background-clip: padding-box;
}

.data-table tbody tr:hover {
  background: rgba(13, 142, 130, 0.07);
}

.badge {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.tradingview-frame {
  border-color: rgba(185, 200, 192, 0.82);
  background:
    linear-gradient(135deg, rgba(13, 142, 130, 0.1), transparent 44%),
    linear-gradient(180deg, #f8fbfa, #eef4f1);
  box-shadow: var(--shadow-hairline), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.order-ticket {
  background:
    linear-gradient(180deg, rgba(18, 34, 31, 0.04), transparent),
    #f8fbfa;
}

.quote-box {
  border-color: rgba(13, 142, 130, 0.22);
  background: #ffffff;
  box-shadow: var(--shadow-hairline);
}

.message.admin,
.message.incoming {
  background: #eaf7f4;
  border-color: rgba(13, 142, 130, 0.24);
}

.message.outgoing {
  justify-self: end;
  background: var(--amber-soft);
  border-color: rgba(187, 132, 40, 0.25);
}

.modal {
  background:
    linear-gradient(180deg, rgba(4, 13, 12, 0.6), rgba(4, 13, 12, 0.44));
  backdrop-filter: blur(10px);
}

.modal-card,
.drawer-card {
  border-color: rgba(185, 200, 192, 0.72);
  box-shadow: 0 34px 90px rgba(8, 22, 19, 0.28);
}

.toast {
  border-color: rgba(13, 142, 130, 0.3);
  background: #effaf7;
  color: #0d4d49;
}

body.theme-dark {
  color-scheme: dark;
}

body.theme-dark ::selection {
  background: rgba(242, 199, 107, 0.32);
  color: #fff;
}

.app-shell.dark {
  background: var(--bg);
}

.app-shell.dark .workspace {
  background:
    linear-gradient(180deg, rgba(45, 56, 68, 0.52), rgba(21, 27, 33, 0)),
    var(--bg);
}

.app-shell.dark .topbar {
  border-bottom-color: rgba(96, 116, 130, 0.42);
  background: rgba(24, 32, 41, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
.app-shell.dark h1,
.app-shell.dark h2,
.app-shell.dark h3 {
  color: var(--text);
}

body.theme-dark .eyebrow,
.app-shell.dark .eyebrow {
  color: #67d1c8;
}

body.theme-dark .button.secondary,
body.theme-dark .small-button,
body.theme-dark .icon-button,
body.theme-dark .ticker,
body.theme-dark .clock-strip span,
body.theme-dark .polling-pill,
body.theme-dark .badge,
.app-shell.dark .global-search,
.app-shell.dark .button.secondary,
.app-shell.dark .small-button,
.app-shell.dark .icon-button,
.app-shell.dark .ticker,
.app-shell.dark .clock-strip span,
.app-shell.dark .user-chip,
.app-shell.dark .polling-pill,
.app-shell.dark .badge {
  border-color: rgba(96, 116, 130, 0.58);
  background: rgba(31, 39, 48, 0.88);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body.theme-dark .small-button:hover,
body.theme-dark .icon-button:hover {
  border-color: rgba(77, 197, 186, 0.7);
  color: #67d1c8;
}

body.theme-dark .button.danger,
body.theme-dark .small-button.danger {
  border-color: rgba(255, 130, 146, 0.44);
  background: linear-gradient(180deg, #d75b6a, #a73849);
  color: #fff;
}

body.theme-dark .badge.success {
  border-color: rgba(92, 204, 143, 0.28);
  background: rgba(46, 150, 102, 0.22);
  color: #7ee0aa;
}

body.theme-dark .badge.pending,
body.theme-dark .badge.warning {
  border-color: rgba(242, 199, 107, 0.32);
  background: rgba(187, 132, 40, 0.22);
  color: #f2c76b;
}

body.theme-dark .badge.danger {
  border-color: rgba(255, 130, 146, 0.34);
  background: rgba(200, 79, 95, 0.22);
  color: #ff9ba7;
}

body.theme-dark .badge.info {
  border-color: rgba(122, 157, 235, 0.34);
  background: rgba(63, 99, 183, 0.22);
  color: #adc3ff;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  border-color: rgba(96, 116, 130, 0.58);
  background: rgba(24, 32, 41, 0.96);
  color: var(--text);
}

body.theme-dark select {
  background:
    linear-gradient(45deg, transparent 50%, rgba(167, 178, 192, 0.92) 50%) calc(100% - 18px) 17px / 5px 5px no-repeat,
    linear-gradient(135deg, rgba(167, 178, 192, 0.92) 50%, transparent 50%) calc(100% - 13px) 17px / 5px 5px no-repeat,
    linear-gradient(180deg, rgba(39, 50, 61, 0.96), rgba(24, 32, 41, 0.98)),
    var(--surface-soft);
}

body.theme-dark select option {
  background: #1f2730;
  color: var(--text);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color: rgba(167, 178, 192, 0.7);
}

.app-shell.dark .user-chip {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.app-shell.dark .global-search input,
.app-shell.dark .chat-search input,
.app-shell.dark .message-form input,
.app-shell.dark input,
.app-shell.dark select,
.app-shell.dark textarea {
  border-color: rgba(96, 116, 130, 0.58);
  background: rgba(24, 32, 41, 0.96);
  color: var(--text);
}

.app-shell.dark select {
  background:
    linear-gradient(45deg, transparent 50%, rgba(167, 178, 192, 0.92) 50%) calc(100% - 18px) 17px / 5px 5px no-repeat,
    linear-gradient(135deg, rgba(167, 178, 192, 0.92) 50%, transparent 50%) calc(100% - 13px) 17px / 5px 5px no-repeat,
    linear-gradient(180deg, rgba(39, 50, 61, 0.96), rgba(24, 32, 41, 0.98)),
    var(--surface-soft);
}

.app-shell.dark select option {
  background: #1f2730;
  color: var(--text);
}

.app-shell.dark .global-search input::placeholder,
.app-shell.dark input::placeholder,
.app-shell.dark textarea::placeholder {
  color: rgba(167, 178, 192, 0.7);
}

.app-shell.dark .panel,
.app-shell.dark .metric-card,
.app-shell.dark .chat-layout,
.app-shell.dark .summary-strip div,
.app-shell.dark .client-ticker article,
.app-shell.dark .market-category,
.app-shell.dark .document-status,
.app-shell.dark .trade-preview-grid div,
.app-shell.dark .asset-row,
.app-shell.dark .tariff-card,
.app-shell.dark .method-card,
.app-shell.dark .asset-list article,
.app-shell.dark .document-card,
.app-shell.dark .wallet-row,
.app-shell.dark .queue-item,
.app-shell.dark .wizard-step,
.app-shell.dark .permission-grid label,
.app-shell.dark .rule-list span,
.app-shell.dark .flow-steps span,
.app-shell.dark .pipeline div,
.app-shell.dark .timeline article,
.app-shell.dark .kanban-column,
.app-shell.dark .mini-table {
  border-color: rgba(96, 116, 130, 0.52);
  background:
    linear-gradient(180deg, rgba(38, 48, 59, 0.94), rgba(26, 34, 43, 0.96)),
    var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.055) inset, 0 16px 34px rgba(0, 0, 0, 0.18);
}

.app-shell.dark .metric-card:hover,
.app-shell.dark .client-ticker article:hover,
.app-shell.dark .queue-item:hover,
.app-shell.dark .wallet-row:hover,
.app-shell.dark .kanban-card:hover,
.app-shell.dark .asset-row:hover,
.app-shell.dark .tariff-card:hover,
.app-shell.dark .method-card:hover,
.app-shell.dark .asset-list article:hover,
.app-shell.dark .document-card:hover {
  border-color: rgba(77, 197, 186, 0.42);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.055) inset, 0 22px 44px rgba(0, 0, 0, 0.24);
}

.app-shell.dark .segmented,
.app-shell.dark .data-table th {
  border-color: rgba(96, 116, 130, 0.52);
  background: #26313c;
  color: var(--muted);
}

.app-shell.dark .data-table tbody tr:hover {
  background: rgba(77, 197, 186, 0.1);
}

body.theme-dark .asset-chip-list-large,
body.theme-dark .premium-value,
body.theme-dark .plan-pill,
body.theme-dark .tariff-row,
body.theme-dark .tariff-card,
.app-shell.dark .asset-chip-list-large,
.app-shell.dark .premium-value,
.app-shell.dark .plan-pill,
.app-shell.dark .tariff-row,
.app-shell.dark .tariff-card {
  border-color: rgba(96, 116, 130, 0.56);
  background:
    linear-gradient(180deg, rgba(38, 48, 59, 0.92), rgba(26, 34, 43, 0.97)),
    var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.055) inset, 0 14px 30px rgba(0, 0, 0, 0.18);
}

body.theme-dark .asset-chip,
.app-shell.dark .asset-chip {
  border-color: rgba(96, 116, 130, 0.58);
  background:
    linear-gradient(180deg, rgba(39, 50, 61, 0.95), rgba(27, 36, 46, 0.98)),
    var(--surface-soft);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

body.theme-dark .summary-strip .asset-chip-list,
.app-shell.dark .summary-strip .asset-chip-list {
  min-height: 0;
  display: flex;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

body.theme-dark .plan-metrics span,
body.theme-dark .dict-row.premium-plan-row b,
.app-shell.dark .dict-row.premium-plan-row b,
.app-shell.dark .plan-metrics span {
  border-color: rgba(96, 116, 130, 0.46);
  background: rgba(16, 23, 31, 0.36);
}

body.theme-dark .plan-metrics b,
body.theme-dark .money-value,
body.theme-dark .premium-value,
.app-shell.dark .plan-metrics b,
.app-shell.dark .money-value,
.app-shell.dark .premium-value {
  color: var(--text);
}

body.theme-dark .tariff-row.is-active,
body.theme-dark .tariff-card.is-active,
.app-shell.dark .tariff-row.is-active,
.app-shell.dark .tariff-card.is-active {
  border-color: rgba(242, 199, 107, 0.5);
  box-shadow:
    0 0 0 3px rgba(242, 199, 107, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 40px rgba(0, 0, 0, 0.24);
}

.app-shell.dark .market-category .asset-pills button.active {
  border-color: rgba(77, 197, 186, 0.68);
  background:
    linear-gradient(180deg, rgba(77, 197, 186, 0.18), rgba(31, 39, 48, 0.96)),
    var(--surface);
  box-shadow:
    0 0 0 3px rgba(77, 197, 186, 0.1),
    0 16px 34px rgba(0, 0, 0, 0.2);
}

.app-shell.dark .tradingview-frame {
  border-color: rgba(96, 116, 130, 0.58);
  background:
    linear-gradient(135deg, rgba(77, 197, 186, 0.1), transparent 44%),
    linear-gradient(180deg, #1f2730, #182029);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

.app-shell.dark .order-ticket {
  background:
    linear-gradient(180deg, rgba(77, 197, 186, 0.06), transparent),
    #1b232c;
}

.app-shell.dark .quote-box {
  border-color: rgba(77, 197, 186, 0.24);
  background: rgba(24, 32, 41, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.app-shell.dark .message.admin,
.app-shell.dark .message.incoming {
  background: rgba(18, 82, 76, 0.38);
  border-color: rgba(77, 197, 186, 0.28);
}

.app-shell.dark .message.outgoing {
  background: rgba(187, 132, 40, 0.22);
  border-color: rgba(242, 199, 107, 0.26);
}

.app-shell.dark .message-file {
  border-color: rgba(164, 187, 198, 0.24);
  background: rgba(14, 27, 37, 0.68);
  color: #dbe7eb;
}

body.theme-dark .modal-card,
body.theme-dark .drawer-card,
.app-shell.dark .modal-card,
.app-shell.dark .drawer-card {
  border-color: rgba(96, 116, 130, 0.58);
  background: var(--surface);
  color: var(--text);
}

body.theme-dark .drawer-head,
body.theme-dark .drawer-actions,
body.theme-dark .tabs {
  border-color: rgba(96, 116, 130, 0.58);
}

body.theme-dark .tabs button {
  color: rgba(167, 178, 192, 0.9);
}

body.theme-dark .tabs button.active {
  background: linear-gradient(180deg, #c99438, var(--amber));
  color: #fff;
}

body.theme-dark .detail-field,
body.theme-dark .document-card,
body.theme-dark .mini-table,
body.theme-dark .mini-table > div {
  border-color: rgba(96, 116, 130, 0.52);
  background: rgba(24, 32, 41, 0.92);
  color: var(--text);
}

body.theme-dark .detail-field span,
body.theme-dark .detail-field small,
body.theme-dark .document-card small,
body.theme-dark label span,
body.theme-dark .mini-table > div:first-child {
  color: var(--muted);
}

body.theme-dark .detail-field strong,
body.theme-dark .document-card strong,
body.theme-dark .mini-table b,
body.theme-dark .mini-table span {
  color: var(--text);
}

body.theme-dark .doc-thumb,
body.theme-dark code {
  background: rgba(63, 99, 183, 0.2);
  color: #adc3ff;
}

body.theme-dark .modal-head,
body.theme-dark .modal-actions {
  color: var(--text);
}

.app-shell.dark .toast {
  border-color: rgba(77, 197, 186, 0.36);
  background: #142b29;
  color: #c7fbf4;
}

.app-shell.dark .switch-row input[type="checkbox"] {
  border-color: rgba(96, 116, 130, 0.7);
  background: linear-gradient(180deg, #35414d, #28333e);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.35),
    0 0 0 4px rgba(77, 197, 186, 0.08);
}

.app-shell.dark .switch-row input[type="checkbox"]:checked {
  border-color: rgba(77, 197, 186, 0.75);
  background: linear-gradient(135deg, #0d8e82, #4dc5ba);
}

.view.active {
  animation: view-in 0.2s ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1280px) {
  .market-strip {
    display: none;
  }

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

  .dashboard-grid,
  .auto-grid,
  .settings-grid,
  .auth-grid,
  .trading-terminal,
  .ops-grid,
  .lead-workflow-grid,
  .payments-grid,
  .trading-workspace,
  .documents-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

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

  .kanban-grid,
  .method-grid.detailed,
  .client-ticker,
  .market-category-grid,
  .document-status-grid,
  .tariff-card-grid,
  .error-code-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1500px) {
  .market-strip {
    display: none;
  }
}

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

  .sidebar {
    position: fixed;
    left: 0;
    width: min(var(--sidebar), calc(100vw - 28px));
    max-width: calc(100vw - 28px);
    height: 100dvh;
    transform: translate3d(calc(-100% - 18px), 0, 0);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translate3d(0, 0, 0);
  }

  .mobile-only {
    display: grid;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(10, 14, 18, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .sidebar-backdrop.open {
    display: block;
    opacity: 1;
  }

  .icon-button.sidebar-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    background: transparent !important;
    border-color: transparent !important;
    color: rgba(221, 231, 239, 0.72) !important;
    box-shadow: none !important;
  }

  .icon-button.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: transparent !important;
    color: #ffffff !important;
  }

  #sidebarCollapseToggle {
    display: none;
  }

  .workspace {
    padding: 0 16px 16px;
  }

  .topbar {
    margin: 0 -16px 16px;
    padding: 12px 16px;
  }

  .clock-strip,
  .user-chip {
    display: none;
  }

  .filter-grid,
  .form-grid.three,
  .form-grid.two,
  .auth-grid,
  .trading-terminal,
  .user-terminal-grid,
  .terminal-main,
  .client-ticker,
  .market-category-grid,
  .document-status-grid,
  .trade-preview-grid,
  .wizard-grid,
  .tariff-card-grid,
  .wizard-preview,
  .summary-strip,
  .compact-filter-list,
  .compact-form,
  .split-table-grid,
  .pipeline {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

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

  .asset-row {
    grid-template-columns: 1fr;
  }

  .chart-panel,
  .user-chart-panel,
  .market-watch,
  .client-chat-layout {
    min-height: auto;
  }

  .terminal-main,
  .user-portal .terminal-main {
    min-height: 0;
  }

  .tradingview-frame,
  .tradingview-frame iframe,
  .user-portal .tradingview-frame,
  .user-portal .tradingview-frame iframe {
    min-height: 460px;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 24px;
  }

  .page-head,
  .panel-head,
  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar .global-search {
    flex: 1 1 calc(100% - 48px);
    max-width: none;
    min-width: 0;
  }

  .topbar .button {
    width: auto;
    flex: 1 1 calc(50% - 5px);
  }

  .head-actions,
  .bulk-actions {
    width: 100%;
  }

  .button,
  .small-button {
    width: 100%;
  }

  .topbar .button {
    width: auto;
    flex: 1 1 calc(50% - 5px);
  }

  .queue-item {
    display: grid;
    grid-template-columns: 12px 1fr;
    align-items: start;
  }

  .queue-item .small-button {
    grid-column: 2;
    justify-self: start;
    width: auto;
  }

  .wallet-row {
    grid-template-columns: 1fr 1fr;
  }

  .wallet-row strong,
  .wallet-row span {
    grid-column: 1 / -1;
  }

  .kpi-grid,
  .crm-grid,
  .permission-grid,
  .method-grid,
  .detail-grid,
  .kanban-grid,
  .method-grid.detailed,
  .error-code-grid,
  .pipeline.compact {
    grid-template-columns: 1fr;
  }

  .asset-list article,
  .document-card,
  .dictionary-add-form,
  .dictionary-item,
  .manager-add-form,
  .timeline article,
  .method-row {
    grid-template-columns: 1fr;
  }

  .tradingview-frame,
  .tradingview-frame iframe,
  .user-portal .tradingview-frame,
  .user-portal .tradingview-frame iframe {
    min-height: 380px;
  }

  .message-form {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .user-portal .topbar,
  body[data-admin-view="orders"] .topbar {
    position: static;
  }

  .user-portal .summary-strip,
  #ordersSummary {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    gap: 8px;
    margin: 0 -16px 12px;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 8;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  .user-portal .summary-strip::-webkit-scrollbar,
  #ordersSummary::-webkit-scrollbar {
    display: none;
  }

  .user-portal .summary-strip div,
  #ordersSummary div {
    flex: 0 0 auto;
    min-width: 118px;
    min-height: 0;
    scroll-snap-align: start;
    padding: 8px 10px;
  }

  .user-portal .summary-strip span,
  #ordersSummary span {
    font-size: 11px;
    white-space: nowrap;
  }

  .user-portal .summary-strip strong,
  #ordersSummary strong {
    font-size: 15px;
    white-space: nowrap;
  }
}

/* RadianX premium cold palette */
:root {
  --bg: #e8edf2;
  --surface: #fbfcfd;
  --surface-soft: #f1f5f8;
  --surface-strong: #dbe4ea;
  --line: #c8d3db;
  --line-strong: #9baab5;
  --text: #0d1720;
  --muted: #60707d;
  --muted-2: #8b99a4;
  --teal: #2f7f8d;
  --teal-dark: #102a38;
  --amber: #b7985b;
  --amber-soft: #f5ecd8;
  --blue: #3f6788;
  --blue-soft: #e5edf4;
  --green: #3f8c74;
  --green-soft: #e2f1eb;
  --red: #b75561;
  --red-soft: #f7e3e7;
  --shadow: 0 34px 90px rgba(9, 20, 29, 0.22);
  --shadow-soft: 0 18px 42px rgba(9, 20, 29, 0.105);
  --shadow-hairline: 0 1px 0 rgba(255, 255, 255, 0.78) inset;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, #eef3f7 36%, #dfe7ed 100%),
    linear-gradient(90deg, rgba(12, 28, 39, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(12, 28, 39, 0.035) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
}

::selection {
  background: rgba(183, 152, 91, 0.28);
  color: #0a1118;
}

.sidebar {
  background:
    linear-gradient(90deg, rgba(183, 152, 91, 0.12), transparent 46%),
    linear-gradient(180deg, #09121a 0%, #101c26 48%, #071018 100%);
  border-right-color: rgba(183, 152, 91, 0.28);
  box-shadow: 18px 0 42px rgba(8, 18, 27, 0.14);
}

.sidebar::after {
  background: linear-gradient(90deg, transparent, rgba(183, 152, 91, 0.12));
}

.sidebar .brand {
  border-bottom-color: rgba(183, 152, 91, 0.2);
}

.sidebar .brand-logo {
  filter: brightness(1.2) contrast(1.05) drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42));
}

.brand-subtitle,
.sidebar .brand-subtitle {
  color: rgba(222, 196, 138, 0.82);
}

.sidebar .operator-card {
  border-color: rgba(183, 152, 91, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.045)),
    rgba(10, 21, 30, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 16px 32px rgba(0, 0, 0, 0.22);
}

.sidebar .operator-card strong {
  color: #f7fafc;
}

.sidebar .operator-card span,
.sidebar .nav-divider {
  color: rgba(204, 216, 225, 0.68);
}

.sidebar .avatar,
.avatar,
.user-chip > span {
  background: linear-gradient(145deg, #f1dfb5 0%, #b99654 48%, #6f5428 100%);
  color: #16130c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.sidebar .nav-item,
.sidebar .switch-row {
  color: rgba(221, 231, 239, 0.72);
}

.sidebar .nav-item:hover,
.sidebar .switch-row:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.sidebar .nav-item.active {
  background:
    linear-gradient(90deg, rgba(183, 152, 91, 0.22), transparent 62%),
    linear-gradient(90deg, rgba(45, 98, 118, 0.46), rgba(13, 25, 35, 0.38));
  color: #ffffff;
  box-shadow:
    inset 3px 0 0 #d8bd7b,
    0 12px 28px rgba(0, 0, 0, 0.22);
}

.sidebar .nav-count {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(238, 244, 248, 0.86);
}

.sidebar .nav-count.warn {
  background: rgba(183, 152, 91, 0.2);
  color: #e6c77e;
}

.sidebar .nav-count.danger {
  background: rgba(183, 81, 95, 0.2);
  color: #f0a4ad;
}

.workspace,
.user-portal .workspace {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 320px),
    transparent;
}

.topbar {
  border-bottom-color: rgba(153, 170, 182, 0.52);
  background: rgba(247, 250, 252, 0.9);
  box-shadow: 0 18px 48px rgba(11, 24, 35, 0.08);
}

.global-search,
.ticker,
.clock-strip span,
.polling-pill,
.badge,
.user-chip {
  border-color: rgba(158, 174, 185, 0.58);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-hairline);
}

.topbar .user-chip {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.global-search input {
  background: transparent;
}

input,
select,
textarea,
.chat-search input,
.message-form input {
  border-color: rgba(158, 174, 185, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 251, 0.98)),
    var(--surface);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(47, 127, 141, 0.46);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 127, 141, 0.16), var(--shadow-hairline);
}

.eyebrow {
  color: #8a6a32;
}

h1 {
  color: #08131c;
  font-weight: 850;
}

h2,
h3 {
  color: #0d1720;
}

.panel,
.metric-card,
.chat-layout,
.summary-strip div,
.client-ticker article,
.market-category,
.document-status,
.trade-preview-grid div,
.asset-row,
.tariff-card,
.method-card,
.asset-list article,
.document-card,
.wallet-row,
.queue-item,
.wizard-step,
.permission-grid label,
.rule-list span,
.flow-steps span,
.pipeline div,
.timeline article,
.kanban-column,
.mini-table,
.detail-field {
  border-color: rgba(151, 169, 181, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 251, 0.98)),
    var(--surface);
  box-shadow: var(--shadow-hairline), 0 18px 42px rgba(11, 24, 35, 0.075);
}

.panel::before {
  background: linear-gradient(90deg, rgba(183, 152, 91, 0.68), rgba(47, 127, 141, 0.46), transparent 76%);
}

.metric-card::before,
.tariff-card::before {
  background: linear-gradient(90deg, #d3b66f, #2f7f8d, #3f6788);
}

.metric-card:hover,
.client-ticker article:hover,
.queue-item:hover,
.wallet-row:hover,
.kanban-card:hover,
.asset-row:hover,
.tariff-card:hover,
.method-card:hover,
.asset-list article:hover,
.document-card:hover {
  border-color: rgba(183, 152, 91, 0.44);
  box-shadow: var(--shadow-hairline), 0 24px 54px rgba(10, 22, 32, 0.13);
}

.metric-icon.teal,
.metric-icon.blue {
  background: linear-gradient(145deg, #82bac4, #2f7f8d 56%, #173d50);
}

.metric-icon.amber {
  background: linear-gradient(145deg, #f0d799, #b7985b 56%, #705528);
}

.metric-icon.red {
  background: linear-gradient(145deg, #d9848e, #b75561 56%, #6d2530);
}

.button.primary {
  border-color: rgba(183, 152, 91, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
    linear-gradient(135deg, #1a2d3b 0%, #0b1823 56%, #071018 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 16px 32px rgba(9, 20, 29, 0.2);
}

.button.primary:hover {
  border-color: rgba(216, 189, 123, 0.66);
}

.button.secondary,
.small-button,
.icon-button {
  border-color: rgba(158, 174, 185, 0.56);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 247, 250, 0.94)),
    var(--surface);
  color: #172532;
}

.button.danger,
.small-button.danger {
  border-color: rgba(183, 81, 95, 0.3);
  background: linear-gradient(180deg, #c86a74, #9f3d49);
}

.small-button:hover,
.icon-button:hover,
.provider-row button:hover,
.market-category .asset-pills button:hover {
  border-color: rgba(183, 152, 91, 0.5);
  color: #0f2b3b;
}

.segmented {
  border-color: rgba(158, 174, 185, 0.62);
  background: #e9eef3;
}

.segmented button.active,
.tabs button.active {
  background: linear-gradient(180deg, #d1b56e, #a88343);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(122, 91, 37, 0.2);
}

.calendar-cell.event {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 12px 22px rgba(10, 22, 32, 0.12);
}

.amber-event {
  background: linear-gradient(180deg, #d9bd78, #aa8540);
}

.green-event {
  background: linear-gradient(180deg, #78b8a4, #3f8c74);
}

.red-event {
  background: linear-gradient(180deg, #cd7b85, #a64551);
}

.blue-event {
  background: linear-gradient(180deg, #7ea4c0, #3f6788);
}

.month-day.has-event,
.client-ticker article.active,
.market-category .asset-pills button.active {
  border-color: rgba(183, 152, 91, 0.58);
  background:
    linear-gradient(135deg, rgba(183, 152, 91, 0.12), rgba(47, 127, 141, 0.08)),
    var(--surface);
  box-shadow:
    0 0 0 3px rgba(183, 152, 91, 0.1),
    var(--shadow-hairline),
    0 18px 36px rgba(10, 22, 32, 0.09);
}

.data-table th {
  border-bottom-color: rgba(153, 170, 182, 0.72);
  background: #e7edf2;
  color: #536573;
}

.data-table tbody tr:hover {
  background: rgba(47, 127, 141, 0.07);
}

.badge.success {
  background: var(--green-soft);
  color: #2f765f;
}

.badge.pending,
.badge.warning {
  background: var(--amber-soft);
  color: #7b5a22;
}

.badge.info {
  background: var(--blue-soft);
  color: #2f5777;
}

.status-dot.green,
.pulse {
  background: #3f8c74;
}

.asset-chip,
.plan-pill,
.premium-value,
.asset-chip-list-large {
  border-color: rgba(151, 169, 181, 0.6);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 247, 250, 0.98)),
    var(--surface);
}

.asset-chip {
  color: #10202c;
}

.asset-chip::before {
  background: linear-gradient(135deg, #d1b56e, #2f7f8d);
  box-shadow: 0 0 0 3px rgba(183, 152, 91, 0.1);
}

.premium-value {
  background:
    linear-gradient(135deg, rgba(183, 152, 91, 0.12), rgba(47, 127, 141, 0.09)),
    var(--surface);
}

.money-value {
  color: #0e1b25;
}

.tariff-row,
.tariff-card {
  border-color: rgba(151, 169, 181, 0.62);
}

.tariff-row.is-active,
.tariff-card.is-active {
  border-color: rgba(183, 152, 91, 0.62);
  box-shadow:
    0 0 0 3px rgba(183, 152, 91, 0.12),
    var(--shadow-hairline),
    0 24px 52px rgba(10, 22, 32, 0.14);
}

.plan-medallion,
.plan-standard {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 38%),
    linear-gradient(145deg, #22313d, #0d1a24 58%, #2b2112);
}

.plan-medallion::before,
.plan-medallion::after {
  display: none;
}

.plan-medallion svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: #d8bd7b;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.24));
}

.plan-silver {
  border-color: rgba(151, 169, 181, 0.58);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 38%),
    linear-gradient(145deg, #2a3540, #131f2a 56%, #4c5661);
}

.plan-gold {
  border-color: rgba(183, 152, 91, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent 38%),
    linear-gradient(145deg, #40321a, #161d22 48%, #8a6a32);
}

.plan-vip {
  border-color: rgba(216, 189, 123, 0.8);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 36%),
    linear-gradient(145deg, #2d2a22, #071018 54%, #000);
}

.tradingview-frame {
  border-color: rgba(40, 63, 80, 0.48);
  background:
    linear-gradient(135deg, rgba(183, 152, 91, 0.1), transparent 38%),
    linear-gradient(180deg, #101d28, #071018);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 24px 54px rgba(9, 20, 29, 0.16);
}

.order-ticket,
.quote-box {
  border-color: rgba(151, 169, 181, 0.58);
}

.quote-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 247, 250, 0.98)),
    var(--surface);
}

.message.admin,
.message.incoming {
  background: #e6f1f3;
  border-color: rgba(47, 127, 141, 0.26);
}

.message.outgoing {
  background: #f3ead7;
  border-color: rgba(183, 152, 91, 0.28);
}

.message-file {
  border-color: rgba(92, 128, 145, 0.24);
  background: rgba(235, 241, 244, 0.72);
}

.message.incoming strong {
  color: #214d5a;
}

.message.outgoing strong {
  color: #7a5a24;
}

.modal {
  background:
    linear-gradient(180deg, rgba(5, 11, 16, 0.66), rgba(5, 11, 16, 0.5));
}

.modal-card,
.drawer-card {
  border-color: rgba(183, 152, 91, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 251, 0.99)),
    var(--surface);
  box-shadow: 0 38px 96px rgba(5, 12, 18, 0.3);
}

.toast {
  border-color: rgba(183, 152, 91, 0.42);
  background: #f8f1e1;
  color: #563d18;
}

body.theme-dark,
.app-shell.dark {
  --bg: #071018;
  --surface: #101923;
  --surface-soft: #0c151e;
  --surface-strong: #192735;
  --line: #283948;
  --line-strong: #405465;
  --text: #edf4f8;
  --muted: #a9b6c1;
  --muted-2: #7f909f;
  --teal: #6db9c5;
  --teal-dark: #95d1db;
  --amber: #d2b66f;
  --amber-soft: rgba(210, 182, 111, 0.2);
  --blue: #8db0cc;
  --blue-soft: rgba(141, 176, 204, 0.18);
  --green: #7ec6ad;
  --green-soft: rgba(126, 198, 173, 0.18);
  --red: #ef8994;
  --red-soft: rgba(239, 137, 148, 0.18);
  --shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.28);
  --shadow-hairline: 0 1px 0 rgba(255, 255, 255, 0.07) inset;
}

body.theme-dark .sidebar,
.app-shell.dark .sidebar {
  background:
    linear-gradient(90deg, rgba(210, 182, 111, 0.12), transparent 48%),
    linear-gradient(180deg, #08111a 0%, #101b26 52%, #060d14 100%);
  border-right-color: rgba(210, 182, 111, 0.24);
}

body.theme-dark .topbar,
.app-shell.dark .topbar {
  border-bottom-color: rgba(64, 84, 101, 0.62);
  background: rgba(12, 21, 30, 0.9);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body.theme-dark .workspace,
.app-shell.dark .workspace,
.user-portal .app-shell.dark .workspace {
  background:
    linear-gradient(180deg, rgba(22, 35, 48, 0.72), transparent 340px),
    var(--bg);
}

body.theme-dark .panel,
body.theme-dark .metric-card,
body.theme-dark .chat-layout,
body.theme-dark .summary-strip div,
body.theme-dark .client-ticker article,
body.theme-dark .market-category,
body.theme-dark .document-status,
body.theme-dark .trade-preview-grid div,
body.theme-dark .asset-row,
body.theme-dark .tariff-card,
body.theme-dark .method-card,
body.theme-dark .asset-list article,
body.theme-dark .document-card,
body.theme-dark .wallet-row,
body.theme-dark .queue-item,
body.theme-dark .wizard-step,
body.theme-dark .permission-grid label,
body.theme-dark .rule-list span,
body.theme-dark .flow-steps span,
body.theme-dark .pipeline div,
body.theme-dark .timeline article,
body.theme-dark .kanban-column,
body.theme-dark .mini-table,
body.theme-dark .detail-field,
.app-shell.dark .panel,
.app-shell.dark .metric-card,
.app-shell.dark .chat-layout,
.app-shell.dark .summary-strip div,
.app-shell.dark .client-ticker article,
.app-shell.dark .market-category,
.app-shell.dark .document-status,
.app-shell.dark .trade-preview-grid div,
.app-shell.dark .asset-row,
.app-shell.dark .tariff-card,
.app-shell.dark .method-card,
.app-shell.dark .asset-list article,
.app-shell.dark .document-card,
.app-shell.dark .wallet-row,
.app-shell.dark .queue-item,
.app-shell.dark .wizard-step,
.app-shell.dark .permission-grid label,
.app-shell.dark .rule-list span,
.app-shell.dark .flow-steps span,
.app-shell.dark .pipeline div,
.app-shell.dark .timeline article,
.app-shell.dark .kanban-column,
.app-shell.dark .mini-table,
.app-shell.dark .detail-field {
  border-color: rgba(64, 84, 101, 0.58);
  background:
    linear-gradient(180deg, rgba(22, 35, 48, 0.94), rgba(13, 23, 33, 0.98)),
    var(--surface);
  box-shadow: var(--shadow-hairline), 0 22px 48px rgba(0, 0, 0, 0.24);
}

body.theme-dark .button.primary,
.app-shell.dark .button.primary {
  border-color: rgba(210, 182, 111, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    linear-gradient(135deg, #243849, #101b26 58%, #071018);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 18px 34px rgba(0, 0, 0, 0.28);
}

body.theme-dark .button.secondary,
body.theme-dark .small-button,
body.theme-dark .icon-button,
body.theme-dark .global-search,
body.theme-dark .ticker,
body.theme-dark .clock-strip span,
body.theme-dark .polling-pill,
body.theme-dark .badge,
body.theme-dark .user-chip,
.app-shell.dark .button.secondary,
.app-shell.dark .small-button,
.app-shell.dark .icon-button,
.app-shell.dark .global-search,
.app-shell.dark .ticker,
.app-shell.dark .clock-strip span,
.app-shell.dark .polling-pill,
.app-shell.dark .badge,
.app-shell.dark .user-chip {
  border-color: rgba(64, 84, 101, 0.58);
  background: rgba(16, 25, 35, 0.9);
  color: var(--text);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .chat-search input,
body.theme-dark .message-form input,
.app-shell.dark input,
.app-shell.dark select,
.app-shell.dark textarea,
.app-shell.dark .chat-search input,
.app-shell.dark .message-form input {
  border-color: rgba(64, 84, 101, 0.62);
  background:
    linear-gradient(180deg, rgba(22, 35, 48, 0.96), rgba(12, 21, 30, 0.98)),
    var(--surface-soft);
  color: var(--text);
}

body.theme-dark .global-search input,
.app-shell.dark .global-search input {
  background: transparent;
  border: 0;
}

body.theme-dark .data-table th,
.app-shell.dark .data-table th {
  border-bottom-color: rgba(64, 84, 101, 0.72);
  background: #152331;
  color: #a9b6c1;
}

body.theme-dark .tradingview-frame,
.app-shell.dark .tradingview-frame {
  border-color: rgba(210, 182, 111, 0.24);
  background:
    linear-gradient(135deg, rgba(210, 182, 111, 0.08), transparent 38%),
    linear-gradient(180deg, #111e2a, #060d14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 58px rgba(0, 0, 0, 0.34);
}

body.theme-dark .modal-card,
body.theme-dark .drawer-card,
.app-shell.dark .modal-card,
.app-shell.dark .drawer-card {
  border-color: rgba(210, 182, 111, 0.22);
  background:
    linear-gradient(180deg, rgba(20, 32, 44, 0.98), rgba(12, 21, 30, 0.99)),
    var(--surface);
}

body.theme-dark .toast,
.app-shell.dark .toast {
  border-color: rgba(210, 182, 111, 0.42);
  background: rgba(45, 37, 18, 0.96);
  color: #f0d799;
}

@media (max-width: 640px) {
  .head-actions,
  .bulk-actions,
  .modal-actions,
  .drawer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .head-actions .button,
  .bulk-actions .button,
  .modal-actions .button,
  .drawer-actions .small-button {
    width: auto;
  }

  .head-actions .button:only-child,
  .bulk-actions .button:only-child,
  .modal-actions .button:only-child {
    grid-column: 1 / -1;
  }
}

.table-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--amber);
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.table-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.theme-dark .table-link,
.app-shell.dark .table-link {
  color: #d8bd7b;
}

body.theme-dark .table-link:hover,
.app-shell.dark .table-link:hover {
  color: #f5e0aa;
}

/* App shell: the menu and workspace now behave like one cabinet screen. */
html,
body {
  height: 100%;
}

body {
  overflow: hidden;
}

.app-shell,
.user-shell {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar,
body.theme-dark .sidebar,
.app-shell.dark .sidebar {
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
}

.workspace,
.user-portal .workspace {
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

@media (min-width: 981px) {
  .sidebar,
  body.theme-dark .sidebar,
  .app-shell.dark .sidebar {
    position: relative;
    top: auto;
    align-self: stretch;
    border-radius: 0;
    box-shadow:
      inset -1px 0 0 rgba(255, 255, 255, 0.04),
      6px 0 18px rgba(0, 0, 0, 0.12);
  }
}

/* Sidebar cleanup: remove the broad glow and keep the premium accent crisp. */
.sidebar,
body.theme-dark .sidebar,
.app-shell.dark .sidebar {
  background:
    linear-gradient(180deg, #08121b 0%, #0d1a25 48%, #061019 100%) !important;
  border-right-color: rgba(35, 54, 68, 0.9);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.04),
    8px 0 26px rgba(0, 0, 0, 0.16);
  scrollbar-gutter: auto;
  scrollbar-width: none;
}

.sidebar::after,
body.theme-dark .sidebar::after,
.app-shell.dark .sidebar::after {
  display: none;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar .nav-item.active,
body.theme-dark .sidebar .nav-item.active,
.app-shell.dark .sidebar .nav-item.active {
  background:
    linear-gradient(90deg, rgba(216, 189, 123, 0.16), transparent 54%),
    linear-gradient(180deg, rgba(24, 43, 57, 0.96), rgba(9, 24, 34, 0.98));
  border-color: rgba(216, 189, 123, 0.34);
  box-shadow:
    inset 3px 0 0 #d8bd7b,
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar .nav-item:hover,
.sidebar .switch-row:hover,
body.theme-dark .sidebar .nav-item:hover,
body.theme-dark .sidebar .switch-row:hover,
.app-shell.dark .sidebar .nav-item:hover,
.app-shell.dark .sidebar .switch-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

[data-icon] svg,
.icon-button svg,
.small-button svg,
.button svg,
.metric-icon svg,
.muted-pill svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-icon svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.nav-icon {
  display: grid;
  place-items: center;
  color: currentColor;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.notification-wrap {
  position: relative;
  flex: 0 0 auto;
}

.notification-button {
  position: relative;
}

.notification-button.has-alerts {
  border-color: rgba(200, 79, 95, 0.48);
  color: var(--red);
  background: color-mix(in srgb, var(--red-soft) 74%, var(--surface));
}

.notification-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.notification-dot.empty {
  display: none;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 80;
  width: min(360px, calc(100vw - 32px));
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notification-dropdown.open {
  display: block;
}

.notification-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.notification-head strong,
.notification-head small {
  display: block;
}

.notification-head small,
.notification-empty,
.notification-item small {
  color: var(--muted);
}

.notification-list {
  display: grid;
  max-height: 320px;
  overflow: auto;
}

.notification-section-label {
  padding: 8px 12px 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.notification-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.notification-item:hover {
  background: var(--surface-soft);
}

.notification-item-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.notification-dismiss {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.notification-dismiss:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.notification-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #d8bd7b, #9e742f);
  color: #101a22;
  font-size: 12px;
  font-weight: 900;
}

.notification-empty {
  padding: 14px;
}

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

.chat-search select {
  min-height: 34px;
}

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

.conversation-item.muted {
  opacity: 0.72;
}

.conversation-item.has-messages {
  background:
    linear-gradient(90deg, rgba(216, 189, 123, 0.14), transparent 56%),
    var(--surface-soft);
}

.conversation-item.has-unread {
  background:
    linear-gradient(90deg, rgba(200, 79, 95, 0.16), rgba(216, 189, 123, 0.1) 46%, transparent 78%),
    var(--surface);
  box-shadow: inset 4px 0 0 var(--red);
}

.conversation-item.has-unread.active {
  box-shadow:
    inset 4px 0 0 var(--red),
    inset 0 0 0 1px rgba(200, 79, 95, 0.16);
}

.conversation-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.message-count,
.muted-pill {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 850;
}

.message-count.has-messages {
  border-color: rgba(187, 132, 40, 0.58);
  background:
    linear-gradient(180deg, #f9e5a7, #c79a43);
  color: #13211d;
  box-shadow: 0 8px 18px rgba(187, 132, 40, 0.24);
}

.message-count.has-unread {
  border-color: rgba(200, 79, 95, 0.62);
  background:
    linear-gradient(180deg, #e96a78, #b83d50);
  color: #fff;
  box-shadow: 0 10px 20px rgba(200, 79, 95, 0.28);
}

.muted-pill svg {
  width: 13px;
  height: 13px;
}

.access-matrix {
  display: grid;
  gap: 10px;
}

.access-matrix div {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.access-matrix strong {
  color: var(--text);
}

.access-matrix span {
  color: var(--muted);
}

body.theme-dark .data-table input[type="checkbox"],
.app-shell.dark .data-table input[type="checkbox"] {
  border-color: rgba(145, 162, 176, 0.78);
  background: linear-gradient(180deg, #162330, #0f1b26);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

body.theme-dark .data-table input[type="checkbox"]:checked,
.app-shell.dark .data-table input[type="checkbox"]:checked {
  border-color: #58bec6;
  background: linear-gradient(135deg, #2f7f8d, #58bec6);
  box-shadow:
    0 0 0 3px rgba(88, 190, 198, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

body.theme-dark .data-table tbody tr.is-selected,
.app-shell.dark .data-table tbody tr.is-selected {
  background: rgba(88, 190, 198, 0.1);
}

.plan-medallion svg,
.plan-medallion[data-icon] svg {
  stroke: #d8bd7b;
}

#leadsTable th:nth-child(2),
#leadsTable td:nth-child(2),
#leadsTable th:nth-child(6),
#leadsTable td:nth-child(6),
#leadsTable th:nth-child(7),
#leadsTable td:nth-child(7),
#leadsTable th:nth-child(8),
#leadsTable td:nth-child(8),
#leadsTable th:nth-child(9),
#leadsTable td:nth-child(9) {
  display: none;
}
