/* 星梦岛 · 授权运营后台 — design system v2 (ui-ux-pro-max: B2B dashboard) */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --vf-font: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --vf-mono: "IBM Plex Mono", ui-monospace, monospace;

  --vf-bg: #0c1222;
  --vf-bg-elevated: #111827;
  --vf-surface: #151d2e;
  --vf-surface-hover: #1a2438;
  --vf-surface-inset: #0f1628;

  --vf-border: rgba(148, 163, 184, 0.12);
  --vf-border-strong: rgba(148, 163, 184, 0.22);

  --vf-text: #f1f5f9;
  --vf-text-secondary: #94a3b8;
  --vf-text-muted: #64748b;
  --vf-label: #7dd3fc;

  --vf-primary: #0284c7;
  --vf-primary-hover: #0ea5e9;
  --vf-primary-muted: rgba(2, 132, 199, 0.15);
  --vf-accent: #38bdf8;

  --vf-success: #34d399;
  --vf-success-bg: rgba(52, 211, 153, 0.12);
  --vf-warn: #fbbf24;
  --vf-warn-bg: rgba(251, 191, 36, 0.12);
  --vf-danger: #f87171;
  --vf-danger-bg: rgba(248, 113, 113, 0.12);
  --vf-info-bg: rgba(56, 189, 248, 0.1);

  --vf-radius: 8px;
  --vf-radius-sm: 6px;
  --vf-usgs-blue: #0077b6;
  --vf-usgs-teal: #00a896;
  --vf-radius-lg: 16px;
  --vf-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 40px rgba(0, 0, 0, 0.25);
  --vf-sidebar-w: 228px;
  --vf-topbar-h: 52px;
  --vf-content-max: 1440px;
  --vf-space-1: 4px;
  --vf-space-2: 8px;
  --vf-space-3: 12px;
  --vf-space-4: 16px;
  --vf-space-5: 20px;
  --vf-space-6: 24px;
  --vf-space-8: 32px;
  --vf-transition: 0.2s ease;
}

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

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--vf-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--vf-text);
  background: var(--vf-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(2, 132, 199, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 35% at 100% 10%, rgba(56, 189, 248, 0.06), transparent 45%),
    var(--vf-bg);
}

.vf-admin-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— Login —— */
.vf-admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--vf-space-6);
}

.vf-admin-login__card {
  width: min(420px, 100%);
  padding: var(--vf-space-8) var(--vf-space-6);
  border-radius: var(--vf-radius-lg);
  background: var(--vf-surface);
  border: 1px solid var(--vf-border);
  box-shadow: var(--vf-shadow);
}

.vf-admin-login__brand {
  font-family: var(--vf-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--vf-accent);
  margin-bottom: var(--vf-space-2);
}

.vf-admin-login__title {
  margin: 0 0 var(--vf-space-2);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.vf-admin-login__sub {
  margin: 0 0 var(--vf-space-6);
  color: var(--vf-text-secondary);
  font-size: 0.92rem;
}

.vf-login-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-2);
  margin-bottom: var(--vf-space-5);
}

.vf-login-features span {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--vf-surface-inset);
  border: 1px solid var(--vf-border);
  color: var(--vf-text-secondary);
}

/* —— Shell layout (sidebar + main only; backdrop/toggle live outside grid) —— */
.vf-admin-shell {
  display: grid;
  grid-template-columns: var(--vf-sidebar-w) minmax(0, 1fr);
  grid-template-rows: 1fr;
  grid-template-areas: "sidebar main";
  min-height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.vf-admin-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--vf-space-4) var(--vf-space-3);
  border-right: 1px solid var(--vf-border);
  background: var(--vf-bg-elevated);
  overflow: hidden;
  z-index: 40;
}

.vf-admin-sidebar__brand {
  padding: var(--vf-space-2) var(--vf-space-2) var(--vf-space-3);
  margin-bottom: var(--vf-space-1);
  border-bottom: 1px solid var(--vf-border);
}

.vf-admin-sidebar__brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vf-admin-sidebar__brand p {
  margin: var(--vf-space-1) 0 0;
  font-size: 0.8rem;
  color: var(--vf-text-muted);
}

.vf-brand-block__link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.vf-brand-block__link:hover .vf-brand-block__name {
  color: var(--vf-accent);
}

.vf-brand-block__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

.vf-brand-block__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.vf-brand-block__name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--vf-text);
}

.vf-brand-block__sub {
  font-size: 0.72rem;
  color: var(--vf-text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf-brand-block__meta {
  margin: var(--vf-space-2) 0 0;
  padding-left: 46px;
  font-size: 0.68rem;
  color: var(--vf-text-muted);
  line-height: 1.35;
}

.vf-login-brand-row {
  display: flex;
  align-items: center;
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-4);
}

.vf-login-brand-row .vf-admin-login__brand {
  margin-bottom: 0;
}

.vf-login-brand-row .vf-admin-login__title {
  margin: 0;
  font-size: 1.35rem;
}

.vf-key-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 0 var(--vf-space-3);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--vf-text-secondary);
  background: var(--vf-info-bg);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--vf-radius-sm);
}

.vf-key-tip strong {
  color: var(--vf-accent);
  font-weight: 600;
}

.vf-admin-shell--compact {
  --vf-sidebar-w: 212px;
}

