:root {
  color-scheme: dark;
  --bg: #06101c;
  --bg-soft: #091522;
  --sidebar: #07121f;
  --surface: #0d1b2a;
  --surface-2: #112235;
  --surface-3: #14293e;
  --line: #1d344a;
  --line-bright: #29516b;
  --text: #e8f3fc;
  --muted: #8499aa;
  --muted-2: #61788b;
  --cyan: #27d4f2;
  --cyan-2: #64e7ff;
  --blue: #4686ff;
  --green: #35d39a;
  --yellow: #f3bc58;
  --red: #ff6b78;
  --surface-date: rgba(13, 27, 42, 0.6);
  --surface-table-head: rgba(7, 18, 31, 0.65);
  --surface-search: rgba(5, 14, 24, 0.65);
  --surface-input: #091725;
  --surface-modal: #0b1927;
  --surface-modal-header: rgba(17, 34, 53, 0.72);
  --surface-toast: rgba(10, 28, 42, 0.96);
  --surface-login-screen: #050e18;
  --surface-login-card: rgba(10, 25, 38, 0.95);
  --text-table-head: #7590a3;
  --text-table-cell: #b8cbd8;
  --text-form-label: #aec2ce;
  --text-login-label: #a8bdca;
  --text-modal-tip: #86a8ba;
  --text-modal-body: #a9bdc9;
  --text-modal-detail: #cfdee7;
  --text-toast: #c7e2eb;
  --text-primary-button: #06141d;
  --text-primary-button-hover: #06141d;
  --text-secondary-button: #b9cfdd;
  --text-danger-button: #ffdce0;
  --text-status-success: #83edc5;
  --text-status-normal: #91a6b5;
  --text-status-info: #86dffa;
  --text-status-warning: #ffd788;
  --text-status-danger: #ff9da7;
  --text-table-action: #9eb5c4;
  --text-pagination: #a7bdca;
  --text-form-error: #ff909b;
  --text-promotion-code: #64e7ff;
  --text-card-kicker: #8da8b9;
  --text-promotion-release: #64e7ff;
  --text-link-hover: #64e7ff;
  --text-avatar: #bcd4ff;
  --text-mini-avatar-cyan: #9ff3ff;
  --text-mini-avatar-accent: #bfd3ff;
  --text-nav-count: #a6c9dc;
  --text-system-status: #9bb2c2;
  --text-empty-state: #a8bdca;
  --text-withdrawal-label: #acc0ce;
  --text-notice: #8fb1c3;
  --text-notice-strong: #b7eaf3;
  --text-settlement-strong: #c4d8ff;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  --sidebar-width: 238px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 82% -20%, rgba(39, 212, 242, 0.08), transparent 32rem),
    linear-gradient(180deg, #07121f, var(--bg) 38rem);
  font-size: 14px;
  line-height: 1.5;
}

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

button { color: inherit; }

button:not(:disabled) { cursor: pointer; }

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

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-layout { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(7, 18, 31, 0.98);
  box-shadow: 16px 0 40px rgba(0, 0, 0, 0.14);
}

.brand {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.brand > span:last-child,
.login-brand { display: flex; flex-direction: column; }

.brand strong,
.login-brand strong { font-size: 19px; letter-spacing: 0.02em; }

.brand small { color: var(--muted); font-size: 9px; letter-spacing: 0.2em; }

.brand-mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  background: url("/brandmark") center / contain no-repeat;
  filter: drop-shadow(0 0 12px rgba(51, 152, 206, 0.2));
}

.brand-mark.small { width: 30px; height: 30px; }

.agent-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 18px 14px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(39, 212, 242, 0.07), rgba(17, 34, 53, 0.65));
}

.agent-avatar,
.mini-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(70, 134, 255, 0.45);
  border-radius: 10px;
  color: var(--text-avatar);
  background: rgba(70, 134, 255, 0.15);
  font-weight: 700;
}

.agent-card > span:nth-child(2) { min-width: 0; }
.agent-card strong,
.agent-card small { display: block; }
.agent-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-card small { color: var(--muted); font-size: 11px; }

.online-dot,
.system-status i,
.auto-note i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(53, 211, 154, 0.75);
}

.side-nav { padding: 8px 12px; }
.side-nav p { margin: 18px 10px 8px; color: var(--muted-2); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }

.nav-button {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  margin: 3px 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition: 150ms ease;
}

