﻿.nexus-h1        { font-family: var(--nexus-font-heading); font-size: var(--nexus-fs-h1); line-height: var(--nexus-lh-h1); font-weight: var(--nexus-fw-semibold); letter-spacing: -0.02em; margin: 0; }
.nexus-h2        { font-family: var(--nexus-font-heading); font-size: var(--nexus-fs-h2); line-height: var(--nexus-lh-h2); font-weight: var(--nexus-fw-semibold); letter-spacing: -0.01em; margin: 0; }
.nexus-h3        { font-family: var(--nexus-font-heading); font-size: var(--nexus-fs-h3); line-height: var(--nexus-lh-h3); font-weight: var(--nexus-fw-semibold); margin: 0; }
.nexus-section   { font-size: var(--nexus-fs-section); line-height: var(--nexus-lh-section); font-weight: var(--nexus-fw-semibold);
                   letter-spacing: 0.08em; text-transform: uppercase; color: var(--nexus-text-muted); }
.nexus-label     { font-size: var(--nexus-fs-label); font-weight: var(--nexus-fw-medium); color: var(--nexus-text-secondary); }
.nexus-caption   { font-size: var(--nexus-fs-caption); color: var(--nexus-text-muted); }
.nexus-mono      { font-family: var(--nexus-font-mono); font-size: 12px; }
.nexus-num       { font-variant-numeric: tabular-nums; text-align: right; }
.nexus-kpi       { font-size: var(--nexus-fs-kpi); line-height: var(--nexus-lh-kpi); font-weight: var(--nexus-fw-semibold);
                   letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.nexus-rail { position: relative; }
.nexus-rail::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: var(--nexus-rail-width); border-radius: 1px;
  background: var(--nexus-primary);
}
.nexus-tab-active { box-shadow: inset 0 calc(-1 * var(--nexus-rail-width)) 0 var(--nexus-primary); }

.nexus-card {
  background: var(--nexus-surface);
  border: var(--nexus-border-width) solid var(--nexus-border);
  border-radius: var(--nexus-radius-lg);
  padding: var(--nexus-card-padding);
}
.nexus-card--flush { padding: 0; overflow: hidden; }

.nexus-grid { --dxbl-grid-border-color: transparent; }
.nexus-grid td { border-left: 0 !important; border-right: 0 !important; }
.nexus-grid tr { border-bottom: var(--nexus-border-width) solid var(--nexus-border-subtle); }

.nexus-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--nexus-radius-pill);
  font-size: var(--nexus-fs-caption); font-weight: var(--nexus-fw-medium);
  white-space: nowrap;
}
.nexus-chip__mark { width: 7px; height: 7px; flex: 0 0 auto; }
.nexus-chip--success { background: var(--nexus-success-subtle); color: var(--nexus-success-text); }
.nexus-chip--success .nexus-chip__mark { background: var(--nexus-success); border-radius: var(--nexus-radius-pill); }
.nexus-chip--warning { background: var(--nexus-warning-subtle); color: var(--nexus-warning-text); }
.nexus-chip--warning .nexus-chip__mark { background: var(--nexus-warning); transform: rotate(45deg); }
.nexus-chip--error   { background: var(--nexus-error-subtle); color: var(--nexus-error-text); }
.nexus-chip--error .nexus-chip__mark { border: 2px solid var(--nexus-error); border-radius: var(--nexus-radius-pill); }
.nexus-chip--neutral { background: var(--nexus-surface-alt); color: var(--nexus-text-secondary); }
.nexus-chip--neutral .nexus-chip__mark { background: var(--nexus-slate-400); border-radius: var(--nexus-radius-pill); }
.nexus-chip--auto    { background: var(--nexus-accent-subtle); color: var(--nexus-accent-text-on-subtle, var(--nexus-accent-text)); }
.nexus-chip--auto .nexus-chip__mark { background: var(--nexus-accent); border-radius: var(--nexus-radius-xs); }

