/* Operational controls layered onto the compiled management tables. */
.an-enhancer-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 34px;
  font-family: var(--an-font-sans, "Geist Variable", "Microsoft YaHei", sans-serif);
  color: var(--an-text-secondary, #544f44);
}

.an-control-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.an-control-button {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--an-radius-sm, 6px);
  background: color-mix(in srgb, var(--an-text-primary, #211f1a) 5%, transparent);
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 34px;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)),
    background-color var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)),
    transform var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1));
}

.an-control-button:hover {
  background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 9%, transparent);
  color: var(--an-brand-blue, #c2401c);
}

.an-control-button:active { transform: scale(.98); }

.an-control-button--primary {
  background: var(--an-brand-blue, #c2401c);
  color: #fff;
  box-shadow: 0 1px 1px color-mix(in srgb, #000 14%, transparent);
}

.an-control-button--primary:hover {
  background: var(--an-brand-blue-hover, #d14a24);
  color: #fff;
}

.an-control-button--danger {
  background: color-mix(in srgb, var(--an-danger, #ef4444) 12%, transparent);
  color: var(--an-danger, #ef4444);
}

.an-status-select-wrap {
  min-width: 154px;
}

.an-status-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--an-border, #dcd5c4);
  border-radius: var(--an-radius-sm, 6px);
  outline: 0;
  background: color-mix(in srgb, var(--an-bg-elevated, #faf8f1) 94%, var(--an-brand-blue, #c2401c) 6%);
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)),
    box-shadow var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)),
    color var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1));
}

.an-status-select::after {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: .62;
  transform: rotate(45deg);
  transition: transform var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)), opacity var(--an-transition-fast, .15s ease);
}

