/* === XR UI2 CORE KIT V1 START === */

html.xr-ui2-runtime {
  --xr2-bg: #f4f3ef;
  --xr2-surface: #ffffff;
  --xr2-surface-soft: #f8f7f4;
  --xr2-surface-muted: #efeee9;
  --xr2-border: #e4e1da;
  --xr2-border-strong: #d1cec6;

  --xr2-text: #202328;
  --xr2-text-soft: #444952;
  --xr2-muted: #737985;
  --xr2-faint: #9aa0aa;

  --xr2-brand: #0b6cff;
  --xr2-brand-hover: #0058d9;
  --xr2-brand-soft: #eaf2ff;
  --xr2-success: #059669;
  --xr2-success-soft: #ecfdf5;
  --xr2-warning: #d97706;
  --xr2-warning-soft: #fffbeb;
  --xr2-danger: #dc2626;
  --xr2-danger-soft: #fef2f2;
  --xr2-info: #0284c7;
  --xr2-info-soft: #f0f9ff;

  --xr2-radius-sm: 6px;
  --xr2-radius: 8px;
  --xr2-radius-lg: 10px;

  --xr2-shadow-xs: 0 2px 4px rgba(28, 31, 36, 0.035), 0 10px 28px rgba(28, 31, 36, 0.04);
  --xr2-shadow-sm: 0 8px 24px rgba(28, 31, 36, 0.08);
  --xr2-shadow-drawer: -18px 0 48px rgba(15, 18, 24, 0.16);

  --xr2-space-1: 4px;
  --xr2-space-2: 8px;
  --xr2-space-3: 12px;
  --xr2-space-4: 16px;
  --xr2-space-5: 20px;
  --xr2-space-6: 24px;

  --xr2-control-h: 36px;
  --xr2-row-h: 44px;
  --xr2-content-max: 1680px;
}

html.xr-ui2-runtime,
html.xr-ui2-runtime body {
  color-scheme: light;
}

.xr-ui2-runtime .xr2-page,
.xr-ui2-runtime .xr2-page *,
.xr-ui2-runtime .xr2-drawer,
.xr-ui2-runtime .xr2-drawer * {
  box-sizing: border-box;
}

.xr-ui2-runtime .xr2-page {
  width: min(100%, var(--xr2-content-max));
  margin: 0 auto;
  padding: var(--xr2-space-5) var(--xr2-space-6) var(--xr2-space-6);
  color: var(--xr2-text);
  font-size: 14px;
  line-height: 1.4;
}

.xr-ui2-runtime .xr2-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--xr2-space-4);
  margin-bottom: var(--xr2-space-4);
}

.xr-ui2-runtime .xr2-page-copy {
  min-width: 0;
}

.xr-ui2-runtime .xr2-eyebrow {
  margin: 0 0 var(--xr2-space-1);
  color: var(--xr2-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.xr-ui2-runtime .xr2-title {
  margin: 0;
  color: var(--xr2-text);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -.02em;
}

.xr-ui2-runtime .xr2-subtitle {
  max-width: 860px;
  margin: var(--xr2-space-1) 0 0;
  color: var(--xr2-muted);
  font-size: 13px;
}

.xr-ui2-runtime .xr2-page-actions,
.xr-ui2-runtime .xr2-actions,
.xr-ui2-runtime .xr2-toolbar-left,
.xr-ui2-runtime .xr2-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--xr2-space-2);
  flex-wrap: wrap;
}

.xr-ui2-runtime .xr2-panel {
  border: 1px solid var(--xr2-border);
  border-radius: var(--xr2-radius);
  background: var(--xr2-surface);
  box-shadow: var(--xr2-shadow-xs);
}

.xr-ui2-runtime .xr2-panel + .xr2-panel {
  margin-top: var(--xr2-space-3);
}

.xr-ui2-runtime .xr2-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--xr2-space-3);
  min-height: 44px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--xr2-border);
}

.xr-ui2-runtime .xr2-panel-head--borderless {
  border-bottom: 0;
}

.xr-ui2-runtime .xr2-panel-title {
  margin: 0;
  color: var(--xr2-text);
  font-size: 15px;
  font-weight: 700;
}