.nexus-alert {
  display: flex; gap: 10px; padding: 11px 13px;
  border: var(--nexus-border-width) solid var(--nexus-border);
  border-left: 3px solid var(--nexus-text-muted);
  border-radius: var(--nexus-radius-md);
  font-size: var(--nexus-fs-body-sm); line-height: 1.5;
}
.nexus-alert--success { background: var(--nexus-success-subtle); border-left-color: var(--nexus-success); color: var(--nexus-success-text); }
.nexus-alert--warning { background: var(--nexus-warning-subtle); border-left-color: var(--nexus-warning); color: var(--nexus-warning-text); }
.nexus-alert--error   { background: var(--nexus-error-subtle);   border-left-color: var(--nexus-error);   color: var(--nexus-error-text); }
.nexus-alert--info    { background: var(--nexus-info-subtle);    border-left-color: var(--nexus-info);    color: var(--nexus-info-text); }

.nexus-readonly-editor {
  --dxbl-text-edit-bg: transparent;
  --dxbl-text-edit-readonly-bg: transparent;
  --dxbl-text-edit-border-color: transparent;
  --dxbl-text-edit-border-hovered-color: transparent;
  --dxbl-text-edit-color: var(--nexus-text-secondary);
}

.nexus-focusable:focus-visible {
  outline: none;
  border-color: var(--nexus-focus-border);
  box-shadow: var(--nexus-focus-ring);
}

.nexus-scroll-x { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *:not(.nx-motion-keep):not(.nx-motion-keep *) {
    transition: none !important;
    animation: none !important;
  }
}

.nx-cmd,
.nx-erpdict__btn,
.nx-erpviews__btn,
.nx-price__btn,
.nx-cond__btn,
.dm-archive__btn,
.nx-vwiz__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nexus-space-2);
  border: none;
  background: var(--nx-surface, var(--nexus-surface-elevated));
  color: var(--nx-text, var(--nexus-text-primary));
  border-radius: var(--nx-radius, var(--nexus-radius-md));
  min-height: var(--nx-control-h, 38px);
  padding: 0 16px;
  cursor: pointer;
  font-size: var(--nexus-fs-body-sm);
  font-family: inherit;
  font-weight: var(--nexus-fw-semibold);
  white-space: nowrap;
  box-shadow: var(--nx-shadow-card, none);
  transition: box-shadow .12s ease-out, background-color .12s ease-out;
}

.nx-cmd:hover:not(:disabled),
.nx-erpdict__btn:hover:not(:disabled),
.nx-erpviews__btn:hover:not(:disabled),
.nx-price__btn:hover:not(:disabled),
.nx-cond__btn:hover:not(:disabled),
.dm-archive__btn:hover:not(:disabled),
.nx-vwiz__btn:hover:not(:disabled) {
  background: var(--nx-field, var(--nexus-surface-alt));
  box-shadow: var(--nx-shadow-lift, none);
}

.nx-cmd:active:not(:disabled),
.nx-erpdict__btn:active:not(:disabled),
.nx-erpviews__btn:active:not(:disabled),
.nx-price__btn:active:not(:disabled),
.nx-cond__btn:active:not(:disabled),
.dm-archive__btn:active:not(:disabled),
.nx-vwiz__btn:active:not(:disabled) {
  box-shadow: var(--nx-shadow-card, none);
}

.nx-cmd:disabled,
.nx-erpdict__btn:disabled,
.nx-erpviews__btn:disabled,
.nx-price__btn:disabled,
.nx-cond__btn:disabled,
.dm-archive__btn:disabled,
.nx-vwiz__btn:disabled {
  background: var(--nx-field, var(--nexus-surface-alt));
  color: var(--nexus-text-muted);
  box-shadow: none;
  cursor: default;
  opacity: 1;
}

.nx-cmd:focus-visible,
.nx-erpdict__btn:focus-visible,
.nx-erpviews__btn:focus-visible,
.nx-price__btn:focus-visible,
.nx-cond__btn:focus-visible,
.dm-archive__btn:focus-visible,
.nx-vwiz__btn:focus-visible {
  outline: 2px solid var(--nexus-interactive);
  outline-offset: 1px;
}

