:root {
  color: #d8e4ec;
  background: #101415;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #101415;
  --sidebar: #062f53;
  --sidebar-dark: #052944;
  --panel: #161b1c;
  --panel-2: #1b2022;
  --panel-3: #111617;
  --line: #2a3235;
  --line-strong: #354044;
  --text: #d8e4ec;
  --muted: #87949b;
  --muted-2: #5f6c72;
  --accent: #1594ff;
  --accent-2: #50bfff;
  --success: #8ee95c;
  --danger: #ff4f67;
  --warning: #ffb22c;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(8, 12, 14, .88);
}

.login-gate[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 26px;
  background: #151a1c;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .42);
}

.login-card p {
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #b9c7ce;
  font-size: 13px;
  font-weight: 700;
}

.login-hint {
  min-height: 20px;
  color: var(--warning);
  font-size: 13px;
}

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

button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 13px;
  background: #202629;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  border-color: #4f5b60;
  background: #293033;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  color: #e7eef3;
  font-size: 22px;
  font-weight: 800;
}

h2 {
  color: #edf5fb;
  font-size: 18px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #0d4269;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-dark));
  padding: 22px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 24px;
  color: #f1f8ff;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 3px solid #67d5ff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(103, 213, 255, .16), 0 0 18px rgba(21, 148, 255, .35);
}

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

.brand strong {
  font-size: 18px;
}

.brand span {
  margin-top: 2px;
  color: #86b7d8;
  font-size: 12px;
}

.side-search {
  display: grid;
  gap: 7px;
  margin-bottom: 24px;
  color: #9fc4dc;
}

.side-search span {
  font-size: 12px;
}

.side-search input {
  border-color: #0f4b76;
  background: #0b2337;
  color: #d8e4ec;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  background: #131718;
  padding: 18px 28px;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}

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

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

.session-chip {
  display: grid;
  gap: 2px;
  min-width: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 12px;
  background: #0f181b;
}

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

.session-chip strong {
  overflow: hidden;
  color: #edf5fb;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-settings {
  position: relative;
}

.connection-settings summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 13px;
  background: #202629;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.connection-settings summary::-webkit-details-marker {
  display: none;
}

.connection-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 12px;
  width: 360px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  background: #11191d;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
}

.connection input {
  width: 220px;
  border-color: var(--line-strong);
  background: #0f1415;
}

.connection-popover input {
  width: 100%;
}

.tabs {
  display: grid;
  gap: 4px;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 14px 9px 42px;
  background: transparent;
  color: #c5dced;
  text-align: left;
}

.tab::before {
  content: "";
  position: absolute;
  left: 18px;
  width: 8px;
  height: 8px;
  border: 2px solid #7ebde7;
  border-radius: 2px;
}

.tab:hover {
  background: rgba(255, 255, 255, .06);
}

.tab.active {
  background: rgba(21, 148, 255, .16);
  color: #fff;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.limited-tab {
  gap: 8px;
}

.limited-tab span {
  margin-left: auto;
  border: 1px solid rgba(255, 178, 44, .42);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--warning);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.layout {
  padding: 16px 22px 38px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.dashboard-panel {
  border: 0;
  background: transparent;
  overflow: visible;
}

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

#agentPanel .agent-metrics {
  margin: 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .018);
}

#agentPanel .agent-metrics .metric {
  min-height: 86px;
  padding: 16px 18px;
}

#agentPanel .agent-metrics .metric strong {
  margin-top: 9px;
  font-size: 24px;
}

.agent-workspace-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0));
}

.agent-workspace-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 68px;
  border-color: var(--line);
  padding: 12px 14px;
  background: rgba(255, 255, 255, .035);
  text-align: left;
}

.agent-workspace-tab:hover {
  border-color: rgba(21, 148, 255, .48);
  background: rgba(21, 148, 255, .07);
}

.agent-workspace-tab.active {
  border-color: rgba(21, 148, 255, .72);
  background: rgba(21, 148, 255, .13);
  box-shadow: inset 0 0 0 1px rgba(21, 148, 255, .18);
}

.agent-workspace-tab.active::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.agent-workspace-tab strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.agent-workspace-tab span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.matchmaking-audit-tabs {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  background: rgba(255, 255, 255, .018);
}

.matchmaking-audit-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--muted);
  letter-spacing: 0;
}

.matchmaking-audit-tab:hover {
  border-bottom-color: rgba(21, 148, 255, .45);
  background: transparent;
  color: var(--text);
}