.vf-admin-shell--compact .vf-admin-sidebar {
  padding: var(--vf-space-2);
}

.vf-admin-shell--compact .vf-nav-item__desc {
  display: none;
}

.vf-admin-shell--compact .vf-admin-nav--v3 button {
  padding: 6px var(--vf-space-2);
}

.vf-admin-shell--compact .vf-admin-nav--v3 .vf-nav-item__icon {
  width: 26px;
  height: 26px;
  font-size: 0.75rem;
}

.vf-admin-shell--compact .vf-nav-group {
  margin-bottom: var(--vf-space-2);
}

.vf-admin-shell--compact .vf-nav-group__label {
  padding: 4px var(--vf-space-2);
  font-size: 0.62rem;
}

.vf-admin-shell--compact .vf-admin-topbar {
  padding: var(--vf-space-2) var(--vf-space-4);
}

.vf-admin-shell--compact .vf-admin-topbar__titles h2 {
  font-size: 1.1rem;
}

.vf-admin-shell--compact .vf-admin-topbar__titles p {
  font-size: 0.78rem;
  margin-top: 2px;
}

.vf-admin-shell--compact .vf-breadcrumb {
  font-size: 0.7rem;
  margin-bottom: 2px;
}

.vf-admin-shell--compact .vf-admin-content {
  padding: var(--vf-space-3) var(--vf-space-4) var(--vf-space-6);
}

.vf-admin-shell--compact .vf-stat-row {
  gap: var(--vf-space-2);
  margin-bottom: var(--vf-space-3);
}

.vf-admin-shell--compact .vf-stat {
  padding: var(--vf-space-3);
}

.vf-admin-shell--compact .vf-stat__value {
  font-size: 1.12rem;
  margin-top: var(--vf-space-1);
}

.vf-admin-shell--compact .vf-card {
  padding: var(--vf-space-4);
}

.vf-admin-shell--compact .vf-toolbar {
  margin-bottom: var(--vf-space-3);
  gap: var(--vf-space-2);
}

.vf-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.vf-nav-group {
  margin-bottom: var(--vf-space-3);
}

.vf-nav-group__label {
  display: block;
  padding: var(--vf-space-2) var(--vf-space-3);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vf-text-muted);
}

.vf-admin-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vf-admin-nav button {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--vf-space-3);
  padding: 9px var(--vf-space-3);
  border-radius: var(--vf-radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--vf-text-secondary);
  transition: background var(--vf-transition), color var(--vf-transition);
}

.vf-admin-nav button:hover {
  background: var(--vf-surface-hover);
  color: var(--vf-text);
}

.vf-admin-nav button:focus-visible {
  outline: 2px solid var(--vf-primary);
  outline-offset: 2px;
}

.vf-admin-nav button.is-active {
  background: var(--vf-primary-muted);
  color: var(--vf-accent);
  box-shadow: inset 3px 0 0 var(--vf-primary);
}

.vf-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.75;
}

.vf-admin-nav button.is-active .vf-nav-icon {
  opacity: 1;
}

/* —— Sidebar nav v3 (dual-line labels) —— */
.vf-admin-nav--v3 button {
  position: relative;
  padding: 7px var(--vf-space-2);
  gap: var(--vf-space-2);
}

.vf-admin-nav--v3 .vf-nav-item__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--vf-radius-sm);
  background: var(--vf-surface-inset);
  border: 1px solid var(--vf-border);
  font-size: 0.85rem;
  opacity: 0.9;
}

.vf-admin-nav--v3 button.is-active .vf-nav-item__icon {
  background: var(--vf-primary-muted);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--vf-accent);
}

.vf-admin-nav--v3 .vf-nav-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.vf-admin-nav--v3 .vf-nav-item__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: inherit;
  line-height: 1.2;
}

.vf-admin-nav--v3 .vf-nav-item__desc {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--vf-text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf-admin-nav--v3 button.is-active .vf-nav-item__desc {
  color: var(--vf-text-secondary);
}

.vf-admin-nav--v3 .vf-nav-badge {
  position: absolute;
  top: 8px;
  right: 10px;
}

.vf-admin-sidebar__foot {
  display: none;
}

.vf-sidebar-link {
  display: block;
  padding: 8px var(--vf-space-3);
  border-radius: var(--vf-radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--vf-text-secondary);
  text-decoration: none;
  text-align: center;
  border: 1px solid var(--vf-border);
  transition: background var(--vf-transition), color var(--vf-transition);
}

.vf-sidebar-link:hover {
  background: var(--vf-surface-hover);
  color: var(--vf-text);
}

/* —— Main —— */
.vf-admin-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vf-admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--vf-space-2);
  padding: var(--vf-space-3) var(--vf-space-5);
  min-height: var(--vf-topbar-h);
  background: rgba(12, 18, 34, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vf-border);
}

.vf-admin-topbar__titles h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vf-admin-topbar__titles p {
  margin: 2px 0 0;
  color: var(--vf-text-secondary);
  font-size: 0.8rem;
  max-width: 48rem;
  line-height: 1.35;
}

.vf-admin-topbar__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  order: 2;
}

.vf-admin-topbar #vf-msg {
  order: 3;
  width: 100%;
  flex-basis: 100%;
}

