:root {
  --wb-primary: #2457d6;
  --wb-primary-strong: #183fa8;
  --wb-primary-soft: #eef3ff;
  --wb-navy: #13213c;
  --wb-navy-soft: #1b2d50;
  --wb-page: #f4f6fa;
  --wb-surface: #ffffff;
  --wb-surface-soft: #f8f9fc;
  --wb-border: #dfe4ed;
  --wb-border-strong: #cdd4e0;
  --wb-text: #182235;
  --wb-text-muted: #687386;
  --wb-success: #18875f;
  --wb-success-soft: #eaf7f1;
  --wb-warning: #b26b16;
  --wb-warning-soft: #fff4df;
  --wb-danger: #c43c4b;
  --wb-danger-soft: #fff0f2;
  --wb-info: #2762c7;
  --wb-shadow-sm: 0 1px 2px rgba(19, 33, 60, 0.06);
  --wb-shadow-md: 0 10px 30px rgba(19, 33, 60, 0.09);
  --wb-radius-sm: 8px;
  --wb-radius: 12px;
  --wb-radius-lg: 16px;
  --wb-sidebar-width: 224px;
  --wb-topbar-height: 68px;
  --wb-content-width: 1520px;
  --wb-font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--wb-page);
}

body.wb-app {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--wb-text);
  background: var(--wb-page);
  font-family: var(--wb-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.wb-app button,
body.wb-app input,
body.wb-app select,
body.wb-app textarea {
  font: inherit;
}

body.wb-app button,
body.wb-app a {
  -webkit-tap-highlight-color: transparent;
}

body.wb-app a {
  color: inherit;
}

.wb-hidden,
[hidden] {
  display: none !important;
}

.wb-shell {
  display: grid;
  grid-template-columns: var(--wb-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.wb-sidebar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: var(--wb-sidebar-width);
  height: 100vh;
  padding: 18px 14px 16px;
  color: #dce5f7;
  background: var(--wb-navy);
  overflow-y: auto;
}

.wb-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  margin: 0 4px 20px;
  color: #fff;
  text-decoration: none;
}

.wb-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: var(--wb-primary);
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(36, 87, 214, 0.32);
}

.wb-brand-copy {
  display: grid;
  min-width: 0;
}

.wb-brand-copy strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-brand-copy small {
  margin-top: 1px;
  color: #91a2c0;
  font-size: 11px;
}

.wb-nav-label {
  margin: 10px 10px 7px;
  color: #7f91af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

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

.wb-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #b9c6db;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.wb-nav-item:hover,
.wb-nav-item:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.wb-nav-item.is-active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(67, 112, 224, 0.25);
}

.wb-nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #dbe5f8;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 800;
}

.wb-nav-item.is-active .wb-nav-icon {
  color: #fff;
  background: var(--wb-primary);
}

.wb-sidebar-footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 18px;
}

.wb-sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 9px;
  color: #aab8cf;
  text-decoration: none;
}

.wb-sidebar-link:hover,
.wb-sidebar-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.wb-stage {
  min-width: 0;
  min-height: 100vh;
}

.wb-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  min-height: var(--wb-topbar-height);
  padding: 10px 24px;
  border-bottom: 1px solid var(--wb-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--wb-shadow-sm);
  backdrop-filter: blur(12px);
}

.wb-topbar-leading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.wb-page-identity {
  display: grid;
  min-width: 0;
}

.wb-page-identity small {
  margin-bottom: 1px;
  color: var(--wb-text-muted);
  font-size: 11px;
}

.wb-page-identity strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.wb-menu-toggle {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--wb-border);
  border-radius: 10px;
  color: var(--wb-text);
  background: var(--wb-surface);
  cursor: pointer;
}

.wb-account {
  position: relative;
}

.wb-account-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px 8px 5px 6px;
  border: 1px solid var(--wb-border);
  border-radius: 12px;
  color: var(--wb-text);
  background: var(--wb-surface);
  cursor: pointer;
}

.wb-account-button:hover,
.wb-account-button:focus-visible {
  border-color: var(--wb-border-strong);
  background: var(--wb-surface-soft);
  outline: none;
}