.matchmaking-audit-tab.active {
  border-bottom-color: var(--accent);
  background: transparent;
  color: var(--text);
}

.matchmaking-tab-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 0 6px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.matchmaking-audit-tab.active .matchmaking-tab-count {
  border-color: rgba(21, 148, 255, .5);
  background: rgba(21, 148, 255, .14);
  color: #cce9ff;
}

.matchmaking-audit-content {
  padding: 20px 22px 24px;
}

.matchmaking-audit-content[hidden] {
  display: none;
}

.matchmaking-audit-content .table-wrap {
  margin: 0;
}

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

.matchmaking-section-head h3 {
  font-size: 16px;
  letter-spacing: 0;
}

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

.matchmaking-record-head {
  margin-top: 24px;
}

.matchmaking-verification-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, .025);
}

.matchmaking-verification-fields {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(210px, 1.4fr) repeat(4, minmax(130px, 1fr));
  gap: 12px;
  min-width: 0;
}

.matchmaking-verification-form > button {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
  height: 39px;
  padding: 0 16px;
  white-space: nowrap;
}

.matchmaking-profile-detail-modal {
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}

.matchmaking-profile-detail-body {
  display: grid;
  gap: 20px;
  padding: 20px;
}

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

.matchmaking-profile-photo {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1415;
}

.matchmaking-profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.matchmaking-profile-copy {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.matchmaking-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.matchmaking-status-approved {
  border-color: rgba(62, 207, 142, .42);
  background: rgba(62, 207, 142, .09);
  color: #8be2b9;
}

.matchmaking-status-pending,
.matchmaking-status-unverified,
.matchmaking-status-missing {
  border-color: rgba(255, 178, 44, .4);
  background: rgba(255, 178, 44, .08);
  color: #ffd080;
}

.matchmaking-status-rejected {
  border-color: rgba(255, 91, 118, .42);
  background: rgba(255, 91, 118, .08);
  color: #ff9bae;
}

.matchmaking-status-hidden {
  color: #aebdca;
}

.agent-workspace-view[hidden] {
  display: none;
}

.agent-workspace-view {
  min-height: 460px;
}

.agent-workspace-view > .panel-subhead:first-child,
.agent-workspace-view > .panel-head:first-child {
  border-top: 0;
}

.metric,
.panel,
.editor,
.table-wrap,
.detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric {
  min-height: 112px;
  padding: 24px 26px;
}

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

.metric strong {
  display: block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.summary .metric:nth-child(1) strong,
.summary .metric:nth-child(5) strong,
#commissionSettleable,
#walletAvailable {
  color: var(--success);
}

.summary .metric:nth-child(2) strong,
#commissionReversed {
  color: var(--danger);
}

.summary .metric:nth-child(4) strong,
.summary .metric:nth-child(6) strong,
#withdrawalPending {
  color: var(--warning);
}

#withdrawalPaid {
  color: var(--accent-2);
}

.panel {
  display: none;
  padding: 0;
  overflow: hidden;
}

.panel.active {
  display: block;
}

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

.panel-subhead {
  margin: 0;
  border-top: 1px solid var(--line);
}

.panel-head p,
.panel-subhead p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.panel-head .panel-note {
  color: var(--warning);
}

.module-notice {
  display: none;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 178, 44, .24);
  padding: 12px 26px;
  background: rgba(255, 178, 44, .08);
  color: var(--muted);
  font-size: 13px;
}

.module-notice strong {
  color: var(--warning);
  white-space: nowrap;
}

.module-notice span {
  display: none;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
}

.scenic-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.route-workbench {
  display: block;
}

.route-picker,
.filters {
  padding: 18px 26px 0;
}

.route-picker {
  max-width: 560px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 260px));
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.filters > button[id$="FilterBtn"] {
  justify-self: start;
  min-width: 96px;
  height: 38px;
  padding: 0 18px;
}

.vip-card-import-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(260px, 1fr);
  gap: 14px;
  padding: 18px 26px 0;
}

.vip-card-import-data {
  width: calc(100% - 52px);
  min-height: 156px;
  margin: 14px 26px 0;
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.vip-card-import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px 22px;
}

.vip-card-import-actions .vip-card-import-submit {
  width: auto;
  min-width: 160px;
  min-height: 38px;
  padding: 0 20px;
}

.vip-card-import-result {
  max-height: 200px;
  margin: 0 26px 24px;
  overflow: auto;
}

.vip-card-filters {
  grid-template-columns: minmax(220px, 324px) minmax(180px, 324px) auto;
  margin-bottom: 12px;
}