.nx-cmd--primary,
.nx-erpdict__btn--primary,
.nx-erpviews__btn--primary,
.nx-price__btn--primary,
.nx-cond__btn--primary,
.dm-archive__btn--primary,
.nx-vwiz__btn--primary {
  background: var(--nx-teal, var(--nexus-primary));
  color: var(--nx-navy-deep, var(--nexus-text-on-primary));
  box-shadow: var(--nx-shadow-cta, none);
}

.nx-cmd--primary:hover:not(:disabled),
.nx-erpdict__btn--primary:hover:not(:disabled),
.nx-erpviews__btn--primary:hover:not(:disabled),
.nx-price__btn--primary:hover:not(:disabled),
.nx-cond__btn--primary:hover:not(:disabled),
.dm-archive__btn--primary:hover:not(:disabled),
.nx-vwiz__btn--primary:hover:not(:disabled) {
  background: var(--nx-teal-hover, var(--nexus-primary-hover));
  box-shadow: var(--nx-shadow-cta, none);
}

.nx-cmd--quiet,
.nx-cond__btn--quiet,
.nx-vwiz__btn--quiet {
  background: var(--nx-surface, var(--nexus-surface-elevated));
  box-shadow: inset 0 0 0 1px var(--nx-cmd-outline, var(--nexus-text-muted));
  color: var(--nx-text, var(--nexus-text-primary));
}

.nx-cmd--quiet:hover:not(:disabled),
.nx-cond__btn--quiet:hover:not(:disabled),
.nx-vwiz__btn--quiet:hover:not(:disabled) {
  background: var(--nx-field, var(--nexus-surface-alt));
  box-shadow: inset 0 0 0 1px var(--nx-cmd-outline, var(--nexus-text-muted));
  color: var(--nx-text, var(--nexus-text-primary));
}

.nx-cmd--sm,
.nx-erpdict__rowactions .nx-erpdict__btn,
.nx-price__actions .nx-price__btn,
.dm-archive__row .dm-archive__btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: var(--nexus-fs-caption, .8rem);
}

.nx-cmd--icon,
.nx-vwiz__btn--icon {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  justify-content: center;
  font-size: var(--nexus-fs-caption);
  color: var(--nexus-text-secondary);
}

.nx-cmd--icon:disabled,
.nx-vwiz__btn--icon:disabled {
  border: var(--nexus-border-width) solid var(--nexus-border-subtle);
  background: none;
  color: var(--nexus-text-muted);
  opacity: 0.6;
}

.nx-cmd--ai,
.nx-vwiz__btn--ai {
  background: color-mix(in srgb, var(--nx-blue, var(--nexus-interactive)) 10%, var(--nx-surface, var(--nexus-surface-elevated)));
  color: var(--nx-blue-ink, var(--nexus-interactive));
}

.nx-cmd--ai:hover:not(:disabled),
.nx-vwiz__btn--ai:hover:not(:disabled) {
  background: color-mix(in srgb, var(--nx-blue, var(--nexus-interactive)) 18%, var(--nx-surface, var(--nexus-surface-elevated)));
  color: var(--nx-blue-ink, var(--nexus-interactive));
}

.nx-cmd--redo,
.nx-vwiz__btn--redo {
  background: var(--nx-warning-bg, var(--nexus-warning-subtle));
  color: var(--nx-warning-ink, var(--nexus-warning-text));
}

.nx-cmd--redo:hover:not(:disabled),
.nx-vwiz__btn--redo:hover:not(:disabled) {
  background: color-mix(in srgb, var(--nx-warning, var(--nexus-warning)) 22%, var(--nx-surface, var(--nexus-surface-elevated)));
  color: var(--nx-warning-ink, var(--nexus-warning-text));
}

.nx-cmd--danger,
.nx-price__btn--danger,
.nx-vwiz__btn--danger {
  background: var(--nx-error-bg, var(--nexus-error-subtle));
  color: var(--nx-danger-ink, var(--nexus-error-text));
}