.wb-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  background: var(--wb-primary);
  font-size: 13px;
  font-weight: 800;
}

.wb-account-copy {
  display: grid;
  max-width: 160px;
  text-align: left;
}

.wb-account-copy strong,
.wb-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-account-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.wb-account-copy small {
  color: var(--wb-text-muted);
  font-size: 11px;
}

.wb-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  display: grid;
  width: 190px;
  padding: 7px;
  border: 1px solid var(--wb-border);
  border-radius: 12px;
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-md);
}

.wb-account-menu a,
.wb-account-menu button {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--wb-text);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.wb-account-menu a:hover,
.wb-account-menu button:hover,
.wb-account-menu a:focus-visible,
.wb-account-menu button:focus-visible {
  background: var(--wb-surface-soft);
  outline: none;
}

.wb-account-menu .danger {
  color: var(--wb-danger);
}

.wb-main {
  width: 100%;
  max-width: var(--wb-content-width);
  margin: 0 auto;
  padding: 24px;
}

.wb-main.wb-main-wide {
  max-width: none;
}

/* One persistent outer shell; business frames contain only their work area. */
.wb-host .wb-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.wb-host .wb-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.wb-host .wb-topbar { flex: 0 0 auto; }
.wb-host .wb-main { flex: 1; min-height: 0; overflow: auto; }
.wb-host .wb-main.has-business-frame { padding: 0; overflow: hidden; }

.business-view { position: relative; height: 100%; }
.business-frame-mount { width: 100%; height: 100%; }
.business-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--wb-page); }
.business-frame-status {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--wb-text-muted);
  background: var(--wb-page);
}

body.wb-embedded .wb-shell { display: block; min-height: 100vh; }
body.wb-embedded .wb-sidebar,
body.wb-embedded .wb-topbar,
body.wb-embedded .wb-nav-backdrop { display: none !important; }
body.wb-embedded .wb-main { max-width: none; }
body.wb-embedded .module-nav { top: 0; }

.wb-page-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.wb-page-header-copy {
  min-width: 0;
}

.wb-page-header h1,
.wb-page-header h2,
.wb-page-header p {
  margin: 0;
}

.wb-page-header h1 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.wb-page-header p {
  margin-top: 5px;
  color: var(--wb-text-muted);
}

.wb-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.wb-panel {
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-sm);
}

.wb-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--wb-border);
}

.wb-panel-header h2,
.wb-panel-header h3,
.wb-panel-header p {
  margin: 0;
}

.wb-panel-header h2,
.wb-panel-header h3 {
  font-size: 16px;
}

.wb-panel-body {
  padding: 16px;
}

.wb-grid {
  display: grid;
  gap: 16px;
}

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

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

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

.wb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--wb-border-strong);
  border-radius: 9px;
  color: var(--wb-text);
  background: var(--wb-surface);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.wb-button:hover:not(:disabled),
.wb-button:focus-visible:not(:disabled) {
  border-color: #aeb9ca;
  background: var(--wb-surface-soft);
  outline: none;
}

.wb-button:active:not(:disabled) {
  transform: translateY(1px);
}

.wb-button:disabled,
.wb-button.is-busy {
  opacity: 0.58;
  cursor: not-allowed;
}

.wb-button-primary {
  border-color: var(--wb-primary);
  color: #fff;
  background: var(--wb-primary);
}

.wb-button-primary:hover:not(:disabled),
.wb-button-primary:focus-visible:not(:disabled) {
  border-color: var(--wb-primary-strong);
  background: var(--wb-primary-strong);
}

.wb-button-danger {
  border-color: #efc8ce;
  color: var(--wb-danger);
  background: var(--wb-danger-soft);
}

.wb-icon-button {
  width: 38px;
  padding: 0;
}

.wb-subnav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--wb-border);
  border-radius: 11px;
  background: var(--wb-surface);
  overflow-x: auto;
}

.wb-subnav button,
.wb-subnav a {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--wb-text-muted);
  background: transparent;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.wb-subnav button:hover,
.wb-subnav a:hover,
.wb-subnav .is-active,
.wb-subnav .active {
  color: var(--wb-primary-strong);
  background: var(--wb-primary-soft);
}