.vip-card-filters > #vipCardFilterBtn {
  width: auto;
  min-width: 96px;
  height: 38px;
  padding: 0 18px;
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px;
  gap: 12px;
  margin-bottom: 12px;
}

.audit-filters {
  grid-template-columns: repeat(2, minmax(220px, 320px));
  justify-content: start;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
  padding: 18px;
}

.detail-card {
  padding: 18px;
}

.detail-card h3 {
  margin: 0 0 14px;
  color: #edf5fb;
  font-size: 17px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row span:first-child {
  color: var(--muted);
}

.detail-row strong,
.detail-cell strong,
.order-item-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-card .detail-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  justify-content: initial;
}

.modal-card .detail-row strong {
  justify-self: start;
  max-width: 100%;
}

.modal-card .detail-section {
  min-width: 0;
}

.detail-section {
  margin-top: 16px;
}

.compact-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .018);
  padding: 12px;
}

.compact-section h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 14px;
  align-items: start;
}

.order-detail-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.order-detail-column .compact-section {
  margin-top: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  column-gap: 14px;
  row-gap: 8px;
}

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

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

.detail-cell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px solid rgba(129, 156, 179, .18);
}

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

.detail-cell span {
  color: var(--muted);
  font-size: 13px;
}

.detail-cell strong {
  color: #edf5fb;
  font-size: 14px;
  justify-self: start;
  text-align: left;
}

.relation-source-cell {
  align-items: start;
}

.source-order-value {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.source-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-order-actions .link-btn {
  font-size: 12px;
}

.order-shipping-section .row-sub {
  margin-top: 8px;
}

.order-item-list {
  display: grid;
  gap: 6px;
}

.order-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 32px;
  border-bottom: 1px solid rgba(129, 156, 179, .18);
  color: var(--muted);
}

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

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

.wallet-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
  padding: 10px;
}

.wallet-item span,
.wallet-item strong {
  display: block;
}

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

.wallet-item strong {
  margin-top: 6px;
  color: #edf5fb;
  font-size: 17px;
}

.primary-wallet {
  border-color: rgba(142, 233, 92, .5);
  background: rgba(142, 233, 92, .08);
}

.primary-wallet strong {
  color: var(--success);
}

.notice-box,
.asset-manager {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}

.compact-form {
  display: grid;
  gap: 12px;
}

.compact-form[hidden],
.inline-form[hidden],
.asset-manager[hidden] {
  display: none;
}

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

.identity-note {
  margin-top: 8px;
}

.identity-item,
.external-result,
.asset-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
  padding: 10px;
}

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

.identity-item-row .identity-item-main {
  min-width: 0;
}

.identity-item-row .row-title .tag {
  margin-left: 8px;
}

.identity-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.identity-section-head h3 {
  margin: 0;
}

.identity-actions,
.asset-tags,
.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

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

.inline-form .primary {
  width: auto;
}

.agent-name-form {
  align-items: end;
  margin-bottom: 0;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(109, 142, 173, 0.28);
  border-radius: 8px;
  background: rgba(43, 62, 78, 0.28);
  color: #9fb2c4;
}

.workflow-status strong {
  color: #f5f9ff;
}

.workflow-actions {
  margin: 10px 0 4px;
}

.file-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(109, 142, 173, 0.24);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  color: #9fb2c4;
}

.file-status-row strong {
  color: #f5f9ff;
}

.file-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-upload-row input[type="file"] {
  flex: 1;
  min-width: 220px;
}

.json-box {
  overflow: auto;
  max-height: 340px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0f1415;
  color: #d8e4ec;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.audit-summary-box {
  margin: 0;
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  background: rgba(21, 148, 255, .06);
  color: var(--text);
  line-height: 1.65;
}

.technical-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
}

.technical-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.technical-details[open] summary {
  margin-bottom: 10px;
}

.technical-details .json-box + .json-box {
  margin-top: 10px;
}

.technical-meta {
  max-height: 150px;
}

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

.form-hint {
  border: 1px solid rgba(255, 178, 44, .55);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(255, 178, 44, .08);
  color: var(--warning);
  font-size: 13px;
}

.basis-point-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--warning);
}

.editor {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.form-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
}

.route-spot-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #10181d;
}

.route-spot-field strong,
.route-spot-field span {
  display: block;
}

.route-spot-field span {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.modal-backdrop[hidden] {
  display: none;
}

#confirmDialogModal {
  z-index: 180;
}

.modal-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  background: #11191d;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.confirm-modal {
  grid-template-rows: none;
  align-content: start;
  width: min(430px, 100%);
}