@media (min-width: 900px) {
  .vf-admin-topbar #vf-msg {
    order: 2;
    width: auto;
    flex-basis: auto;
    max-width: min(420px, 40vw);
    margin-left: 12px;
  }
  .vf-admin-topbar__actions {
    order: 3;
  }
}

.vf-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--vf-space-2);
  margin-bottom: var(--vf-space-1);
  font-size: 0.75rem;
  color: var(--vf-text-muted);
}

.vf-breadcrumb strong {
  color: var(--vf-text-secondary);
  font-weight: 500;
}

.vf-admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: none;
  padding: var(--vf-space-4) clamp(var(--vf-space-3), 2.5vw, var(--vf-space-6)) var(--vf-space-6);
}

.vf-admin-content > .vf-panel.is-visible {
  width: 100%;
  max-width: var(--vf-content-max);
}

.vf-admin-content > .vf-panel--dash.is-visible {
  flex: 1;
  min-height: 0;
  max-width: none;
  overflow: hidden;
}

.vf-admin-content:has(> .vf-panel--dash.is-visible) {
  overflow: hidden;
  padding-bottom: var(--vf-space-3);
}

/* 宽屏：表单 + 列表并排（企业组） */
@media (min-width: 1100px) {
  .vf-panel[data-panel="enterprise"].is-visible {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: var(--vf-space-4);
    align-items: start;
  }

  .vf-panel[data-panel="enterprise"].is-visible > .vf-card {
    margin-bottom: 0;
  }

  .vf-panel[data-panel="enterprise"].is-visible > .vf-card:last-child {
    min-height: 280px;
  }
}

/* 解绑审批：单卡铺满右侧操作区（勿用 enterprise 双栏 grid） */
.vf-panel[data-panel="unbind"].is-visible {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 10rem);
}

.vf-panel[data-panel="unbind"].is-visible > .vf-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  min-height: 0;
}

.vf-panel[data-panel="unbind"] .vf-card__hint {
  margin: var(--vf-space-2) 0 var(--vf-space-4);
  max-width: 56rem;
}

.vf-panel[data-panel="unbind"] .vf-toolbar {
  margin-bottom: var(--vf-space-3);
}

.vf-panel[data-panel="unbind"] .vf-table-wrap {
  flex: 1;
  min-height: 360px;
  overflow: auto;
  margin-top: 0;
}

/* —— Toast message —— */
.vf-toast {
  min-width: 200px;
  max-width: 360px;
  padding: var(--vf-space-3) var(--vf-space-4);
  border-radius: var(--vf-radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--vf-border);
  background: var(--vf-surface);
  transition: opacity var(--vf-transition), border-color var(--vf-transition);
}

.vf-toast:empty {
  display: none;
}

.vf-toast.is-error {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--vf-danger-bg);
  color: var(--vf-danger);
}

.vf-toast.is-ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--vf-success-bg);
  color: var(--vf-success);
}

.vf-admin-msg {
  min-height: 1.4em;
  font-size: 0.88rem;
  color: var(--vf-text-secondary);
}

.vf-admin-msg.is-error { color: var(--vf-danger); }
.vf-admin-msg.is-ok { color: var(--vf-success); }

/* —— Panels —— */
.vf-panel { display: none; }
.vf-panel.is-visible {
  display: block;
  animation: vf-fade-in 0.25s ease-out;
}

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

/* —— Cards —— */
.vf-card {
  background: var(--vf-surface);
  border: 1px solid var(--vf-border);
  border-radius: var(--vf-radius);
  padding: var(--vf-space-5);
  margin-bottom: var(--vf-space-4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.vf-card--flat {
  box-shadow: none;
  background: var(--vf-surface-inset);
}

.vf-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-4);
}

.vf-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.vf-card__desc {
  margin: var(--vf-space-1) 0 0;
  font-size: 0.875rem;
  color: var(--vf-text-secondary);
  line-height: 1.5;
}

.vf-card__title + .vf-card__desc,
.vf-card__header .vf-card__desc {
  margin-top: var(--vf-space-1);
}

/* —— Callouts —— */
.vf-callout {
  padding: var(--vf-space-4);
  margin-bottom: var(--vf-space-4);
  border-radius: var(--vf-radius-sm);
  border: 1px solid var(--vf-border);
  background: var(--vf-info-bg);
  font-size: 0.875rem;
  color: var(--vf-text-secondary);
  line-height: 1.55;
}

.vf-callout strong { color: var(--vf-text); font-weight: 600; }

.vf-callout a {
  color: var(--vf-accent);
  font-weight: 500;
}

.vf-callout--warn {
  background: var(--vf-warn-bg);
  border-color: rgba(251, 191, 36, 0.25);
}

.vf-callout--success {
  background: var(--vf-success-bg);
  border-color: rgba(52, 211, 153, 0.25);
}

.vf-hint {
  margin: var(--vf-space-1) 0 0;
  font-size: 0.78rem;
  color: var(--vf-text-muted);
  line-height: 1.45;
}

.vf-config-inline-help {
  margin-top: var(--vf-space-2);
  font-size: 0.78rem;
  color: var(--vf-text-muted);
}

.vf-config-inline-help summary {
  cursor: pointer;
  color: var(--vf-accent, #3b82f6);
}

.vf-muted { color: var(--vf-text-muted); }

/* —— Marketing model cards (dashboard) —— */
.vf-model-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-4);
}