.nx-cmd--danger:hover:not(:disabled),
.nx-price__btn--danger:hover:not(:disabled),
.nx-vwiz__btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--nx-error, var(--nexus-error)) 18%, var(--nx-surface, var(--nexus-surface-elevated)));
  color: var(--nx-danger-ink, var(--nexus-error-text));
}

:is(.nx-cmd--sm, .nx-cmd--icon, .nx-vwiz__btn--icon):is(.nx-cmd--ai, .nx-cmd--redo, .nx-cmd--danger, .nx-vwiz__btn--ai, .nx-vwiz__btn--redo, .nx-vwiz__btn--danger):not(:hover):not(:disabled) {
  background: var(--nx-surface, var(--nexus-surface-elevated));
}

.nx-cmd-field,
.nx-erpdict__search,
.nx-erpviews__search,
.nx-vwiz__search {
  min-height: var(--nx-control-h, 38px);
  box-sizing: border-box;
}

.nx-switch {
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--nx-border-strong, #C3D3E3);
  transition: background-color .15s ease;
}

.nx-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgb(11 31 58 / .3);
  transition: transform .15s ease;
}

.nx-switch--on {
  background: var(--nx-teal, #1CCFC9);
}

.nx-switch--on .nx-switch__knob {
  transform: translateX(16px);
}

.nx-account__item--switch,
.nx-mmenu__item--switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nx-account__item--switch > span:nth-child(2),
.nx-mmenu__item--switch > span:first-child {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  .nx-switch,
  .nx-switch__knob {
    transition: none;
  }
}

.nx-select,
select.nx-vwiz__input,
select.nx-aq__select,
select.nx-docstore__input,
.nx-sg__flow select,
.nx-cat__form select,
.dm-archive__field select,
.dm-archive__group select,
.dm-card__field select,
.dm-card__launch select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%20fill='none'%20stroke='%235A6B82'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%204.5%206%207.5%209%204.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  text-overflow: ellipsis;
  cursor: pointer;
}

[data-nexus-theme="dark"] .nx-select,
[data-nexus-theme="dark"] select.nx-vwiz__input,
[data-nexus-theme="dark"] select.nx-aq__select,
[data-nexus-theme="dark"] select.nx-docstore__input,
[data-nexus-theme="dark"] .nx-sg__flow select,
[data-nexus-theme="dark"] .nx-cat__form select,
[data-nexus-theme="dark"] .dm-archive__field select,
[data-nexus-theme="dark"] .dm-archive__group select,
[data-nexus-theme="dark"] .dm-card__field select,
[data-nexus-theme="dark"] .dm-card__launch select {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2012%2012'%20fill='none'%20stroke='%238FA3BA'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3%204.5%206%207.5%209%204.5'/%3E%3C/svg%3E");
}

.nx-select {
  box-sizing: border-box;
  min-height: var(--nx-control-h, 38px);
  padding-left: 10px;
  border: var(--nexus-border-width, 1px) solid var(--nexus-border, #dfe3e8);
  border-radius: var(--nx-radius-sm, var(--nexus-radius-md, 8px));
  background-color: var(--nx-surface, var(--nexus-surface-elevated, #fff));
  color: var(--nx-text, var(--nexus-text-primary, #0F172A));
  font-family: inherit;
  font-size: var(--nexus-fs-body-sm, .875rem);
}

.nx-select:focus-visible,
select.nx-vwiz__input:focus-visible,
select.nx-aq__select:focus-visible,
.nx-sg__flow select:focus-visible {
  outline: 2px solid var(--nexus-interactive);
  outline-offset: 1px;
}

.nx-select:disabled,
select.nx-vwiz__input:disabled,
select.nx-aq__select:disabled,
.nx-sg__flow select:disabled,
.dm-card__launch select:disabled {
  background-image: none;
  background-color: var(--nx-field, var(--nexus-surface-alt, #F0F4F9));
  color: var(--nexus-text-muted);
  cursor: default;
  opacity: 1;
}