.confirm-message {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.confirm-input-wrap {
  display: grid;
  gap: 8px;
}

.confirm-input-wrap[hidden] {
  display: none;
}

.confirm-input-wrap span {
  color: var(--muted);
  font-size: 13px;
}

#confirmDialogInput {
  min-height: 82px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: #0b1114;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  outline: none;
}

#confirmDialogInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 176, 255, .18);
}

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

.confirm-primary.danger {
  border-color: rgba(255, 79, 103, .82);
  background: #d83b52;
}

.confirm-primary.danger:hover {
  border-color: var(--danger);
  background: var(--danger);
}

.modal-editor {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
}

#tripForm.modal-editor {
  width: min(640px, 100%);
}

.asset-manager.modal-card {
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
}

.order-detail-modal {
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
  width: min(900px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 40px));
}

#userDetail.modal-card {
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
  width: min(900px, calc(100vw - 32px));
}

#refundForm.modal-card,
#invoiceForm.modal-card,
#benefitForm.modal-card,
.agent-detail-modal,
.audit-detail-modal {
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
  width: min(900px, calc(100vw - 32px));
}

#refundForm .detail-row,
#invoiceForm .detail-row,
.agent-detail-modal > .detail-row,
.audit-detail-modal > .detail-row {
  grid-template-columns: 96px minmax(0, 1fr);
}

#benefitForm .detail-row {
  grid-template-columns: 112px minmax(0, 1fr);
}

.user-profile-section {
  margin-top: 10px;
}

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

.user-detail-grid .detail-cell {
  grid-template-columns: 64px minmax(0, 1fr);
}

.user-detail-grid .detail-cell strong {
  max-width: 100%;
}

.admin-detail-section {
  margin-top: 10px;
}

.modal-detail-grid .detail-cell {
  grid-template-columns: 88px minmax(0, 1fr);
}

.benefit-detail-grid .detail-cell {
  grid-template-columns: 96px minmax(0, 1fr);
}

#refundForm label,
#invoiceForm label,
#benefitForm label {
  min-width: 0;
  max-width: 100%;
}

#refundForm input,
#refundForm select,
#refundForm textarea,
#invoiceForm input,
#invoiceForm select,
#invoiceForm textarea,
#benefitForm input,
#benefitForm select,
#benefitForm textarea,
#agentMemberForm input,
#agentMemberForm select,
#agentMemberForm textarea {
  min-width: 0;
  max-width: 100%;
}

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

.asset-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: end;
}

#routeAssetManager .asset-upload-row {
  grid-template-columns: minmax(0, 1fr) 160px 180px;
}

.asset-upload-hint {
  color: var(--muted);
  font-size: 12px;
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.modal-head h3 {
  margin: 0;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.modal-tools {
  display: grid;
}

.modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
}

.modal-actions .primary {
  width: auto;
}

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

.modal-check-list {
  overflow: auto;
  align-content: start;
  padding-right: 4px;
}

.check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: #0f1415;
  color: var(--text);
}

.check-item input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}

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

.check-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.external-search-head,
.asset-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.external-search-head strong,
.external-search-head span,
.asset-manager-head strong,
.asset-manager-head span {
  display: block;
}

.external-search-head span,
.asset-manager-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.external-results,
.asset-list {
  display: grid;
  gap: 10px;
  min-height: 0;
}

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

.external-result .row-sub {
  line-height: 1.45;
}

.asset-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 112px;
}