.vf-model-card {
  padding: var(--vf-space-4);
  border-radius: var(--vf-radius-sm);
  border: 1px solid var(--vf-border);
  background: var(--vf-surface-inset);
  cursor: pointer;
  transition: border-color var(--vf-transition), transform var(--vf-transition);
  text-align: left;
}

.vf-model-card:hover {
  border-color: var(--vf-border-strong);
  transform: translateY(-1px);
}

.vf-model-card__tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vf-accent);
  margin-bottom: var(--vf-space-2);
}

.vf-model-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 var(--vf-space-1);
}

.vf-model-card__text {
  font-size: 0.8rem;
  color: var(--vf-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* —— Quick actions —— */
.vf-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-2);
}

/* —— Settings tabs —— */
.vf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-2);
  margin-bottom: var(--vf-space-5);
  padding-bottom: var(--vf-space-3);
  border-bottom: 1px solid var(--vf-border);
}

.vf-tabs button {
  cursor: pointer;
  border: 1px solid var(--vf-border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--vf-text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--vf-radius-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: background var(--vf-transition), color var(--vf-transition), border-color var(--vf-transition);
}

.vf-tabs button:hover {
  background: var(--vf-surface-hover);
  color: var(--vf-text);
}

.vf-tabs button.is-active {
  background: var(--vf-primary-muted);
  color: var(--vf-accent);
  border-color: rgba(2, 132, 199, 0.35);
}

.vf-settings-section { display: none; }
.vf-settings-section.is-visible { display: block; }

.vf-channel-section { display: none; }
.vf-channel-section.is-visible {
  display: flex;
  flex-direction: column;
  gap: var(--vf-space-3);
}

/* 渠道管理：仅整页滚动，禁止面板内再套一层滚动条 */
.vf-panel--channel-hub.is-visible {
  display: block;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.vf-channel-section--create.is-visible {
  gap: var(--vf-space-2);
  overflow: visible;
}

.vf-key-tip--inline {
  margin-bottom: 0;
  padding: var(--vf-space-2) var(--vf-space-3);
  font-size: 0.78rem;
}

.vf-channel-create-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: var(--vf-space-3);
  align-items: start;
}

.vf-channel-create-aside .vf-card--compact {
  margin-bottom: 0;
  padding: var(--vf-space-3);
}

.vf-channel-type-guide--scroll {
  margin-bottom: 0;
  overflow: visible;
  max-height: none;
  font-size: 0.76rem;
  line-height: 1.45;
  padding: var(--vf-space-2) var(--vf-space-3);
}

.vf-channel-type-guide--scroll ol {
  margin: var(--vf-space-1) 0 0;
}

.vf-channel-type-guide--scroll li {
  margin-bottom: 2px;
}

.vf-channel-type-guide--scroll__note {
  margin-top: var(--vf-space-2);
  padding-top: var(--vf-space-2);
}

.vf-channel-create-main {
  overflow: visible;
  min-height: 0;
}

.vf-channel-create-main .vf-card--compact {
  margin-bottom: 0;
  padding: var(--vf-space-3);
}

.vf-channel-create-main .vf-grid--dense {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vf-channel-create-main .vf-hint {
  font-size: 0.72rem;
  margin-top: 2px;
  line-height: 1.35;
}

.vf-channel-create-extra {
  margin-bottom: 0;
}

.vf-channel-create-extra summary {
  cursor: pointer;
  list-style: none;
}

.vf-grid--dense {
  gap: var(--vf-space-2) var(--vf-space-3);
}

.vf-grid--dense .vf-field {
  margin-bottom: var(--vf-space-1);
}

.vf-card--compact .vf-form-block__title {
  margin-top: var(--vf-space-2);
  margin-bottom: var(--vf-space-2);
}

.vf-panel--channel-hub .vf-page-guide {
  margin-bottom: var(--vf-space-2);
}

.vf-panel--channel-hub .vf-page-guide [data-vf-help-expand] {
  display: none;
}

@media (max-width: 1280px) {
  .vf-channel-create-main .vf-grid--dense {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .vf-channel-create-layout {
    grid-template-columns: 1fr;
  }

  .vf-channel-create-main .vf-grid--dense {
    grid-template-columns: 1fr;
  }
}

.vf-panel--channel-hub .vf-channel-tabs {
  flex-shrink: 0;
  margin-bottom: var(--vf-space-3);
}

.vf-card--fill {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vf-card--fill .vf-table-wrap--grow {
  flex: 1;
  min-height: min(52vh, 640px);
  overflow: auto;
}

/* 渠道列表/账号：表格随页面整体滚动，不单独嵌套滚动 */
.vf-panel--channel-hub .vf-card--fill {
  flex: none;
  min-height: auto;
}

.vf-panel--channel-hub .vf-table-wrap--grow {
  flex: none;
  min-height: 0;
  overflow: visible;
}

.vf-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-3);
}

.vf-toolbar--inline {
  margin: 0;
  align-items: center;
}

.vf-field--type-first label {
  font-weight: 600;
  color: var(--vf-accent);
}

.vf-input--emphasis {
  font-weight: 600;
  border-color: rgba(56, 189, 248, 0.45);
  background: var(--vf-surface-inset);
}

.vf-channel-type-guide {
  margin: 0 0 var(--vf-space-4);
  padding: var(--vf-space-4);
  border-radius: var(--vf-radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: var(--vf-info-bg);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--vf-text-secondary);
}

.vf-channel-type-guide__title {
  margin: 0 0 var(--vf-space-2);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--vf-accent);
}

.vf-channel-type-guide__model {
  display: inline-block;
  margin-bottom: var(--vf-space-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--vf-primary-muted);
  color: var(--vf-accent);
}

.vf-channel-type-guide ol {
  margin: var(--vf-space-2) 0 0;
  padding-left: 1.25rem;
}

.vf-channel-type-guide li {
  margin-bottom: var(--vf-space-1);
}

.vf-channel-type-guide__note {
  margin: var(--vf-space-3) 0 0;
  padding-top: var(--vf-space-2);
  border-top: 1px solid var(--vf-border);
  font-size: 0.8rem;
  color: var(--vf-text-muted);
}

.vf-form-block__title {
  margin: var(--vf-space-4) 0 var(--vf-space-3);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vf-text-muted);
}