.xr-ui2-runtime .xr2-panel-subtitle {
  margin: 2px 0 0;
  color: var(--xr2-muted);
  font-size: 12px;
}

.xr-ui2-runtime .xr2-panel-body {
  padding: 12px;
}

.xr-ui2-runtime .xr2-panel-body--flush {
  padding: 0;
}

.xr-ui2-runtime .xr2-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--xr2-space-3);
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--xr2-border);
  border-radius: var(--xr2-radius);
  background: var(--xr2-surface);
}

.xr-ui2-runtime .xr2-toolbar + .xr2-panel,
.xr-ui2-runtime .xr2-toolbar + .xr2-table-wrap {
  margin-top: var(--xr2-space-3);
}

.xr-ui2-runtime .xr2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--xr2-control-h);
  padding: 0 12px;
  border: 1px solid var(--xr2-border-strong);
  border-radius: var(--xr2-radius-sm);
  background: var(--xr2-surface);
  color: var(--xr2-text-soft);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.xr-ui2-runtime .xr2-btn:hover {
  border-color: #aebccc;
  background: var(--xr2-surface-soft);
}

.xr-ui2-runtime .xr2-btn:focus-visible {
  outline: 2px solid var(--xr2-brand);
  outline-offset: 2px;
}

.xr-ui2-runtime .xr2-btn--primary {
  border-color: var(--xr2-brand);
  background: var(--xr2-brand);
  color: #fff;
}

.xr-ui2-runtime .xr2-btn--primary:hover {
  border-color: var(--xr2-brand-hover);
  background: var(--xr2-brand-hover);
}

.xr-ui2-runtime .xr2-btn--danger {
  border-color: #fecaca;
  background: var(--xr2-danger-soft);
  color: #b91c1c;
}

.xr-ui2-runtime .xr2-btn--ghost {
  border-color: transparent;
  background: transparent;
}

.xr-ui2-runtime .xr2-btn--icon {
  width: var(--xr2-control-h);
  padding: 0;
}

.xr-ui2-runtime .xr2-btn[disabled],
.xr-ui2-runtime .xr2-btn[aria-disabled="true"] {
  opacity: .46;
  cursor: not-allowed;
}

.xr-ui2-runtime .xr2-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.xr-ui2-runtime .xr2-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--xr2-radius-sm);
  background: transparent;
  color: var(--xr2-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.xr-ui2-runtime .xr2-tab:hover {
  background: var(--xr2-surface-muted);
  color: var(--xr2-text);
}

.xr-ui2-runtime .xr2-tab.is-active,
.xr-ui2-runtime .xr2-tab[aria-selected="true"] {
  border-color: #bfdbfe;
  background: var(--xr2-brand-soft);
  color: var(--xr2-brand);
}

.xr-ui2-runtime .xr2-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--xr2-border);
  border-radius: 999px;
  background: var(--xr2-surface-soft);
  color: var(--xr2-text-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.xr-ui2-runtime .xr2-badge--brand {
  border-color: #bfdbfe;
  background: var(--xr2-brand-soft);
  color: #1d4ed8;
}

.xr-ui2-runtime .xr2-badge--success {
  border-color: #a7f3d0;
  background: var(--xr2-success-soft);
  color: #047857;
}

.xr-ui2-runtime .xr2-badge--warning {
  border-color: #fde68a;
  background: var(--xr2-warning-soft);
  color: #b45309;
}

.xr-ui2-runtime .xr2-badge--danger {
  border-color: #fecaca;
  background: var(--xr2-danger-soft);
  color: #b91c1c;
}

.xr-ui2-runtime .xr2-badge--info {
  border-color: #bae6fd;
  background: var(--xr2-info-soft);
  color: #0369a1;
}

.xr-ui2-runtime .xr2-metric-strip {
  display: grid;
  grid-template-columns: repeat(var(--xr2-metric-cols, 4), minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--xr2-border);
  border-radius: var(--xr2-radius);
  background: var(--xr2-surface);
}

.xr-ui2-runtime .xr2-metric {
  min-width: 0;
  padding: 9px 11px;
  border-right: 1px solid var(--xr2-border);
}

.xr-ui2-runtime .xr2-metric:last-child {
  border-right: 0;
}

.xr-ui2-runtime .xr2-metric-label {
  color: var(--xr2-muted);
  font-size: 11px;
}

.xr-ui2-runtime .xr2-metric-value {
  margin-top: 2px;
  color: var(--xr2-text);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.1;
}

.xr-ui2-runtime .xr2-metric-note {
  margin-top: 2px;
  color: var(--xr2-faint);
  font-size: 10px;
}

.xr-ui2-runtime .xr2-table-wrap {
  overflow: auto;
  border: 1px solid var(--xr2-border);
  border-radius: var(--xr2-radius);
  background: var(--xr2-surface);
}

.xr-ui2-runtime .xr2-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--xr2-text-soft);
  font-size: 13px;
}

