/*
 * Enterprise UI compatibility layer.
 *
 * This file is intentionally loaded after every legacy/page stylesheet. It is
 * the final authority for shell, typography and shared components while old
 * business pages are migrated incrementally. Do not add page business logic
 * or one-off theme colors here.
 */

:root {
  --ui-sidebar-width: 240px;
  --ui-sidebar-collapsed: 68px;
  --ui-header-height: 72px;
  --ui-page-padding: 24px;
  --ui-section-gap: 20px;
  --ui-card-padding: 18px;
  --ui-control-height: 36px;
  --ui-control-height-compact: 32px;
  --ui-table-row-height: 44px;
  --ui-icon-size: 16px;
}

* { box-sizing: border-box; }

html {
  min-width: 0;
  background: var(--wx-page);
  color: var(--wx-text);
  font-family: var(--wx-font-sans);
  font-size: 14px;
}

body.premium-ui {
  min-width: 0;
  background: var(--wx-page) !important;
  color: var(--wx-text) !important;
  font-family: var(--wx-font-sans) !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.premium-ui::before,
body.premium-ui::after { display: none !important; }

body.premium-ui :where(button, input, select, textarea, table) {
  font-family: inherit !important;
}

body.premium-ui :where(strong, b, [data-numeric], .money, .quantity, .metric) {
  font-variant-numeric: tabular-nums lining-nums;
}

body.premium-ui :where(h1, h2, h3, h4, p) { text-wrap: pretty; }

/* Application shell */
body.premium-ui > aside {
  width: var(--ui-sidebar-width) !important;
  border: 0 !important;
  background: var(--wx-brand-950) !important;
  color: #d7deea !important;
  box-shadow: none !important;
}

body.premium-ui > main {
  min-width: 0;
  width: calc(100% - var(--ui-sidebar-width)) !important;
  margin-left: var(--ui-sidebar-width) !important;
  background: var(--wx-page) !important;
}

body.premium-ui .brand {
  height: var(--ui-header-height) !important;
  padding: 16px 18px !important;
  gap: 11px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

body.premium-ui .brand > span {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  background: var(--wx-primary) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

body.premium-ui .brand > div {
  min-width: 0;
  overflow: hidden;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.premium-ui .brand small {
  display: block;
  margin-top: 3px !important;
  overflow: hidden;
  color: #8f9bb0 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis;
}

body.premium-ui aside nav {
  padding: 10px 9px 76px !important;
  scrollbar-width: thin;
  scrollbar-color: #344054 transparent;
}

body.premium-ui .nav-section {
  margin: 2px 0 !important;
  border: 0 !important;
  background: transparent !important;
}

body.premium-ui .nav-section-title {
  min-height: 34px !important;
  padding: 8px 10px !important;
  border-radius: 7px !important;
  color: #8f9bb0 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

body.premium-ui .nav-section-title:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #c7d0df !important;
}

body.premium-ui aside nav button[data-page] {
  min-height: 38px !important;
  margin: 2px 0 !important;
  padding: 8px 10px !important;
  gap: 10px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #aab4c5 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  transition: background-color 140ms ease, color 140ms ease !important;
}

body.premium-ui aside nav button[data-page]:hover {
  transform: none !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f6f8fb !important;
}

body.premium-ui aside nav button[data-page].active {
  background: rgba(91, 124, 225, 0.18) !important;
  box-shadow: inset 2px 0 #8aa7ff !important;
  color: #fff !important;
  font-weight: 500 !important;
}

body.premium-ui aside .nav-icon {
  width: var(--ui-icon-size) !important;
  height: var(--ui-icon-size) !important;
  flex: 0 0 var(--ui-icon-size);
  color: #7f8ca2 !important;
  stroke-width: 1.8 !important;
}

body.premium-ui aside button.active .nav-icon { color: #9bb2ff !important; }

body.premium-ui .nav-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.premium-ui .aside-foot {
  padding: 13px 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: var(--wx-brand-950) !important;
  color: #9aa6ba !important;
  font-size: 12px !important;
}

body.premium-ui .aside-foot i {
  background: #2ea77c !important;
  box-shadow: 0 0 0 3px rgba(46, 167, 124, 0.12) !important;
}

body.premium-ui .aside-foot small { color: #77849a !important; }

body.premium-ui .sidebar-toggle {
  border: 1px solid var(--wx-border) !important;
  background: #fff !important;
  box-shadow: var(--wx-shadow-card) !important;
  color: var(--wx-text-muted) !important;
}

body.premium-ui .mobile-menu-toggle,
body.premium-ui .sidebar-backdrop { display: none; }

body.premium-ui.sidebar-collapsed > aside { width: var(--ui-sidebar-collapsed) !important; }
body.premium-ui.sidebar-collapsed > main {
  width: calc(100% - var(--ui-sidebar-collapsed)) !important;
  margin-left: var(--ui-sidebar-collapsed) !important;
}

body.premium-ui.sidebar-collapsed .brand { justify-content: center !important; padding: 16px !important; }
body.premium-ui.sidebar-collapsed .brand > div,
body.premium-ui.sidebar-collapsed .nav-label,
body.premium-ui.sidebar-collapsed .nav-section-title,
body.premium-ui.sidebar-collapsed .aside-foot span,
body.premium-ui.sidebar-collapsed .aside-foot small { display: none !important; }
body.premium-ui.sidebar-collapsed aside nav { padding-inline: 9px !important; }
body.premium-ui.sidebar-collapsed aside nav button[data-page] {
  width: 100% !important;
  justify-content: center !important;
  padding: 9px !important;
}

/* Header and page container */
body.premium-ui main > header {
  height: var(--ui-header-height) !important;
  min-height: var(--ui-header-height) !important;
  padding: 0 var(--ui-page-padding) !important;
  border-bottom: 1px solid var(--wx-border) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: none !important;
  backdrop-filter: blur(10px);
}

body.premium-ui .page-heading {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 1px;
}

body.premium-ui .header-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
  color: var(--wx-text-faint);
  font-size: 11px;
  line-height: 1.25;
}

body.premium-ui .header-breadcrumb span,
body.premium-ui .header-breadcrumb strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.premium-ui .header-breadcrumb i {
  color: var(--wx-border-strong);
  font-style: normal;
}

body.premium-ui .header-breadcrumb strong {
  color: var(--wx-text-muted);
  font-weight: 500;
}

body.premium-ui .page-heading h1,
body.premium-ui #title {
  margin: 0 !important;
  color: var(--wx-ink) !important;
  font-size: 23px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em !important;
}

body.premium-ui .page-heading p,
body.premium-ui #subtitle {
  margin: 1px 0 0 !important;
  overflow: hidden;
  color: var(--wx-text-muted) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.premium-ui .header-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

body.premium-ui .environment-badge {
  min-height: 26px !important;
  padding: 4px 9px !important;
  border: 1px solid #c9e7da !important;
  border-radius: 999px !important;
  background: #f0f9f5 !important;
  color: #187255 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

body.premium-ui .user-context {
  max-width: 160px;
  overflow: hidden;
  color: var(--wx-text-muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.premium-ui main > #content {
  width: 100%;
  max-width: var(--wx-content-max);
  margin: 0 auto;
  padding: var(--ui-page-padding) var(--ui-page-padding) 40px !important;
  background: var(--wx-page) !important;
  background-image: none !important;
}

/* Shared typography and layout */
body.premium-ui #content :where(h2) {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

body.premium-ui #content :where(h3) {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

body.premium-ui #content :where(h4) {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

body.premium-ui :where(.sub, .muted, .subtle, .hint, .help-text, .helper-text, .card-subtitle, .data-source) {
  color: var(--wx-text-muted) !important;
  font-size: 12px;
  line-height: 1.55;
}

body.premium-ui :where(.toolbar, .filters, [class*="-filters"], .page-actions, .card-actions) {
  gap: 10px !important;
}

body.premium-ui .toolbar,
body.premium-ui .filters,
body.premium-ui [class*="-filters"] {
  border-color: var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.premium-ui :where(.actions, .form-actions, .modal-actions, .drawer-actions) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px !important;
}

/* Buttons */
body.premium-ui :where(button.primary, .btn-primary, .primary-action, button.secondary, .btn-secondary, button.ghost, .btn-ghost, .danger-button, .btn-danger, .link, .btn-link, .icon-button) {
  min-height: var(--ui-control-height) !important;
  padding: 0 13px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease !important;
}

body.premium-ui :where(button.primary, .btn-primary, .primary-action, [data-variant="primary"]) {
  border: 1px solid var(--wx-primary) !important;
  background: var(--wx-primary) !important;
  color: #fff !important;
}

body.premium-ui :where(button.primary, .btn-primary, .primary-action, [data-variant="primary"]):hover {
  transform: none !important;
  border-color: var(--wx-primary-hover) !important;
  background: var(--wx-primary-hover) !important;
}

body.premium-ui :where(button.secondary, .btn-secondary, button.ghost, .btn-ghost, .filter-button) {
  border: 1px solid var(--wx-border-strong) !important;
  background: #fff !important;
  color: var(--wx-text) !important;
}

body.premium-ui :where(button.secondary, .btn-secondary, button.ghost, .btn-ghost, .filter-button):hover {
  transform: none !important;
  border-color: #b8c0cc !important;
  background: var(--wx-surface-subtle) !important;
  color: var(--wx-ink) !important;
}

body.premium-ui :where(.danger-button, .btn-danger) {
  border: 1px solid var(--wx-danger) !important;
  background: var(--wx-danger) !important;
  color: #fff !important;
}

body.premium-ui :where(.link, .btn-link) {
  min-height: 30px !important;
  padding-inline: 6px !important;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--wx-primary) !important;
}

body.premium-ui :where(.compact, .btn-sm) { min-height: var(--ui-control-height-compact) !important; }
body.premium-ui :where(.icon-button) { width: var(--ui-control-height); padding: 0 !important; }

body.premium-ui :where(button, a, input, select, textarea):focus { outline: none !important; }
body.premium-ui :where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid rgba(53, 89, 199, 0.5) !important;
  outline-offset: 2px !important;
}

body.premium-ui :where(button, input, select, textarea):disabled,
body.premium-ui :where(button, input, select, textarea)[aria-disabled="true"] {
  cursor: not-allowed !important;
  opacity: 0.52 !important;
  transform: none !important;
}

/* Form controls */
body.premium-ui :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: var(--ui-control-height) !important;
  padding: 7px 11px !important;
  border: 1px solid var(--wx-border-strong) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--wx-ink) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  transition: border-color 140ms ease, box-shadow 140ms ease !important;
}

body.premium-ui textarea { min-height: 96px !important; resize: vertical; }
body.premium-ui :where(input, textarea)::placeholder { color: var(--wx-text-faint) !important; }
body.premium-ui :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  border-color: #7892dc !important;
  box-shadow: var(--wx-focus) !important;
}

body.premium-ui label,
body.premium-ui .field > label {
  color: var(--wx-text) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

/* Cards and data surfaces */
body.premium-ui :where(.card, .panel, .section-card, .metric-card, .stat-card, .summary-card, .workspace-card, .data-card, .premium-card, .chart-card, .stat) {
  border: 1px solid var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: var(--wx-shadow-card) !important;
}

body.premium-ui :where(.card, .panel, .section-card, .workspace-card, .data-card, .premium-card):hover {
  border-color: var(--wx-border-strong) !important;
}

body.premium-ui :where(.card-head, .panel-head, .section-head, .chart-card__head) {
  gap: 12px !important;
  margin-bottom: 14px !important;
}

body.premium-ui :where(.card-head, .panel-head, .section-head, .chart-card__head) :where(h2, h3, h4) {
  font-size: 15px !important;
  font-weight: 600 !important;
}

body.premium-ui .stat :where(strong, b) {
  font-size: clamp(22px, 1.8vw, 28px) !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

/* Tables */
body.premium-ui :where(.table-wrap, .table-container) {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
  scrollbar-width: thin;
  scrollbar-color: var(--wx-border-strong) transparent;
}

body.premium-ui table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: #fff !important;
  color: var(--wx-text) !important;
  font-variant-numeric: tabular-nums lining-nums;
}

body.premium-ui thead th {
  height: 40px !important;
  padding: 9px 12px !important;
  border-bottom: 1px solid var(--wx-border) !important;
  background: var(--wx-surface-subtle) !important;
  color: var(--wx-text-muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap;
}

body.premium-ui tbody td {
  height: var(--ui-table-row-height) !important;
  padding: 9px 12px !important;
  border-bottom: 1px solid var(--wx-divider) !important;
  color: var(--wx-text) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  vertical-align: middle;
}

body.premium-ui tbody tr:hover > td { background: #fafbfc !important; }
body.premium-ui tbody tr:last-child > td { border-bottom: 0 !important; }
body.premium-ui :where(th, td).numeric,
body.premium-ui :where(th, td)[data-type="amount"],
body.premium-ui :where(th, td)[data-type="quantity"] { text-align: right !important; }
body.premium-ui :where(th, td).operation-column,
body.premium-ui :where(th, td).actions-column {
  position: sticky;
  right: 0;
  z-index: 1;
  background: inherit;
}

/* Status and navigation pills */
body.premium-ui :where(.tag, .status-tag, .badge, .pill) {
  min-height: 22px !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 16px !important;
}

body.premium-ui :where(.tag, .status-tag, .badge, .pill):not(.green):not(.success):not(.orange):not(.warn):not(.warning):not(.red):not(.danger):not(.error):not(.blue):not(.info):not(.ai) {
  border-color: #dfe3e8 !important;
  background: #f4f6f8 !important;
  color: #596579 !important;
}

body.premium-ui :where(.tag, .status-tag, .badge, .pill):where(.green, .success, [data-status="success"]) {
  border-color: var(--wx-success-border) !important;
  background: var(--wx-success-soft) !important;
  color: var(--wx-success) !important;
}

body.premium-ui :where(.tag, .status-tag, .badge, .pill):where(.orange, .yellow, .warn, .warning, [data-status="warning"]) {
  border-color: var(--wx-warning-border) !important;
  background: var(--wx-warning-soft) !important;
  color: var(--wx-warning) !important;
}

body.premium-ui :where(.tag, .status-tag, .badge, .pill):where(.red, .danger, .error, [data-status="danger"]) {
  border-color: var(--wx-danger-border) !important;
  background: var(--wx-danger-soft) !important;
  color: var(--wx-danger) !important;
}

body.premium-ui :where(.tag, .status-tag, .badge, .pill):where(.blue, .info, [data-status="info"]) {
  border-color: var(--wx-info-border) !important;
  background: var(--wx-info-soft) !important;
  color: var(--wx-info) !important;
}

body.premium-ui :where(.tabs, .tab-list, .segmented) {
  padding: 3px !important;
  border: 1px solid var(--wx-border) !important;
  border-radius: 8px !important;
  background: var(--wx-surface-muted) !important;
  box-shadow: none !important;
}

body.premium-ui :where(.tab.active, .tabs button.active, .tab-list button.active) {
  border-color: transparent !important;
  background: #fff !important;
  color: var(--wx-primary) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08) !important;
}

/* Hero and command-center compatibility */
body.premium-ui :where(.page-hero, .hero, .dashboard-hero, .workflow-hero, .command-hero, .business-command-hero, .channel-hero, .sample-hero, .brake-hero, .fulfillment-hero, .fulfillment-hero-v3, .fulfillment-hero-v4, .ranking-hero) {
  padding: 20px !important;
  border: 1px solid var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  background-image: none !important;
  color: var(--wx-text) !important;
  box-shadow: var(--wx-shadow-card) !important;
}

body.premium-ui :where(.workflow-hero, .channel-hero, .sample-hero, .brake-hero, .fulfillment-hero, .ranking-hero) h2 {
  margin: 5px 0 !important;
  color: var(--wx-ink) !important;
  font-size: 20px !important;
  font-weight: 600 !important;
}

body.premium-ui :where(.workflow-hero, .channel-hero, .sample-hero, .brake-hero, .fulfillment-hero, .ranking-hero) p {
  color: var(--wx-text-muted) !important;
}

body.premium-ui .kicker {
  color: var(--wx-primary) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
}

body.premium-ui .flow-pipeline { gap: 8px !important; }
body.premium-ui .flow-pipeline button {
  padding: 12px !important;
  border: 1px solid var(--wx-border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--wx-text) !important;
  box-shadow: none !important;
}
body.premium-ui .flow-pipeline button:hover { transform: none !important; border-color: var(--wx-border-strong) !important; }
body.premium-ui .flow-pipeline b { width: 26px !important; height: 26px !important; border-radius: 7px !important; }
body.premium-ui .flow-pipeline span { font-weight: 600 !important; }

body.premium-ui .business-command { gap: var(--ui-section-gap) !important; }
body.premium-ui .bcc-header {
  padding: 20px !important;
  border: 1px solid var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: var(--wx-shadow-card) !important;
}
body.premium-ui .bcc-header h2 { margin: 5px 0 !important; font-size: 22px !important; font-weight: 600 !important; }
body.premium-ui .bcc-header p { color: var(--wx-text-muted) !important; }
body.premium-ui .bcc-safety {
  padding: 12px 14px !important;
  border: 1px solid var(--wx-warning-border) !important;
  border-radius: 8px !important;
  background: var(--wx-warning-soft) !important;
  color: var(--wx-warning) !important;
}
body.premium-ui .bcc-stats,
body.premium-ui .bcc-module-grid { gap: 10px !important; }
body.premium-ui .bcc-stats button,
body.premium-ui .bcc-center-card,
body.premium-ui .bcc-lower > section,
body.premium-ui .bcc-work-queues,
body.premium-ui .bcc-uat-actions {
  border: 1px solid var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
}
body.premium-ui .bcc-stats button { padding: 14px 16px !important; }
body.premium-ui .bcc-stats strong { font-size: 25px !important; font-weight: 600 !important; }
body.premium-ui .bcc-center-card {
  min-height: 158px !important;
  padding: 16px !important;
  border-left-width: 3px !important;
}
body.premium-ui .bcc-center-card:hover { transform: none !important; border-color: var(--wx-border-strong) !important; background: #fcfcfd !important; }
body.premium-ui .bcc-center-head b { font-size: 15px !important; font-weight: 600 !important; }
body.premium-ui .bcc-center-head i,
body.premium-ui .bcc-dimensions em { border-radius: 6px !important; font-size: 11px !important; }
body.premium-ui .bcc-lower > section,
body.premium-ui .bcc-work-queues,
body.premium-ui .bcc-uat-actions { padding: 18px !important; }
body.premium-ui .bcc-list button,
body.premium-ui .bcc-task-numbers div,
body.premium-ui .bcc-callout,
body.premium-ui .bcc-queue-grid button,
body.premium-ui .bcc-action-stage,
body.premium-ui .bcc-action-item,
body.premium-ui .bcc-action-footnote {
  border-radius: 8px !important;
  box-shadow: none !important;
}
body.premium-ui .bcc-queue-grid button { padding: 13px !important; }
body.premium-ui .bcc-queue-grid b { font-size: 22px !important; font-weight: 600 !important; }

body.premium-ui .global-trust-banner {
  padding: 14px 16px !important;
  border: 1px solid var(--wx-info-border) !important;
  border-radius: 10px !important;
  background: var(--wx-info-soft) !important;
  box-shadow: none !important;
}
body.premium-ui .global-trust-banner.ok { border-color: var(--wx-success-border) !important; background: var(--wx-success-soft) !important; }
body.premium-ui .global-trust-banner.warn { border-color: var(--wx-warning-border) !important; background: var(--wx-warning-soft) !important; }

body.premium-ui .foundation-summary-banner,
body.premium-ui .product-quality-banner {
  padding: 16px 18px !important;
  border: 1px solid var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.premium-ui .product-quality-banner.has-risk {
  border-color: var(--wx-warning-border) !important;
  background: var(--wx-warning-soft) !important;
}

body.premium-ui .finance-v1-hero {
  padding: 20px !important;
  border: 1px solid var(--wx-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  background-image: none !important;
  box-shadow: var(--wx-shadow-card) !important;
}

body.premium-ui .finance-v1-hero h2 {
  font-size: 20px !important;
  font-weight: 600 !important;
}

body.premium-ui .finance-v1-trust {
  border-color: var(--wx-border) !important;
  border-radius: 8px !important;
  background: var(--wx-surface-subtle) !important;
}

body.premium-ui .finance-v1-trust b { font-size: 26px !important; font-weight: 600 !important; }
body.premium-ui .finance-v1-tabs { gap: 6px !important; margin-bottom: var(--ui-section-gap) !important; }
body.premium-ui .finance-v1-tabs button {
  min-height: 60px !important;
  padding: 9px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  background-image: none !important;
  color: var(--wx-text-muted) !important;
  box-shadow: none !important;
}
body.premium-ui .finance-v1-tabs button:hover {
  border-color: var(--wx-border) !important;
  background: #fff !important;
  color: var(--wx-ink) !important;
}
body.premium-ui .finance-v1-tabs button.active {
  border-color: var(--wx-primary-border) !important;
  background: var(--wx-primary-soft) !important;
  background-image: none !important;
  color: var(--wx-primary) !important;
  box-shadow: inset 2px 0 var(--wx-primary) !important;
}
body.premium-ui .finance-v1-tabs button > span { font-size: 12px !important; font-weight: 500 !important; }
body.premium-ui .finance-v1-card,
body.premium-ui .finance-v1-metric,
body.premium-ui .finance-v1-boundary {
  border-radius: 10px !important;
  box-shadow: none !important;
}
body.premium-ui .finance-v1-metric { min-height: 96px !important; padding: 14px !important; }
body.premium-ui .finance-v1-metric b { font-size: 22px !important; font-weight: 600 !important; }
body.premium-ui .finance-v1-step-index { font-weight: 600 !important; }

/* Dialogs, drawers and feedback */
body.premium-ui :where(.modal, .drawer-backdrop) {
  background: rgba(16, 24, 40, 0.54) !important;
  backdrop-filter: blur(3px);
}

body.premium-ui .modal { padding: 24px !important; }
body.premium-ui .modal-card {
  width: min(680px, calc(100vw - 48px)) !important;
  max-width: 680px !important;
  max-height: calc(100vh - 48px) !important;
  margin: auto !important;
  overflow: auto !important;
  border: 1px solid var(--wx-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: var(--wx-shadow-float) !important;
}

body.premium-ui :where(.modal-head, .drawer-head) {
  min-height: 58px !important;
  padding: 15px 18px !important;
  border-bottom: 1px solid var(--wx-border) !important;
  background: #fff !important;
}
body.premium-ui .modal-head h2 { font-size: 17px !important; font-weight: 600 !important; }
body.premium-ui .modal-head .close {
  width: 32px !important;
  height: 32px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--wx-surface-muted) !important;
  color: var(--wx-text-muted) !important;
}
body.premium-ui #modalBody,
body.premium-ui :where(.modal-body, .drawer-body) { padding: 18px !important; }
body.premium-ui .modal-card form { gap: 16px !important; }
body.premium-ui :where(.form-actions, .modal-actions, .drawer-actions) {
  margin-top: 4px !important;
  padding-top: 16px !important;
  border-top: 1px solid var(--wx-border) !important;
}

body.premium-ui .drawer {
  border-left: 1px solid var(--wx-border) !important;
  border-radius: 12px 0 0 12px !important;
  background: #fff !important;
  box-shadow: var(--wx-shadow-drawer) !important;
}

body.premium-ui #toast {
  border-radius: 8px !important;
  background: var(--wx-brand-900) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.18) !important;
}

body.premium-ui :where(.empty, .empty-state, .error-state, .loading-state) {
  padding: 40px 24px !important;
  color: var(--wx-text-muted) !important;
  text-align: center;
}

body.premium-ui :where(.skeleton, [data-loading="true"]) {
  border-radius: 6px !important;
  background: #e9edf2 !important;
}

body.premium-ui :where(.pagination, .pager) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
}

@media (max-width: 1100px) {
  :root { --ui-page-padding: 20px; }
}

@media (max-width: 900px) {
  body.premium-ui > aside { width: var(--ui-sidebar-collapsed) !important; }
  body.premium-ui > main {
    width: calc(100% - var(--ui-sidebar-collapsed)) !important;
    margin-left: var(--ui-sidebar-collapsed) !important;
  }
  body.premium-ui .brand { justify-content: center !important; padding: 16px !important; }
  body.premium-ui .brand > div,
  body.premium-ui .nav-label,
  body.premium-ui .nav-section-title,
  body.premium-ui .aside-foot span,
  body.premium-ui .aside-foot small { display: none !important; }
  body.premium-ui aside nav button[data-page] { justify-content: center !important; padding: 9px !important; }
}

@media (max-width: 900px) {
  :root { --ui-page-padding: 16px; }
  body.premium-ui { min-width: 0 !important; }
  body.premium-ui aside .sidebar-toggle { display: none !important; }
  body.premium-ui > aside {
    width: 240px !important;
    transform: translateX(-100%);
    transition: transform 180ms ease !important;
  }
  body.premium-ui > main,
  body.premium-ui.sidebar-collapsed > main {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
  body.premium-ui.sidebar-collapsed > aside {
    width: 240px !important;
    transform: translateX(0) !important;
    box-shadow: 12px 0 36px rgba(16, 24, 40, 0.22) !important;
  }
  body.premium-ui.sidebar-collapsed .brand { justify-content: flex-start !important; padding: 16px 18px !important; }
  body.premium-ui.sidebar-collapsed .brand > div,
  body.premium-ui.sidebar-collapsed .nav-label,
  body.premium-ui.sidebar-collapsed .nav-section-title,
  body.premium-ui.sidebar-collapsed .aside-foot span,
  body.premium-ui.sidebar-collapsed .aside-foot small { display: initial !important; }
  body.premium-ui.sidebar-collapsed aside nav button[data-page] { justify-content: flex-start !important; padding: 8px 10px !important; }
  body.premium-ui main > header { min-height: 68px !important; height: 68px !important; }
  body.premium-ui .page-heading h1,
  body.premium-ui #title { font-size: 19px !important; }
  body.premium-ui .header-breadcrumb,
  body.premium-ui .header-context { display: none !important; }
  body.premium-ui .modal { padding: 10px !important; }
  body.premium-ui .modal-card { width: 100% !important; max-height: calc(100vh - 20px) !important; border-radius: 10px !important; }
  body.premium-ui .mobile-menu-toggle {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--wx-border) !important;
    border-radius: 10px;
    background: #fff !important;
    color: var(--wx-text) !important;
    box-shadow: var(--wx-shadow-card) !important;
  }
  body.premium-ui .mobile-menu-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
  body.premium-ui.sidebar-collapsed .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 44;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.34);
  }
  body.premium-ui.sidebar-collapsed > aside { z-index: 45 !important; }
}

.bcc-uat-loader { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.bcc-uat-loader b,.bcc-uat-loader span { display: block; }
.bcc-uat-loader span { margin-top: 5px; color: var(--wx-text-muted); font-size: 12px; line-height: 1.55; }
@media (max-width: 700px) { .bcc-uat-loader { align-items: stretch; flex-direction: column; } }

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