.vf-form-block__title:first-of-type {
  margin-top: 0;
}

.vf-input-row {
  display: flex;
  gap: var(--vf-space-2);
  align-items: center;
}

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

.vf-form-actions {
  margin-top: var(--vf-space-4);
  padding-top: var(--vf-space-3);
  border-top: 1px solid var(--vf-border);
}

/* —— Forms —— */
.vf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--vf-space-4);
  margin-bottom: var(--vf-space-4);
}

.vf-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--vf-text-secondary);
}

.vf-field input,
.vf-field select,
.vf-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--vf-radius-sm);
  border: 1px solid var(--vf-border-strong);
  background: var(--vf-surface-inset);
  color: var(--vf-text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--vf-transition), box-shadow var(--vf-transition);
}

.vf-field input::placeholder,
.vf-field textarea::placeholder {
  color: var(--vf-text-muted);
}

.vf-field input:focus,
.vf-field select:focus,
.vf-field textarea:focus {
  outline: none;
  border-color: var(--vf-primary);
  box-shadow: 0 0 0 3px var(--vf-primary-muted);
}

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

.vf-field textarea {
  resize: vertical;
  min-height: 88px;
  font-family: var(--vf-mono);
  font-size: 0.82rem;
  line-height: 1.5;
}

.vf-check {
  display: inline-flex;
  align-items: center;
  gap: var(--vf-space-2);
  font-size: 0.875rem;
  color: var(--vf-text-secondary);
  cursor: pointer;
}

.vf-check input { width: auto; accent-color: var(--vf-primary); }

/* —— Buttons —— */
.vf-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-2);
  align-items: center;
}

button.vf-btn,
a.vf-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--vf-radius-sm);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background var(--vf-transition), transform 0.12s, box-shadow var(--vf-transition);
}

button.vf-btn:focus-visible,
a.vf-btn:focus-visible {
  outline: 2px solid var(--vf-accent);
  outline-offset: 2px;
}

button.vf-btn:active { transform: scale(0.98); }

button.vf-btn--primary,
a.vf-btn--primary {
  background: linear-gradient(180deg, var(--vf-primary-hover) 0%, var(--vf-usgs-blue, var(--vf-primary)) 100%);
  color: #fff;
  border: 1px solid rgba(125, 211, 252, 0.45);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.45), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

button.vf-btn--primary:hover,
a.vf-btn--primary:hover {
  background: linear-gradient(180deg, #38bdf8 0%, var(--vf-primary-hover) 100%);
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.55);
}

button.vf-btn--lg {
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

button.vf-btn--ghost,
a.vf-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--vf-text);
  border: 1px solid var(--vf-border-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

button.vf-btn--ghost:hover,
a.vf-btn--ghost:hover {
  background: var(--vf-surface-hover);
  color: var(--vf-text);
  border-color: rgba(148, 163, 184, 0.45);
}

button.vf-btn--secondary,
a.vf-btn--secondary {
  background: var(--vf-surface-hover);
  color: var(--vf-text);
  border: 1px solid rgba(125, 211, 252, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

button.vf-btn--secondary:hover,
a.vf-btn--secondary:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--vf-accent);
}

button.vf-btn--danger {
  background: var(--vf-danger-bg);
  color: var(--vf-danger);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

button.vf-btn--sm,
a.vf-btn--sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* —— Tables —— */
.vf-table-wrap {
  overflow-x: auto;
  border-radius: var(--vf-radius-sm);
  border: 1px solid var(--vf-border);
  background: var(--vf-surface-inset);
}

table.vf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

table.vf-table th,
table.vf-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--vf-border);
  vertical-align: middle;
}

table.vf-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--vf-bg-elevated);
  color: var(--vf-text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: none;
  white-space: nowrap;
}

table.vf-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

table.vf-table tr:last-child td { border-bottom: 0; }