.wb-field {
  display: grid;
  gap: 6px;
}

.wb-field > span,
.wb-field > label {
  color: #455064;
  font-size: 12px;
  font-weight: 650;
}

.wb-input,
.wb-select,
.wb-textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--wb-border-strong);
  border-radius: 9px;
  color: var(--wb-text);
  background: var(--wb-surface);
  outline: none;
}

.wb-textarea {
  min-height: 96px;
  resize: vertical;
}

.wb-input:focus,
.wb-select:focus,
.wb-textarea:focus {
  border-color: #7d9dec;
  box-shadow: 0 0 0 3px rgba(36, 87, 214, 0.12);
}

.wb-filterbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
}

.wb-table-wrap {
  max-width: 100%;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
  overflow: auto;
}

.wb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

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

.wb-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #4e596c;
  background: #f7f8fb;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.wb-table tbody tr:hover td {
  background: #fafbfe;
}

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

.wb-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.wb-metric {
  min-height: 92px;
  padding: 15px;
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-sm);
}

.wb-metric span {
  display: block;
  color: var(--wb-text-muted);
  font-size: 12px;
}

.wb-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 23px;
  line-height: 1.2;
}

.wb-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #536076;
  background: #edf0f5;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

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

.wb-badge-warning {
  color: var(--wb-warning);
  background: var(--wb-warning-soft);
}

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

.wb-notice {
  padding: 11px 13px;
  border: 1px solid #d6e1fb;
  border-radius: 10px;
  color: #31548d;
  background: #f1f5ff;
}

.wb-notice-warning {
  border-color: #f0d9aa;
  color: #855214;
  background: var(--wb-warning-soft);
}

.wb-notice-danger {
  border-color: #f1cbd1;
  color: #9d2e3b;
  background: var(--wb-danger-soft);
}

.wb-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 28px;
  color: var(--wb-text-muted);
  text-align: center;
}

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

.wb-toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.wb-toast {
  padding: 11px 13px;
  border: 1px solid var(--wb-border);
  border-radius: 10px;
  color: var(--wb-text);
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.wb-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.wb-toast-success {
  border-left: 4px solid var(--wb-success);
}

.wb-toast-error {
  border-left: 4px solid var(--wb-danger);
}

.wb-nav-backdrop {
  display: none;
}

@media (max-width: 1180px) {
  :root {
    --wb-sidebar-width: 208px;
  }

  .wb-main {
    padding: 20px;
  }

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

@media (max-width: 900px) {
  .wb-shell {
    display: block;
  }

  .wb-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    width: min(280px, calc(100vw - 52px));
    transition: transform 180ms ease;
    box-shadow: 18px 0 40px rgba(10, 20, 38, 0.24);
  }

  body.wb-nav-open {
    overflow: hidden;
  }

  body.wb-nav-open .wb-sidebar {
    transform: translateX(0);
  }

  .wb-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    border: 0;
    background: rgba(11, 22, 41, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.wb-nav-open .wb-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .wb-menu-toggle {
    display: grid;
  }

  .wb-main {
    padding: 18px;
  }

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

@media (max-width: 640px) {
  .wb-topbar {
    min-height: 60px;
    padding: 8px 12px;
  }

  .wb-page-identity small,
  .wb-account-copy,
  .wb-topbar-actions > .wb-button:not(.wb-keep-mobile) {
    display: none;
  }

  .wb-account-button {
    min-height: 38px;
    padding: 3px;
    border: 0;
    background: transparent;
  }

  .wb-avatar {
    width: 32px;
    height: 32px;
  }

  .wb-main {
    padding: 14px 12px 24px;
  }

  .wb-page-header {
    display: grid;
    gap: 12px;
  }

  .wb-page-actions {
    margin-left: 0;
  }

  .wb-grid-2,
  .wb-grid-3,
  .wb-grid-4 {
    grid-template-columns: 1fr;
  }

  .wb-filterbar {
    align-items: stretch;
  }

  .wb-filterbar > * {
    width: 100%;
  }

  .wb-toast-region {
    right: 12px;
    bottom: 12px;
  }
}

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