.xr-ui2-runtime .xr2-table th {
  height: 34px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--xr2-border);
  background: var(--xr2-surface-soft);
  color: var(--xr2-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .025em;
  text-align: left;
  text-transform: uppercase;
  vertical-align: middle;
}

.xr-ui2-runtime .xr2-table td {
  height: var(--xr2-row-h);
  padding: 7px 10px;
  border-bottom: 1px solid #e8edf4;
  vertical-align: middle;
}

.xr-ui2-runtime .xr2-table tbody tr:last-child td {
  border-bottom: 0;
}

.xr-ui2-runtime .xr2-table tbody tr:hover {
  background: #f9fbfd;
}

.xr-ui2-runtime .xr2-table-row--clickable {
  cursor: pointer;
}

.xr-ui2-runtime .xr2-cell-main {
  min-width: 0;
  color: var(--xr2-text);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xr-ui2-runtime .xr2-cell-sub {
  margin-top: 2px;
  color: var(--xr2-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xr-ui2-runtime .xr2-field {
  min-width: 0;
}

.xr-ui2-runtime .xr2-field-label {
  display: block;
  margin: 0 0 5px;
  color: var(--xr2-text-soft);
  font-size: 11px;
  font-weight: 650;
}

.xr-ui2-runtime .xr2-input,
.xr-ui2-runtime .xr2-select,
.xr-ui2-runtime .xr2-textarea {
  width: 100%;
  min-height: var(--xr2-control-h);
  border: 1px solid var(--xr2-border-strong);
  border-radius: var(--xr2-radius-sm);
  background: var(--xr2-surface);
  color: var(--xr2-text);
  font: inherit;
  outline: none;
}

.xr-ui2-runtime .xr2-input,
.xr-ui2-runtime .xr2-select {
  padding: 0 10px;
}

.xr-ui2-runtime .xr2-textarea {
  min-height: 76px;
  padding: 8px 10px;
  resize: vertical;
}

.xr-ui2-runtime .xr2-input:focus,
.xr-ui2-runtime .xr2-select:focus,
.xr-ui2-runtime .xr2-textarea:focus {
  border-color: #93b4fb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.xr-ui2-runtime .xr2-field-hint {
  margin-top: 4px;
  color: var(--xr2-muted);
  font-size: 10px;
}

.xr-ui2-runtime .xr2-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px 12px;
}

.xr-ui2-runtime .xr2-col-12 { grid-column: span 12; }
.xr-ui2-runtime .xr2-col-9  { grid-column: span 9; }
.xr-ui2-runtime .xr2-col-8  { grid-column: span 8; }
.xr-ui2-runtime .xr2-col-6  { grid-column: span 6; }
.xr-ui2-runtime .xr2-col-4  { grid-column: span 4; }
.xr-ui2-runtime .xr2-col-3  { grid-column: span 3; }

.xr-ui2-runtime .xr2-empty {
  display: flex;
  min-height: 88px;
  padding: 16px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.xr-ui2-runtime .xr2-empty-title {
  color: var(--xr2-text-soft);
  font-weight: 650;
}

.xr-ui2-runtime .xr2-empty-text {
  max-width: 520px;
  margin-top: 3px;
  color: var(--xr2-muted);
  font-size: 12px;
}

.xr-ui2-runtime .xr2-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--xr2-border);
  border-radius: var(--xr2-radius);
  background: var(--xr2-surface);
}

.xr-ui2-runtime .xr2-alert--warning {
  border-color: #fde68a;
  background: var(--xr2-warning-soft);
}

.xr-ui2-runtime .xr2-alert--danger {
  border-color: #fecaca;
  background: var(--xr2-danger-soft);
}

.xr-ui2-runtime .xr2-alert--success {
  border-color: #a7f3d0;
  background: var(--xr2-success-soft);
}

/* Notice tokens are shared by pages and Dashboard, independent of legacy field tokens. */
html.xr-ui2-runtime {
  --xr2-notice-bg: #fcfcf7;
  --xr2-notice-danger-bg: #f7f0ed;
  --xr2-notice-text: #232b2c;
  --xr2-notice-muted: #526168;
  --xr2-notice-border: #b9beb7;
  --xr2-notice-action-bg: #eaece7;
  --xr2-notice-action-border: #7c857f;
  --xr2-notice-accent: #9c7828;
  --xr2-notice-danger: #af4942;
}
html.xr-ui2-runtime[data-ui3-theme="dark"] {
  --xr2-notice-bg: #1b1f22;
  --xr2-notice-danger-bg: #292628;
  --xr2-notice-text: #f3f3ee;
  --xr2-notice-muted: #b8c1c7;
  --xr2-notice-border: #50595f;
  --xr2-notice-action-bg: #24292d;
  --xr2-notice-action-border: #808b92;
  --xr2-notice-accent: #e4c474;
  --xr2-notice-danger: #f28a82;
}
/* Preserve every message/action; wrap content instead of reserving empty rows. */
.xr-ui2-runtime .xr2-page-host > .mode-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 1px solid var(--xr2-notice-border);
  border-left: 3px solid var(--xr2-notice-accent);
  border-radius: 8px;
  background: var(--xr2-notice-bg);
  color: var(--xr2-notice-text);
  box-shadow: none;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner > div:first-child {
  min-width: 0;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner strong {
  color: var(--xr2-notice-text);
  font-size: 12px;
  line-height: 1.3;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner p,
.xr-ui2-runtime .xr2-page-host > .mode-banner .subtle {
  display: inline;
  margin: 0 0 0 8px;
  /* Legacy styles.css pins .subtle with !important; this component owns its text. */
  color: var(--xr2-notice-muted) !important;
  font-size: 12px;
  line-height: 1.4;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner > .toolbar {
  flex: 0 0 auto;
  margin: 0;
  gap: 6px;
  flex-wrap: wrap;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner .tag {
  background: var(--xr2-notice-action-bg);
  color: var(--xr2-notice-text);
  border-color: var(--xr2-notice-border);
  width: auto;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner .ghost-button {
  min-height: 36px;
  padding: 6px 10px;
  border-color: var(--xr2-notice-action-border) !important;
  border-radius: 6px;
  background: var(--xr2-notice-action-bg) !important;
  color: var(--xr2-notice-text) !important;
  white-space: normal;
  line-height: 1.3;
  font-size: 12px;
  font-weight: 700;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner .ghost-button:hover {
  border-color: var(--xr2-notice-accent) !important;
  background: var(--xr2-notice-bg) !important;
}
.xr-ui2-runtime .xr2-page-host > .mode-banner .ghost-button:focus-visible {
  outline: 2px solid var(--xr2-notice-accent);
  outline-offset: 2px;
}

.xr-ui2-runtime .xr2-page-host > .mode-banner.danger-banner {
  border-left-color: var(--xr2-notice-danger);
  background: var(--xr2-notice-danger-bg);
}

.xr-ui2-runtime .xr2-page-host > .mode-banner.danger-banner .ghost-button {
  border-color: var(--xr2-notice-action-border);
  color: var(--xr2-notice-text);
}

.xr-ui2-runtime .xr2-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, var(--xr2-aside, 380px));
  gap: var(--xr2-space-3);
  align-items: start;
}

.xr-ui2-runtime .xr2-sticky {
  position: sticky;
  top: 12px;
}

.xr-ui2-runtime .xr2-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .22);
}

.xr-ui2-runtime .xr2-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 81;
  display: block;
  width: min(560px, calc(100vw - 40px));
  overflow: auto;
  border-left: 1px solid var(--xr2-border);
  background: var(--xr2-surface);
  box-shadow: var(--xr2-shadow-drawer);
}

.xr-ui2-runtime .xr2-drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--xr2-border);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
}