table.vf-table code {
  font-family: var(--vf-mono);
  font-size: 0.78rem;
  color: var(--vf-accent);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

.vf-table-empty td {
  text-align: center;
  color: var(--vf-text-muted);
  padding: var(--vf-space-8) !important;
}

/* —— Pills & stats —— */
.vf-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.vf-pill--ok {
  background: var(--vf-success-bg);
  color: var(--vf-success);
}

.vf-pill--bad {
  background: var(--vf-danger-bg);
  color: var(--vf-danger);
}

.vf-pill--warn {
  background: var(--vf-warn-bg);
  color: var(--vf-warn);
}

/* 用户管理：所属产品（与「版本/套餐」区分） */
.vf-pill--product-vf {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.vf-pill--product-aistaff {
  background: rgba(167, 139, 250, 0.16);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.4);
}

.vf-table__col-product {
  white-space: nowrap;
  min-width: 7.5rem;
}

.vf-pill--product-editable {
  cursor: pointer;
}

.vf-pill--product-editable:hover {
  filter: brightness(1.12);
  outline: 1px solid rgba(255, 255, 255, 0.25);
}

.vf-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-4);
}

.vf-stat {
  padding: var(--vf-space-4);
  border-radius: var(--vf-radius-sm);
  background: var(--vf-surface-inset);
  border: 1px solid var(--vf-border);
}

.vf-stat__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--vf-text-muted);
}

.vf-stat__value {
  margin-top: var(--vf-space-2);
  font-family: var(--vf-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--vf-text);
  letter-spacing: -0.02em;
}

.vf-stat--highlight {
  border-color: rgba(2, 132, 199, 0.35);
  background: var(--vf-primary-muted);
}

.vf-stat--highlight .vf-stat__value {
  color: var(--vf-accent);
}

/* —— Toolbar —— */
.vf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-4);
  align-items: flex-end;
}

.vf-toolbar--split {
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--vf-space-4);
  padding-bottom: var(--vf-space-3);
  border-bottom: 1px solid var(--vf-border);
}

.vf-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-3);
  align-items: flex-end;
  flex: 1;
  min-width: 280px;
}

.vf-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-2);
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.vf-toolbar__actions-hint {
  margin: 0;
  width: 100%;
  text-align: right;
  font-size: 0.72rem;
  color: var(--vf-text-muted);
  line-height: 1.3;
}

.vf-toolbar__actions .vf-btn {
  flex-shrink: 0;
}

.vf-toolbar .vf-field {
  margin: 0;
  min-width: 140px;
}

.vf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-1);
}

/* —— Code output —— */
.vf-codes-out {
  margin-top: var(--vf-space-3);
  padding: var(--vf-space-4);
  border-radius: var(--vf-radius-sm);
  background: #060a14;
  border: 1px solid var(--vf-border);
  font-family: var(--vf-mono);
  font-size: 0.82rem;
  color: var(--vf-success);
  white-space: pre-wrap;
  line-height: 1.5;
  min-height: 2.5em;
}

.vf-card__hint,
.vf-card__hint.vf-muted {
  color: var(--vf-text-muted);
  font-size: 0.875rem;
  margin: -8px 0 var(--vf-space-4);
  line-height: 1.5;
}

/* —— Modal —— */
.vf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 1000;
  padding: var(--vf-space-5);
}

.vf-modal-backdrop.is-open { display: grid; }

.vf-modal {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--vf-space-6);
  border-radius: var(--vf-radius-lg);
  background: var(--vf-surface);
  border: 1px solid var(--vf-border-strong);
  box-shadow: var(--vf-shadow);
}

.vf-modal h3 {
  margin: 0 0 var(--vf-space-2);
  font-size: 1.1rem;
}

.vf-modal-backdrop--sheet {
  place-items: stretch end;
  padding: 0;
}

.vf-modal--sheet {
  width: min(960px, 100%);
  max-width: 100%;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border-radius: var(--vf-radius-lg) 0 0 var(--vf-radius-lg);
  display: flex;
  flex-direction: column;
}

.vf-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-4);
}

.vf-sheet__head h3 {
  margin: 0;
}

.vf-sheet__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.vf-sheet__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-4);
}

.vf-pill--warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.vf-pill--partial {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* —— Mobile nav toggle —— */
.vf-nav-toggle {
  display: none;
  position: fixed;
  bottom: var(--vf-space-4);
  right: var(--vf-space-4);
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--vf-primary);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: var(--vf-shadow);
  cursor: pointer;
}

.vf-hidden { display: none !important; }

.vf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .vf-admin-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .vf-admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--vf-sidebar-w), 88vw);
    height: 100vh;
    max-height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--vf-transition);
    box-shadow: var(--vf-shadow);
    grid-area: unset;
    overflow-y: auto;
  }

  .vf-admin-sidebar.is-open {
    transform: translateX(0);
  }

  .vf-nav-toggle { display: block; }

  .vf-admin-topbar,
  .vf-admin-content {
    padding-left: var(--vf-space-4);
    padding-right: var(--vf-space-4);
  }

  .vf-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 35;
  }

  .vf-sidebar-backdrop.is-open { display: block; }

  .vf-panel[data-panel="enterprise"].is-visible {
    display: block;
  }
}

@media (max-width: 600px) {
  .vf-grid {
    grid-template-columns: 1fr;
  }

  table.vf-table th,
  table.vf-table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}

.vf-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 4px;
  font-size: 0.88rem;
  color: var(--vf-muted);
}

.vf-pagination__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vf-pagination__meta,
.vf-pagination__empty {
  color: var(--vf-muted);
  font-size: 0.88rem;
}

.vf-pagination__size select {
  margin-left: 4px;
}