.an-status-select:hover {
  border-color: color-mix(in srgb, var(--an-brand-blue, #c2401c) 52%, var(--an-border, #dcd5c4));
}

.an-status-select:focus-visible,
.an-status-select.is-open {
  border-color: var(--an-brand-blue, #c2401c);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--an-brand-blue, #c2401c) 20%, transparent);
}

.an-status-select.is-open::after {
  margin-top: 3px;
  opacity: .9;
  transform: rotate(225deg);
}

.an-status-select__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-status-option {
  display: flex;
  align-items: center;
  width: calc(100% - 8px);
  min-height: 36px;
  margin: 2px 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  outline: 0;
  background: transparent;
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 36px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--an-transition-fast, .15s ease), background-color var(--an-transition-fast, .15s ease);
}

.an-status-option:hover,
.an-status-option:focus-visible {
  background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 8%, transparent);
  color: var(--an-brand-blue, #c2401c);
}

.an-status-option[aria-selected="true"] {
  color: var(--an-brand-blue, #c2401c);
  font-weight: 500;
}

.an-status-option__check {
  margin-left: auto;
  padding-left: 14px;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transform: scale(.72);
  transition: opacity var(--an-transition-fast, .15s ease), transform var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1));
}

.an-status-option__label { overflow: hidden; text-overflow: ellipsis; }

.an-status-swatch {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--an-text-tertiary, #766f60);
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 10%, transparent);
  color: var(--an-text-tertiary, #766f60);
}

.an-status-swatch.is-all { background: transparent; border: 1.5px solid currentColor; box-shadow: none; }
.an-status-swatch.is-active,
.an-status-swatch.is-online { background: var(--an-success, #10b981); color: var(--an-success, #10b981); }
.an-status-swatch.is-offline,
.an-status-swatch.is-unactivated { background: var(--an-text-tertiary, #766f60); color: var(--an-text-tertiary, #766f60); }
.an-status-swatch.is-frozen,
.an-status-swatch.is-locked { background: var(--an-warning, #f59e0b); color: var(--an-warning, #f59e0b); }
.an-status-swatch.is-blacklisted,
.an-status-swatch.is-banned,
.an-status-swatch.is-expired { background: var(--an-danger, #ef4444); color: var(--an-danger, #ef4444); }

.an-status-option[aria-selected="true"] .an-status-option__check {
  opacity: 1;
  transform: scale(1);
}

.an-select-control {
  position: relative;
  width: 100%;
  min-width: 0;
}

.an-modal-field .an-native-select {
  display: none !important;
  position: absolute !important;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.an-select-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--an-border, #dcd5c4);
  border-radius: var(--an-radius-sm, 6px);
  outline: 0;
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)),
    box-shadow var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)),
    background-color var(--an-transition-fast, .15s ease);
}

.an-select-trigger::after {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: .58;
  transform: rotate(45deg);
  transition: transform var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1)), opacity var(--an-transition-fast, .15s ease);
}

.an-select-trigger:hover {
  border-color: color-mix(in srgb, var(--an-brand-blue, #c2401c) 52%, var(--an-border, #dcd5c4));
}

.an-select-trigger:focus-visible,
.an-select-trigger.is-open {
  border-color: var(--an-brand-blue, #c2401c);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--an-brand-blue, #c2401c) 18%, transparent);
}

.an-select-trigger.is-open::after {
  margin-top: 3px;
  opacity: .9;
  transform: rotate(225deg);
}

.an-select-trigger__label,
.an-select-option__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-popup-menu.an-select-menu {
  z-index: 2100;
  min-width: 144px;
  max-height: min(280px, calc(100vh - 48px));
  padding: 4px 0;
  border-radius: var(--an-radius-sm, 6px);
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05);
  transform-origin: top left;
  animation-duration: .16s;
}

.an-select-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 0 32px 0 12px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 14px;
  font-weight: 440;
  line-height: 34px;
  text-align: left;
  cursor: pointer;
  transition: color var(--an-transition-fast, .15s ease);
}

.an-select-option::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0 4px;
  border-radius: var(--an-radius-sm, 6px);
  background: transparent;
  transition: background-color var(--an-transition-fast, .15s ease);
}

.an-select-option__label,
.an-select-option__check { position: relative; z-index: 1; }

.an-select-option:hover,
.an-select-option:focus-visible {
  background: transparent;
  color: var(--an-brand-blue, #c2401c);
}

.an-select-option:hover::before,
.an-select-option:focus-visible::before,
.an-select-option[aria-selected="true"]::before {
  background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 8%, transparent);
}

.an-select-option[aria-selected="true"] {
  color: var(--an-brand-blue, #c2401c);
  font-weight: 440;
}

.an-select-option__check {
  margin-left: auto;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  transform: scale(.72);
  transition: opacity var(--an-transition-fast, .15s ease), transform var(--an-transition-fast, .15s cubic-bezier(.4, 0, .2, 1));
}

.an-select-option[aria-selected="true"] .an-select-option__check {
  opacity: 1;
  transform: scale(1);
}

.an-realtime-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  color: var(--an-text-tertiary, #766f60);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.an-selection-count {
  min-width: 52px;
  color: var(--an-text-tertiary, #766f60);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.an-control-wrap[hidden],
.an-selection-count[hidden] { display: none !important; }

.an-login-log-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  flex-wrap: wrap;
}

.an-login-log-count {
  color: var(--an-text-tertiary, #766f60);
  font-size: 12px;
  white-space: nowrap;
}

.an-control-button--danger {
  border-color: color-mix(in srgb, var(--an-danger, #ef4444) 36%, var(--an-border, #dcd5c4));
  color: var(--an-danger, #ef4444);
}

.an-control-button--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--an-danger, #ef4444) 9%, transparent);
}

.an-login-log-row-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  white-space: nowrap;
}

.an-login-log-row-action {
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--an-danger, #ef4444) 30%, var(--an-border, #dcd5c4));
  border-radius: 4px;
  background: transparent;
  color: var(--an-danger, #ef4444);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.an-login-log-row-action:hover {
  background: color-mix(in srgb, var(--an-danger, #ef4444) 9%, transparent);
}

button[data-an-suppressed-bulk="1"] { display: none !important; }

.an-popup-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 8px);
  right: 0;
  min-width: 214px;
  max-height: min(520px, calc(100vh - 96px));
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: var(--an-radius-md, 10px);
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-text-secondary, #544f44);
  box-shadow: var(--an-shadow-lg, 0 12px 24px -6px rgba(4, 21, 46, .1), 0 4px 8px -4px rgba(4, 21, 46, .05));
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  transform-origin: top right;
  animation: an-popup-in .18s cubic-bezier(.22, 1, .36, 1) forwards;
}

.an-popup-menu.is-positioning {
  visibility: hidden !important;
  animation: none !important;
  transition: none !important;
}

.an-zero-selection-placeholder .n-base-selection-input__content,
.an-zero-selection-placeholder .n-base-selection-overlay__wrapper {
  color: transparent !important;
  font-size: 0 !important;
}

.an-zero-selection-placeholder .n-base-selection-input__content::before,
.an-zero-selection-placeholder .n-base-selection-overlay__wrapper::before {
  content: attr(data-an-placeholder);
  color: var(--n-placeholder-color, rgba(194, 194, 194, 1));
  font-size: 14px;
}

.an-popup-menu.an-status-menu {
  top: calc(100% + 4px);
  right: auto;
  left: 0;
  min-width: 172px;
  max-height: min(350px, calc(100vh - 64px));
  padding: 3px 0;
  border-color: var(--an-border-light, #e8e3d4);
  border-radius: var(--an-radius-sm, 6px);
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05);
  transform-origin: top left;
  animation-duration: .16s;
}

.an-action-menu {
  min-width: 220px;
  max-height: min(360px, calc(100vh - 40px));
  overflow: visible;
}

.an-action-submenu {
  top: var(--an-submenu-top, 0);
  right: calc(100% - 2px);
  min-width: 210px;
  max-height: min(520px, calc(100vh - 96px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  transform-origin: top right;
}

.an-action-submenu:not(.is-positioning):not(.is-closing) {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

.an-action-submenu::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
}

.an-action-submenu[data-side="right"]::before { right: 100%; }
.an-action-submenu[data-side="left"]::before { left: 100%; }

.n-dropdown-menu.an-native-action-submenu {
  min-width: 190px;
  scrollbar-gutter: stable;
}

/* Keep long row-action menus inside the viewport so every command remains clickable. */
.n-dropdown-menu:has([data-dropdown-option]):not(:has(.n-dropdown-menu-wrapper)) {
  max-height: min(360px, calc(100vh - 32px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.n-dropdown-menu:has(.n-dropdown-menu-wrapper) {
  overflow: visible !important;
}

.an-popup-menu.is-closing {
  animation: an-popup-out .12s cubic-bezier(.4, 0, 1, 1) forwards;
  pointer-events: none;
}

.an-popup-title {
  padding: 6px 10px 7px;
  color: var(--an-text-tertiary, #766f60);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.an-column-option,
.an-menu-action {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: var(--an-radius-sm, 6px);
  background: transparent;
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 14px;
  font-weight: 440;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: color var(--an-transition-fast, .15s ease), background-color var(--an-transition-fast, .15s ease);
}

.an-column-option { gap: 8px; }

.an-column-option:hover,
.an-menu-action:hover {
  background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 8%, transparent);
  color: var(--an-brand-blue, #c2401c);
}

.an-menu-action.is-danger { color: var(--an-danger, #ef4444); }
.an-menu-action.is-danger:hover { background: color-mix(in srgb, var(--an-danger, #ef4444) 10%, transparent); }
.an-menu-action:disabled { cursor: not-allowed; opacity: .45; background: transparent; }

.an-menu-section {
  padding: 8px 10px 4px;
  color: var(--an-text-tertiary, #766f60);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.an-menu-section:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--an-border-light, #e8e3d4);
}

.an-menu-section.is-danger { color: var(--an-danger, #ef4444); }

.an-menu-group::after {
  content: "›";
  margin-left: auto;
  padding-left: 14px;
  color: var(--an-text-tertiary, #766f60);
  font-size: 17px;
  line-height: 1;
}

.an-menu-group {
  justify-content: flex-start;
  min-width: 208px;
}

.an-menu-group[aria-expanded="true"] {
  background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 8%, transparent);
  color: var(--an-brand-blue, #c2401c);
}

.an-popup-empty {
  padding: 10px;
  color: var(--an-text-tertiary, #766f60);
  font-size: 12px;
  line-height: 1.5;
}

.an-resizable-header {
  position: relative;
  overflow: visible !important;
}

.an-resizable-header.n-data-table-th--fixed-left,
.an-resizable-header.n-data-table-th--fixed-right {
  position: sticky !important;
}

.an-resizable-table .an-action-column {
  position: sticky !important;
  z-index: 3 !important;
  right: 0 !important;
  width: var(--an-action-column-width, 120px) !important;
  min-width: var(--an-action-column-width, 120px) !important;
  max-width: var(--an-action-column-width, 120px) !important;
  background: var(--an-bg-elevated, #faf8f1) !important;
  background-clip: padding-box !important;
  box-shadow: -8px 0 12px -12px rgba(4, 21, 46, .28);
}

.an-resizable-table thead .an-action-column { z-index: 5 !important; }
.an-resizable-table .an-action-column .an-column-resizer { display: none !important; }

.an-column-resizer {
  position: absolute;
  z-index: 2;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.an-column-resizer::after {
  content: "";
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: 3px;
  width: 1px;
  background: transparent;
  transition: background-color var(--an-transition-fast, .15s ease);
}

.an-resizable-header:hover .an-column-resizer::after,
.an-column-resizer:active::after,
.an-column-resizer.is-active::after { background: var(--an-brand-blue, #c2401c); }

.an-resizable-grid .n-scrollbar-rail--horizontal {
  display: none !important;
}

.an-resizable-grid .n-scrollbar-container::-webkit-scrollbar:horizontal {
  height: 0 !important;
}

.an-horizontal-scrollbar {
  width: 100%;
  height: 14px;
  padding: 4px 3px;
  outline: 0;
  touch-action: none;
}

.an-horizontal-scrollbar[hidden] { display: none !important; }

.an-horizontal-scrollbar__track {
  position: relative;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, var(--an-text-tertiary, #766f60) 16%, transparent);
  cursor: pointer;
}

.an-horizontal-scrollbar__thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--an-text-tertiary, #766f60) 68%, transparent);
  cursor: grab;
  transform: translate3d(0, 0, 0);
  transition: background-color var(--an-transition-fast, .15s ease);
  will-change: width, transform;
}

.an-horizontal-scrollbar:hover .an-horizontal-scrollbar__thumb,
.an-horizontal-scrollbar:focus-visible .an-horizontal-scrollbar__thumb,
.an-horizontal-scrollbar__thumb.is-active {
  background: var(--an-brand-blue, #c2401c);
}

.an-horizontal-scrollbar__thumb.is-active { cursor: grabbing; }

.an-horizontal-scrollbar:focus-visible {
  border-radius: var(--an-radius-sm, 6px);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--an-brand-blue, #c2401c) 20%, transparent);
}

html.an-column-resizing,
html.an-column-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.an-table-resizing,
.an-table-resizing th,
.an-table-resizing td,
.an-table-resizing col {
  transition: none !important;
}

.an-resizable-table td {
  overflow: hidden !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.an-resizable-table .an-status-stack {
  max-width: none;
}

.an-managed-column { transition: opacity var(--an-transition-fast, .15s ease); }

.an-mono-value {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  font-family: var(--an-font-mono, Consolas, monospace);
  font-size: 11px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.an-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
}

.an-status-stack {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.an-status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
}

.an-status-pill.is-active,
.an-status-pill.is-online,
.an-status-pill.is-running { background: color-mix(in srgb, var(--an-success, #10b981) 12%, transparent); color: var(--an-success, #10b981); }
.an-status-pill.is-offline,
.an-status-pill.is-unactivated { background: color-mix(in srgb, var(--an-text-tertiary, #766f60) 12%, transparent); color: var(--an-text-tertiary, #766f60); }
.an-status-pill.is-paused,
.an-status-pill.is-frozen,
.an-status-pill.is-locked { background: color-mix(in srgb, var(--an-warning, #f59e0b) 14%, transparent); color: var(--an-warning, #f59e0b); }
.an-status-pill.is-banned,
.an-status-pill.is-blacklisted,
.an-status-pill.is-expired { background: color-mix(in srgb, var(--an-danger, #ef4444) 12%, transparent); color: var(--an-danger, #ef4444); }

.an-quick-action {
  min-height: 26px;
  margin-left: 6px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--an-radius-sm, 6px);
  background: transparent;
  color: var(--an-text-tertiary, #766f60);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color var(--an-transition-fast, .15s ease), background-color var(--an-transition-fast, .15s ease), transform var(--an-transition-fast, .15s ease);
}

.an-quick-action:hover { transform: translateY(-1px); }
.an-quick-action--danger { color: var(--an-danger, #ef4444); }
.an-quick-action--danger:hover { background: color-mix(in srgb, var(--an-danger, #ef4444) 10%, transparent); }

.an-modal-backdrop {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 21, 46, .35);
  opacity: 0;
  transition: opacity var(--an-transition-base, .25s cubic-bezier(.4, 0, .2, 1));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.an-modal-backdrop.is-visible { opacity: 1; }

.an-enhance-modal {
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: var(--an-radius-lg, 14px);
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-text-secondary, #544f44);
  box-shadow: 0 1px rgba(255, 255, 255, .7) inset, 0 24px 60px -20px rgba(4, 21, 46, .32), 0 8px 24px -12px rgba(4, 21, 46, .18);
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transform-origin: center center;
  transition: opacity var(--an-transition-base, .25s cubic-bezier(.4, 0, .2, 1)), transform var(--an-transition-base, .25s cubic-bezier(.4, 0, .2, 1)) !important;
}

.an-enhance-modal.is-visible { opacity: 1; transform: translateY(0) scale(1); }

.an-enhance-modal > header {
  position: relative;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: var(--an-radius-lg, 14px) var(--an-radius-lg, 14px) 0 0;
  background: linear-gradient(180deg, var(--an-window-chrome-1, #f8fafc), var(--an-window-chrome-2, #f1f4fa));
  flex: 0 0 auto;
}

.an-enhance-modal h3 {
  color: var(--an-text-primary, #211f1a);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.an-modal-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--an-radius-sm, 6px);
  background: transparent;
  color: var(--an-text-tertiary, #766f60);
  font: inherit;
  font-size: 20px;
  line-height: 28px;
  cursor: pointer;
  transition: background-color var(--an-transition-fast, .15s ease), color var(--an-transition-fast, .15s ease);
}

.an-modal-close:hover { background: color-mix(in srgb, var(--an-text-primary, #211f1a) 7%, transparent); color: var(--an-text-primary, #211f1a); }

.an-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px;
}
.an-modal-summary { margin: 0 0 16px; color: var(--an-text-secondary, #544f44); font-size: 13px; line-height: 1.55; }

.an-modal-checks { display: grid; gap: 8px; }
.an-modal-check { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; color: var(--an-text-secondary, #544f44); font-size: 13px; cursor: pointer; }

.an-modal-field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.an-modal-field > span { color: var(--an-text-secondary, #544f44); font-size: 12px; font-weight: 500; }
.an-modal-field input,
.an-modal-field select,
.an-modal-field textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--an-border, #dcd5c4);
  border-radius: var(--an-radius-sm, 6px);
  outline: 0;
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--an-transition-fast, .15s ease), box-shadow var(--an-transition-fast, .15s ease);
}

.an-modal-field textarea { min-height: 74px; resize: vertical; line-height: 1.5; }
/* Match the existing Naive UI checkboxes while retaining native input behavior. */
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-modal-field .an-modal-check) input[type="checkbox"],
input:is([data-an-login-log-select], [data-an-login-log-select-all]) {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  box-sizing: border-box;
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--an-border, #dcd5c4);
  border-radius: var(--an-radius-sm, 6px);
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-checkbox-check-mark, #fff);
  vertical-align: middle;
  cursor: pointer;
  outline: none;
  transition: background-color .3s cubic-bezier(.4, 0, .2, 1),
    border-color .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s cubic-bezier(.4, 0, .2, 1);
}
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92C54.13,15.78,51.93,15.55,50.42,16.76z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .3s cubic-bezier(.4, 0, .2, 1), transform .3s cubic-bezier(.4, 0, .2, 1);
}
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]:is(:hover, :checked, :indeterminate, :focus-visible) {
  border-color: var(--an-checkbox-color-checked, var(--an-brand-blue, #c2401c));
}
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]:is(:checked, :indeterminate) {
  background: var(--an-checkbox-color-checked, var(--an-brand-blue, #c2401c));
}
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]:is(:checked, :indeterminate)::before {
  opacity: 1;
  transform: scale(1);
}
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]:indeterminate::before {
  width: 10px;
  height: 2px;
  border-radius: 1px;
  mask: none;
}
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--an-checkbox-color-checked, var(--an-brand-blue, #c2401c)) 30%, transparent);
}
:is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.an-login-log-select-cell {
  width: 44px;
  min-width: 44px;
  padding: 12px 14px !important;
  text-align: center !important;
  vertical-align: middle;
}
@media (forced-colors: active) {
  :is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"] { appearance: auto; }
  :is(.an-realtime-toggle, .an-column-option, .an-modal-check, .an-login-log-select-cell) input[type="checkbox"]::before { display: none; }
}
.an-secret-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.an-secret-control input { min-width: 0; }
.an-secret-toggle { min-width: 56px; height: 36px; padding: 0 12px; }
.an-inline-field-group {
  display: grid;
  grid-template-columns: minmax(92px, .75fr) minmax(110px, 1fr) minmax(92px, .75fr);
  gap: 8px;
}
.an-inline-field-group--two { grid-template-columns: minmax(110px, .85fr) minmax(140px, 1fr); }
.an-inline-field-group > input,
.an-inline-field-group > select,
.an-inline-field-group > .an-select-control { min-width: 0; }
.an-direction-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--an-border-light, #d9d9d9);
  border-radius: var(--an-radius-sm, 6px);
  background: var(--an-bg-sunken, #f6f7f9);
  color: var(--an-text-secondary, #5f6570);
  font-size: 14px;
  font-weight: 600;
}

.an-record-editor-modal { width: min(760px, calc(100vw - 32px)); }
.an-record-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.an-record-editor-grid .an-modal-field:has(textarea) { grid-column: 1 / -1; }
.an-modal-field.is-readonly > span::after {
  content: " · 只读";
  color: var(--an-text-tertiary, #766f60);
  font-weight: 400;
}
.an-modal-field.is-readonly input,
.an-modal-field.is-readonly textarea,
.an-modal-field.is-readonly .an-select-trigger {
  cursor: not-allowed;
  background: var(--an-bg-sunken, #f1eee6);
  color: var(--an-text-tertiary, #766f60);
  opacity: .82;
}
.an-modal-field input:focus,
.an-modal-field select:focus,
.an-modal-field textarea:focus { border-color: var(--an-brand-blue, #c2401c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--an-brand-blue, #c2401c) 14%, transparent); }

.an-native-action-prefix {
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
}
.an-modal-hint { margin-top: 7px; color: var(--an-text-tertiary, #766f60); font-size: 11px; line-height: 1.5; }
.an-modal-hint--accent { padding: 9px 10px; border-radius: var(--an-radius-sm, 6px); background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 8%, transparent); color: var(--an-text-secondary, #544f44); }

.an-enhance-modal > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: 0 0 var(--an-radius-lg, 14px) var(--an-radius-lg, 14px);
  background: var(--an-bg-base, #f3efe6);
  flex: 0 0 auto;
}

.an-enhance-modal > footer .an-control-button { min-width: 72px; }
.an-control-button.is-loading { opacity: .6; pointer-events: none; }
.an-control-button.is-loading::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: an-spin .7s linear infinite; }

.an-runtime-qvm-panel {
  width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: 8px;
  background: var(--an-bg-elevated, #faf8f1);
  overflow: hidden;
}
.an-runtime-qvm-panel > header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--an-border-light, #e8e3d4);
}
.an-runtime-qvm-panel > header h3 { margin: 0; color: var(--an-text-primary, #211f1a); font-size: 14px; font-weight: 680; letter-spacing: 0; }
.an-runtime-qvm-panel > header p { max-width: 680px; margin: 4px 0 0; color: var(--an-text-tertiary, #766f60); font-size: 11px; line-height: 1.5; }
.an-runtime-qvm-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.an-runtime-qvm-actions select { width: 180px; min-height: 34px; border: 1px solid var(--an-border, #dcd5c4); border-radius: 6px; background: var(--an-bg-elevated, #faf8f1); color: var(--an-text-primary, #211f1a); font: inherit; font-size: 12px; }
.an-runtime-qvm-actions .an-control-button { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.an-runtime-qvm-actions .an-control-button svg { width: 15px; height: 15px; }
.an-runtime-qvm-table-wrap { width: 100%; overflow: auto; scrollbar-width: thin; }
.an-runtime-qvm-table-wrap table { width: 100%; min-width: 980px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.an-runtime-qvm-table-wrap th,
.an-runtime-qvm-table-wrap td { height: 48px; padding: 8px 10px; border-bottom: 1px solid var(--an-border-light, #e8e3d4); overflow: hidden; color: var(--an-text-secondary, #544f44); font-size: 11px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.an-runtime-qvm-table-wrap th { height: 36px; background: var(--an-bg-sunken, #f1eee5); color: var(--an-text-tertiary, #766f60); font-weight: 650; }
.an-runtime-qvm-table-wrap tr:last-child td { border-bottom: 0; }
.an-runtime-qvm-table-wrap th:nth-child(1) { width: 190px; }
.an-runtime-qvm-table-wrap th:nth-child(2) { width: 105px; }
.an-runtime-qvm-table-wrap th:nth-child(3) { width: 145px; }
.an-runtime-qvm-table-wrap th:nth-child(4) { width: 170px; }
.an-runtime-qvm-table-wrap th:nth-child(5) { width: 190px; }
.an-runtime-qvm-table-wrap th:nth-child(6) { width: 95px; }
.an-runtime-qvm-table-wrap th:nth-child(7) { width: 86px; }
.an-runtime-qvm-table-wrap td strong,
.an-runtime-qvm-table-wrap td small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-runtime-qvm-table-wrap td strong { color: var(--an-text-primary, #211f1a); font-weight: 600; }
.an-runtime-qvm-table-wrap td small { margin-top: 3px; color: var(--an-text-tertiary, #766f60); font-size: 10px; }
.an-runtime-qvm-table-wrap code { color: var(--an-text-secondary, #544f44); font-family: var(--an-font-mono, "Geist Mono", monospace); font-size: 10px; }
.an-runtime-qvm-table-wrap td:last-child { overflow: visible; }
.an-qvm-kind,
.an-qvm-match { display: inline-flex; min-height: 22px; align-items: center; padding: 0 7px; border: 1px solid var(--an-border-light, #e8e3d4); border-radius: 999px; font-size: 10px; white-space: nowrap; }
.an-qvm-kind.is-runtime { border-color: color-mix(in srgb, #2563eb 28%, var(--an-border-light, #e8e3d4)); background: color-mix(in srgb, #2563eb 8%, transparent); color: #2563eb; }
.an-qvm-kind.is-internal,
.an-qvm-match.is-pending { color: var(--an-text-tertiary, #766f60); }
.an-qvm-match { margin-left: 5px; }
.an-qvm-match.is-match { border-color: color-mix(in srgb, var(--an-success, #10b981) 32%, var(--an-border-light, #e8e3d4)); color: var(--an-success, #0d8d67); }
.an-qvm-match.is-error { border-color: color-mix(in srgb, var(--an-danger, #ef4444) 34%, var(--an-border-light, #e8e3d4)); color: var(--an-danger, #ef4444); }
.an-runtime-qvm-loading,
.an-runtime-qvm-error { min-height: 94px; display: grid; place-items: center; color: var(--an-text-tertiary, #766f60); font-size: 12px; }
.an-runtime-qvm-error { color: var(--an-danger, #ef4444); }

.an-runtime-modal {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
}

.an-runtime-modal-body { padding: 0; }

.an-runtime-toolbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--an-border-light, #e8e3d4);
  background: var(--an-bg-elevated, #faf8f1);
}

.an-runtime-mode-filter {
  display: inline-grid;
  grid-template-columns: 82px 92px 124px;
  padding: 3px;
  border: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: var(--an-radius-sm, 6px);
  background: var(--an-bg-sunken, #f1eee5);
}

.an-runtime-mode-filter button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--an-text-secondary, #544f44);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
}

.an-runtime-mode-filter button:hover { color: var(--an-text-primary, #211f1a); }
.an-runtime-mode-filter button.is-active {
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-brand-blue, #c2401c);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--an-text-primary, #211f1a) 14%, transparent);
  font-weight: 650;
}

.an-runtime-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.an-runtime-count { color: var(--an-text-tertiary, #766f60); font-size: 12px; white-space: nowrap; }

.an-runtime-table-wrap { width: 100%; min-height: 300px; overflow: auto; }
.an-runtime-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.an-runtime-table th,
.an-runtime-table td {
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--an-border-light, #e8e3d4);
  overflow: hidden;
  color: var(--an-text-secondary, #544f44);
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.an-runtime-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: var(--an-bg-sunken, #f1eee5);
  color: var(--an-text-tertiary, #766f60);
  font-size: 11px;
  font-weight: 650;
}
.an-runtime-table th:first-child { width: 180px; }
.an-runtime-table th:nth-child(2) { width: 134px; }
.an-runtime-table th:nth-child(3) { width: 82px; }
.an-runtime-table th:nth-child(4) { width: 152px; }
.an-runtime-table th:nth-child(5) { width: 80px; }
.an-runtime-table th:nth-child(6) { width: 144px; }
.an-runtime-table th:nth-child(7) { width: 86px; }
.an-runtime-table th:last-child { width: 112px; }
.an-runtime-table th:last-child,
.an-runtime-table td:last-child {
  position: sticky;
  z-index: 3;
  right: 0;
  background: var(--an-bg-elevated, #faf8f1);
  box-shadow: -8px 0 12px -12px color-mix(in srgb, var(--an-text-primary, #211f1a) 34%, transparent);
}
.an-runtime-table th:last-child { z-index: 5; background: var(--an-bg-sunken, #f1eee5); }
.an-runtime-table tbody tr:hover td { background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 4%, var(--an-bg-elevated, #faf8f1)); }
.an-runtime-table td strong,
.an-runtime-table td small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-runtime-table td strong { color: var(--an-text-primary, #211f1a); font-size: 12px; font-weight: 600; }
.an-runtime-table td small { margin-top: 3px; color: var(--an-text-tertiary, #766f60); font-size: 10px; }
.an-runtime-empty { height: 220px; color: var(--an-text-tertiary, #766f60) !important; text-align: center !important; }

.an-runtime-mode-badge,
.an-runtime-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.an-runtime-mode-badge.is-single { background: color-mix(in srgb, var(--an-success, #10b981) 12%, transparent); color: var(--an-success, #0d8d67); }
.an-runtime-mode-badge.is-dual { background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 11%, transparent); color: var(--an-brand-blue, #c2401c); }
.an-runtime-status-badge.is-active { background: color-mix(in srgb, var(--an-success, #10b981) 12%, transparent); color: var(--an-success, #0d8d67); }
.an-runtime-status-badge.is-disabled { background: color-mix(in srgb, var(--an-danger, #ef4444) 10%, transparent); color: var(--an-danger, #ef4444); }
.an-runtime-status-badge.is-draft { background: color-mix(in srgb, var(--an-warning, #f59e0b) 12%, transparent); color: var(--an-warning, #b86f00); }

.an-runtime-row-actions { display: flex; align-items: center; gap: 4px; overflow: visible !important; }
.an-runtime-icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--an-text-tertiary, #766f60);
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
}
.an-runtime-icon-button svg { width: 16px; height: 16px; stroke-width: 2; }
.an-runtime-icon-button:hover { background: color-mix(in srgb, var(--an-text-primary, #211f1a) 7%, transparent); color: var(--an-text-primary, #211f1a); }
.an-runtime-icon-button.is-danger { color: var(--an-danger, #ef4444); }
.an-runtime-icon-button:disabled { opacity: .45; cursor: wait; }

.an-runtime-editor-modal { width: min(760px, calc(100vw - 32px)); }
.an-runtime-editor-modal .an-runtime-modal-body { padding: 20px; }
.an-runtime-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.an-runtime-editor-grid > .an-modal-field { min-width: 0; margin-top: 0; }
.an-runtime-editor-grid > .is-full,
.an-runtime-editor-summary,
.an-runtime-file-hint,
.an-runtime-qvm-hint,
.an-runtime-qvm-explanation { grid-column: 1 / -1; }
.an-runtime-editor-summary,
.an-runtime-delete-warning {
  padding: 11px 12px;
  border: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: var(--an-radius-sm, 6px);
  background: var(--an-bg-sunken, #f1eee5);
  color: var(--an-text-secondary, #544f44);
  font-size: 12px;
  line-height: 1.55;
}
.an-runtime-file-hint { margin-top: -8px; }
.an-runtime-qvm-hint,
.an-runtime-qvm-explanation { margin-top: -8px; padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, #2563eb 7%, transparent); color: var(--an-text-secondary, #544f44); }
.an-runtime-qvm-deploy-modal { width: min(720px, calc(100vw - 32px)); }
.an-runtime-qvm-deploy-modal .an-runtime-modal-body { padding: 20px; }
.an-runtime-version-detection {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin-top: 22px;
  padding: 8px 10px;
  border-radius: var(--an-radius-sm, 6px);
  background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 7%, transparent);
  color: var(--an-text-secondary, #544f44);
}
.an-runtime-mode-segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.an-runtime-mode-segmented label { position: relative; min-width: 0; cursor: pointer; }
.an-runtime-mode-segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.an-runtime-mode-segmented span {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--an-border, #dcd5c4);
  border-radius: var(--an-radius-sm, 6px);
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-text-secondary, #544f44);
  font-size: 12px;
  letter-spacing: 0;
}
.an-runtime-mode-segmented input:checked + span {
  border-color: var(--an-brand-blue, #c2401c);
  background: color-mix(in srgb, var(--an-brand-blue, #c2401c) 8%, var(--an-bg-elevated, #faf8f1));
  color: var(--an-brand-blue, #c2401c);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--an-brand-blue, #c2401c) 12%, transparent);
  font-weight: 650;
}
.an-runtime-mode-segmented input:focus-visible + span { outline: 2px solid var(--an-brand-blue, #c2401c); outline-offset: 2px; }
.an-runtime-delete-modal { width: min(520px, calc(100vw - 32px)); }
.an-runtime-delete-modal .an-runtime-modal-body { padding: 20px; }

@media (max-width: 720px) {
  .an-runtime-qvm-panel > header { align-items: stretch; flex-direction: column; }
  .an-runtime-qvm-actions { width: 100%; flex-wrap: wrap; }
  .an-runtime-qvm-actions select { min-width: 0; flex: 1 1 180px; }
  .an-runtime-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .an-runtime-toolbar { align-items: stretch; flex-direction: column; }
  .an-runtime-mode-filter { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an-runtime-mode-filter button { min-width: 0; padding: 0 6px; }
  .an-runtime-toolbar-actions { justify-content: space-between; }
  .an-runtime-editor-grid { grid-template-columns: 1fr; }
  .an-runtime-editor-grid > .is-full,
  .an-runtime-editor-summary,
  .an-runtime-file-hint,
  .an-runtime-qvm-hint,
  .an-runtime-qvm-explanation { grid-column: auto; }
  .an-runtime-version-detection { margin-top: 0; }
  .an-runtime-mode-segmented { grid-template-columns: 1fr; }
}

.an-enhance-toast {
  position: fixed;
  z-index: 3000;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 10px 14px;
  border: 1px solid var(--an-border-light, #e8e3d4);
  border-radius: var(--an-radius-md, 10px);
  background: var(--an-bg-elevated, #faf8f1);
  color: var(--an-text-secondary, #544f44);
  box-shadow: var(--an-shadow-lg, 0 12px 24px -6px rgba(4, 21, 46, .1));
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--an-transition-base, .25s ease), transform var(--an-transition-base, .25s ease);
}

.an-enhance-toast.is-visible { opacity: 1; transform: translateY(0); }
.an-enhance-toast--error { border-color: color-mix(in srgb, var(--an-danger, #ef4444) 32%, var(--an-border-light, #e8e3d4)); color: var(--an-danger, #ef4444); }
.an-enhance-toast--warning { border-color: color-mix(in srgb, var(--an-warning, #f59e0b) 32%, var(--an-border-light, #e8e3d4)); color: var(--an-warning, #f59e0b); }

@keyframes an-popup-in { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes an-popup-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes an-spin { to { transform: rotate(360deg); } }

html.dark .an-enhance-modal > header { background: linear-gradient(180deg, var(--an-window-chrome-1, #1a2238), var(--an-window-chrome-2, #131929)); }
html.dark .an-enhance-modal > footer { background: var(--an-bg-base, #0a0e1a); }

@media (max-width: 900px) {
  .an-enhancer-controls { justify-content: flex-start; width: 100%; }
  .an-popup-menu { left: 0; right: auto; transform-origin: top left; }
  .an-enhance-modal { width: min(520px, calc(100vw - 24px)); }
  .an-record-editor-grid { grid-template-columns: 1fr; }
  .an-record-editor-grid .an-modal-field:has(textarea) { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .an-popup-menu, .an-enhance-toast { animation: none; transition-duration: .01ms; }
  .an-popup-menu { opacity: 1; transform: none; }
  .an-popup-menu.is-closing { opacity: 0; transform: none; }
  .an-status-select::after, .an-status-option__check,
  .an-select-trigger::after, .an-select-option__check { transition-duration: .01ms; }
}
/* Agent creation permissions use the same category model as permission editing. */
.agent-permission-category + .agent-permission-category {
  margin-top: 14px;
}

.agent-permission-category__title {
  margin: 0;
  padding: 10px 2px 7px;
  color: var(--an-primary, #2563eb);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.agent-permission-category__items {
  overflow: hidden;
  border: 1px solid var(--an-border-light, #e2e8f0);
  border-radius: 8px;
  background: var(--an-bg-elevated, #fff);
}

.agent-permission-category__row {
  padding-right: 12px !important;
  padding-left: 12px !important;
}

html.dark .agent-permission-category__items {
  border-color: #1e2533;
  background: #151820;
}
.an-native-option-danger {
  color: #dc2626;
}

.an-native-option-danger:hover {
  background: color-mix(in srgb, #dc2626 9%, transparent);
}

/* Application access-policy controls added to the compiled management view. */
.application-editor-modal > .n-card__content {
  min-height: 0;
  overflow-y: auto;
}

.app-policy-section {
  margin: 6px 0 18px;
  padding: 14px;
  border: 1px solid var(--an-border, #d9dee8);
  border-radius: 8px;
  background: var(--an-bg, #f7f9fc);
}

.app-policy-title {
  margin: 0 0 12px;
  color: var(--an-text-primary, #1f2937);
  font-size: 13px;
  font-weight: 650;
}

.app-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.app-policy-item,
.app-policy-number {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--an-border-light, #e6eaf0);
  border-radius: 7px;
  background: var(--an-bg-elevated, #fff);
  color: var(--an-text-primary, #1f2937);
  font-size: 13px;
}

.app-policy-item > span,
.app-policy-number > span {
  min-width: 0;
}

.app-policy-number {
  width: calc(50% - 5px);
  margin-top: 10px;
}

.app-policy-number .n-input-number {
  width: 150px;
}

@media (max-width: 720px) {
  .app-policy-grid,
  .app-policy-grid-three {
    grid-template-columns: 1fr;
  }

  .app-policy-number {
    width: 100%;
  }
}

/* Usage-count cost steps nested inside each validity tier. */
.application-editor-modal .tier-table {
  overflow-x: auto;
}

.application-editor-modal .tier-row {
  min-width: 1000px !important;
  grid-template-columns: minmax(120px, 1fr) minmax(132px, 1fr) 72px 72px minmax(450px, 3.5fr) 36px !important;
  align-items: start;
  box-sizing: border-box;
}

.application-editor-modal .tier-head {
  align-items: center;
}

.application-editor-modal .tc-cost {
  display: block;
}

.cost-step-editor {
  width: 100%;
  min-width: 0;
}

.cost-step-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--an-text-secondary, #5f6570);
  font-size: 11px;
}

.cost-step-heading strong {
  color: var(--an-text-primary, #1f2937);
  font-size: 12px;
}

.cost-step-free {
  margin-bottom: 7px;
}

.cost-step-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1fr) 28px;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 0;
  border-top: 1px solid var(--an-border-light, #e6eaf0);
}

.cost-step-range,
.cost-step-cost {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--an-text-secondary, #5f6570);
  font-size: 12px;
  white-space: nowrap;
}

.cost-step-count-input {
  flex: 0 0 48px;
  width: 48px;
}

.cost-step-value-input {
  flex: 1 1 64px;
  min-width: 58px;
}

.cost-step-unit-select {
  flex: 0 0 72px;
  width: 72px;
}

.cost-step-end {
  overflow: hidden;
  color: var(--an-text-tertiary, #7b8494);
  text-overflow: ellipsis;
}

.cost-step-remove {
  align-self: center;
}

.cost-step-add {
  margin-top: 7px;
}

@media (max-width: 900px) {
  .application-editor-modal .tier-row {
    min-width: 940px;
  }
}

/* Keep the shared developer/agent shell fluid while Naive UI changes max-width. */
.app-shell .app-sider.n-layout-sider {
  overflow: hidden;
  transition:
    max-width 240ms cubic-bezier(.22, 1, .36, 1),
    width 240ms cubic-bezier(.22, 1, .36, 1),
    min-width 240ms cubic-bezier(.22, 1, .36, 1),
    flex-basis 240ms cubic-bezier(.22, 1, .36, 1) !important;
  will-change: max-width, width;
}

.app-shell .app-sider > .n-layout-sider-scroll-container {
  width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden;
}

.app-shell .app-sider .sider-menu {
  width: 100%;
  box-sizing: border-box;
}

.app-shell .app-sider .n-layout-toggle-button {
  z-index: 4;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--an-text-primary, #1f2937) 16%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .app-shell .app-sider.n-layout-sider {
    transition-duration: 160ms !important;
  }
}
