/* UI-2: componentes opt-in. Toda regra de produto exige o root ADM comprovado. */
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--biwa-button-gap);
  min-height: var(--biwa-button-height);
  max-width: 100%;
  padding: var(--biwa-space-2) var(--biwa-button-padding-x);
  border: 1px solid transparent !important;
  border-radius: var(--biwa-radius-md) !important;
  background: var(--biwa-color-primary-soft) !important;
  color: var(--biwa-color-primary-pressed) !important;
  box-shadow: none !important;
  font: 650 var(--biwa-font-size-md)/1.25 var(--biwa-font-family);
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transform: none !important;
  transition: background var(--biwa-transition-fast), border-color var(--biwa-transition-fast), box-shadow var(--biwa-transition-fast);
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn:hover:not(:disabled),
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn:hover:not(:disabled) {
  background: var(--biwa-color-surface-hover) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn:active:not(:disabled),
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn:active:not(:disabled) {
  box-shadow: inset 0 2px 4px var(--biwa-color-focus-ring) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn:focus-visible,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn:focus-visible,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-icon-btn:focus-visible,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-icon-btn:focus-visible {
  outline: 2px solid var(--biwa-color-primary) !important;
  outline-offset: 2px;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn:disabled,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn[aria-busy="true"],
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn[aria-busy="true"] {
  cursor: progress;
  pointer-events: none;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn[aria-busy="true"]::before,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn[aria-busy="true"]::before {
  content: '';
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: biwa-enterprise-spin .8s linear infinite;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--primary,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn--primary {
  background: var(--biwa-color-primary) !important;
  color: var(--biwa-color-white) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--primary:hover:not(:disabled),
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn--primary:hover:not(:disabled) {
  background: var(--biwa-color-primary-hover) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--primary:active:not(:disabled),
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn--primary:active:not(:disabled) {
  background: var(--biwa-color-primary-pressed) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--secondary {
  background: var(--biwa-color-primary-soft) !important;
  color: var(--biwa-color-primary-pressed) !important;
  border-color: var(--biwa-color-border) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--ghost,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn--ghost {
  background: transparent !important;
  color: var(--biwa-color-text-secondary) !important;
  border-color: var(--biwa-color-border) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--danger {
  background: var(--biwa-color-danger-soft) !important;
  color: var(--biwa-color-danger) !important;
  border-color: var(--biwa-color-danger-soft) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--danger:hover:not(:disabled) {
  background: var(--biwa-color-danger) !important;
  color: var(--biwa-color-white) !important;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn--compact { min-height: var(--biwa-button-height-compact); padding: var(--biwa-space-1) var(--biwa-space-3); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .page-head-dark .biwa-btn--ghost { color: var(--biwa-shell-header-text) !important; border-color: var(--biwa-shell-sidebar-border) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .page-head-dark .biwa-btn--ghost:disabled { opacity: .7; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-icon-btn,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--biwa-button-height);
  height: var(--biwa-button-height);
  padding: 0;
  border: 1px solid var(--biwa-color-border);
  border-radius: var(--biwa-radius-md);
  background: var(--biwa-color-surface);
  color: var(--biwa-color-text-secondary);
  cursor: pointer;
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-icon-btn:hover,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-icon-btn:hover { background: var(--biwa-color-surface-hover); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-icon-btn:disabled,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-icon-btn:disabled { opacity: .55; cursor: not-allowed; }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-panel,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card {
  min-width: 0;
  padding: var(--biwa-panel-padding);
  border: 1px solid var(--biwa-color-border) !important;
  border-radius: var(--biwa-radius-lg) !important;
  background: var(--biwa-color-surface) !important;
  box-shadow: var(--biwa-shadow-sm) !important;
  color: var(--biwa-color-text-primary);
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-panel--compact { padding: var(--biwa-space-3); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-panel--elevated,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card--action { box-shadow: var(--biwa-shadow-md) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-panel__header,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--biwa-space-3); min-width: 0; margin-bottom: var(--biwa-space-3); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-panel__body,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card__body { min-width: 0; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-panel__footer,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card__footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--biwa-space-2); margin-top: var(--biwa-space-4); padding-top: var(--biwa-space-3); border-top: 1px solid var(--biwa-color-border); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card--kpi { border-left: 3px solid var(--biwa-color-primary) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card--info { background: var(--biwa-color-info-soft) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-card--status { border-left: 3px solid var(--biwa-color-info) !important; }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-field,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-field { display: grid; align-content: start; gap: var(--biwa-space-1); min-width: 0; color: var(--biwa-color-text-secondary); font-size: var(--biwa-font-size-sm); font-weight: 650; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-control,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-control {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: var(--biwa-form-height);
  padding: var(--biwa-space-2) var(--biwa-space-3);
  border: 1px solid var(--biwa-form-border) !important;
  border-radius: var(--biwa-radius-md) !important;
  background: var(--biwa-color-surface) !important;
  color: var(--biwa-color-text-primary);
  font: 500 var(--biwa-font-size-md)/var(--biwa-line-height) var(--biwa-font-family);
  transition: border-color var(--biwa-transition-fast), box-shadow var(--biwa-transition-fast);
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui textarea.biwa-control { min-height: calc(var(--biwa-form-height) * 2); resize: vertical; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-control:hover:not(:disabled):not(:read-only),
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-control:hover:not(:disabled):not(:read-only) { border-color: var(--biwa-color-primary) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-control:focus-visible,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-control:focus-visible { outline: none !important; border-color: var(--biwa-color-primary) !important; box-shadow: 0 0 0 3px var(--biwa-color-focus-ring) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-control:disabled,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-control:disabled { background: var(--biwa-color-surface-subtle) !important; color: var(--biwa-color-disabled); cursor: not-allowed; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui input.biwa-control:read-only,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui textarea.biwa-control:read-only { background: var(--biwa-color-surface-subtle) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-field[aria-invalid="true"] .biwa-control,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-field[aria-invalid="true"] .biwa-control { border-color: var(--biwa-color-danger) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-field[data-state="success"] .biwa-control { border-color: var(--biwa-color-success) !important; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-field__helper,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-field__message { font-size: var(--biwa-font-size-sm); font-weight: 500; color: var(--biwa-color-text-muted); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-field__message--error { color: var(--biwa-color-danger); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-field__message--success { color: var(--biwa-color-success); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-check { display: inline-flex; align-items: center; gap: var(--biwa-space-2); min-height: var(--biwa-control-height-sm); cursor: pointer; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-check > input { width: 16px; height: 16px; flex: none; accent-color: var(--biwa-color-primary); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-check > input:focus-visible { outline: 2px solid var(--biwa-color-primary) !important; outline-offset: 2px; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-toggle > input { width: 32px; height: 18px; }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: var(--biwa-space-1); min-width: 0; padding: var(--biwa-space-1); border: 1px solid var(--biwa-color-border); border-radius: var(--biwa-radius-md); background: var(--biwa-color-surface-subtle); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tab { min-height: var(--biwa-control-height-md); padding: var(--biwa-space-2) var(--biwa-space-3); border: 0; border-radius: var(--biwa-radius-sm); background: transparent; color: var(--biwa-color-text-secondary); font: 650 var(--biwa-font-size-sm)/1.25 var(--biwa-font-family); cursor: pointer; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tab:hover { background: var(--biwa-color-surface-hover); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tab.active,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tab[aria-selected="true"] { background: var(--biwa-color-surface); color: var(--biwa-color-primary-pressed); box-shadow: var(--biwa-shadow-sm); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tab:focus-visible { outline: 2px solid var(--biwa-color-primary); outline-offset: 1px; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tab:disabled { opacity: .55; cursor: not-allowed; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tabs--compact .biwa-tab { min-height: var(--biwa-control-height-sm); padding: var(--biwa-space-1) var(--biwa-space-3); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tabs--secondary { border-color: transparent; background: transparent; border-bottom-color: var(--biwa-color-border); border-radius: 0; }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-badge,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-status { display: inline-flex; align-items: center; gap: var(--biwa-space-1); max-width: 100%; padding: 3px var(--biwa-space-2); border: 1px solid var(--biwa-color-border); border-radius: 999px; background: var(--biwa-color-surface-subtle); color: var(--biwa-color-text-secondary); font: 650 var(--biwa-font-size-sm)/1.2 var(--biwa-font-family); white-space: normal; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-badge--info,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-status--info { background: var(--biwa-color-info-soft); color: var(--biwa-color-info); border-color: var(--biwa-color-info-soft); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-badge--success,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-status--success { background: var(--biwa-color-success-soft); color: var(--biwa-color-success); border-color: var(--biwa-color-success-soft); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-badge--warning,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-status--warning { background: var(--biwa-color-warning-soft); color: var(--biwa-color-warning); border-color: var(--biwa-color-warning-soft); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-badge--danger,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-status--danger { background: var(--biwa-color-danger-soft); color: var(--biwa-color-danger); border-color: var(--biwa-color-danger-soft); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-status::before { content: ''; width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-empty,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-error { display: grid; justify-items: start; align-content: center; gap: var(--biwa-space-2); min-width: 0; padding: var(--biwa-space-4); border: 1px dashed var(--biwa-color-border-strong); border-radius: var(--biwa-radius-md); background: var(--biwa-color-surface-subtle); color: var(--biwa-color-text-secondary); overflow-wrap: anywhere; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-empty__title,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-error__title { color: var(--biwa-color-text-primary); font-weight: 700; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-empty__icon { color: var(--biwa-color-info); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-error { border-color: var(--biwa-color-danger); background: var(--biwa-color-danger-soft); color: var(--biwa-color-danger); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-loading { display: inline-flex; align-items: center; gap: var(--biwa-space-2); color: var(--biwa-color-text-muted); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--biwa-color-border); border-top-color: var(--biwa-color-primary); border-radius: 50%; animation: biwa-enterprise-spin .8s linear infinite; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-skeleton { min-height: var(--biwa-control-height-sm); border-radius: var(--biwa-radius-sm); background: linear-gradient(90deg, var(--biwa-color-skeleton), var(--biwa-color-skeleton-highlight), var(--biwa-color-skeleton)); background-size: 200% 100%; animation: biwa-enterprise-skeleton 1.5s ease infinite; }
@keyframes biwa-enterprise-spin { to { transform: rotate(360deg); } }
@keyframes biwa-enterprise-skeleton { to { background-position-x: -200%; } }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--biwa-space-3); min-width: 0; padding: var(--biwa-space-3); border: 1px solid var(--biwa-color-border); border-radius: var(--biwa-radius-md); background: var(--biwa-color-surface); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-toolbar__left,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-toolbar__center,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-toolbar__right { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--biwa-space-2); min-width: 0; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-toolbar--compact { padding: var(--biwa-space-2) var(--biwa-space-3); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-search { position: relative; display: flex; align-items: center; min-width: 0; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-search .biwa-control { padding-inline-start: var(--biwa-space-5); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-search__icon { position: absolute; inset-inline-start: var(--biwa-space-2); pointer-events: none; color: var(--biwa-color-text-muted); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--biwa-space-2); min-width: 0; color: var(--biwa-color-text-primary); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-divider { border: 0; border-top: 1px solid var(--biwa-color-border); margin-block: var(--biwa-space-3); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-tooltip { position: absolute; z-index: var(--biwa-z-popover); max-width: 30ch; padding: var(--biwa-space-2); border-radius: var(--biwa-radius-sm); background: var(--biwa-color-text-primary); color: var(--biwa-color-white); box-shadow: var(--biwa-shadow-sm); font-size: var(--biwa-font-size-sm); overflow-wrap: anywhere; }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-popover,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-dropdown,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu { z-index: var(--biwa-z-popover); max-width: calc(100vw - 20px); max-height: var(--biwa-menu-max-height); overflow-y: auto; overflow-x: hidden; border: 1px solid var(--biwa-color-border); border-radius: var(--biwa-radius-md); background: var(--biwa-color-surface); box-shadow: var(--biwa-shadow-md); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-popover,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-dropdown { position: absolute; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu { width: min(var(--biwa-menu-width), calc(100vw - 20px)); padding: var(--biwa-space-2); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu .biwa-menu__item { display: flex; align-items: center; gap: var(--biwa-space-2); width: 100%; min-height: var(--biwa-control-height-md); padding: var(--biwa-space-2) var(--biwa-space-3); border: 0; border-radius: var(--biwa-radius-sm); background: transparent; color: var(--biwa-color-text-secondary); text-align: left; cursor: pointer; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu .biwa-menu__item:hover,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu .biwa-menu__item:focus-visible { background: var(--biwa-color-surface-hover); outline: none; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu .biwa-menu__item[aria-selected="true"] { background: var(--biwa-color-primary-soft); color: var(--biwa-color-primary-pressed); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu .biwa-menu__item:disabled { opacity: .55; cursor: not-allowed; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu .biwa-menu__item.logout { color: var(--biwa-color-danger); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #userAccountMenu.biwa-menu .biwa-menu__item.logout:hover { background: var(--biwa-color-danger-soft); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-menu__divider { height: 1px; margin: var(--biwa-space-1) 0; background: var(--biwa-color-border); }

body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal { z-index: var(--biwa-z-modal); padding: var(--biwa-modal-viewport-gap); background: var(--biwa-color-overlay); backdrop-filter: blur(4px); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal__card,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-modal__card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(var(--biwa-modal-width-md), calc(100vw - 2 * var(--biwa-modal-viewport-gap))); max-height: calc(100vh - 2 * var(--biwa-modal-viewport-gap)); max-height: calc(100dvh - 2 * var(--biwa-modal-viewport-gap)); padding: 0; overflow: hidden; border: 1px solid var(--biwa-color-border); border-radius: var(--biwa-radius-lg); background: var(--biwa-color-surface); box-shadow: var(--biwa-shadow-lg); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal--sm .biwa-modal__card,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal.biwa-modal--sm .biwa-modal__card { width: min(var(--biwa-modal-width-sm), calc(100vw - 2 * var(--biwa-modal-viewport-gap))); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal--lg .biwa-modal__card { width: min(var(--biwa-modal-width-lg), calc(100vw - 2 * var(--biwa-modal-viewport-gap))); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal--xl .biwa-modal__card { width: min(var(--biwa-modal-width-xl), calc(100vw - 2 * var(--biwa-modal-viewport-gap))); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal--workspace .biwa-modal__card { width: calc(100vw - 2 * var(--biwa-modal-viewport-gap)); height: calc(100dvh - 2 * var(--biwa-modal-viewport-gap)); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal__header,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-modal__header { display: flex; align-items: center; justify-content: space-between; gap: var(--biwa-space-3); min-width: 0; margin: 0; padding: var(--biwa-space-4); border-bottom: 1px solid var(--biwa-color-border); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal__body,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-modal__body { min-width: 0; min-height: 0; padding: var(--biwa-space-4); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal__footer,
body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-modal__footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--biwa-space-2); min-width: 0; margin: 0; padding: var(--biwa-space-3) var(--biwa-space-4); border-top: 1px solid var(--biwa-color-border); background: var(--biwa-color-surface); }
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-modal--confirm .biwa-modal__body { max-width: 65ch; }

/* A coluna de ações existente em Inserir Dados é estreita no notebook. */
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .insert-mysql-panel.biwa-panel .insert-source-grid {
  grid-template-columns: minmax(180px, 1.2fr) minmax(165px, 1fr) minmax(145px, 1fr) minmax(96px, auto);
}
body:not(.viewer-mode) #appShell.biwa-enterprise-ui .insert-mysql-panel.biwa-panel .insert-actions-col .biwa-btn {
  width: 100%;
  padding-inline: var(--biwa-space-2);
  overflow-wrap: normal;
}
@media (max-width: 980px) {
  body:not(.viewer-mode) #appShell.biwa-enterprise-ui .insert-mysql-panel.biwa-panel .insert-source-grid { grid-template-columns: minmax(0, 1fr); }
  body:not(.viewer-mode) #appShell.biwa-enterprise-ui .insert-mysql-panel.biwa-panel .insert-actions-col .biwa-btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-spinner,
  body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-skeleton,
  body:not(.viewer-mode) #appShell.biwa-enterprise-ui .biwa-btn[aria-busy="true"]::before,
  body:not(.viewer-mode) #appShell.biwa-enterprise-ui ~ #profileModal.biwa-modal .biwa-btn[aria-busy="true"]::before { animation: none; }
}