/* —— Compact activation code form —— */
.vf-card--compact {
  padding: var(--vf-space-3) var(--vf-space-4);
}

.vf-card__header--tight {
  margin-bottom: var(--vf-space-2);
  padding-bottom: var(--vf-space-2);
}

.vf-codes-form__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.vf-field--inline {
  min-width: 0;
}

.vf-field--inline label {
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.vf-field--inline select,
.vf-field--inline input {
  min-height: 34px;
  font-size: 0.85rem;
}

.vf-field--xs {
  max-width: 72px;
}

.vf-field--grow {
  flex: 1;
  min-width: 140px;
}

.vf-codes-form__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--vf-text-secondary);
  padding-bottom: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.vf-hint--inline {
  margin: 6px 0 0;
  font-size: 0.75rem;
}

.vf-codes-out--inline {
  margin-top: 8px;
  max-height: 88px;
  font-size: 0.78rem;
}

/* —— Audit log table —— */
.vf-table--audit .vf-col-time {
  width: 148px;
  white-space: nowrap;
}

.vf-table--audit .vf-col-id {
  width: 52px;
  text-align: right;
  color: var(--vf-text-muted);
}

.vf-table--audit .vf-col-detail {
  min-width: 200px;
  max-width: 360px;
}

.vf-audit-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.vf-audit-action__title {
  font-size: 0.9rem;
  font-weight: 600;
}

.vf-pill--audit {
  font-size: 0.65rem;
  padding: 2px 8px;
  background: var(--vf-surface-inset);
  border: 1px solid var(--vf-border);
  color: var(--vf-text-secondary);
}

.vf-audit-code {
  font-size: 0.68rem;
  color: var(--vf-text-muted);
  opacity: 0.85;
}

.vf-audit-subject {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}

.vf-audit-subject .vf-muted {
  font-size: 0.72rem;
}

.vf-audit-detail__text {
  font-size: 0.85rem;
  line-height: 1.45;
}

.vf-audit-detail__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--vf-text-secondary);
}

.vf-audit-time {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vf-actions--wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 280px;
}

/* —— User management: grouped row actions —— */
.vf-panel[data-panel="users"] .vf-table-wrap,
.vf-panel[data-panel="recycle"] .vf-table-wrap,
.vf-panel[data-panel="channels"] .vf-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.vf-panel[data-panel="users"] .vf-table th:last-child,
.vf-panel[data-panel="users"] .vf-table td.vf-user-ops,
.vf-panel[data-panel="recycle"] .vf-table td.vf-user-ops {
  min-width: 280px;
  vertical-align: middle;
}

.vf-user-ops {
  padding: var(--vf-space-1) 0;
}

.vf-user-ops--compact .vf-user-ops__bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 360px;
}

.vf-user-ops--compact .vf-user-ops__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}

.vf-user-ops--compact .vf-user-ops__core {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  margin-right: 2px;
  border-right: 1px solid var(--vf-border);
}

.vf-btn--accent {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: var(--vf-accent);
  font-weight: 600;
}

.vf-btn--accent:hover {
  background: rgba(56, 189, 248, 0.28);
  color: #fff;
}

.vf-user-ops__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vf-space-1);
}

.vf-user-ops__account {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--vf-space-1);
  margin-left: auto;
}

.vf-ops-menu {
  position: relative;
  display: inline-flex;
}

.vf-ops-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.vf-ops-menu__caret {
  font-size: 0.65rem;
  opacity: 0.75;
  line-height: 1;
}

.vf-ops-menu__panel {
  display: none;
  position: fixed;
  z-index: 200;
  min-width: 168px;
  padding: var(--vf-space-2);
  border-radius: var(--vf-radius-sm);
  background: var(--vf-bg-elevated);
  border: 1px solid var(--vf-border-strong);
  box-shadow: var(--vf-shadow);
}

.vf-ops-menu.is-open .vf-ops-menu__panel {
  display: block !important;
  visibility: visible;
}

.vf-ops-menu__group-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vf-text-muted);
  padding: var(--vf-space-1) var(--vf-space-1) var(--vf-space-2);
}

.vf-ops-menu__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vf-space-1);
}

.vf-ops-menu__divider {
  height: 1px;
  margin: var(--vf-space-2) 0;
  background: var(--vf-border);
}

.vf-ops-menu__panel .vf-btn {
  flex: 1 1 auto;
  min-width: calc(50% - var(--vf-space-1));
  justify-content: center;
}

.vf-table__col-check {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.vf-table__col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--vf-primary);
  cursor: pointer;
}

.vf-users-select-hint {
  font-size: 0.82rem;
  align-self: center;
  margin-left: var(--vf-space-1);
}

/* —— Product profit / sales panels —— */
.vf-profit-ml-banner {
  margin-bottom: var(--vf-space-3);
}

.vf-profit-grid {
  display: flex;
  flex-direction: column;
  gap: var(--vf-space-3);
}

.vf-profit-card {
  border: 1px solid var(--vf-border);
  border-radius: var(--vf-radius);
  background: var(--vf-surface);
  padding: var(--vf-space-4);
}

.vf-profit-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--vf-space-3);
  margin-bottom: var(--vf-space-3);
  padding-bottom: var(--vf-space-3);
  border-bottom: 1px solid var(--vf-border);
}