.asset-thumb {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: #0e1a22;
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.asset-thumb span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.asset-info {
  min-width: 0;
}

.asset-actions {
  margin-top: 8px;
}

.inline-select {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.inline-select select {
  min-height: 30px;
  padding: 4px 8px;
}

.asset-pager {
  padding-top: 2px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--text);
  background: #0f1415;
}

textarea {
  resize: vertical;
}

.field-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.field-row .flex-1 {
  flex: 1;
  min-width: 0;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.table-wrap {
  overflow: auto;
  margin: 0 18px 18px;
}

.table-with-pager {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}

.workbench .table-wrap,
.order-layout .table-wrap {
  margin: 0;
}

.table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.table-pager > div {
  display: flex;
  gap: 8px;
}

.table-pager button {
  min-width: 76px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #c3d1d8;
  font-size: 13px;
  white-space: nowrap;
  background: #181e20;
}

td {
  color: var(--text);
  font-size: 14px;
}

tr:hover td {
  background: rgba(255, 255, 255, .02);
}

.clickable-row {
  cursor: pointer;
}

.selected-row td {
  background: rgba(21, 148, 255, .08);
}

.row-title {
  color: #edf5fb;
  font-weight: 800;
}

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

.tag {
  display: inline-flex;
  border: 1px solid rgba(21, 148, 255, .45);
  border-radius: 5px;
  padding: 3px 8px;
  background: rgba(21, 148, 255, .08);
  color: var(--accent);
  font-size: 12px;
}

.tag-success {
  border-color: rgba(142, 233, 92, .5);
  background: rgba(142, 233, 92, .08);
  color: var(--success);
}

.tag-warn {
  border-color: rgba(255, 178, 44, .5);
  background: rgba(255, 178, 44, .08);
  color: var(--warning);
}

.tag-danger {
  border-color: rgba(255, 79, 103, .5);
  background: rgba(255, 79, 103, .08);
  color: var(--danger);
}

.tag-info {
  border-color: rgba(80, 191, 255, .5);
  background: rgba(80, 191, 255, .08);
  color: var(--accent-2);
}

.tag-muted {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
}

.readonly-field {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
}

.action-cell {
  min-width: 170px;
}

.action-cell .link-btn {
  margin: 0 10px 6px 0;
}

.link-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
}

.link-btn:hover {
  background: transparent;
  color: var(--accent-2);
}

.link-btn:disabled,
.link-btn:disabled:hover,
.muted-action {
  background: transparent;
  color: var(--muted);
}

.danger-link {
  color: var(--danger);
}

.danger-link:hover {
  color: #ff8a9a;
}

.link-btn + .link-btn {
  margin-left: 10px;
}

.primary {
  width: 100%;
  border-color: #0e84e6;
  background: #0e84e6;
  color: #fff;
}

.primary:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: none;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  background: #0f1415;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.checkbox-group-field {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px 8px;
  margin: 0;
}

.checkbox-group-field legend {
  font-size: .82rem;
  color: var(--text-dim);
  padding: 0 4px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 4px;
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.toast.show {
  display: block;
  animation: toast-in 0.28s ease;
}

.toast.toast-error {
  border-color: #ef4444;
  background: #7f1d1d;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

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

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar,
  .connection,
  .workbench,
  .order-layout,
  .agent-workspace-nav,
  .filters {
    display: grid;
  }

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

  .connection input {
    width: 100%;
  }

  .summary,
  .agent-metrics,
  .order-detail-grid,
  .detail-grid,
  .modal-detail-grid,
  .vip-card-import-fields,
  .vip-card-filters,
  #agentMemberForm,
  .grid-2,
  .grid-3,
  .grid-4,
  .asset-upload-row,
  .check-list {
    grid-template-columns: 1fr;
  }

  .detail-cell,
  .modal-detail-grid .detail-cell,
  .benefit-detail-grid .detail-cell,
  .user-detail-grid .detail-cell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .matchmaking-verification-form {
    align-items: stretch;
    flex-direction: column;
  }

  .matchmaking-verification-fields {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matchmaking-verification-form > button {
    align-self: flex-end;
  }

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

@media (max-width: 680px) {
  .agent-workspace-nav {
    grid-template-columns: 1fr;
  }

  .matchmaking-audit-tabs {
    gap: 14px;
    overflow-x: auto;
    padding: 0 16px;
  }

  .matchmaking-audit-tab {
    flex: 0 0 auto;
  }

  .matchmaking-audit-content {
    padding: 16px;
  }

  .matchmaking-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .matchmaking-verification-fields {
    grid-template-columns: 1fr;
  }

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

.membership-referral-setting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 4px;
  border-top: 1px solid var(--line);
}

.membership-referral-setting h3 {
  margin: 0 0 6px;
}

.membership-referral-setting p {
  max-width: 760px;
  margin: 0;
  color: var(--text-dim);
}

.membership-referral-control {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.membership-referral-control label {
  min-width: 240px;
}

.membership-referral-control button {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .membership-referral-setting,
  .membership-referral-control {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-referral-control label {
    min-width: 0;
  }

  .membership-referral-control button {
    align-self: flex-start;
  }
}

.today-recommend-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(100, 180, 255, 0.25);
  border-radius: 8px;
  background: rgba(30, 60, 100, 0.35);
}

.today-recommend-label {
  color: #88baef;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.today-recommend-select {
  min-width: 140px;
  padding: 4px 8px;
  border: 1px solid rgba(100, 180, 255, 0.3);
  border-radius: 4px;
  background: rgba(20, 40, 70, 0.6);
  color: #d0dfef;
  font-size: 13px;
}