.nav-button > span:first-child { width: 18px; color: #6d8da5; font-size: 17px; text-align: center; }
.nav-button:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-button.is-active { color: #eaffff; border-color: rgba(39, 212, 242, 0.2); background: linear-gradient(90deg, rgba(39, 212, 242, 0.15), rgba(39, 212, 242, 0.04)); }
.nav-button.is-active::before { content: ""; position: absolute; inset: 9px auto 9px -13px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.nav-button.is-active > span:first-child { color: var(--cyan); }

.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--text-nav-count);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  text-align: center;
}

.nav-pulse { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.sidebar-footer small { display: block; margin-top: 11px; color: var(--muted-2); font-size: 9px; letter-spacing: 0.12em; text-align: center; }
.logout-button { width: 100%; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; }
.logout-button:hover { color: var(--red); border-color: rgba(255, 107, 120, 0.2); background: rgba(255, 107, 120, 0.06); }

.workspace { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid rgba(29, 52, 74, 0.8);
  background: rgba(6, 16, 28, 0.88);
  backdrop-filter: blur(18px);
}

.mobile-brand { display: none; }
.page-heading p { margin: 0 0 2px; color: var(--muted-2); font-size: 11px; }
.page-heading h1 { margin: 0; font-size: 18px; letter-spacing: 0.01em; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.system-status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-system-status); font-size: 12px; }
.system-clock { min-width: 40px; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-chip { padding: 4px 8px; border: 1px solid rgba(39, 212, 242, 0.25); border-radius: 5px; color: var(--cyan); background: rgba(39, 212, 242, 0.06); font-size: 9px; letter-spacing: 0.13em; }
.topbar-logout { display: none; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(255, 255, 255, 0.02); }
.topbar-logout:hover { color: var(--red); border-color: rgba(255, 107, 120, 0.3); }
.theme-toggle { display: inline-grid; width: 31px; height: 31px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.theme-toggle:hover { color: var(--cyan); border-color: var(--line-bright); background: rgba(39, 212, 242, 0.06); }

#main-content { width: 100%; max-width: 1680px; margin: 0 auto; padding: clamp(22px, 3vw, 40px); }
.page { animation: page-in 220ms ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.welcome-line,
.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.welcome-line h2,
.page-intro h2 { margin: 2px 0 3px; font-size: clamp(21px, 2vw, 28px); letter-spacing: -0.02em; }
.welcome-line p:not(.eyebrow),
.page-intro p:not(.eyebrow) { margin: 0; color: var(--muted); }
.eyebrow { margin: 0 !important; color: var(--cyan) !important; font-size: 9px !important; font-weight: 700; letter-spacing: 0.18em; }
.date-pill { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-date); font-size: 12px; font-variant-numeric: tabular-nums; }

.invite-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.invite-card,
.invite-banner {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid rgba(39, 212, 242, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(39, 212, 242, 0.12), rgba(70, 134, 255, 0.04) 68%),
    var(--surface);
  box-shadow: var(--shadow);
}

.invite-card::after,
.invite-banner::after { content: ""; position: absolute; width: 130px; height: 130px; right: -55px; top: -67px; border: 1px solid rgba(39, 212, 242, 0.12); border-radius: 50%; box-shadow: 0 0 0 24px rgba(39, 212, 242, 0.025), 0 0 0 49px rgba(39, 212, 242, 0.018); }
.invite-card.agent-invite { border-color: rgba(70, 134, 255, 0.25); background: linear-gradient(120deg, rgba(70, 134, 255, 0.14), rgba(39, 212, 242, 0.03) 70%), var(--surface); }
.invite-card.agent-invite[data-state="unavailable"],
.invite-card.agent-invite[data-state="forbidden"] { border-color: var(--line); background: var(--surface); }
.invite-card.agent-invite[data-state="unavailable"] strong,
.invite-card.agent-invite[data-state="forbidden"] strong { font-family: inherit; font-size: clamp(19px, 2vw, 24px); letter-spacing: 0; }
.invite-card > *, .invite-banner > * { position: relative; z-index: 1; }
.card-kicker { display: block; color: var(--text-card-kicker); font-size: 11px; }
.invite-card strong,
.invite-banner strong { display: block; margin: 3px 0; color: #e9fdff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: 0.12em; }
.invite-card p,
.invite-banner p { margin: 0; color: var(--muted); font-size: 12px; }
.invite-banner { margin-bottom: 14px; }

.copy-button,
.primary-button,
.secondary-button,
.danger-button,
.link-button,
.icon-button,
.table-action {
  border-radius: 8px;
  transition: 150ms ease;
}

.copy-button,
.primary-button { padding: 9px 14px; border: 1px solid rgba(39, 212, 242, 0.45); color: var(--text-primary-button); background: var(--cyan); box-shadow: 0 7px 20px rgba(39, 212, 242, 0.12); font-weight: 700; }
.copy-button:hover,
.primary-button:hover { border-color: var(--cyan-2); color: var(--text-primary-button-hover); background: var(--cyan-2); transform: translateY(-1px); }
.secondary-button { padding: 8px 13px; border: 1px solid var(--line-bright); color: var(--text-secondary-button); background: rgba(255, 255, 255, 0.02); }
.secondary-button:hover { color: var(--text); border-color: #3a6c88; background: rgba(255, 255, 255, 0.045); }
.danger-button { padding: 9px 14px; border: 1px solid rgba(255, 107, 120, 0.45); color: var(--text-danger-button); background: rgba(255, 107, 120, 0.14); }
.danger-button:hover { background: rgba(255, 107, 120, 0.24); }
.link-button { padding: 4px 0; border: 0; color: var(--cyan); background: transparent; font-size: 12px; }
.link-button:hover { color: var(--text-link-hover); }
.full-width { width: 100%; justify-content: center; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-grid.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  position: relative;
  min-width: 0;
  min-height: 130px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(18, 39, 59, 0.8), rgba(11, 25, 39, 0.92));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}
.metric-card::after { content: ""; position: absolute; inset: auto -35px -50px auto; width: 90px; height: 90px; border: 1px solid rgba(39, 212, 242, 0.06); border-radius: 50%; }
.metric-card.accent { border-color: rgba(39, 212, 242, 0.38); box-shadow: inset 0 0 30px rgba(39, 212, 242, 0.035), 0 12px 34px rgba(0, 0, 0, 0.18); }
.metric-card p { margin: 3px 0 10px; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; overflow: hidden; color: #effaff; font-size: clamp(19px, 2vw, 25px); text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { display: block; margin-top: 6px; color: var(--muted-2); font-size: 10px; }
.metric-card button { padding: 0; border: 0; color: var(--cyan); background: transparent; font-size: 10px; }
.metric-icon { position: absolute; right: 14px; top: 12px; display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(39, 212, 242, 0.16); border-radius: 8px; color: var(--cyan); background: rgba(39, 212, 242, 0.06); font-size: 12px; }
.metric-icon.queued { color: var(--yellow); border-color: rgba(243, 188, 88, 0.25); background: rgba(243, 188, 88, 0.07); }
.metric-icon.done { color: var(--green); border-color: rgba(53, 211, 154, 0.25); background: rgba(53, 211, 154, 0.07); }
.metric-icon.failed { color: var(--red); border-color: rgba(255, 107, 120, 0.25); background: rgba(255, 107, 120, 0.07); }

.overview-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.overview-columns.is-single { grid-template-columns: 1fr; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(13, 27, 42, 0.88); box-shadow: var(--shadow); }

.promotion-level-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 12px; border: 1px solid rgba(39, 212, 242, 0.24); border-radius: 999px; color: var(--cyan); background: rgba(39, 212, 242, 0.06); font-size: 11px; font-weight: 700; }
.promotion-installer-card { display: grid; grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr); min-height: 480px; }
.promotion-installer-visual { position: relative; display: grid; min-height: 480px; place-items: center; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(circle at 50% 46%, rgba(39, 212, 242, 0.18), transparent 12rem), linear-gradient(145deg, rgba(39, 212, 242, 0.065), rgba(70, 134, 255, 0.045)); }
.promotion-installer-visual::before { content: ""; position: absolute; width: 230px; height: 230px; border: 1px solid rgba(39, 212, 242, 0.16); border-radius: 50%; box-shadow: 0 0 0 34px rgba(39, 212, 242, 0.035), 0 0 0 68px rgba(39, 212, 242, 0.018); }
.promotion-installer-visual::after { content: "JY AGENT"; position: absolute; bottom: 36px; color: rgba(100, 231, 255, 0.55); font-size: 9px; font-weight: 800; letter-spacing: 0.28em; }
.promotion-installer-visual i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.promotion-installer-visual i:nth-of-type(1) { transform: translate(-117px, -96px); }
.promotion-installer-visual i:nth-of-type(2) { transform: translate(126px, 55px); }
.promotion-installer-visual i:nth-of-type(3) { transform: translate(-82px, 137px); }
.promotion-download-glyph { position: relative; z-index: 1; display: grid; width: 112px; height: 112px; place-items: center; border: 1px solid rgba(39, 212, 242, 0.4); border-radius: 30px; color: var(--cyan-2); background: linear-gradient(145deg, rgba(39, 212, 242, 0.16), rgba(70, 134, 255, 0.1)); box-shadow: inset 0 0 30px rgba(39, 212, 242, 0.07), 0 18px 50px rgba(0, 0, 0, 0.22); font-size: 47px; }
.promotion-installer-copy { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 58px); }
.promotion-installer-copy h3 { margin: 6px 0 8px; font-size: clamp(25px, 3vw, 38px); letter-spacing: -0.035em; }
.promotion-lead { max-width: 690px; margin: 0; color: var(--muted); line-height: 1.8; }
.promotion-release-version { display: inline-flex; width: fit-content; min-height: 29px; align-items: center; gap: 7px; margin: 13px 0 0; padding: 5px 10px; border: 1px solid rgba(39, 212, 242, 0.2); border-radius: 999px; color: var(--muted); background: rgba(39, 212, 242, 0.045); font-size: 10px; }
.promotion-release-version strong { color: var(--text-promotion-release); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: 0.02em; }
.promotion-identity { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 28px 0 20px; }
.promotion-identity div { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 18, 31, 0.5); }
.promotion-identity dt { color: var(--muted-2); font-size: 10px; }
.promotion-identity dd { margin: 4px 0 0; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
#promotion-invite-code { color: var(--text-promotion-code); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; }
.promotion-download-area { display: flex; min-width: 0; align-items: center; gap: 14px; flex-wrap: wrap; }
.promotion-download { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.promotion-download.is-disabled { cursor: not-allowed; pointer-events: none; border-color: var(--line-bright); color: var(--muted-2); background: var(--surface-2); box-shadow: none; opacity: 0.72; transform: none; }
.promotion-download-status { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: 11px; }
.promotion-download-status[data-state="ready"] { color: var(--green); }
.promotion-download-status[data-state="error"] { color: var(--red); }
.promotion-filename-warning { margin-top: 22px; padding: 15px 16px; border: 1px solid rgba(255, 177, 66, 0.45); border-radius: 10px; background: rgba(255, 177, 66, 0.1); box-shadow: inset 3px 0 0 rgba(255, 177, 66, 0.72); }
.promotion-filename-warning strong { color: #ffc46e; font-size: 12px; }
.promotion-filename-warning p { margin: 5px 0 0; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.75; }
.promotion-binding-note { margin-top: 24px; padding: 14px 16px; border: 1px solid rgba(39, 212, 242, 0.16); border-radius: 10px; background: rgba(39, 212, 242, 0.045); }
.promotion-binding-note strong { color: var(--text-promotion-code); font-size: 11px; }
.promotion-binding-note p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-header { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-header > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.panel-header h3,
.table-toolbar h3 { margin: 0; font-size: 14px; }
.panel-header p,
.table-toolbar p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.section-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid rgba(39, 212, 242, 0.2); border-radius: 8px; color: var(--cyan); background: rgba(39, 212, 242, 0.06); }

.compact-list > div { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; min-height: 58px; padding: 9px 16px; border-bottom: 1px solid rgba(29, 52, 74, 0.65); }
.compact-list > div:last-child { border-bottom: 0; }
.mini-avatar { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.mini-avatar.cyan { color: var(--text-mini-avatar-cyan); border-color: rgba(39, 212, 242, 0.3); background: rgba(39, 212, 242, 0.1); }
.mini-avatar.blue,
.mini-avatar.purple { color: var(--text-mini-avatar-accent); }
.compact-list strong,
.compact-list small { display: block; }
.compact-list strong { font-size: 12px; }
.compact-list small { color: var(--muted-2); font-size: 10px; }
.compact-money { text-align: right; }
.compact-money strong { color: var(--cyan); }

.status { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 2px 7px; border: 1px solid transparent; border-radius: 99px; font-size: 10px; white-space: nowrap; }
.status.online,
.status.success { color: var(--text-status-success); border-color: rgba(53, 211, 154, 0.22); background: rgba(53, 211, 154, 0.09); }
.status.online::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.status.offline,
.status.normal { color: var(--text-status-normal); border-color: rgba(132, 153, 170, 0.18); background: rgba(132, 153, 170, 0.07); }
.status.vip,
.status.info { color: var(--text-status-info); border-color: rgba(39, 212, 242, 0.22); background: rgba(39, 212, 242, 0.08); }
.status.warning { color: var(--text-status-warning); border-color: rgba(243, 188, 88, 0.23); background: rgba(243, 188, 88, 0.09); }
.status.danger { color: var(--text-status-danger); border-color: rgba(255, 107, 120, 0.23); background: rgba(255, 107, 120, 0.09); }

.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wide-table { min-width: 1180px; }
th { padding: 11px 14px; color: var(--text-table-head); background: var(--surface-table-head); font-size: 10px; font-weight: 600; letter-spacing: 0.02em; text-align: left; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid rgba(29, 52, 74, 0.62); color: var(--text-table-cell); white-space: nowrap; }
tbody tr { transition: 120ms ease; }
tbody tr:hover { background: rgba(39, 212, 242, 0.025); }
td.money,
.money { color: var(--cyan); font-weight: 700; }

.table-panel { margin-top: 14px; }
.table-toolbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.training-refresh-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.training-refresh-meta { display: grid; gap: 4px; color: var(--muted); font-size: 10px; text-align: right; }
.training-refresh-meta .status { justify-self: end; }
.training-refresh-meta .status.warning { padding-inline: 7px; }
.table-summary { color: var(--muted); font-size: 10px; white-space: nowrap; }
.limit-request-toolbar-meta { display: grid; justify-items: end; gap: 4px; }
.limit-request-toolbar-meta .status { text-align: right; }
.search-box { display: flex; min-width: min(320px, 100%); align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-search); }
.search-box > span:first-child { color: var(--muted); font-size: 17px; }
.search-box input { width: 100%; min-width: 0; padding: 9px 0; border: 0; outline: 0; color: var(--text); background: transparent; }
input::placeholder,
textarea::placeholder { color: #526879; }
.filter-row { display: flex; gap: 8px; }

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-input);
}
select { padding: 8px 30px 8px 10px; }

.summary-chips { display: flex; gap: 8px; }
.summary-chips span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(13, 27, 42, 0.7); font-size: 11px; }
.summary-chips strong { color: var(--text); }

.focus-toggle { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; color: #587185; background: rgba(255, 255, 255, 0.02); font-size: 15px; }
.focus-toggle.is-active { color: var(--yellow); border-color: rgba(243, 188, 88, 0.28); background: rgba(243, 188, 88, 0.08); }
.note-cell { display: flex; gap: 6px; }
.agent-note-text { display: block; min-width: 120px; max-width: 220px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-cell input { width: 160px; padding: 7px 8px; }
.note-cell button,
.table-action { padding: 6px 8px; border: 1px solid var(--line); color: var(--text-table-action); background: rgba(255, 255, 255, 0.025); font-size: 10px; }
.note-cell button:hover,
.table-action:hover { color: var(--cyan); border-color: rgba(39, 212, 242, 0.35); }
.table-action.danger:hover { color: var(--red); border-color: rgba(255, 107, 120, 0.3); }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.commission-cell { display: grid; min-width: 215px; gap: 4px; }
.commission-cell > strong { color: var(--cyan); }
.commission-cell > small { color: var(--muted); line-height: 1.45; white-space: normal; }
.customer-tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.customer-tool-grid button { display: grid; gap: 5px; min-height: 126px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: rgba(255, 255, 255, 0.025); text-align: left; }
.customer-tool-grid button:hover { border-color: rgba(39, 212, 242, 0.38); background: rgba(39, 212, 242, 0.07); }
.customer-tool-grid button:disabled { cursor: not-allowed; opacity: 0.48; }
.customer-tool-grid button > span { color: var(--cyan); font-size: 24px; }
.customer-tool-grid button > strong { font-size: 13px; }
.customer-tool-grid button > small { color: var(--muted); line-height: 1.5; }
.customer-limit-request-grid { margin-top: 12px; }
.customer-limit-request-grid > .modal-tip { margin-bottom: 10px; }
.customer-tool-limit,
#customer-tool-result { color: var(--text-status-warning); border-color: rgba(243, 188, 88, 0.28); background: rgba(243, 188, 88, 0.07); }

.pagination { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.pagination button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-pagination); background: rgba(255, 255, 255, 0.02); }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

.empty-state { padding: 54px 20px; color: var(--muted); text-align: center; }
.empty-state span { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 26px; }
.empty-state strong { display: block; color: var(--text-empty-state); }
.empty-state p { margin: 4px 0; font-size: 11px; }
.limit-request-empty-state { padding: 40px 20px; color: var(--muted); text-align: center; }
.limit-request-empty-state span { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 26px; }
.limit-request-empty-state strong { display: block; color: var(--text-empty-state); }
.limit-request-empty-state p { margin: 4px 0; font-size: 11px; }

.auto-note,
.security-note { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(13, 27, 42, 0.65); font-size: 11px; }

.segmented-filter { display: flex; flex-wrap: wrap; gap: 5px; }
.segmented-filter button,
.finance-tabs button { padding: 7px 11px; border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, 0.015); font-size: 11px; }
.segmented-filter button { border-radius: 7px; }
.segmented-filter button:hover,
.segmented-filter button.is-active { color: var(--cyan); border-color: rgba(39, 212, 242, 0.32); background: rgba(39, 212, 242, 0.08); }
.progress-cell { min-width: 116px; }
.task-progress { width: 76px; height: 6px; margin-right: 6px; vertical-align: middle; accent-color: var(--cyan); }
.task-progress.failed { accent-color: var(--red); }

.wallet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wallet-card { min-height: 142px; padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(150deg, rgba(18, 39, 59, 0.85), rgba(10, 23, 36, 0.95)); box-shadow: var(--shadow); }
.wallet-card.primary { border-color: rgba(39, 212, 242, 0.38); background: linear-gradient(145deg, rgba(39, 212, 242, 0.13), rgba(10, 23, 36, 0.95)); }
.wallet-card p { margin: 0 0 12px; color: var(--muted); }
.wallet-card strong { display: block; font-size: clamp(21px, 2.4vw, 29px); }
.wallet-card span { display: block; margin-top: 9px; color: var(--muted-2); font-size: 10px; }
.wallet-card button { margin-top: 8px; padding: 0; border: 0; color: var(--cyan); background: transparent; font-size: 11px; }

.finance-tabs { display: flex; margin: 20px 0 14px; border-bottom: 1px solid var(--line); }
.finance-tabs button { position: relative; min-width: 106px; border: 0; background: transparent; }
.finance-tabs button.is-active { color: var(--cyan); }
.finance-tabs button.is-active::after { content: ""; position: absolute; inset: auto 12px -1px; height: 2px; background: var(--cyan); box-shadow: 0 0 8px rgba(39, 212, 242, 0.5); }
.finance-panel { animation: page-in 180ms ease-out; }
.finance-two-column { display: grid; grid-template-columns: minmax(300px, 0.72fr) minmax(480px, 1.28fr); gap: 14px; }
.withdrawal-card form { padding: 17px; }
.withdrawal-card form > label { display: block; margin-bottom: 7px; color: var(--text-withdrawal-label); font-size: 12px; }
.notice-box { margin: 16px; padding: 13px 15px; border: 1px solid rgba(39, 212, 242, 0.17); border-radius: 10px; color: var(--text-notice); background: rgba(39, 212, 242, 0.045); font-size: 11px; }
.notice-box strong { color: var(--text-notice-strong); }
.notice-box ul { margin: 7px 0 0; padding-left: 18px; }
.settlement-note { margin: 0 16px; padding: 12px 14px; border: 1px solid rgba(70, 134, 255, 0.2); border-radius: 10px; background: rgba(70, 134, 255, 0.055); }
.settlement-note strong { color: var(--text-settlement-strong); font-size: 12px; }
.settlement-note p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.amount-input { display: grid; grid-template-columns: auto 1fr auto; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #081522; }
.amount-input > span { padding-left: 12px; color: var(--cyan); font-size: 18px; }
.amount-input input { width: 100%; min-width: 0; padding: 11px 8px; border: 0; outline: 0; background: transparent; font-size: 18px; }
.amount-input button { margin-right: 7px; padding: 5px 8px; border: 1px solid rgba(39, 212, 242, 0.2); border-radius: 6px; color: var(--cyan); background: rgba(39, 212, 242, 0.06); font-size: 10px; }
.withdrawal-card .primary-button { margin-top: 12px; }

.payout-panel { display: grid; grid-template-columns: minmax(280px, 0.72fr) minmax(320px, 1.28fr); min-height: 310px; }
.payout-visual { display: flex; flex-direction: column; justify-content: flex-end; min-height: 310px; padding: 28px; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(circle at 28% 22%, rgba(39, 212, 242, 0.19), transparent 15rem), linear-gradient(145deg, #0d2a3a, #0a1927); }
.payout-visual > span { width: fit-content; padding: 5px 9px; border: 1px solid rgba(39, 212, 242, 0.3); border-radius: 7px; color: var(--cyan); background: rgba(39, 212, 242, 0.07); }
.payout-visual strong { margin-top: auto; font-size: 22px; }
.payout-visual small { margin-top: 4px; color: var(--muted); }
.payout-copy { padding: 34px; }
.payout-copy h3 { margin: 16px 0 5px; font-size: 20px; }
.payout-copy p,
.payout-copy li { color: var(--muted); }
.payout-copy ul { padding-left: 19px; }
.payout-copy .primary-button { margin-top: 10px; }
.payout-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.payout-account-card { min-width: 0; padding: 24px; overflow-wrap: anywhere; }
.payout-account-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payout-provider { display: inline-flex; width: fit-content; align-items: center; min-height: 28px; padding: 5px 10px; border: 1px solid rgba(39, 212, 242, 0.25); border-radius: 8px; color: var(--cyan); background: rgba(39, 212, 242, 0.07); font-size: 11px; font-weight: 700; }
.payout-provider.wechat { border-color: rgba(53, 211, 154, 0.25); color: var(--green); background: rgba(53, 211, 154, 0.065); }
.payout-account-card h3 { margin: 20px 0 7px; font-size: 20px; }
.payout-account-card > strong { display: block; min-height: 30px; color: #e9fdff; font-size: clamp(19px, 2vw, 24px); }
.payout-account-card > p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.payout-account-card .payout-lock-note { min-height: 42px; color: var(--muted-2); font-size: 11px; }
.payout-account-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.payout-account-card > .primary-button,
.payout-account-actions { margin-top: 20px; }
.account-rule-note { margin: 13px 2px 0; color: var(--muted); font-size: 11px; }
.readonly-output { display: flex; min-height: 42px; align-items: center; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: rgba(5, 14, 24, 0.72); font-size: 12px; }
.payout-file-field input[type="file"] { padding: 8px; }
.payout-file-field small { color: var(--muted-2); line-height: 1.5; }
.payout-qr-preview { margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; text-align: center; background: rgba(5, 14, 24, 0.48); }
.payout-qr-preview img,
.saved-payout-qr { display: block; width: auto; max-width: min(220px, 100%); max-height: 300px; margin: 0 auto; border: 1px solid var(--line); border-radius: 9px; object-fit: contain; background: #fff; }
.payout-qr-preview figcaption { margin: 9px 0; color: var(--muted); font-size: 11px; }
.saved-payout-qr { margin-block: 6px 18px; }

.form-error { margin: 8px 0 0; color: var(--text-form-error); font-size: 11px; }
.intro-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty-inline { margin: 0; padding: 18px; color: var(--muted); }
.text-link-button { border: 0; color: var(--cyan); background: transparent; }
.text-link-button:hover { color: var(--text-link-hover); }

.mobile-nav { display: none; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7fb;
  --bg-soft: #edf4f9;
  --sidebar: #f7fbfe;
  --surface: #ffffff;
  --surface-2: #eef5fa;
  --surface-3: #e4eff6;
  --line: #d3e1eb;
  --line-bright: #abc3d3;
  --text: #152838;
  --muted: #5b7182;
  --muted-2: #526f80;
  --cyan: #08758f;
  --cyan-2: #009cc2;
  --blue: #2d67ca;
  --green: #137953;
  --yellow: #9b6814;
  --red: #be3948;
  --surface-date: #ffffff;
  --surface-table-head: #e7f0f5;
  --surface-search: #f9fcfe;
  --surface-input: #f9fcfe;
  --surface-modal: #ffffff;
  --surface-modal-header: #eef5fa;
  --surface-toast: rgba(255, 255, 255, 0.98);
  --surface-login-screen: #f3f7fb;
  --surface-login-card: rgba(255, 255, 255, 0.96);
  --text-table-head: #37586b;
  --text-table-cell: #36596c;
  --text-form-label: #35566a;
  --text-login-label: #35566a;
  --text-modal-tip: #3d6275;
  --text-modal-body: #3d5a6c;
  --text-modal-detail: #1d3b4d;
  --text-toast: #24475a;
  --text-primary-button: #ffffff;
  --text-primary-button-hover: #06141d;
  --text-secondary-button: #31566b;
  --text-danger-button: #9f2839;
  --text-status-success: #11794f;
  --text-status-normal: #4f6471;
  --text-status-info: #00627c;
  --text-status-warning: #8d5c00;
  --text-status-danger: #9f3341;
  --text-table-action: #355d73;
  --text-pagination: #4f6471;
  --text-form-error: #aa3140;
  --text-promotion-code: #00647e;
  --text-card-kicker: #476779;
  --text-promotion-release: #00647e;
  --text-link-hover: #00647e;
  --text-avatar: #315d82;
  --text-mini-avatar-cyan: #006278;
  --text-mini-avatar-accent: #315d82;
  --text-nav-count: #49697b;
  --text-system-status: #31566b;
  --text-empty-state: #31566b;
  --text-withdrawal-label: #35566a;
  --text-notice: #3b6072;
  --text-notice-strong: #235367;
  --text-settlement-strong: #2d4d73;
  --shadow: 0 18px 42px rgba(39, 72, 94, 0.1);
}
html[data-theme="light"] body { background: radial-gradient(circle at 82% -20%, rgba(0, 156, 194, 0.09), transparent 32rem), linear-gradient(180deg, #f8fbfd, var(--bg) 38rem); }
html[data-theme="light"] .sidebar { background: rgba(248, 252, 255, 0.98); box-shadow: 16px 0 40px rgba(39, 72, 94, 0.07); }
html[data-theme="light"] .topbar { border-bottom-color: rgba(211, 225, 235, 0.92); background: rgba(247, 251, 254, 0.9); }
html[data-theme="light"] .agent-card { background: linear-gradient(135deg, rgba(0, 156, 194, 0.075), rgba(238, 245, 250, 0.86)); }
html[data-theme="light"] .nav-button:hover { background: rgba(21, 40, 56, 0.045); }
html[data-theme="light"] .nav-button.is-active { color: #075b72; border-color: rgba(0, 156, 194, 0.22); background: linear-gradient(90deg, rgba(0, 156, 194, 0.13), rgba(0, 156, 194, 0.035)); }
html[data-theme="light"] .nav-count { color: #49697b; background: rgba(21, 40, 56, 0.06); }
html[data-theme="light"] .panel { background: rgba(255, 255, 255, 0.92); }
html[data-theme="light"] .summary-chips span,
html[data-theme="light"] .auto-note,
html[data-theme="light"] .security-note { background: var(--surface-2); }
html[data-theme="light"] .wallet-card { background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(238, 245, 250, 0.92)); }
html[data-theme="light"] .wallet-card.primary { background: linear-gradient(145deg, rgba(0, 156, 194, 0.1), rgba(238, 245, 250, 0.95)); }
html[data-theme="light"] .amount-input { background: #f9fcfe; }
html[data-theme="light"] .payout-visual { background: radial-gradient(circle at 28% 22%, rgba(0, 156, 194, 0.14), transparent 15rem), linear-gradient(145deg, #e5f4f7, #f3f8fb); }
html[data-theme="light"] .invite-card,
html[data-theme="light"] .invite-banner { background: linear-gradient(120deg, rgba(0, 156, 194, 0.1), rgba(45, 103, 202, 0.035) 68%), var(--surface); }
html[data-theme="light"] .invite-card strong,
html[data-theme="light"] .invite-banner strong,
html[data-theme="light"] .metric-card strong,
html[data-theme="light"] .wallet-card strong,
html[data-theme="light"] .payout-account-card > strong { color: var(--text); }
html[data-theme="light"] .metric-card { background: linear-gradient(155deg, rgba(255, 255, 255, 0.96), rgba(238, 245, 250, 0.92)); box-shadow: 0 10px 28px rgba(39, 72, 94, 0.08); }
html[data-theme="light"] .promotion-installer-visual { background: radial-gradient(circle at 50% 46%, rgba(0, 156, 194, 0.14), transparent 12rem), linear-gradient(145deg, rgba(0, 156, 194, 0.045), rgba(45, 103, 202, 0.035)); }
html[data-theme="light"] .promotion-download-glyph { color: #087f9d; background: linear-gradient(145deg, rgba(0, 156, 194, 0.13), rgba(45, 103, 202, 0.08)); box-shadow: inset 0 0 30px rgba(0, 156, 194, 0.06), 0 18px 42px rgba(39, 72, 94, 0.13); }
html[data-theme="light"] .promotion-identity div { background: rgba(238, 245, 250, 0.72); }
html[data-theme="light"] .promotion-binding-note { background: rgba(0, 156, 194, 0.045); }
html[data-theme="light"] .promotion-filename-warning { border-color: rgba(180, 105, 0, 0.36); background: rgba(212, 132, 12, 0.08); box-shadow: inset 3px 0 0 rgba(180, 105, 0, 0.62); }
html[data-theme="light"] .promotion-filename-warning strong { color: #915800; }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .readonly-output { color: var(--text); background: #f9fcfe; }
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .topbar-logout { background: rgba(21, 40, 56, 0.025); }
html[data-theme="light"] .demo-chip { color: #087f9d; background: rgba(0, 156, 194, 0.06); }

.modal {
  width: min(600px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 15px;
  color: var(--text);
  background: var(--surface-modal);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.modal::backdrop { background: rgba(2, 8, 14, 0.78); backdrop-filter: blur(5px); }
.modal-shell { max-height: calc(100vh - 30px); overflow-y: auto; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); background: var(--surface-modal-header); }
.modal header h2 { margin: 2px 0 0; font-size: 18px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, 0.02); font-size: 22px; line-height: 1; }
.icon-button:hover { color: var(--text); border-color: var(--line-bright); }
.modal-content { padding: 22px; }
.modal-tip { margin: 0 0 17px; padding: 10px 12px; border: 1px solid rgba(39, 212, 242, 0.15); border-radius: 8px; color: var(--text-modal-tip); background: rgba(39, 212, 242, 0.04); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; color: var(--text-form-label); font-size: 11px; }
.form-grid input,
.form-grid select,
.form-grid textarea { width: 100%; padding: 10px 11px; resize: vertical; }
.full-field { grid-column: 1 / -1; }
.code-field { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.code-field button { padding: 0 10px; border: 1px solid rgba(39, 212, 242, 0.25); border-radius: 8px; color: var(--cyan); background: rgba(39, 212, 242, 0.06); font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; }
.warning-visual { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 15px; border: 1px solid rgba(255, 107, 120, 0.3); border-radius: 50%; color: var(--red); background: rgba(255, 107, 120, 0.09); font-size: 22px; font-weight: 800; }
.warning-visual.neutral { color: var(--yellow); border-color: rgba(243, 188, 88, 0.3); background: rgba(243, 188, 88, 0.08); }
[data-modal="customer-unbind"] > p,
[data-modal="logout"] > p { max-width: 440px; margin: 0 auto; color: var(--text-modal-body); text-align: center; }
.modal-field { display: grid; gap: 6px; margin-top: 16px; color: var(--text-form-label); font-size: 11px; }
.modal-field input,
.modal-field textarea { width: 100%; padding: 10px 11px; }
.modal-field textarea { resize: vertical; }
.modal-field > small { color: var(--muted); font-size: 10px; text-align: right; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.detail-grid div { min-width: 0; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid div:nth-child(2n) { border-right: 0; }
.detail-grid span,
.detail-grid strong { display: block; }
.detail-grid span { color: var(--muted); font-size: 10px; }
.detail-grid strong { margin-top: 3px; overflow: hidden; color: var(--text-modal-detail); text-overflow: ellipsis; }
.confirm-amount { padding: 25px; border: 1px solid rgba(39, 212, 242, 0.18); border-radius: 12px; background: rgba(39, 212, 242, 0.04); text-align: center; }
.confirm-amount span,
.confirm-amount small { display: block; color: var(--muted); }
.confirm-amount strong { display: block; margin: 6px; color: var(--cyan); font-size: 31px; }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; width: min(350px, calc(100vw - 32px)); gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border: 1px solid rgba(39, 212, 242, 0.25); border-radius: 9px; color: var(--text-toast); background: var(--surface-toast); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38); animation: toast-in 180ms ease-out; }
.toast::before { content: "✓"; color: var(--cyan); font-weight: 800; }
.toast.error { border-color: rgba(255, 107, 120, 0.3); }
.toast.error::before { content: "!"; color: var(--red); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: 180ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

.login-screen { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; overflow-x: hidden; overflow-y: auto; background: radial-gradient(circle at 50% 25%, rgba(39, 212, 242, 0.12), transparent 25rem), var(--surface-login-screen); }
.login-orbit { position: absolute; width: min(680px, 90vw); height: min(680px, 90vw); border: 1px solid rgba(39, 212, 242, 0.05); border-radius: 50%; box-shadow: 0 0 0 70px rgba(39, 212, 242, 0.018), 0 0 0 140px rgba(39, 212, 242, 0.01); }
.login-card { position: relative; width: min(420px, 100%); padding: 30px; border: 1px solid rgba(39, 212, 242, 0.22); border-radius: 16px; background: var(--surface-login-card); box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5); }
.login-brand { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-card h1 { margin: 4px 0; font-size: 25px; }
.login-card > p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); }
.login-card form { display: grid; gap: 8px; }
.login-card label { margin-top: 7px; color: var(--text-login-label); font-size: 11px; }
.login-card input { width: 100%; padding: 11px 12px; }
.login-card button { margin-top: 10px; }
.login-card > small { display: block; margin-top: 16px; color: var(--muted-2); text-align: center; }
.application-card { width: min(720px, 100%); margin-block: 20px; }
.application-card .form-grid { gap: 10px 14px; }
.application-card textarea { width: 100%; padding: 10px 11px; resize: vertical; }
.legal-consent { padding: 12px; border: 1px solid rgba(39, 212, 242, 0.16); border-radius: 10px; background: rgba(39, 212, 242, 0.04); }
.legal-consent p { margin: 0 0 7px; color: var(--muted); }
.legal-consent a { color: var(--cyan); }
.legal-consent small { color: var(--muted-2); }
.legal-consent .check-line { display: flex; align-items: flex-start; flex-direction: row; gap: 8px; margin-top: 10px; }
.legal-consent .check-line input { width: auto; margin-top: 2px; }
.application-success { padding: 20px 0 4px; text-align: center; }
.application-success > span { display: grid; width: 54px; height: 54px; place-items: center; margin: 0 auto 14px; border: 1px solid rgba(53, 211, 154, 0.35); border-radius: 50%; color: var(--green); background: rgba(53, 211, 154, 0.08); font-size: 26px; }
.application-success p { color: var(--muted); }

@media (max-width: 1280px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-two-column { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 210px; }
  .overview-columns,
  .invite-grid { grid-template-columns: 1fr; }
  .topbar-actions .system-status,
  .system-clock { display: none; }
  .payout-panel { grid-template-columns: 1fr; }
  .payout-account-grid { grid-template-columns: 1fr; }
  .payout-visual { min-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 700px) {
  body { background: var(--bg); }
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding-bottom: 72px; }
  .topbar { min-height: 62px; padding: 8px 14px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .page-heading { display: none; }
  .topbar-actions { margin-left: auto; }
  .demo-chip { font-size: 8px; }
  .topbar-logout { display: inline-grid; place-items: center; }
  #main-content { padding: 17px 14px 24px; }
  .page[data-page="promotion"] { padding-bottom: 92px; }
  .welcome-line,
  .page-intro { align-items: flex-start; margin-bottom: 17px; }
  .welcome-line { flex-direction: column; gap: 10px; }
  .date-pill { display: none; }
  .page-intro > :last-child:not(.summary-chips) { flex: 0 0 auto; }
  .training-refresh-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .training-refresh-meta { text-align: left; }
  .training-refresh-meta .status { justify-self: start; }
  .training-refresh-actions .secondary-button { width: 100%; }
  .limit-request-toolbar-meta { justify-items: start; }
  .limit-request-toolbar-meta .status { text-align: left; }
  .page-intro h2 { font-size: 22px; }
  .page-intro p:not(.eyebrow) { font-size: 12px; }
  .summary-chips { display: none; }
  .invite-card,
  .invite-banner { align-items: flex-start; padding: 17px; }
  .invite-card { flex-direction: column; }
  .invite-card .copy-button { width: 100%; }
  .invite-banner { flex-wrap: wrap; }
  .invite-banner .copy-button { width: 100%; }
  .metric-grid,
  .metric-grid.four-columns,
  .wallet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-card { min-height: 115px; padding: 14px; }
  .metric-card p { padding-right: 22px; font-size: 11px; }
  .metric-card strong { font-size: 18px; }
  .metric-card small { white-space: normal; }
  .overview-columns { gap: 10px; }
  .panel { border-radius: 11px; }
  .panel-header { min-height: 58px; padding: 12px; }
  .panel-header p { display: none; }
  .compact-list > div { padding-inline: 12px; }
  .compact-list .status:nth-last-child(1) { display: none; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-toolbar > .search-box,
  .search-box { min-width: 0; width: 100%; }
  .filter-row { display: grid; grid-template-columns: 1fr 1fr auto; }
  .filter-row select { width: 100%; min-width: 0; }
  .stacked-mobile { gap: 10px; }
  .segmented-filter { display: grid; grid-template-columns: repeat(3, 1fr); }
  .segmented-filter button { padding-inline: 5px; }
  .finance-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .finance-tabs button { min-width: 0; }
  .finance-two-column { grid-template-columns: 1fr; }
  .payout-panel { display: block; }
  .payout-copy { padding: 20px; }
  .payout-account-card { padding: 20px; }
  .payout-account-actions { align-items: stretch; flex-direction: column; }
  .payout-account-actions button { width: 100%; min-height: 44px; }
  .promotion-installer-card { grid-template-columns: 1fr; min-height: 0; }
  .promotion-installer-visual { min-height: 205px; border-right: 0; border-bottom: 1px solid var(--line); }
  .promotion-installer-visual::before { width: 154px; height: 154px; box-shadow: 0 0 0 25px rgba(39, 212, 242, 0.03), 0 0 0 50px rgba(39, 212, 242, 0.015); }
  .promotion-installer-visual::after { bottom: 18px; }
  .promotion-installer-visual i:nth-of-type(1) { transform: translate(-92px, -54px); }
  .promotion-installer-visual i:nth-of-type(2) { transform: translate(98px, 38px); }
  .promotion-installer-visual i:nth-of-type(3) { transform: translate(-70px, 74px); }
  .promotion-download-glyph { width: 82px; height: 82px; border-radius: 23px; font-size: 35px; }
  .promotion-installer-copy { padding: 24px 19px; }
  .promotion-installer-copy h3 { font-size: 26px; }
  .promotion-identity { grid-template-columns: 1fr; margin-block: 21px 17px; }
  .promotion-download-area { align-items: stretch; flex-direction: column; }
  .promotion-download { width: 100%; }
  .promotion-download-status { flex: 0 1 auto; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .modal-content { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .modal-actions { flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid div,
  .detail-grid div:nth-child(2n) { border-right: 0; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 25; display: grid; grid-template-columns: repeat(6, 1fr); min-height: 64px; padding: 5px 5px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(6, 16, 28, 0.96); backdrop-filter: blur(18px); }
  #app[data-agent-level="2"] .mobile-nav { grid-template-columns: repeat(5, 1fr); }
  html[data-theme="light"] .mobile-nav { background: rgba(247, 251, 254, 0.96); }
  .mobile-nav .nav-button { display: flex; min-width: 0; min-height: 52px; align-items: center; justify-content: center; flex-direction: column; gap: 1px; margin: 0; padding: 3px 1px; border-radius: 7px; }
  .mobile-nav .nav-button::before { display: none; }
  .mobile-nav .nav-button > span:first-child { width: auto; font-size: 17px; }
  .mobile-nav small { font-size: 9px; }
  .toast-region { right: 12px; bottom: 78px; }
}

@media (max-width: 390px) {
  #main-content { padding-inline: 12px; }
  .topbar { padding-inline: 12px; }
  .welcome-line h2 { font-size: 21px; }
  .invite-card strong,
  .invite-banner strong { font-size: 20px; }
  .metric-grid,
  .metric-grid.four-columns,
  .wallet-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 108px; }
  .metric-card strong { font-size: 17px; }
  .compact-list > div { grid-template-columns: auto minmax(0, 1fr) auto; }
  .compact-list > div > :last-child:not(.status) { grid-column: 3; }
  .compact-list > div > .status:nth-last-child(2) { display: none; }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .filter-row .secondary-button { grid-column: 1 / -1; }
  .login-card { padding: 23px 19px; }
}

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