.vf-profit-card__title {
  margin: 0;
  font-size: 1.05rem;
}

.vf-profit-card__code {
  margin: var(--vf-space-1) 0 0;
  font-size: 0.78rem;
  color: var(--vf-text-muted);
}

.vf-profit-card__body {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.2fr);
  gap: var(--vf-space-4);
}

@media (max-width: 800px) {
  .vf-profit-card__body {
    grid-template-columns: 1fr;
  }
}

.vf-profit-card__col h4 {
  margin: 0 0 var(--vf-space-2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--vf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vf-profit-price {
  margin: 0 0 var(--vf-space-3);
  font-family: var(--vf-mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--vf-accent);
}

.vf-table--compact td,
.vf-table--compact th {
  padding: 6px 8px;
  font-size: 0.82rem;
}

.vf-commission-matrix-wrap {
  margin-top: var(--vf-space-2);
  max-width: 640px;
}

.vf-commission-matrix input[type="number"] {
  width: 5.5rem;
  max-width: 100%;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.vf-commission-matrix th[scope="row"] {
  font-weight: 600;
  white-space: nowrap;
}

.vf-profit-tiers {
  margin: 0 0 var(--vf-space-3);
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--vf-text-secondary);
}

.vf-profit-block {
  margin: 0 0 var(--vf-space-2);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--vf-text-secondary);
}

/* —— Device online presence (user list) —— */
.vf-table__col-device {
  min-width: 9.5rem;
  max-width: 11rem;
}

.vf-device-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.vf-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid var(--vf-border);
  background: var(--vf-surface-inset);
  cursor: help;
}

.vf-presence__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--vf-text-muted);
}

.vf-presence--online {
  color: var(--vf-success);
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--vf-success-bg);
}

.vf-presence--online .vf-presence__dot {
  background: var(--vf-success);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}

.vf-presence--offline {
  color: var(--vf-text-muted);
}

.vf-presence--offline .vf-presence__dot {
  background: #64748b;
}

.vf-presence--unbound {
  color: var(--vf-warn);
  border-color: rgba(251, 191, 36, 0.3);
  background: var(--vf-warn-bg);
}

.vf-presence--unbound .vf-presence__dot {
  background: var(--vf-warn);
}

.vf-presence--inactive {
  color: var(--vf-danger);
  border-color: rgba(248, 113, 113, 0.3);
  background: var(--vf-danger-bg);
}

.vf-device-id {
  font-size: 0.7rem;
  color: var(--vf-accent);
  word-break: break-all;
}

.vf-presence__ago {
  font-size: 0.68rem;
  color: var(--vf-text-muted);
  line-height: 1.3;
}


/* —— User record full page —— */
.vf-record-page__head {
  display: flex;
  align-items: flex-start;
  gap: var(--vf-space-4);
  margin-bottom: var(--vf-space-5);
}

.vf-record-page__title {
  margin: 0 0 var(--vf-space-1);
  font-size: 1.25rem;
}

.vf-record-page__sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--vf-text-secondary);
}

.vf-record-page__body .vf-card {
  margin-bottom: var(--vf-space-4);
}

.vf-enterprise-guide {
  border-color: rgba(56, 189, 248, 0.25);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), transparent 55%);
}

.vf-guide-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--vf-text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

.vf-guide-steps li {
  margin-bottom: var(--vf-space-2);
}

.vf-link-btn {
  all: unset;
  cursor: pointer;
  color: var(--vf-accent);
  text-decoration: underline;
  font-weight: 600;
}

.vf-link-btn:hover {
  color: var(--vf-primary-hover);
}

.vf-pagination select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--vf-border);
  background: var(--vf-surface);
  color: var(--vf-text);
}

.vf-nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  background: var(--vf-danger, #ef4444);
  color: #fff;
  vertical-align: middle;
}

.vf-nav-badge.vf-hidden {
  display: none;
}

.vf-fb-att-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* Product catalog — vertical paginated cards */
.vf-product-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.vf-product-card {
  display: grid;
  grid-template-columns: auto 96px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--vf-border);
  border-radius: var(--vf-radius);
  background: var(--vf-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vf-product-card:hover {
  border-color: var(--vf-border-strong);
  background: var(--vf-surface-hover);
}

.vf-product-card__img {
  width: 96px;
  height: 72px;
  border-radius: var(--vf-radius-sm);
  object-fit: cover;
  background: var(--vf-surface-inset);
  border: 1px solid var(--vf-border);
}

.vf-product-card__img--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--vf-text-muted);
}

.vf-product-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.vf-product-card__meta {
  font-size: 0.82rem;
  color: var(--vf-text-secondary);
  line-height: 1.45;
}

.vf-product-card__price {
  font-family: var(--vf-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--vf-accent);
  white-space: nowrap;
}

.vf-product-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.vf-product-list--compact .vf-product-card {
  grid-template-columns: auto 1fr auto;
  padding: 12px 14px;
}

.vf-product-list--compact .vf-product-card__img {
  display: none;
}

.vf-user-uid {
  font-family: var(--vf-mono);
  font-size: 0.82rem;
  color: var(--vf-accent);
  cursor: copy;
}

@media (max-width: 720px) {
  .vf-product-card {
    grid-template-columns: auto 1fr;
  }
  .vf-product-card__img {
    display: none;
  }
}