.xr-ui2-runtime .xr2-drawer-body {
  padding: 16px;
}

.xr-ui2-runtime .xr2-action-menu {
  position: relative;
  display: inline-block;
}

.xr-ui2-runtime .xr2-action-menu-popover {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 30;
  min-width: 188px;
  padding: 5px;
  border: 1px solid var(--xr2-border);
  border-radius: var(--xr2-radius);
  background: var(--xr2-surface);
  box-shadow: var(--xr2-shadow-sm);
}

.xr-ui2-runtime .xr2-action-menu-item {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--xr2-text-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.xr-ui2-runtime .xr2-action-menu-item:hover {
  background: var(--xr2-surface-muted);
}

.xr-ui2-runtime .xr2-action-menu-item--danger {
  color: var(--xr2-danger);
}

.xr-ui2-runtime .xr2-kbd {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 5px;
  border: 1px solid var(--xr2-border);
  border-bottom-color: var(--xr2-border-strong);
  border-radius: 4px;
  background: var(--xr2-surface-soft);
  color: var(--xr2-muted);
  font-size: 10px;
  font-weight: 700;
}

.xr-ui2-runtime .xr2-muted { color: var(--xr2-muted); }
.xr-ui2-runtime .xr2-danger-text { color: var(--xr2-danger); }
.xr-ui2-runtime .xr2-success-text { color: var(--xr2-success); }
.xr-ui2-runtime .xr2-nowrap { white-space: nowrap; }
.xr-ui2-runtime .xr2-truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .xr-ui2-runtime .xr2-page {
    padding: 16px;
  }

  .xr-ui2-runtime .xr2-split {
    grid-template-columns: 1fr;
  }

  .xr-ui2-runtime .xr2-sticky {
    position: static;
  }

  .xr-ui2-runtime .xr2-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xr-ui2-runtime .xr2-metric:nth-child(2n) {
    border-right: 0;
  }

  .xr-ui2-runtime .xr2-metric:nth-child(n+3) {
    border-top: 1px solid var(--xr2-border);
  }
}

@media (max-width: 720px) {
  .xr-ui2-runtime .xr2-page {
    padding: 12px;
    font-size: 13px;
  }

  .xr-ui2-runtime .xr2-page-header,
  .xr-ui2-runtime .xr2-toolbar,
  .xr-ui2-runtime .xr2-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .xr-ui2-runtime .xr2-page-actions,
  .xr-ui2-runtime .xr2-toolbar-left,
  .xr-ui2-runtime .xr2-toolbar-right {
    width: 100%;
  }

  .xr-ui2-runtime .xr2-title {
    font-size: 21px;
  }

  .xr-ui2-runtime .xr2-form-grid {
    grid-template-columns: 1fr;
  }

  .xr-ui2-runtime .xr2-col-12,
  .xr-ui2-runtime .xr2-col-9,
  .xr-ui2-runtime .xr2-col-8,
  .xr-ui2-runtime .xr2-col-6,
  .xr-ui2-runtime .xr2-col-4,
  .xr-ui2-runtime .xr2-col-3 {
    grid-column: 1;
  }

  .xr-ui2-runtime .xr2-drawer {
    width: 100vw;
  }

  .xr-ui2-runtime .xr2-page-host > .mode-banner {
    align-items: center;
  }
  .xr-ui2-runtime .xr2-page-host > .mode-banner p,
  .xr-ui2-runtime .xr2-page-host > .mode-banner .subtle {
    display: block;
    margin: 2px 0 0;
  }
  .xr-ui2-runtime .xr2-page-host > .mode-banner > .toolbar:has(button) {
    grid-column: 1 / -1;
  }
  .xr-ui2-runtime .xr2-page-host > .mode-banner .ghost-button {
    width: auto;
    max-width: 138px;
  }
}

/* === XR UI2 CORE KIT V1 END === */

/* === XR UI2 VISUAL FOUNDATION V1 START === */

html.xr-ui2-runtime {
  --xr2-bg: #f4f3ef;
  --xr2-surface: #ffffff;
  --xr2-surface-raised: #ffffff;
  --xr2-surface-soft: #f8f7f4;
  --xr2-surface-muted: #efeee9;
  --xr2-surface-section: #faf9f6;
  --xr2-border-subtle: #ece9e3;
  --xr2-border: #e4e1da;
  --xr2-border-strong: #d1cec6;
  --xr2-ring: rgba(11, 108, 255, .16);

  --xr2-brand: #0b6cff;
  --xr2-brand-hover: #0058d9;
  --xr2-brand-soft: #eaf2ff;
  --xr2-success: #07875f;
  --xr2-success-soft: #eaf8f1;
  --xr2-warning: #b96d08;
  --xr2-warning-soft: #fff5dd;
  --xr2-danger: #c93636;
  --xr2-danger-soft: #fff0ef;
  --xr2-info: #0679ad;
  --xr2-info-soft: #eaf7fd;

  --xr2-shadow-xs: 0 2px 4px rgba(28, 31, 36, .035), 0 10px 28px rgba(28, 31, 36, .04);
  --xr2-shadow-sm: 0 8px 24px rgba(28, 31, 36, .08);
  --xr2-shadow-drawer: -18px 0 48px rgba(15, 18, 24, .16);

  --xr2-primary: var(--xr2-brand);
  --xr2-primary-hover: var(--xr2-brand-hover);
  --xr2-control: var(--xr2-control-h);
}

html.xr-ui2-runtime .xr-ui-v2 {
  --xr2-bg: #f4f3ef;
  --xr2-surface: #ffffff;
  --xr2-surface-soft: #f8f7f4;
  --xr2-border: #e4e1da;
  --xr2-text: #202328;
  --xr2-muted: #737985;
  --xr2-primary: #0b6cff;
  --xr2-primary-hover: #0058d9;
  --xr2-success: #07875f;
  --xr2-warning: #b96d08;
  --xr2-danger: #c93636;
  --xr2-neutral: #7b8794;
  --xr2-shadow: 0 2px 4px rgba(28, 31, 36, .035), 0 10px 28px rgba(28, 31, 36, .04);
}

.xr-ui2-runtime .xr2-panel,
.xr-ui2-runtime .xr2-toolbar,
.xr-ui2-runtime .xr2-table-wrap,
.xr-ui2-runtime .xr2-metric-strip {
  border-color: var(--xr2-border);
  box-shadow: var(--xr2-shadow-xs);
}

.xr-ui2-runtime .xr2-panel-head,
.xr-ui2-runtime .xr2-table th {
  background: var(--xr2-surface-section);
  border-color: var(--xr2-border);
}

.xr-ui2-runtime .xr2-btn {
  border-color: var(--xr2-border-strong);
  box-shadow: 0 1px 1px rgba(15, 23, 42, .03);
}

.xr-ui2-runtime .xr2-btn:hover {
  border-color: var(--xr2-border-strong);
  background: var(--xr2-surface-soft);
}

.xr-ui2-runtime .xr2-btn:focus-visible,
.xr-ui2-runtime .xr2-input:focus,
.xr-ui2-runtime .xr2-select:focus,
.xr-ui2-runtime .xr2-textarea:focus {
  border-color: var(--xr2-brand);
  box-shadow: 0 0 0 3px var(--xr2-ring);
}

.xr-ui2-runtime .xr2-tab.is-active,
.xr-ui2-runtime .xr2-tab[aria-selected="true"] {
  border-color: var(--xr2-brand);
  background: var(--xr2-brand-soft);
  box-shadow: inset 0 -2px 0 var(--xr2-brand);
}

.xr-ui2-runtime .xr2-badge {
  border-color: var(--xr2-border-strong);
  font-weight: 750;
}

.xr-ui2-runtime .xr2-table td {
  border-bottom-color: var(--xr2-border-subtle);
}

.xr-ui2-runtime .xr2-table tbody tr:hover td {
  background: var(--xr2-surface-soft);
}

.xr-ui2-runtime .xr2-alert {
  border-left-width: 4px;
  box-shadow: var(--xr2-shadow-xs);
}

.xr-ui2-runtime .xr2-alert--warning { border-left-color: var(--xr2-warning); }
.xr-ui2-runtime .xr2-alert--danger { border-left-color: var(--xr2-danger); }
.xr-ui2-runtime .xr2-alert--success { border-left-color: var(--xr2-success); }

.xr-ui2-runtime .xr2-drawer,
.xr-ui2-runtime .xr2-action-menu-popover {
  border-color: var(--xr2-border-strong);
  background: var(--xr2-surface-raised);
}

html.xr-ui2-runtime .modal-backdrop {
  z-index: 1200;
  background: rgba(15, 23, 42, .34) !important;
  backdrop-filter: blur(6px) !important;
}

html.xr-ui2-runtime .modal {
  border: 1px solid var(--xr2-border-strong) !important;
  background: #ffffff !important;
  color: var(--xr2-text) !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .20) !important;
}

html.xr-ui2-runtime .modal > .panel-head {
  border-bottom: 1px solid var(--xr2-border) !important;
  background: rgba(255, 255, 255, .97) !important;
  color: var(--xr2-text) !important;
}

html.xr-ui2-runtime .modal h1,
html.xr-ui2-runtime .modal h2,
html.xr-ui2-runtime .modal h3,
html.xr-ui2-runtime .modal h4,
html.xr-ui2-runtime .modal strong,
html.xr-ui2-runtime .modal label {
  color: var(--xr2-text) !important;
}

html.xr-ui2-runtime .modal p,
html.xr-ui2-runtime .modal small,
html.xr-ui2-runtime .modal .subtle {
  color: var(--xr2-muted) !important;
}

html.xr-ui2-runtime .modal input,
html.xr-ui2-runtime .modal select,
html.xr-ui2-runtime .modal textarea {
  border-color: var(--xr2-border-strong) !important;
  background: #ffffff !important;
  color: var(--xr2-text) !important;
  color-scheme: light !important;
}

html.xr-ui2-runtime .modal select option,
html.xr-ui2-runtime .modal select optgroup {
  background: #ffffff !important;
  color: var(--xr2-text) !important;
}

html.xr-ui2-runtime .modal .inline-create-panel,
html.xr-ui2-runtime .modal .breakdown-panel,
html.xr-ui2-runtime .modal .document-money-guide,
html.xr-ui2-runtime .modal .client-autofill-panel,
html.xr-ui2-runtime .modal .inn-preview,
html.xr-ui2-runtime .modal .client-autofill-preview,
html.xr-ui2-runtime .modal .mode-banner,
html.xr-ui2-runtime .modal .lookup-grid > div,
html.xr-ui2-runtime .modal .calculation-formula,
html.xr-ui2-runtime .modal .warehouse-order-summary,
html.xr-ui2-runtime .modal .warehouse-item-card {
  border-color: var(--xr2-border) !important;
  background: var(--xr2-surface-soft) !important;
  color: var(--xr2-text-soft) !important;
  box-shadow: none !important;
}

html.xr-ui2-runtime .modal .notice-row {
  border-color: var(--xr2-warning) !important;
  background: var(--xr2-warning-soft) !important;
  color: var(--xr2-warning) !important;
}

html.xr-ui2-runtime .modal .danger-zone,
html.xr-ui2-runtime .modal .warning-text,
html.xr-ui2-runtime .modal .warning-note {
  border-color: var(--xr2-danger) !important;
  background: var(--xr2-danger-soft) !important;
  color: var(--xr2-danger) !important;
}

/* === XR UI2 VISUAL FOUNDATION V1 END === */
