/* ============================================================
   Estilos extraídos dos <style scoped> das views/componentes Vue.
   Fonte: moments_of_glass/frontend/src/**/*.vue  (gerado)
   ============================================================ */

/* --- components/account/ChangePasswordModal.vue --- */
.account-modal__section + .account-modal__section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.account-modal__header h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text);
}

.account-modal__header p {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.account-modal__languages {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.account-modal__language {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.account-modal__language:hover:not(:disabled) {
  border-color: var(--color-primary-border);
  background: var(--color-primary-soft);
}

.account-modal__language--active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.account-modal__language:disabled {
  opacity: 0.7;
  cursor: wait;
}

.account-modal__language-code {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: 0.6875rem;
  font-weight: 800;
}

.account-modal__language-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.account-modal__language-check {
  color: var(--color-primary);
  font-weight: 800;
}

.account-modal__saving {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.account-modal__form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.account-modal__admin-hint {
  margin: 0.85rem 0 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* --- components/layout/AppSidebar.vue --- */
.user-info__icon {
  margin: 0 auto;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: none;
  background: rgba(16, 24, 40, 0.45);
}

.sidebar-backdrop-fade-enter-active,
.sidebar-backdrop-fade-leave-active {
  transition: opacity 0.22s ease;
}

.sidebar-backdrop-fade-enter-from,
.sidebar-backdrop-fade-leave-to {
  opacity: 0;
}

@media (max-width: 960px) {
  .sidebar-backdrop {
    display: block;
  }
}

/* --- components/layout/SidebarNavIcon.vue --- */
.sidebar-nav-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

/* --- components/settings/PermissionEditor.vue --- */
.permission-editor__table {
  width: 100%;
  border-collapse: collapse;
}

.permission-editor__table th,
.permission-editor__table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  text-align: left;
}

.permission-editor__cell {
  text-align: center;
}

/* --- components/shipping/CoverageMap.vue --- */
.coverage-map {
  display: grid;
  gap: 8px;
}

.coverage-map__canvas {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
}

.coverage-map__canvas :deep(.leaflet-container) {
  background: #d4dadd;
  font-family: inherit;
}

.coverage-map__canvas :deep(.leaflet-interactive),
.coverage-map__canvas :deep(.leaflet-interactive:focus),
.coverage-map__canvas :deep(path) {
  outline: none;
}

.coverage-map__canvas :deep(.leaflet-control-attribution) {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.75);
}

.coverage-map__empty,
.coverage-map__extras {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
}

.coverage-map__extras {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.coverage-map__chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* --- components/tutorial/AppTutorial.vue --- */
.app-tutorial {
  position: fixed;
  inset: 0;
  z-index: 600;
}

.app-tutorial__shield {
  position: fixed;
  inset: 0;
  pointer-events: auto;
}

.app-tutorial__spotlight {
  position: fixed;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62);
  pointer-events: none;
  transition:
    top 0.2s ease,
    left 0.2s ease,
    width 0.2s ease,
    height 0.2s ease;
}

.app-tutorial__card {
  position: fixed;
  z-index: 1;
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.app-tutorial__card--centered {
  top: 50%;
  left: 50%;
  width: min(420px, calc(100vw - 24px));
  transform: translate(-50%, -50%);
}

.app-tutorial__progress {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.app-tutorial__card h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.app-tutorial__body {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.app-tutorial__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.app-tutorial__skip {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.app-tutorial__skip:hover {
  color: var(--color-text);
}

.app-tutorial__nav {
  display: flex;
  gap: 0.5rem;
}

.app-tutorial__btn {
  min-height: 2.125rem;
  padding: 0 0.85rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.app-tutorial__btn--ghost {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
}

.app-tutorial__btn--ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-tutorial__btn--primary {
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.app-tutorial__btn--primary:hover {
  filter: brightness(1.05);
}

/* --- components/ui/AppSearchPanel.vue --- */
.search-panel__filters-dropdown {
  flex-shrink: 0;
}

.search-panel__dropdown {
  position: fixed;
  z-index: 400;
  display: grid;
  gap: 0.125rem;
  padding: 0.35rem;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.search-panel__dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.search-panel__dropdown-item:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.search-panel__dropdown-item--active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.search-panel__dropdown-check {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
}

/* --- components/ui/AppSelect --- */
.app-select-field {
  width: 100%;
  min-width: 0;
}

.app-select-field__trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.15rem 0.35rem 0.15rem 0.55rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.app-select-field__trigger:hover,
.app-select-field--open .app-select-field__trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(23, 75, 204, 0.12);
}

.app-select-field--disabled .app-select-field__trigger {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.app-select-field__display {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 1.9rem;
  padding: 0.2rem 0.2rem;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.app-select-field__display:disabled {
  cursor: not-allowed;
}

.app-select-field__display--placeholder {
  color: var(--color-text-muted);
}

.app-select-field__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 1.9rem;
  padding: 0.2rem 0.25rem;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
}

.app-select-field__input:focus {
  outline: none;
}

.app-select-field__input::-webkit-search-cancel-button {
  appearance: none;
}

.app-select-field__value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.app-select-field__value-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-select-field__chevron-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.app-select-field__chevron-btn:disabled {
  cursor: not-allowed;
}

.app-select-field__chevron {
  width: 0.7rem;
  height: 0.45rem;
  transition: transform 0.18s ease;
}

.app-select-field--open .app-select-field__chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}

.app-select-field__menu {
  position: fixed;
  z-index: 420;
  display: grid;
  align-content: start;
  gap: 0.15rem;
  box-sizing: border-box;
  padding: 0.4rem;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.14),
    0 2px 8px rgba(15, 23, 42, 0.06);
}

.app-select-field__menu::-webkit-scrollbar {
  width: 8px;
}

.app-select-field__menu::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: #cbd5e1;
}

.app-select-field__empty {
  margin: 0;
  padding: 0.85rem 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-align: center;
}

.app-select-field__option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.app-select-field__option:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.app-select-field__option--active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
}

.app-select-field__option-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-select-field__badge {
  flex: 0 1 auto;
  max-width: 4.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 7px;
  border: 1px solid var(--color-primary-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-primary);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-select-field__check {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 800;
}

.app-select-field--compact .app-select-field__trigger {
  min-height: 2rem;
  padding: 0.1rem 0.25rem 0.1rem 0.45rem;
}

.app-select-field--compact .app-select-field__display,
.app-select-field--compact .app-select-field__input {
  min-height: 1.55rem;
  font-size: 0.75rem;
}

.app-select-field--compact .app-select-field__option {
  min-height: 34px;
  padding: 0.35rem 0.55rem;
}

.app-select-field--narrow {
  width: auto;
  min-width: 4.5rem;
}

/* --- components/ui/AttributeValuePicker.vue --- */
.attribute-box {
  position: relative;
  min-width: 0;
}

.combo-field__menu {
  position: fixed;
  z-index: 80;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--color-border-strong, #d7dde8);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
}

.combo-field__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.combo-field__option:hover {
  background: #eef4ff;
}

.combo-field__badge {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.6875rem;
  font-weight: 700;
}

/* --- components/ui/CarrierProcessingLoader.vue --- */
.carrier-processing-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 32px;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 16px;
  box-shadow:
    0 18px 48px rgba(16, 24, 40, 0.12),
    0 2px 8px rgba(16, 24, 40, 0.06);
  text-align: center;
}

.carrier-processing-loader__visual {
  position: relative;
  width: 72px;
  height: 72px;
}

.carrier-processing-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.carrier-processing-loader__ring--outer {
  border-top-color: var(--color-primary, #2563eb);
  border-right-color: rgba(37, 99, 235, 0.18);
  animation: carrier-processing-spin 1.1s linear infinite;
}

.carrier-processing-loader__ring--inner {
  inset: 12px;
  border-bottom-color: var(--color-primary-hover, #1d4ed8);
  border-left-color: rgba(37, 99, 235, 0.12);
  animation: carrier-processing-spin 0.85s linear infinite reverse;
}

.carrier-processing-loader__core {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, var(--color-primary-soft, #eff6ff) 100%);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
  animation: carrier-processing-pulse 1.6s ease-in-out infinite;
}

.carrier-processing-loader__copy {
  display: grid;
  gap: 6px;
}

.carrier-processing-loader__message {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-primary, #111827);
}

.carrier-processing-loader__hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
}

@keyframes carrier-processing-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes carrier-processing-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.92);
    opacity: 0.85;
  }
}

/* --- components/ui/ConfirmModal.vue --- */
.confirm-modal__error {
  margin-top: var(--space-3);
}

/* --- components/ui/RowActionsMenu.vue --- */
.row-actions {
  display: inline-flex;
  justify-content: center;
}

.row-actions__trigger {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.row-actions__trigger svg {
  width: 1.1rem;
  height: 1.1rem;
}

.row-actions__trigger:hover,
.row-actions__trigger[aria-expanded='true'] {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-primary);
}

.row-actions__menu {
  position: fixed;
  z-index: 400;
  display: grid;
  gap: 0.125rem;
  padding: 0.35rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.row-actions__item {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.row-actions__item:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.row-actions__item--danger {
  color: #dc2626;
}

.row-actions__item--danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* --- views/dashboard/DashboardView.vue --- */
.dashboard-page {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 1.75rem;
}

.dashboard-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-page__header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard-page__header p {
  margin: 0.35rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.dashboard-page__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-panel {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1.25rem;
}

.dashboard-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-panel__header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.dashboard-panel__link {
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.dashboard-panel__link:hover {
  text-decoration: underline;
}

.dashboard-panel__state {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.dashboard-metric {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.dashboard-metric span {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-metric strong {
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 800;
}

.dashboard-metric--link {
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.dashboard-metric--link:hover {
  border-color: var(--color-primary-border);
  background: var(--color-primary-soft);
}

.stat-card--link {
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.stat-card--link:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-sm);
}

.stat-card small {
  display: block;
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.dashboard-table-wrap {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.8125rem;
  text-align: left;
}

.dashboard-table th {
  background: #f8fafc;
  color: var(--color-primary);
  font-weight: 800;
}

.dashboard-table__row {
  cursor: pointer;
}

.dashboard-table__row:hover {
  background: var(--color-primary-soft);
}

.dashboard-table__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
}

@media (max-width: 960px) {
  .dashboard-page__grid,
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-page {
    padding: 1rem;
  }

  .dashboard-page__header {
    flex-direction: column;
  }
}

/* --- views/documents/CarrierSelectionModal.vue --- */
.carrier-modal__intro,
.carrier-modal__destination {
  margin: 0 0 16px;
  color: var(--color-text-muted, #6b7280);
}

.carrier-modal__destination {
  margin-top: -8px;
  font-size: 0.8125rem;
}

.carrier-modal__panel {
  position: relative;
}

.carrier-modal__panel--centered {
  display: flex;
  justify-content: center;
  padding: 32px 0 16px;
}

.carrier-modal__panel--processing .carrier-modal__list,
.carrier-modal__panel--processing .carrier-modal__dynamic-fields,
.carrier-modal__panel--processing .carrier-modal__field--printer {
  pointer-events: none;
  user-select: none;
  filter: blur(1px);
  opacity: 0.35;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.carrier-modal__processing {
  position: absolute;
  inset: -4px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  animation: carrier-modal-fade-in 0.25s ease;
}

.carrier-modal__list-label {
  display: block;
  margin-top: 20px;
  margin-bottom: 6px;
}

.carrier-modal__list {
  display: grid;
  gap: 10px;
}

.carrier-modal__option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.carrier-modal__option--active {
  border-color: var(--color-primary, #2563eb);
  background: rgba(37, 99, 235, 0.05);
}

.carrier-modal__option--disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.carrier-modal__input {
  margin: 0;
}

.carrier-modal__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.carrier-modal__name {
  font-size: 0.875rem;
  font-weight: 600;
}

.carrier-modal__badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.carrier-modal__badge--available {
  background: #dcfce7;
  color: #166534;
}

.carrier-modal__badge--recommended {
  background: #dbeafe;
  color: #1d4ed8;
}

.carrier-modal__badge--outside {
  background: #fef3c7;
  color: #92400e;
}

.carrier-modal__dynamic-fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.carrier-modal__field {
  display: grid;
  gap: 6px;
}

.carrier-modal__field--printer {
  margin-top: 16px;
}

.carrier-modal__field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary, #4b5563);
}

.carrier-modal__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted, #6b7280);
}

@keyframes carrier-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- views/documents/DocumentFormView.vue --- */
.doc-page {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  max-width: none;
  min-height: 100%;
  min-width: 0;
}

.doc-page__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.doc-page__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.doc-page__title h1 {
  font-size: 1rem;
  font-weight: 700;
}

.doc-status-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.doc-status-stepper__step {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.doc-status-stepper__step--active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.doc-status-stepper__step--cancelled {
  background: var(--color-danger-soft);
  color: var(--color-danger-text, #c0392b);
}

.doc-page__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.doc-page__back svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.doc-page__back:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-border);
  background: var(--color-primary-soft);
}

.doc-page__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.doc-page__alert {
  margin: 0;
}

.doc-form-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 132px);
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.doc-form {
  display: grid;
  gap: var(--space-5);
  width: 100%;
  padding: var(--space-5);
  min-width: 0;
  box-sizing: border-box;
}

.doc-form .field-control--fluid {
  max-width: none;
  width: 100%;
  min-width: 0;
}

.doc-form textarea.field-control--fluid {
  max-width: none;
}

/* Header panel */
.doc-form__header {
  display: grid;
  gap: 0;
  width: 100%;
}

.doc-form__panel--header {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}

.doc-form__header-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.doc-form__col {
  display: contents;
}

.doc-form__header-grid .doc-form__row {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(108px, 132px) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.doc-form__row {
  display: grid;
  grid-template-columns: minmax(108px, 132px) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.doc-form__row .app-select-field {
  width: 100%;
  min-width: 0;
}

.doc-form__row--wide {
  grid-column: 1 / -1;
}

.doc-form__row--top {
  align-items: start;
}

.doc-form__row--check {
  align-items: center;
}

.doc-form__field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.doc-form__panel--header .doc-form__shipping {
  border: none;
  border-radius: 0;
}

.doc-form__panel--header > .doc-form__row--wide {
  display: grid;
  grid-template-columns: minmax(108px, 132px) minmax(0, 1fr);
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

.doc-form__label {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: right;
}

.doc-form__label--stacked {
  text-align: left;
  font-size: 0.75rem;
}

.doc-form__required {
  color: var(--color-danger-text);
}

.doc-form__inline-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

/* Shipping */
.doc-form__shipping {
  width: 100%;
}

.doc-form__shipping-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px var(--space-4);
  border: none;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.doc-form__shipping-toggle:hover {
  background: var(--color-surface-hover, var(--color-surface-muted));
}

.doc-form__chevron {
  font-size: 1.125rem;
  transition: transform 0.2s;
  display: inline-block;
}

.doc-form__chevron--open {
  transform: rotate(90deg);
}

.doc-form__shipping-fields {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  width: 100%;
  box-sizing: border-box;
}

.doc-form__shipping-fields .doc-form__row--wide {
  display: grid;
  grid-template-columns: minmax(108px, 132px) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}

.doc-form__local-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
}

.doc-form__field-pair {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.doc-form__field-pair .doc-form__label--stacked {
  text-align: left;
}

@media (min-width: 640px) {
  .doc-form__local-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .doc-form__local-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-left: calc(132px + var(--space-3));
    box-sizing: border-box;
  }
}

/* Lines section */
.doc-form__lines-section {
  display: grid;
  width: 100%;
  min-width: 0;
}

.doc-form__lines-panel {
  display: grid;
  gap: 0;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}

.doc-form__lines-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}

.doc-form__lines-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.doc-form__lines-wrap {
  width: 100%;
  overflow-x: auto;
}

.doc-form__lines-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.doc-form__lines-table thead th {
  padding: 10px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.doc-form__lines-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.doc-form__line-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.doc-form__line-input--num {
  text-align: right;
}

.doc-form__stock-hint {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.doc-form__line-row .combo-field {
  min-width: 0;
}

/* Column widths — numeric cols fixed, description takes remaining space */
.col-sku { width: 200px; }
.col-desc { width: auto; }
.col-qty { width: 88px; }
.col-price { width: 104px; }
.col-disc { width: 72px; }
.col-vat { width: 72px; }
.col-total { width: 108px; text-align: right; }
.col-del { width: 40px; text-align: center; }

.doc-form__lines-table thead th.col-qty,
.doc-form__lines-table thead th.col-price,
.doc-form__lines-table thead th.col-disc,
.doc-form__lines-table thead th.col-vat,
.doc-form__lines-table thead th.col-total {
  text-align: right;
}

.doc-form__line-row:last-child td {
  border-bottom: none;
}

.doc-form__line-row--linked {
  cursor: pointer;
}

.doc-form__line-row--linked:hover td {
  background: var(--color-primary-soft);
}

.doc-form__lines-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.doc-form__line-total {
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  white-space: nowrap;
  padding-right: 10px;
}

.doc-form__line-del {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-danger-text, #c0392b);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.doc-form__line-del:hover {
  background: var(--color-danger-soft);
}

/* Totals */
.doc-form__totals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.doc-form__totals-main {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.doc-form__totals strong {
  color: var(--color-text);
}

/* Combo-field (same as ProductFormView) */
.combo-field {
  position: relative;
}

.combo-field__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.combo-field__menu--compact {
  max-height: 180px;
}

.combo-field__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.combo-field__option:last-child {
  border-bottom: none;
}

.combo-field__option:hover {
  background: var(--color-primary-soft);
}

.combo-field__badge {
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.6875rem;
  font-weight: 700;
}

.combo-field__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-field__status {
  margin: 0;
  padding: 10px 12px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .doc-form__header-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-form__header-grid .doc-form__row {
    grid-column: span 1;
  }
}

@media (max-width: 1024px) {
  .doc-form__lines-table {
    table-layout: fixed;
    min-width: 980px;
  }

  .col-desc { width: 36%; }

  .doc-form__shipping-fields .doc-form__row--wide,
  .doc-form__panel--header > .doc-form__row--wide {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .doc-form__shipping-fields .doc-form__label,
  .doc-form__panel--header > .doc-form__row--wide .doc-form__label {
    text-align: left;
  }

  .doc-form__local-grid {
    padding-left: 0;
  }
}

@media (max-width: 900px) {
  .doc-form__header-grid {
    grid-template-columns: 1fr;
  }

  .doc-form__header-grid .doc-form__row {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .doc-form__header-grid .doc-form__label {
    text-align: left;
  }
}

@media (max-width: 639px) {
  .doc-form__local-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .doc-form {
    padding: var(--space-4);
  }

  .doc-form__row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .doc-form__label {
    text-align: left;
  }

  .doc-form__totals {
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
  }

  .doc-page__actions {
    flex-wrap: wrap;
  }
}

/* --- views/documents/DocumentImportModal.vue --- */
.family-import__subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* --- views/documents/DpdNstShipmentResultModal.vue --- */
.dpd-nst-result__success {
  margin: 0 0 16px;
  color: #166534;
  font-weight: 600;
}

.dpd-nst-result__info {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.dpd-nst-result__field {
  display: grid;
  gap: 4px;
}

.dpd-nst-result__label {
  font-size: 0.8rem;
  color: var(--color-text-muted, #6b7280);
}

.dpd-nst-result__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  word-break: break-all;
}

.dpd-nst-result__hint {
  margin: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
}

/* --- views/documents/DpdShipmentResultModal.vue --- */
.dpd-result__success {
  margin: 0 0 16px;
  color: #166534;
  font-weight: 600;
}

.dpd-result__info {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.dpd-result__field {
  display: grid;
  gap: 4px;
}

.dpd-result__label {
  font-size: 0.8rem;
  color: var(--color-text-muted, #6b7280);
}

.dpd-result__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  word-break: break-all;
}

.dpd-result__hint {
  margin: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
}

/* --- views/documents/DsvShipmentResultModal.vue --- */
.dsv-result__success {
  margin: 0 0 16px;
  color: #166534;
  font-weight: 600;
}

.dsv-result__info {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.dsv-result__field {
  display: grid;
  gap: 4px;
}

.dsv-result__label {
  font-size: 0.8rem;
  color: var(--color-text-muted, #6b7280);
}

.dsv-result__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  word-break: break-all;
}

.dsv-result__hint {
  margin: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
}

/* --- views/documents/GlsShipmentResultModal.vue --- */
.gls-result__success {
  margin: 0 0 16px;
  color: #166534;
  font-weight: 600;
}

.gls-result__info {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.gls-result__field {
  display: grid;
  gap: 4px;
}

.gls-result__label {
  font-size: 0.8rem;
  color: var(--color-text-muted, #6b7280);
}

.gls-result__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  word-break: break-all;
}

.gls-result__hint {
  margin: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
}

/* --- views/documents/PrintLabelControl.vue --- */
.print-label-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.print-label-control__select,
.print-label-control .app-select-field {
  min-width: 200px;
  max-width: 18rem;
}

.print-label-control__hint {
  margin: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.85rem;
}

.print-label-control__success {
  margin: 0;
  color: #166534;
  font-size: 0.85rem;
}

.print-label-control__error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.85rem;
}

/* --- views/documents/ShippingLabelsModal.vue --- */
.shipping-labels-modal {
  display: grid;
  gap: 16px;
}

.shipping-labels-modal__card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.shipping-labels-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shipping-labels-modal__info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.shipping-labels-modal__badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.shipping-labels-modal__meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.shipping-labels-modal__count {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.shipping-labels-modal__status {
  margin: 0;
  padding: 16px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.shipping-labels-modal__status--error {
  color: var(--color-danger-text, #c0392b);
}

.shipping-labels-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  justify-content: center;
  gap: 16px;
}

.shipping-labels-modal__preview {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--color-border);
}

.shipping-labels-modal__index {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
}

.shipping-labels-modal__image {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 340px;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.shipping-labels-modal__object {
  width: 220px;
  height: 340px;
  border: none;
  background: #fff;
}

.btn-secondary--sm {
  padding: 4px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* --- views/entidades/EntitiesView.vue --- */
.entity-form-panel {
  padding-top: 0.5rem;
}

.entity-context-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--color-surface-muted) 0%, var(--color-bg) 100%);
  border: 1px solid var(--color-border-lighter, #e4e7ed);
  border-radius: 8px;
}

.entity-context-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8125rem;
}

.entity-context-label {
  color: var(--color-text-muted);
}

.entity-context-value {
  font-weight: 600;
  color: var(--color-text);
}

.entity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-strong, #dcdfe6);
}

.entity-tabs__item {
  margin: 0;
  padding: 0.625rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.entity-tabs__item:hover {
  color: var(--color-primary);
}

.entity-tabs__item--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.entity-info-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.entity-tab-content {
  width: 100%;
  min-width: 0;
}

/* Labels em cima (como VisiGest), não o layout horizontal default do AppField */
.entity-info-form :deep(.form-row) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin-bottom: 12px;
  border-bottom: none;
}

.entity-info-form :deep(.form-row__label) {
  line-height: 1.3;
}

.entity-info-form :deep(.form-row__control) {
  width: 100%;
  max-width: none;
}

.entity-info-form :deep(.field-control) {
  width: 100%;
  max-width: none;
}

.entity-id-nif-name-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
  width: 100%;
  margin-bottom: 4px;
}

.entity-id-nif-name-row :deep(.form-row) {
  margin-bottom: 0;
  min-width: 0;
}

.entity-input-entity-number {
  width: 100%;
  max-width: 88px;
}

.entity-input-entity-number::-webkit-outer-spin-button,
.entity-input-entity-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.entity-input-entity-number[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.entity-form-row {
  display: grid;
  gap: 12px 16px;
  width: 100%;
  margin-bottom: 4px;
}

.entity-form-row :deep(.form-row) {
  margin-bottom: 0;
}

.entity-form-row--half {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entity-form-row--third {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entity-form-row--quarter {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-control--full {
  max-width: none;
  width: 100%;
}

.field-input-group {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.field-input-group--nif {
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
}

.field-input-group--phone {
  grid-template-columns: minmax(0, 108px) minmax(0, 1fr);
}

.entity-info-form select.field-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667085' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-input-group__prepend {
  width: 100%;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.field-input-group .app-select-field {
  min-width: 0;
}

.field-input-group .app-select-field__trigger {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.field-input-group__input {
  width: 100%;
  min-width: 0;
  max-width: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.entity-payment-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.entity-payment-row .field-control {
  flex: 1;
  min-width: 0;
}

.entity-settings-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1;
  cursor: not-allowed;
  opacity: 0.5;
}

.field-control--notes {
  max-width: none;
  min-height: 120px;
  width: 100%;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.entity-subsection {
  margin-bottom: 1rem;
}

.entity-subsection--card {
  padding: 1rem;
  background: #f9fafc;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
}

.entity-subsection__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.entity-subsection__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.entity-tab-actions {
  margin-top: 0.75rem;
  text-align: right;
}

.entity-tab-hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.badge + .badge {
  margin-left: 0.35rem;
}

@media (max-width: 900px) {
  .entity-id-nif-name-row {
    grid-template-columns: 1fr;
  }

  .entity-form-row--half,
  .entity-form-row--third,
  .entity-form-row--quarter {
    grid-template-columns: 1fr;
  }

  .entity-input-entity-number {
    max-width: none;
  }

  .field-input-group,
  .field-input-group--phone {
    grid-template-columns: 1fr;
  }

  .field-input-group__prepend,
  .field-input-group__input {
    border-radius: var(--radius-sm);
    border-right: 1px solid var(--color-border-strong);
  }

  .field-input-group__input {
    border-top: none;
  }
}

/* --- views/inventory/InventoryBundlesView.vue --- */
.inventory-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.inventory-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.inventory-page__header h1 {
  margin: 0;
  color: var(--color-text);
  font-size: 1.35rem;
  font-weight: 700;
}

.inventory-page__header p {
  margin: 0.3rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.inventory-tabs {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.inventory-tabs__item {
  padding: 0 0 0.7rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.inventory-tabs__item--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.inventory-notice {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.inventory-notice strong {
  color: var(--color-text);
}

.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.inventory-bundles,
.inventory-details {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.inventory-bundles {
  overflow: hidden;
}

.inventory-bundles :deep(.data-table-panel) {
  border: none;
  border-radius: 0;
}

.inventory-bundles :deep(.search-panel) {
  align-items: center;
  padding: 0.75rem 1rem;
}

.inventory-bundles :deep(.search-panel__input) {
  width: min(720px, 60vw);
  min-width: 520px;
}

.inventory-bundles :deep(.data-table-wrap) {
  overflow-x: auto;
}

.inventory-bundles :deep(.pagination) {
  padding: 0.8rem 1rem 1rem;
}

.inventory-bundles :deep(.data-table) {
  min-width: 760px;
}

.inventory-details {
  padding: 1rem;
}

.inventory-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.inventory-card-header h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 700;
}

.inventory-card-header span {
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.inventory-bundle-link {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--color-text);
  text-align: left;
}

.inventory-bundle-link strong {
  font-size: 0.875rem;
}

.inventory-bundle-link span {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.inventory-bundle-link--active strong {
  color: var(--color-primary);
}

.inventory-composition-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.inventory-composition-tags span {
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.inventory-composition-tags em {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-style: normal;
}

.inventory-availability--ok {
  color: #047857;
}

.inventory-availability--empty {
  color: #dc2626;
}

.inventory-details__hint,
.inventory-details__empty {
  margin: 1rem 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.inventory-component-list {
  display: grid;
  gap: 0.65rem;
}

.inventory-component {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.inventory-component strong,
.inventory-component span {
  display: block;
}

.inventory-component strong {
  color: var(--color-text);
  font-size: 0.85rem;
}

.inventory-component span {
  margin-top: 0.2rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.inventory-component input {
  width: 88px;
}

.inventory-potential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.inventory-potential span,
.inventory-limiter span {
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.inventory-potential strong {
  color: var(--color-text);
  font-size: 1.25rem;
}

.inventory-limiter {
  display: grid;
  gap: 0.25rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: #111827;
  color: #ffffff;
}

.inventory-limiter strong {
  color: #ffffff;
}

.inventory-limiter small {
  color: #d1d5db;
}

@media (max-width: 1280px) {
  .inventory-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .inventory-page {
    overflow-y: auto;
  }
}

@media (max-width: 720px) {
  .inventory-bundles :deep(.search-panel__input) {
    width: 100%;
    min-width: 0;
  }
}

/* --- views/logistics/LogisticsView.vue --- */
.logistics-row {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.logistics-row:hover {
  background: var(--color-surface-muted);
}

.logistics-row--selected {
  background: var(--color-primary-soft);
}

.logistics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.logistics-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.logistics-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.logistics-col-check {
  width: 36px;
}

.logistics-printer-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logistics-printer-picker__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.logistics-printer-picker select {
  min-width: 180px;
}

.logistics-row-action-mobile {
  display: none;
}

/* Responsivo: em ecrãs estreitos (telemóveis), a tabela passa a cartões empilhados,
   um por documento, com o rótulo de cada coluna ao lado do valor. */
@media (max-width: 768px) {
  .logistics-row-action-mobile {
    display: inline-flex;
  }

  .logistics-row-actions--hide-mobile {
    display: none;
  }

  .logistics-toolbar__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .logistics-printer-picker {
    justify-content: space-between;
  }

  .logistics-printer-picker select {
    flex: 1;
    min-width: 0;
  }

  .logistics-table thead {
    display: none;
  }

  .logistics-table,
  .logistics-table tbody,
  .logistics-table tr,
  .logistics-table td {
    display: block;
    width: 100%;
  }

  .logistics-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
  }

  .logistics-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid var(--color-border-lighter, #eef0f3);
    text-align: right;
  }

  .logistics-table td:last-child {
    border-bottom: none;
  }

  .logistics-table td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
  }

  .logistics-table td.logistics-col-check {
    justify-content: flex-end;
  }

  .logistics-table td.logistics-col-check::before {
    content: '';
  }
}

/* --- views/logistics/ShipmentDetailsModal.vue --- */
.shipment-details-modal {
  display: grid;
  gap: 16px;
}

.shipment-details-modal__defaults {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.shipment-details-modal__defaults-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.shipment-details-modal__defaults-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.shipment-details-modal__defaults-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.shipment-details-modal__input {
  padding: 4px 8px;
  font-size: 0.8125rem;
}

.shipment-details-modal__input--number {
  width: 80px;
}

/* --- views/products/ProductFormView.vue --- */
.product-page {
  display: grid;
  gap: var(--space-3);
  min-height: 100%;
  min-width: 0;
  overflow: hidden;
}

.product-page__topbar,
.product-page__title,
.product-page__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.product-page__topbar {
  justify-content: space-between;
  flex-wrap: wrap;
}

.product-page__title h1 {
  font-size: 1rem;
  font-weight: 700;
}

.product-card__collapse {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 1.125rem;
  line-height: 1;
}

.product-page__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.product-page__back svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.product-page__back:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-border);
  background: var(--color-primary-soft);
}

.product-card,
.cost-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.product-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--color-border);
  color: #98a6ba;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-card__body {
  padding: var(--space-4);
}

.product-card__body--main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24rem;
  gap: var(--space-4);
}

.product-form__name,
.size-field,
.product-options,
.product-form__notes {
  grid-column: 1 / -1;
}

.product-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.field-control--fluid {
  max-width: none;
  min-width: 0;
}

.product-form :deep(input),
.product-form :deep(select),
.product-form :deep(textarea) {
  min-width: 0;
}

.size-field__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.size-field__row select {
  flex: 1;
}

.size-field__input {
  width: 150px;
}

.size-field__separator {
  color: var(--color-text-muted);
  font-weight: 700;
}

.product-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3);
  padding: 0;
  background: transparent;
}

.product-options__field {
  display: grid;
  gap: 4px;
  align-content: start;
  position: relative;
}

.product-options__field.combo-field .combo-field__menu--compact {
  top: calc(100% + 2px);
  max-height: 180px;
  z-index: 30;
}

.product-colors__add.combo-field {
  position: relative;
}

.product-colors__color-field {
  position: relative;
  min-width: 0;
}

.product-colors__color-field .combo-field__menu--compact {
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 180px;
  z-index: 30;
}

.product-options__field label {
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.product-options__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.product-options__field--partes {
  min-width: 16rem;
}

.partes-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem;
  gap: var(--space-2);
  align-items: start;
}

.partes-slot__qty {
  width: 4.5rem;
}

.product-options__field--colors {
  grid-column: auto / span 3;
  max-width: 430px;
}

.product-colors {
  display: grid;
  gap: var(--space-2);
}

.product-colors__add,
.product-colors__item {
  display: grid;
  grid-template-columns: minmax(0, 260px) 86px;
  gap: var(--space-2);
}

.product-colors__add-btn {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.75rem;
}

.product-colors__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-colors__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 6px 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}

.product-colors__item button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  line-height: 1;
}

.product-colors__item button:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger-text);
}

.bundle-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.bundle-toggle--inline {
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  white-space: nowrap;
}

.cost-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.bundle-config {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface-muted);
  border-radius: var(--radius-sm);
}

.bundle-config label {
  display: grid;
  gap: 4px;
}

.bundle-config span {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--color-text-secondary);
}

.bundle-table {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.bundle-table__header,
.bundle-table__row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 110px 110px 52px;
  gap: var(--space-2);
  align-items: center;
  min-width: 720px;
  padding: 8px 10px;
}

.bundle-table__header {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 800;
}

.bundle-table__row + .bundle-table__row {
  border-top: 1px solid var(--color-border);
}

.bundle-table__check {
  display: grid;
  place-items: center;
}

.bundle-list__remove {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm);
  background: var(--color-danger-soft);
  color: var(--color-danger-text);
  font-size: 1rem;
}

.product-list {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.product-list table {
  width: 100%;
  border-collapse: collapse;
}

.product-list th,
.product-list td {
  padding: 8px 10px;
  border-top: 1px solid var(--color-border);
  font-size: 0.75rem;
  text-align: left;
}

.product-list th {
  background: #f8fafc;
  color: var(--color-text);
  font-weight: 800;
}

.cost-card {
  padding: var(--space-4);
}

.cost-card h2 {
  margin-bottom: var(--space-1);
  font-size: 0.9375rem;
}

.cost-card p {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.cost-card strong {
  color: #07833d;
  font-size: 1rem;
}

.product-list {
  margin: var(--space-4);
}

@media (max-width: 1100px) {
  .product-card__body--main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bundle-config {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .product-page__topbar,
  .product-page__actions,
  .size-field__row {
    align-items: stretch;
    flex-direction: column;
  }

  .product-name-row {
    grid-template-columns: 1fr;
  }

  .product-card__body--main {
    grid-template-columns: 1fr;
  }

  .product-options {
    grid-template-columns: 1fr;
  }

  .size-field__input {
    width: 100%;
  }

}

.product-form-shell {
  min-height: calc(100vh - 132px);
  min-width: 0;
  overflow: hidden;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
}

.product-tabs {
  display: flex;
  align-items: flex-end;
  min-height: 40px;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.product-tabs__item {
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.product-tabs__item--active {
  background: var(--color-surface);
  border-color: var(--color-border);
  transform: translateY(1px);
}

.product-form {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  min-width: 0;
}

.product-form__row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.product-form__row--top {
  align-items: start;
}

.product-form__row--code {
  grid-template-columns: 150px minmax(180px, 0.8fr) 80px 140px 170px minmax(260px, 1.2fr);
}

.product-form__row--split {
  grid-template-columns: 150px minmax(260px, 1fr) 190px minmax(220px, 0.7fr);
}

.product-form__row--prices {
  grid-template-columns: 150px 150px minmax(160px, 1fr) 150px minmax(190px, 1fr) 150px;
}

.product-form__row--checks {
  align-items: center;
}

.product-form__label {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
}

.product-form__label span {
  color: var(--color-danger-text);
}

.product-form__label--right {
  padding-left: var(--space-5);
}

.product-form__control {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.combo-field {
  position: relative;
}

.category-selected {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-align: left;
  cursor: pointer;
}

.category-selected__clear {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1;
}

.category-selected__clear:hover {
  background: var(--color-danger-soft, #fee2e2);
  color: var(--color-danger-text, #b91c1c);
}

.bundle-parts .combo-field__menu--compact {
  z-index: 40;
}

.combo-field__status {
  margin: 0;
  padding: 10px 12px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.product-form__hint {
  color: var(--color-danger-text);
  font-size: 0.75rem;
}

.combo-field__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.combo-field__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  text-align: left;
}

.combo-field__option:last-child {
  border-bottom: none;
}

.combo-field__option:hover {
  background: var(--color-primary-soft);
}

.combo-field__badge {
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 0.6875rem;
  font-weight: 700;
}

.combo-field__label {
  min-width: 0;
}

.product-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.product-checks label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.name-field,
.ean-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.ean-list__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
}

.ean-list__code,
.library-list__code {
  width: 14rem;
  max-width: 14rem;
  flex: 0 0 14rem;
}

.ean-list__source {
  position: relative;
  width: 9.5rem;
  max-width: 9.5rem;
  flex: 0 0 9.5rem;
  min-width: 9.5rem;
}

.ean-list__source .app-select-field {
  width: 100%;
}

.ean-list__source-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding-right: 8px;
  text-align: left;
  cursor: pointer;
}

.ean-list__source--open .ean-list__source-trigger {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(23, 75, 204, 0.1);
}

.ean-list__source-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--color-text-secondary);
  flex-shrink: 0;
}

.ean-list__source--open .ean-list__source-caret {
  transform: rotate(180deg);
}

.ean-list__source-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  min-width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.ean-list__source-option {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.ean-list__source-option:hover {
  background: var(--color-primary-soft);
}

.ean-list__source-option--active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
}

.library-list__name {
  width: auto;
  max-width: none;
  flex: 1 1 auto;
  min-width: 12rem;
}

.ean-list__primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.ean-list__remove {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
}

.ean-list__add {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0;
}

.library-tab {
  padding: var(--space-4) var(--space-5);
}

.library-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.library-card__intro {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.library-list__header,
.library-list__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.library-list__header {
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.library-card__add {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0;
}

.product-form .product-options {
  border: none;
  border-radius: 0;
  background: var(--color-surface);
  padding: 0;
}

.characteristics-control {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.category-form__hint {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.attribute-count {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.6875rem;
  font-weight: 600;
}

.product-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

.bundle-tab {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
}

.bundle-parts {
  display: grid;
  gap: var(--space-3);
}

.bundle-parts__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.bundle-parts__header,
.bundle-parts__row {
  display: grid;
  grid-template-columns: 150px minmax(260px, 1fr) 120px 40px;
  column-gap: var(--space-5);
  row-gap: var(--space-3);
  align-items: center;
}

.bundle-parts__row .combo-field,
.bundle-parts__row .app-select-field {
  width: 100%;
  min-width: 0;
}

.bundle-parts__remove {
  border: none;
  background: transparent;
  color: var(--color-danger, #c0392b);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem;
}

.bundle-parts__remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bundle-parts__header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.bundle-parts__header span {
  white-space: nowrap;
}

.bundle-parts__row label {
  font-weight: 600;
  color: var(--color-text-muted);
}

.bundle-parts__pagination {
  margin-top: var(--space-2);
}

.product-stores-tab {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5);
  min-width: 0;
}

.product-form-shell [hidden] {
  display: none !important;
}

.bundle-tab__toolbar {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1500px) {
  .product-form__row--split,
  .product-form__row--code,
  .product-form__row--prices {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .product-form__label--right {
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .product-form {
    padding: var(--space-4);
  }

  .product-stores-tab {
    padding: var(--space-4);
  }

  .product-tabs__item {
    flex-shrink: 0;
  }

  .product-form__row,
  .product-form__row--split,
  .product-form__row--code,
  .product-form__row--prices {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .product-form__label {
    text-align: left;
  }

  .product-checks {
    gap: var(--space-3);
  }

}

/* --- views/products/ProductsView.vue --- */
.products-bundle-picker__hint {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.products-bundle-picker__status {
  margin: 0.75rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.products-skipped {
  display: grid;
  gap: var(--space-3);
}

.products-skipped__stats {
  display: grid;
  gap: var(--space-2);
}

.products-skipped__total {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}

.products-skipped__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.products-skipped__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-muted, #f3f5f8);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

.products-skipped__chip strong {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.products-skipped__table :deep(.data-table-wrap),
.products-skipped__table .data-table-wrap {
  max-height: min(58vh, calc(100vh - 320px));
  overflow: auto;
}

.products-skipped__row,
.products-skipped__ref {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.products-skipped__ref {
  font-weight: 600;
}

.products-skipped__reason {
  color: var(--color-text-secondary);
}

.product-filters {
  display: grid;
  gap: 1.15rem;
}

.product-filters__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.product-filters__field,
.product-filters__section {
  display: grid;
  gap: 0.5rem;
}

.product-filters__field .app-select-field {
  width: 100%;
  min-width: 0;
}

.product-filters__section {
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f6f8fb;
}

.product-filters__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
}

.product-filters__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text);
}

.product-filters__hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.product-filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.product-filters__chip {
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.product-filters__chip:hover {
  border-color: var(--color-primary-border);
  color: var(--color-primary);
}

.product-filters__chip--active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.product-filters__clear {
  margin-right: auto;
}

@media (max-width: 720px) {
  .product-filters__grid {
    grid-template-columns: 1fr;
  }
}

/* --- views/settings/attributes/AttributeImportModal.vue --- */
.attribute-import {
  display: grid;
  gap: var(--space-4);
}

.attribute-import__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.attribute-import__file-input {
  display: none;
}

.attribute-import__file-meta,
.attribute-import__status,
.attribute-import__hint,
.attribute-import__count {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.attribute-import__preview {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
}

.attribute-import__preview table {
  width: 100%;
  border-collapse: collapse;
}

.attribute-import__preview th,
.attribute-import__preview td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  text-align: left;
  font-size: 0.8125rem;
}

/* --- views/settings/attributes/AttributesView.vue --- */
.attribute-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.attribute-tabs__item {
  border: 1px solid var(--border-color, #d7dde8);
  background: var(--color-surface, #fff);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.attribute-tabs__item--active {
  background: #eef4ff;
  border-color: #8aa4d8;
  color: var(--color-text, #1f2937);
  font-weight: 600;
}

.attribute-form {
  display: grid;
  gap: var(--space-4);
}

.attribute-form__hint {
  margin: -0.75rem 0 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
}

.attribute-answers {
  display: grid;
  gap: var(--space-2);
}

.attribute-answers__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.attribute-answers__empty {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.8125rem;
}

.attribute-answers__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 32px;
  gap: var(--space-2);
  align-items: center;
}

.attribute-answers__remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
}

.attribute-answers__remove:hover {
  background: var(--color-danger-soft, #fee2e2);
  color: var(--color-danger-text, #b91c1c);
}

.cell-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- views/settings/carriers/CarrierConnectionForm.vue --- */
.carrier-form {
  display: grid;
  gap: 20px;
  padding: 0.5rem 0;
}

.carrier-form__enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.carrier-form__hint {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
}

.carrier-form__zones {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.carrier-form__zone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.carrier-form__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.carrier-form__group {
  margin: 0;
}

.form-section__title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.carrier-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.carrier-form__checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.carrier-form__test-result {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.carrier-form__test-result--ok {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #a7f3d0;
}

.carrier-form__test-result--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.carrier-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 0.5rem;
}

@media (max-width: 900px) {
  .carrier-form__grid {
    grid-template-columns: 1fr;
  }
}

/* --- views/settings/carriers/CarrierConnectionModal.vue --- */
.carrier-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  gap: 1rem;
}

/* --- views/settings/carriers/CarriersSettingsView.vue --- */
.carriers-settings__badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.carriers-settings__badge--on {
  background: #ecfdf5;
  color: #166534;
}

.carriers-settings__badge--off {
  background: #f3f4f6;
  color: var(--color-text-muted);
}

/* --- views/settings/categories/CategoriesView.vue --- */
.cell-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --- views/settings/categories/CategoryFormView.vue --- */
.product-page {
  display: grid;
  gap: var(--space-4);
}

.product-page__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.product-page__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.product-page__title h1 {
  margin: 0;
  font-size: 1.25rem;
}

.product-page__back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.product-page__back svg {
  width: 18px;
  height: 18px;
}

.product-page__error {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-page__error-action {
  flex-shrink: 0;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.product-page__error-action:hover {
  background: var(--color-danger-text);
  border-color: var(--color-danger-text);
  color: #fff;
}

.product-form-shell {
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 10px);
}

.form-panel__state {
  padding: var(--space-6);
  color: var(--color-text-secondary);
}

.product-form {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5);
  min-width: 0;
}

.product-form__row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.product-form__row--top {
  align-items: start;
}

.product-form__row--split {
  grid-template-columns: 150px minmax(260px, 1fr) 80px 140px;
}

.product-form__row--checks {
  align-items: center;
}

.product-form__label {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
}

.product-form__label span {
  color: var(--color-danger-text);
}

.product-form__label--right {
  padding-left: var(--space-5);
}

.product-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.product-checks label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.characteristics-control {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.category-form__hint {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.kanban {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-4);
  min-width: 0;
  min-height: 480px;
}

.kanban__column {
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted, #f8fafc);
}

.kanban__column--form {
  min-height: 100%;
}

.kanban__column--over {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(23, 75, 204, 0.12);
  background: #f8fbff;
}

.kanban__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.kanban__header h2 {
  margin: 0;
  font-size: 0.875rem;
}

.kanban__header span {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  font-weight: 700;
}

.kanban__list {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-height: 180px;
}

.kanban__list--form {
  flex: 1 1 auto;
  min-height: 280px;
  padding: var(--space-2);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.kanban__empty {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.kanban__list,
.kanban__column {
  -webkit-user-drag: none;
}

.kanban-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: grab;
  -webkit-user-drag: element;
}

.kanban-card--ghost {
  position: absolute;
  top: -1000px;
  left: -1000px;
  z-index: -1;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.kanban-card--assigned {
  grid-template-columns: 22px minmax(0, 1fr);
}

.kanban-card__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.kanban-card__order {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  font-weight: 800;
}

.kanban-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.kanban-card__top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card__name {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

.kanban-card__badge {
  flex-shrink: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.6875rem;
  font-weight: 700;
}

.kanban-card__answers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kanban-card__muted {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
}

.kanban-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-muted, #f1f5f9);
  color: var(--color-text);
  font-size: 0.6875rem;
  font-weight: 600;
}

.kanban-card__action {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.kanban-card__action:hover {
  background: #eef4ff;
}

.field-control--fluid {
  max-width: none;
  min-width: 0;
}

@media (max-width: 760px) {
  .kanban {
    grid-template-columns: 1fr;
  }

  .product-form__row,
  .product-form__row--split {
    grid-template-columns: 1fr;
  }

  .product-form__label,
  .product-form__label--right {
    text-align: left;
    padding-left: 0;
  }

  .product-checks {
    gap: var(--space-3);
  }
}

/* --- views/settings/colors/ColorsView.vue --- */
.colors-form {
  display: grid;
  gap: var(--space-4);
}

/* --- views/settings/documentConfigurations/DocumentConfigurationFormView.vue --- */
.doc-config-form__fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.form-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #f9fafc;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
}

.form-section__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.form-section__subtitle {
  margin: 1rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.doc-config-basic-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
}

.doc-config-basic-row:last-child {
  margin-bottom: 0;
}

.doc-config-basic-row :deep(.form-row) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  width: var(--field-width-sm);
  padding: 0;
  border-bottom: none;
}

.doc-config-basic-row :deep(.form-row__label) {
  line-height: 1.3;
}

.doc-config-basic-row :deep(.form-row__control) {
  max-width: none;
}

.doc-config-basic-row :deep(.field-control) {
  max-width: none;
  width: 100%;
}

.field-checkbox--compact {
  padding: 7px 0;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.checkbox-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  align-items: center;
}

.radio-group__label {
  font-weight: 600;
  width: 100%;
}

.field-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.workflow-levels {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.workflow-level {
  padding: 1rem;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  background: #fff;
}

.workflow-level__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.form-panel__state {
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

@media (max-width: 700px) {
  .doc-config-basic-row :deep(.form-row) {
    width: 100%;
  }
}

/* --- views/settings/families/components/BundleAssistantModal.vue --- */
.bundle-assistant__step {
  display: grid;
  gap: 1rem;
}

.bundle-assistant__intro,
.bundle-assistant__hint,
.bundle-assistant__summary {
  margin: 0;
  color: var(--color-text-muted);
}

.bundle-assistant__check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.bundle-assistant__parts {
  display: grid;
  gap: 1rem;
  overflow: visible;
}

.bundle-assistant__parts--scrollable {
  overflow-x: auto;
}

.bundle-assistant__part {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-muted);
  min-height: 132px;
  position: relative;
  align-content: start;
}

.combo-field {
  position: relative;
}

.bundle-assistant__picker-input {
  padding-right: 2.25rem;
}

.bundle-assistant__picker-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.bundle-assistant__picker-toggle span {
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
}

.bundle-assistant__picker-toggle[aria-expanded='true'] span {
  transform: rotate(180deg);
}

.bundle-assistant__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bundle-assistant__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--color-border);
  font-size: 0.75rem;
}

.bundle-assistant__chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-muted);
}

.bundle-assistant__part-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.bundle-assistant__part h3 {
  margin: 0;
  font-size: 0.875rem;
}

.bundle-assistant__part-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.bundle-assistant__catalog {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 0.35rem;
  max-height: 260px;
  overflow: auto;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.bundle-assistant__catalog-status {
  margin: 0;
  padding: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.bundle-assistant__catalog-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.bundle-assistant__catalog-item:hover {
  background: var(--color-surface-muted);
  border-radius: 6px;
}

.bundle-assistant__preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.bundle-assistant__table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.bundle-assistant__table {
  min-width: 1800px;
  border-collapse: separate;
  border-spacing: 0;
}

.bundle-assistant__table > thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef2f7;
  box-shadow: 0 1px 0 var(--color-border);
}

.bundle-assistant__col-expand {
  width: 2.75rem;
  padding-left: 0.75rem !important;
}

.bundle-assistant__col-select {
  width: 3.25rem;
  text-align: center;
}

.bundle-assistant__cell-ref {
  max-width: 280px;
  word-break: break-word;
}

.bundle-assistant__expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.bundle-assistant__expand:hover {
  background: var(--color-surface-muted);
  border-color: #cbd5e1;
}

.bundle-assistant__expand-icon {
  display: block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid currentColor;
  margin-left: 2px;
  transition: transform 0.15s ease;
}

.bundle-assistant__expand--open .bundle-assistant__expand-icon {
  transform: rotate(90deg);
}

.bundle-assistant__row--main {
  cursor: pointer;
  transition: background 0.12s ease;
}

.bundle-assistant__row--main:hover {
  filter: brightness(0.985);
}

.bundle-assistant__row--open td {
  border-bottom-color: transparent;
}

.bundle-assistant__row--details td {
  padding: 0 !important;
  border-top: 0;
  background: transparent !important;
}

.bundle-assistant__row--details:hover {
  background: transparent !important;
}

.bundle-assistant__parts-panel {
  margin: 0 0.75rem 0.75rem 0.75rem;
  padding: 0.75rem 0.875rem 0.875rem 2.5rem;
  border: 1px solid #dbe3ec;
  border-left: 3px solid var(--color-primary, #2563eb);
  border-radius: 0 10px 10px 10px;
  background: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bundle-assistant__parts-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.bundle-assistant__parts-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 700;
}

.bundle-assistant__parts-table-wrap {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}

.bundle-assistant__parts-table {
  width: 100%;
  min-width: 1600px;
  border-collapse: collapse;
}

.bundle-assistant__parts-table th,
.bundle-assistant__parts-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.8125rem;
  line-height: 1.35;
  vertical-align: top;
}

.bundle-assistant__parts-table thead th {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

.bundle-assistant__parts-table tbody tr:last-child td {
  border-bottom: 0;
}

.bundle-assistant__parts-table tbody tr:hover {
  background: #fafbfd;
}

.bundle-assistant__part-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.75rem;
  font-weight: 700;
}

.bundle-assistant__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.bundle-assistant__badge--new {
  background: #dcfce7;
  color: #166534;
}

.bundle-assistant__badge--exists {
  background: #ffedd5;
  color: #9a3412;
}

.bundle-assistant__table th,
.bundle-assistant__table td {
  vertical-align: middle;
}

.bundle-assistant__row--new {
  background: #f8fff9;
}

.bundle-assistant__row--exists {
  background: #fffaf5;
}

.bundle-assistant__row--created {
  background: #f8fff9;
}

.bundle-assistant__dash {
  color: var(--color-text-muted);
}

.bundle-assistant__results {
  gap: 1rem;
}

.bundle-assistant__result-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.bundle-assistant__result-banner--success {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: #bbf7d0;
}

.bundle-assistant__result-banner--neutral {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #e2e8f0;
}

.bundle-assistant__result-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
}

.bundle-assistant__result-banner--success .bundle-assistant__result-icon {
  background: #dcfce7;
  color: #166534;
}

.bundle-assistant__result-banner--neutral .bundle-assistant__result-icon {
  background: #e2e8f0;
  color: #475569;
}

.bundle-assistant__result-copy {
  min-width: 0;
}

.bundle-assistant__result-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
}

.bundle-assistant__result-summary {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.bundle-assistant__result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.bundle-assistant__result-stat {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.bundle-assistant__result-stat--created {
  border-color: #bbf7d0;
  background: #f8fff9;
}

.bundle-assistant__result-stat--skipped {
  border-color: #fed7aa;
  background: #fffaf5;
}

.bundle-assistant__result-stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
}

.bundle-assistant__result-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.bundle-assistant__result-list {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
}

.bundle-assistant__result-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.bundle-assistant__result-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.bundle-assistant__result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.bundle-assistant__result-item:last-child {
  border-bottom: 0;
}

.bundle-assistant__result-item--created {
  background: #fcfffd;
}

.bundle-assistant__result-item--exists {
  background: #fffdfb;
}

.bundle-assistant__result-ref {
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  word-break: break-word;
}

/* --- settings/groups --- */
.permission-editor__title {
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.group-form .form-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.group-form__back {
  font-weight: 600;
  padding: 0;
}

.group-form__actions,
.form-toolbar__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.group-form__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.group-form__hero-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.group-form__hero-text h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-transform: none;
}

.group-form__meta {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.group-form__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.group-form__main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.group-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.group-card--permissions {
  position: sticky;
  top: 0.75rem;
  max-height: calc(100vh - 6rem);
  overflow: auto;
}

.group-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.group-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted, #64748b);
}

.group-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
}

.group-card__hint {
  margin: 0 0 1rem;
  color: var(--color-text-muted, #667085);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.group-form__fields {
  display: grid;
  gap: 0.85rem;
}

.group-members__add {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0 0 1rem;
}

.group-members__add .app-select-field {
  flex: 1;
  min-width: 0;
}

.group-members__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
}

.group-members__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background: #fff;
}

.group-members__row:last-child {
  border-bottom: 0;
}

.group-members__row:hover {
  background: #f8fafc;
}

.group-members__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #1d4ed8, #3b82f6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.group-members__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.group-members__info strong {
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-members__info small {
  color: var(--color-text-muted, #667085);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-members__remove {
  justify-self: end;
}

.group-members__empty,
.group-members__empty-state {
  color: #667085;
  margin: 0.25rem 0 0;
}

.group-members__empty-state {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1rem;
  border: 1px dashed var(--color-border, #d0d5dd);
  border-radius: 12px;
  background: #fafbfc;
}

.group-members__empty-state strong {
  color: var(--color-text, #111827);
  font-size: 0.875rem;
}

.group-members__empty-state span {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.group-table__count {
  display: inline-flex;
  min-width: 1.6rem;
  justify-content: center;
  font-weight: 650;
}

.group-card--permissions .permission-editor__table {
  width: 100%;
}

@media (max-width: 1100px) {
  .group-form__layout {
    grid-template-columns: 1fr;
  }

  .group-card--permissions {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .group-members__row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "avatar info"
      "badge remove";
  }

  .group-members__avatar { grid-area: avatar; }
  .group-members__info { grid-area: info; }
  .group-members__row .badge { grid-area: badge; justify-self: start; }
  .group-members__remove { grid-area: remove; }
}

/* --- views/settings/logistics/LocationsSettingsView.vue --- */
.location-warehouses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.printers-form__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  min-width: 0;
}

.printers-form .form-row__hint {
  margin: 4px 0 0;
}

@media (max-width: 640px) {
  .printers-form__grid {
    grid-template-columns: 1fr;
  }
}

/* --- views/settings/printing/PrinterHistoryView.vue --- */
.status-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pill--sent {
  background: #e8f8ef;
  color: #137a43;
}

.status-pill--error {
  background: #fdecec;
  color: #b42318;
}

.status-pill--pending {
  background: #fff7e8;
  color: #b54708;
}

/* --- views/settings/printing/ZplLayoutEditorView.vue --- */
.layout-editor__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.layout-editor__code {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid var(--border-color, #d6deeb);
  border-radius: 8px;
  padding: 0.75rem;
}

.layout-editor__dims {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.layout-editor__checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.layout-editor__preview-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.layout-editor__preview-image-wrap {
  border: 1px solid var(--border-color, #d6deeb);
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
}

.layout-editor__preview-image {
  max-width: 100%;
}

.layout-editor__preview-empty,
.layout-editor__loading {
  color: #667085;
}

.layout-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.app-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color, #d6deeb);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 960px) {
  .layout-editor__grid {
    grid-template-columns: 1fr;
  }
}

/* --- views/settings/shippingZones/ShippingZoneFormView.vue --- */
.product-page {
  display: grid;
  gap: 16px;
}

.product-page__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.product-page__title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-page__title h1 {
  margin: 0;
  font-size: 1.35rem;
}

.product-page__back {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.product-page__back svg {
  width: 22px;
  height: 22px;
}

.zone-form-shell {
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 20px;
}

.zone-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
}

.zone-form__fields {
  display: grid;
  gap: 16px;
}

.zone-form__color {
  width: 56px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: transparent;
}

.zone-form__rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zone-form__rules-header h2,
.zone-form__map h2 {
  margin: 0;
  font-size: 1rem;
}

.zone-form__hint,
.zone-form__empty {
  margin: 0;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.875rem;
}

.zone-form__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.zone-rule {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 12px;
}

.zone-rule__remove {
  grid-column: 1 / -1;
  justify-self: end;
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-weight: 600;
  cursor: pointer;
}

.form-panel__state {
  padding: 24px 0;
  color: var(--color-text-muted, #6b7280);
}

@media (max-width: 1100px) {
  .zone-form {
    grid-template-columns: 1fr;
  }
}

/* --- views/settings/shippingZones/ShippingZonesView.vue --- */
.zone-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  vertical-align: middle;
}

/* --- views/settings/UserProfileView.vue --- */
.profile-page {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 1.75rem;
}

.profile-page__intro {
  margin: -0.5rem 0 0;
  max-width: 42rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.profile-page__hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary-soft) 0%, #fff 58%);
}

.profile-page__avatar {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(23, 75, 204, 0.22);
}

.profile-page__identity {
  min-width: 0;
}

.profile-page__identity h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.profile-page__identity p {
  margin: 0.35rem 0 0.75rem;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  word-break: break-word;
}

.profile-page__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.profile-card {
  display: grid;
  gap: 1.25rem;
  align-content: start;
  padding: 1.25rem 1.35rem 1.35rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.profile-card__action {
  justify-self: start;
  align-self: start;
}

.profile-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.profile-card__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.profile-card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.profile-card__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.profile-card__header p {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.profile-info {
  display: grid;
  gap: 0;
  margin: 0;
}

.profile-info__item {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--color-border);
}

.profile-info__item:first-child {
  border-top: none;
  padding-top: 0;
}

.profile-info__item:last-child {
  padding-bottom: 0;
}

.profile-info dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.profile-info dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

.profile-languages {
  display: grid;
  gap: 0.65rem;
}

.profile-language {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.profile-language:hover:not(:disabled) {
  border-color: var(--color-primary-border);
  background: var(--color-primary-soft);
}

.profile-language--active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: 0 0 0 1px var(--color-primary-border);
}

.profile-language:disabled {
  opacity: 0.7;
  cursor: wait;
}

.profile-language__code {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.profile-language--active .profile-language__code {
  border-color: var(--color-primary-border);
  background: #fff;
}

.profile-language__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.profile-language__check {
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 800;
}

.profile-page__saving {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.profile-page__admin-hint {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .profile-page__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .profile-page {
    padding: 1rem;
  }

  .profile-page__hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
  }
}

/* --- views/settings/UsersView.vue --- */
.field-hint--full {
  max-width: none;
  width: 100%;
}

/* --- views/settings/values/DytableValuesView.vue --- */
.values-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.entity-label {
  font-weight: 500;
  color: var(--color-text);
}

.entity-select,
.values-toolbar .app-select-field {
  width: 13rem;
  min-width: 13rem;
}

.values-form {
  display: grid;
  gap: var(--space-4);
}

/* --- views/stores/components/NumberStepper.vue --- */
.number-stepper {
  display: grid;
  grid-template-columns: 48px 92px 48px;
  height: 38px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.number-stepper button,
.number-stepper input {
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  text-align: center;
}

.number-stepper button {
  background: var(--color-surface-muted);
  font-size: 1.1rem;
}

.number-stepper input {
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  font-size: 1rem;
}

.number-stepper input::-webkit-outer-spin-button,
.number-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.number-stepper input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* --- views/stores/StoreConnectionForm.vue --- */
.store-modal-form {
  display: grid;
  gap: 1.4rem;
  padding: 0.5rem 0;
}

.store-form-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.store-form-row label {
  color: #5d626a;
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
}

.store-form-row label span {
  color: #ff3b30;
}

.store-form-row--compact {
  grid-template-columns: 210px auto;
  justify-content: start;
}

.store-section-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.75rem;
  color: #2c3035;
  font-size: 1.05rem;
}

.store-section-title span {
  height: 1px;
  background: var(--color-border);
}

.store-secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
}

.store-secret-field input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.store-secret-field button {
  height: 34px;
  border: 1px solid var(--color-border-strong);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

.store-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.18s ease;
}

.store-toggle span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffffff;
  transition: transform 0.18s ease;
}

.store-toggle--active {
  background: #1e8cff;
}

.store-toggle--active span {
  transform: translateX(22px);
}

.store-test-result {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.store-test-result--ok {
  background: #e7f6ec;
  color: #1e7a3d;
  border: 1px solid #bfe5cc;
}

.store-test-result--error {
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f5c6c0;
}

.store-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 0.5rem;
}

@media (max-width: 720px) {
  .store-form-row,
  .store-form-row--compact {
    grid-template-columns: 1fr;
  }

  .store-form-row label {
    text-align: left;
  }
}

/* --- views/stores/StoreConnectionModal.vue --- */
.store-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  gap: 1rem;
}

.store-modal-footer__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.store-modal-loading {
  margin: 0;
  padding: 2rem 0;
  text-align: center;
  color: var(--color-text-muted);
}

/* --- views/stores/StoresView.vue --- */
.store-products-page {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.store-products-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.store-products-page__header h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 800;
}

.store-products-modal__state {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.store-products-modal__import {
  display: grid;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
}

.store-products-modal__import-status {
  margin: 0;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.store-products-modal__progress-track {
  width: min(420px, 100%);
  height: 10px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.store-products-modal__progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary) 0%, #4f8cff 100%);
  transition: width 0.2s ease;
}

.store-products-modal__import-count {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.store-products-modal__empty {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  text-align: center;
}

.store-products-modal__empty p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.store-products-modal__content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: min(680px, calc(100vh - 12rem));
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.store-products-modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}

.store-products-modal__search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.store-products-modal__count {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.store-products-modal__search label {
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.store-products-modal__search input {
  width: min(360px, 100%);
  height: 38px;
  padding: 0 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font: inherit;
}

.store-products-modal__search input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.store-products-modal__table-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  max-height: min(620px, calc(100vh - 16rem));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.store-products-modal__table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.store-products-modal__table th,
.store-products-modal__table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.store-products-modal__cell--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
}

.store-products-modal__table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--color-primary);
  font-weight: 800;
  box-shadow: inset 0 -1px 0 var(--color-border);
}

.store-products-modal__table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 960px) {
  .store-products-modal__content {
    min-height: min(520px, calc(100dvh - 8rem));
  }

  .store-products-modal__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .store-products-modal__search {
    flex-direction: column;
    align-items: stretch;
  }

  .store-products-modal__search input {
    width: 100%;
  }

  .store-products-modal__count {
    white-space: normal;
  }

  .store-products-modal__table-wrap {
    max-height: min(420px, calc(100dvh - 12rem));
  }
}

/* ============================================================
   Override de precedência: os blocos <style scoped> de várias
   views Vue foram achatados para este ficheiro e partilham as
   classes .product-form__*. Sem o isolamento scoped do Vue, a
   última definição ganhava (CategoryFormView.vue) e partia o
   layout de 2 colunas do formulário de artigo. Re-afirma aqui,
   scoped ao .product-form-shell, as grelhas do ProductFormView.vue.
   ============================================================ */
.product-form-shell .product-form__row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.product-form-shell .product-form__row--top {
  align-items: start;
}

.product-form-shell .product-form__row--code {
  grid-template-columns: 150px minmax(180px, 0.8fr) 80px 140px 170px minmax(260px, 1.2fr);
}

.product-form-shell .product-form__row--split {
  grid-template-columns: 150px minmax(260px, 1fr) 190px minmax(220px, 0.7fr);
}

.product-form-shell .product-form__row--prices {
  grid-template-columns: 150px 150px minmax(160px, 1fr) 150px minmax(190px, 1fr) 150px;
}

.product-form-shell .product-form__row--checks {
  align-items: center;
}

@media (max-width: 1500px) {
  .product-form-shell .product-form__row--split,
  .product-form-shell .product-form__row--code,
  .product-form-shell .product-form__row--prices {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .product-form-shell .product-form__label--right {
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .product-form-shell .product-form__row,
  .product-form-shell .product-form__row--split,
  .product-form-shell .product-form__row--code,
  .product-form-shell .product-form__row--prices {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .product-form-shell .product-form__label {
    text-align: left;
  }
}


/* ============================================================
   Entidades — porta fiel dos <style scoped> de EntitiesView.vue.
   Os seletores :deep(.form-row) do Vue ficaram inertes ao achatar
   o CSS; aqui repõem-se como .entity-info-form .form-row.
   ============================================================ */

.product-page.entity-page {
  align-content: start;
  gap: var(--space-3);
  min-height: 0;
}

.product-page.entity-page .product-page__topbar {
  align-self: start;
  height: auto;
}

.entity-info-form {
  padding: var(--space-4) 0 0;
}

.entity-info-form .form-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
  padding: 0;
  margin-bottom: 8px;
  border-bottom: none;
}

.entity-info-form .form-row--top {
  align-items: start;
}

.entity-info-form .form-row--top .form-row__label {
  padding-top: 8px;
}

.entity-info-form .form-row__label {
  line-height: 1.3;
  text-align: right;
  font-weight: 700;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.entity-info-form .form-row__control {
  width: 100%;
  max-width: none;
}

.entity-info-form .field-control {
  width: 100%;
  max-width: none;
}

/* mog-ui.css tem `.app-form input[type='email'] { max-width: var(--field-width) }`
   (280px) que ganhava por especificidade e encolhia o campo Email. Repor 100%. */
.app-form.entity-info-form input[type='text'],
.app-form.entity-info-form input[type='email'],
.app-form.entity-info-form input[type='url'],
.app-form.entity-info-form input[type='tel'],
.app-form.entity-info-form input[type='number'],
.app-form.entity-info-form input[type='password'],
.app-form.entity-info-form textarea,
.app-form.entity-info-form select {
  max-width: none;
  width: 100%;
}

.app-form.entity-info-form .entity-input-entity-number {
  max-width: none;
}

.entity-info-form .entity-id-nif-name-row,
.entity-info-form .entity-form-row {
  display: grid;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.entity-info-form .entity-id-nif-name-row .form-row,
.entity-info-form .entity-form-row .form-row {
  display: contents;
}

.entity-info-form .entity-id-nif-name-row {
  grid-template-columns: 150px 150px 64px minmax(0, 1.5fr) 72px minmax(0, 1fr);
}

.entity-info-form .entity-form-row--half {
  grid-template-columns: 150px minmax(0, 1fr) 190px minmax(0, 1fr);
}

.entity-info-form .entity-form-row--third {
  grid-template-columns: 150px minmax(0, 1fr) 88px minmax(0, 1fr) 72px minmax(0, 1fr);
}

.entity-info-form .entity-form-row--quarter {
  grid-template-columns: 150px minmax(0, 1.15fr) 78px minmax(0, 1fr) 118px minmax(0, 0.9fr) 48px minmax(72px, 0.55fr);
}

.entity-info-form .checkbox-grid {
  min-height: 36px;
  align-items: center;
}

.entity-form-panel {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.entity-info-form .field-input-group {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.entity-info-form .field-input-group--nif {
  grid-template-columns: 13.5rem minmax(0, 1fr);
}

.entity-info-form .field-input-group--nif .app-select-field {
  width: 13.5rem;
  min-width: 13.5rem;
}

.entity-info-form .field-input-group--phone {
  grid-template-columns: minmax(0, 108px) minmax(0, 1fr);
}

.entity-info-form .field-input-group__prepend {
  width: 100%;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.entity-info-form .field-input-group__input {
  width: 100%;
  min-width: 0;
  max-width: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.entity-payment-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.entity-payment-row .field-control {
  flex: 1;
  min-width: 0;
}

.entity-settings-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary, #2563eb);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1;
  cursor: not-allowed;
  opacity: 0.5;
}

.entity-info-form .field-control--notes {
  max-width: none;
  min-height: 120px;
  width: 100%;
  background: #fff;
}

@media (max-width: 900px) {
  .entity-info-form .entity-id-nif-name-row,
  .entity-info-form .entity-form-row--half,
  .entity-info-form .entity-form-row--third,
  .entity-info-form .entity-form-row--quarter {
    grid-template-columns: 1fr;
  }

  .entity-info-form .entity-id-nif-name-row .form-row,
  .entity-info-form .entity-form-row .form-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    margin-bottom: 8px;
  }
}

/* ============================================================
   Dashboard personalizavel (grelha / livre) - porta de AnjosEnergy
   ============================================================ */
.dash-shell {
  --dash-blue: #2563eb;
  --dash-green: #16a34a;
  --dash-amber: #d97706;
  --dash-red: #dc2626;
  --dash-dim: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dash-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dash-mode {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.dash-mode button {
  padding: 0.4rem 0.8rem;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.dash-mode button.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.dash-empty,
.dash-empty-copy {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.widget-board {
  width: 100%;
}
.widget-board.mode-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}
.widget-board.mode-free {
  position: relative;
  min-height: 560px;
}
.widget-board.is-sorting { cursor: grabbing; }
.widget-board.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.widget-frame {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  container-type: inline-size;
}
.widget-frame.mode-grid { cursor: grab; }
.widget-frame.mode-grid.sorting { opacity: 0.3; pointer-events: none; }
.widget-frame.mode-grid.kind-kpi { grid-column: span 3; }
.widget-frame.mode-grid.kind-wide { grid-column: 1 / -1; }
.widget-frame.mode-grid.kind-panel { grid-column: span 4; }
.widget-frame.mode-free { position: absolute; cursor: grab; }
.widget-frame.active { cursor: grabbing; z-index: 90 !important; }
.widget-frame .widget-body {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
.widget-frame.mode-free .widget-body { overflow: hidden; }
.widget-frame.mode-free .widget-body > * {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: auto;
}
.widget-frame.mode-grid .widget-body > * { height: 100%; }

.mogdash-ghost {
  position: fixed;
  z-index: 2000;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 14px 30px rgba(15, 23, 42, 0.3));
  transform: scale(1.02);
}

.resize-handle {
  position: absolute;
  z-index: 3;
  opacity: 0;
  background: color-mix(in srgb, var(--color-primary) 65%, white);
  border: 1px solid color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
  border-radius: 2px;
  transition: opacity 0.12s ease;
}
.widget-frame:hover .resize-handle,
.widget-frame.active .resize-handle { opacity: 1; }
.handle-n, .handle-s { left: 20px; right: 20px; height: 7px; }
.handle-e, .handle-w { top: 20px; bottom: 20px; width: 7px; }
.handle-n { top: -3px; cursor: ns-resize; }
.handle-s { bottom: -3px; cursor: ns-resize; }
.handle-e { right: -3px; cursor: ew-resize; }
.handle-w { left: -3px; cursor: ew-resize; }
.handle-ne, .handle-nw, .handle-se, .handle-sw { width: 13px; height: 13px; border-radius: 3px; }
.handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }

.kpi-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.kpi-card:hover { border-color: var(--dash-blue); box-shadow: var(--shadow-sm); }
.kpi-card > span { display: grid; gap: 0.1rem; min-width: 0; }
.kpi-card small { color: var(--color-text-muted); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-card strong { font-size: 1.55rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; }
.kpi-card em { color: var(--color-text-muted); font-size: 0.7rem; font-style: normal; line-height: 1.3; }
.kpi-ring { width: 54px; height: 54px; flex-shrink: 0; }
.dash-donut { width: 96px; height: 96px; flex-shrink: 0; }
.ring-track { fill: none; stroke: color-mix(in srgb, var(--color-border) 90%, transparent); stroke-width: 6; }
.ring-arc {
  fill: none;
  stroke-width: 6;
  transform: rotate(-90deg);
  transform-origin: 21px 21px;
}
.dash-donut text { fill: var(--color-text); font-size: 0.5rem; font-weight: 750; text-anchor: middle; }
.dash-donut .donut-sub { fill: var(--color-text-muted); font-size: 0.26rem; font-weight: 600; }

.dash-catalog {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 0.9rem 1.1rem;
  padding: 0.9rem 1rem;
  container-type: inline-size;
}
.dash-catalog__meta { display: grid; align-content: start; gap: 0.3rem; }
.dash-catalog header,
.dash-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}
.dash-catalog h2, .dash-panel h2 { margin: 0; font-size: 0.95rem; }
.dash-catalog header p, .dash-panel header p { margin: 0.15rem 0 0; color: var(--color-text-muted); font-size: 0.72rem; }
.dash-catalog__meta > strong { font-size: 1.7rem; font-weight: 750; letter-spacing: -0.03em; }
.dash-link { color: var(--color-primary); font-size: 0.74rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.dash-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}
.dash-stat-row li {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
}
.dash-stat-row small { display: block; color: var(--color-text-muted); font-size: 0.64rem; }
.dash-stat-row b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.dash-chart-block { display: flex; align-items: center; gap: 0.85rem; }
.dash-legend { display: grid; gap: 0.3rem; flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; }
.dash-legend li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 0.45rem; }
.dash-legend i { width: 9px; height: 9px; border-radius: 50%; }
.dash-legend span { color: var(--color-text-muted); font-size: 0.72rem; }
.dash-legend strong { font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.dash-bars h3 { margin: 0 0 0.4rem; font-size: 0.72rem; color: var(--color-text-muted); font-weight: 700; }
.dash-bars ul, .dash-bars-list {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-bars li, .dash-bars-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
}
.dash-bars li > span, .dash-bars-list li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-track { height: 8px; border-radius: 999px; background: var(--color-surface-muted); overflow: hidden; }
.dash-bar-fill { height: 100%; border-radius: inherit; background: var(--dash-blue); }

.dash-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  container-type: inline-size;
}
.dash-record-list {
  display: grid;
  align-content: start;
  flex: 1;
  min-height: 0;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}
.dash-record-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface-muted) 55%, var(--color-surface));
  cursor: pointer;
}
.dash-record-list li:hover { border-color: var(--dash-blue); }
.dash-record-list li > span:first-child { display: grid; gap: 0.06rem; min-width: 0; }
.dash-record-list strong { font-size: 0.8rem; }
.dash-record-list small { color: var(--color-text-muted); font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}
.dash-table-wrap { flex: 1; min-height: 0; overflow: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.dash-table th {
  position: sticky;
  top: 0;
  padding: 0.35rem 0.5rem;
  text-align: left;
  color: var(--color-primary);
  background: var(--color-surface);
  font-weight: 650;
  border-bottom: 1px solid var(--color-border);
}
.dash-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--color-border); }
.dash-table tbody tr { cursor: pointer; }
.dash-table tbody tr:hover { background: var(--color-surface-muted); }
.dash-table .dash-code { font-family: var(--font-mono); font-size: 0.72rem; }

.dash-manager__hint { margin: 0 0 0.9rem; color: var(--color-text-muted); font-size: 0.82rem; }
.dash-manager__modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.dash-manager__mode {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dash-manager__mode strong { font-size: 0.86rem; }
.dash-manager__mode small { color: var(--color-text-muted); font-size: 0.72rem; line-height: 1.35; }
.dash-manager__mode.is-active { border-color: var(--color-primary-border); background: var(--color-primary-soft); }
.dash-manager__list { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.dash-manager__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  cursor: pointer;
}
.dash-manager__row > span:first-child { display: grid; gap: 0.1rem; min-width: 0; }
.dash-manager__row strong { font-size: 0.86rem; }
.dash-manager__row small { color: var(--color-text-muted); font-size: 0.73rem; }
.dash-manager__row input { position: absolute; opacity: 0; pointer-events: none; }
.dash-manager__switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dash-manager__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: transform 0.15s ease, background 0.15s ease;
}
.dash-manager__row:has(input:checked) .dash-manager__switch { background: var(--color-primary); border-color: var(--color-primary); }
.dash-manager__row:has(input:checked) .dash-manager__switch::after { transform: translateX(16px); background: #fff; }

@media (max-width: 1100px) {
  .widget-frame.mode-grid.kind-panel { grid-column: span 6; }
}
@media (max-width: 900px) {
  .widget-frame.mode-grid.kind-kpi { grid-column: span 6; }
  .dash-catalog { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .widget-board,
  .widget-board.mode-grid,
  .widget-board.mode-free {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0 !important;
  }
  .widget-frame,
  .widget-frame.mode-free,
  .widget-frame.mode-grid.kind-kpi,
  .widget-frame.mode-grid.kind-wide,
  .widget-frame.mode-grid.kind-panel {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0;
    cursor: default;
    grid-column: 1 / -1;
  }
  .resize-handle { display: none; }
  .widget-frame .widget-body > * { overflow: visible; height: auto; }
}

/* dashboard: chrome dos widgets + sem outline no alvo do FocusOnNavigate */
[tabindex="-1"]:focus { outline: none !important; }
.dash-catalog, .dash-panel {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   Product form visual refresh
   ============================================================ */
.product-form-shell {
  overflow: visible;
  box-shadow: none;
}

.product-form-shell .product-tabs {
  padding: 0 1.25rem;
  background: var(--color-surface-muted, #f8fafc);
}

.product-form-shell .product-tabs__item {
  position: relative;
  min-height: 44px;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.product-form-shell .product-tabs__item--active {
  background: var(--color-surface);
  color: var(--color-primary);
  transform: none;
}

.product-form-shell .product-tabs__item--active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--color-primary);
}

.app-content:has(.product-page) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-page:has(.product-form-shell) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.product-form-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Os painéis dos separadores são a área de scroll: o shell fica fixo e só o
   conteúdo do separador activo rola. */
.product-form-shell > *:not(.product-tabs) {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.product-form-shell .product-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  width: 100%;
  gap: 0;
  padding: 0.35rem 1.5rem 0;
}

.product-form-shell .bundle-tab,
.product-form-shell .library-tab,
.product-form-shell .product-stores-tab {
  flex: 1 1 auto;
  min-height: 0;
}

.product-form-shell .product-form__row--top:has(#product-observation) {
  flex: 1 1 auto;
  min-height: 8rem;
}

.product-form-shell .product-form__row--top:has(#product-observation) textarea {
  height: 100%;
  min-height: 8rem;
}

.product-form-shell .product-form__section {
  display: grid;
  gap: 0;
  padding: 0.35rem 1.5rem 0.15rem;
}

.product-form-shell .product-form__section + .product-form__section {
  margin-top: 0.25rem;
  border-top: 1px solid var(--color-border);
}

.product-form-shell .product-form__row,
.product-form-shell .product-form__row--code,
.product-form-shell .product-form__row--split,
.product-form-shell .product-form__row--prices,
.product-form-shell .product-form__row--checks {
  grid-template-columns: 11rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
}

.product-form-shell .product-form__section > .product-form__row:last-child {
  border-bottom: none;
}

.product-form-shell .product-form__row--top {
  align-items: start;
}

.product-form-shell .product-form__row--code {
  grid-template-columns: 11rem minmax(0, 1fr) 5.5rem minmax(9rem, 12rem);
}

.product-form-shell .product-form__row--split {
  grid-template-columns: 11rem minmax(0, 1fr) 7.5rem minmax(0, 0.85fr);
}

.product-form-shell .product-form__row--prices {
  grid-template-columns: 11rem minmax(0, 1fr) 7.5rem minmax(0, 1fr) 7.5rem minmax(0, 1fr);
}

.product-form-shell .product-form__label,
.product-form-shell .product-form__label--right {
  text-align: left;
  padding-left: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
}

.product-form-shell .product-form__label--right {
  justify-self: end;
  text-align: right;
}

.product-form-shell .field-control,
.product-form-shell .field-control--fluid,
.product-form-shell .field-control--textarea {
  width: 100%;
  max-width: none;
  min-height: 2.25rem;
}

.product-form-shell .ean-list,
.product-form-shell .name-field,
.product-form-shell .characteristics-control {
  width: 100%;
}

.product-form-shell .ean-list__row {
  width: 100%;
  max-width: none;
}

.product-form-shell .ean-list__code {
  flex: 1 1 auto;
  width: auto;
  min-width: 12rem;
  max-width: none;
}

.product-form-shell .ean-list__source {
  width: 9.5rem;
  max-width: 9.5rem;
  flex: 0 0 9.5rem;
  min-width: 9.5rem;
}

.product-form-shell .ean-list__source .app-select-field {
  width: 100%;
  min-width: 0;
}

.product-form-shell .field-control--textarea {
  min-height: 5.5rem;
}

.product-form-shell .combo-field {
  width: 100%;
}

.product-form-shell .app-select-field {
  width: 100%;
}

.product-form-shell .combo-field--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.product-form-shell .combo-field__menu {
  z-index: 40;
  max-height: 220px;
  padding: 4px;
  border-color: var(--color-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.product-form-shell .combo-field__option {
  min-height: 36px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.product-form-shell .combo-field__option--active,
.product-form-shell .combo-field__option:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.product-form-shell .combo-field__option--active {
  font-weight: 600;
}

.product-form-shell .category-selected {
  min-height: 2.25rem;
  padding-right: 8px;
}

.product-form-shell .product-options {
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.75rem;
}

.product-form-shell .product-options__field {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-muted, #f8fafc);
  overflow: hidden;
}

.product-form-shell .product-options__field .app-select-field,
.product-form-shell .product-options__field .app-select-field__trigger {
  min-width: 0;
  max-width: 100%;
}

.product-form-shell .product-form__actions {
  margin-top: auto;
  padding: 1rem 1.5rem 1.25rem;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-muted, #f8fafc);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.product-form-shell .library-tab {
  padding: 1.25rem 1.5rem 1.5rem;
}

.product-form-shell .library-card {
  max-width: none;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-muted, #f8fafc);
  gap: 0.85rem;
}

.product-form-shell .library-list__header,
.product-form-shell .library-list__row {
  gap: 0.65rem;
}

.product-form-shell .library-card__add,
.product-form-shell .ean-list__add {
  min-height: 1.75rem;
  font-weight: 600;
}

.product-form-shell .product-checks {
  gap: 1rem 1.5rem;
}

.product-form-shell .product-checks label {
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
}

@media (max-width: 1500px) {
  .product-form-shell .product-form__row--split,
  .product-form-shell .product-form__row--code,
  .product-form-shell .product-form__row--prices {
    grid-template-columns: 11rem minmax(0, 1fr);
  }

  .product-form-shell .product-form__label--right {
    justify-self: start;
    text-align: left;
    padding-left: 0;
    padding-top: 0.55rem;
  }
}

@media (max-width: 760px) {
  .product-form-shell .product-form,
  .product-form-shell .library-card {
    max-width: none;
  }

  .product-form-shell .product-form__section,
  .product-form-shell .product-form__actions,
  .product-form-shell .library-tab {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .product-form-shell .product-form__row,
  .product-form-shell .product-form__row--split,
  .product-form-shell .product-form__row--code,
  .product-form-shell .product-form__row--prices,
  .product-form-shell .product-form__row--checks {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

.panel--table.import-structure {
  min-height: 0;
}

.import-structure__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 1rem;
}

.import-structure__lead,
.import-structure__hint,
.import-structure__state {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.import-structure__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface-muted, #f8fafc);
}

.import-structure__meta .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  padding: 0;
  border-bottom: 0;
}

.import-structure__meta .form-row__control,
.import-structure__meta .field-control {
  max-width: none;
  width: 100%;
}

.import-structure__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.15rem;
}

.import-structure__group {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface);
}

.import-structure__group--wide {
  grid-column: 1 / -1;
}

.import-structure__group h2 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.import-structure__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
}

.import-structure__group--wide .import-structure__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.import-structure__group--wide .import-structure__grid:has(.import-structure__cell:nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.import-structure__cell {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-muted, #f8fafc);
}

.import-structure__cell--duplicate,
.import-structure__cell--invalid {
  border-color: #dc2626;
  background: #fff1f1;
}

.import-structure__cell--duplicate .import-structure__column,
.import-structure__cell--invalid .import-structure__column {
  border-color: #dc2626;
}

.import-structure__field {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-structure__cell-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.import-structure__column {
  width: 100%;
  max-width: none;
  padding: 6px 8px;
}

.import-structure__resolved {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--color-primary, #174bcc);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-structure__resolved--empty {
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 500;
  justify-content: flex-start;
  padding-left: 0;
}

.import-structure__invalid {
  color: var(--color-danger-text, #b91c1c);
}

.import-structure__empty {
  color: var(--color-text-muted);
}

@media (max-width: 1200px) {
  .import-structure__group--wide .import-structure__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .import-structure__groups {
    grid-template-columns: 1fr;
  }

  .import-structure__group--wide .import-structure__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .import-structure__meta,
  .import-structure__grid,
  .import-structure__group--wide .import-structure__grid {
    grid-template-columns: 1fr;
  }
}

/* Category form — isolated from the compact product-article shell. */
.app-content:has(.category-form-page) {
  overflow: auto;
}

.category-form-page {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.category-form-page__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.category-form-page__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.category-form-page__title h1 {
  margin: 0;
  font-size: 1.25rem;
}

.category-form-page__back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}

.category-form-page__back svg {
  width: 18px;
  height: 18px;
}

.category-form-page__shell {
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 10px);
}

.category-form {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6) var(--space-5);
  min-width: 0;
}

.category-form__grid {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1.4fr) minmax(140px, 220px);
  gap: var(--space-4);
  align-items: end;
}

.category-form__field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.category-form__field span {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
}

.category-form__field em {
  color: var(--color-danger-text);
  font-style: normal;
}

.category-form__checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted, #f8fafc);
}

.category-form__checks label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.category-form__checks label:hover {
  background: var(--color-surface);
}

.category-form__hint,
.category-form__intro {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.category-form__section {
  display: grid;
  gap: 4px;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.category-form__section h2 {
  margin: 0;
  font-size: 0.9375rem;
}

.category-form__section p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.family-picker {
  display: grid;
  gap: var(--space-2);
}

.family-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.family-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--color-primary-border, var(--color-border));
  border-radius: 999px;
  background: var(--color-primary-soft, #eef4ff);
  color: var(--color-text);
  font-size: 0.8125rem;
  cursor: pointer;
}

.family-picker__chip strong {
  font-size: 0.75rem;
}

.family-picker__chip-remove {
  color: var(--color-text-muted, #6b7280);
  font-size: 1rem;
  line-height: 1;
}

.family-picker__search {
  position: relative;
}

.family-picker__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 240px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.family-picker__option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.family-picker__option:hover {
  background: var(--color-primary-soft, #eef4ff);
}

.family-picker__option strong,
.family-picker__chip strong {
  color: var(--color-primary);
  font-size: 0.75rem;
}

.family-picker__empty {
  margin: 0;
  padding: 10px;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.category-form-page .kanban {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-4);
  min-width: 0;
  min-height: 480px;
}

.category-form-page .kanban__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted, #f8fafc);
}

.category-form-page .kanban__column--over {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(23, 75, 204, 0.12);
  background: #f8fbff;
}

.category-form-page .kanban__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.category-form-page .kanban__header h2 {
  margin: 0;
  font-size: 0.875rem;
}

.category-form-page .kanban__header span {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  font-weight: 700;
}

.category-form-page .kanban__list {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  min-height: 180px;
}

.category-form-page .kanban__list--form {
  flex: 1 1 auto;
  min-height: 280px;
  padding: var(--space-2);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.category-form-page .kanban__empty {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.category-form-page .kanban-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 58px 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: grab;
}

.category-form-page .kanban-card--assigned {
  grid-template-columns: 22px minmax(0, 1fr);
}

.category-form-page .kanban-card__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.category-form-page .kanban-card__order {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  font-weight: 800;
}

.category-form-page .kanban-card__body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-form-page .kanban-card__name {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

.category-form-page .kanban-card__answers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.category-form-page .kanban-card__muted {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
}

.category-form-page .kanban-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-muted, #f1f5f9);
  color: var(--color-text);
  font-size: 0.6875rem;
  font-weight: 600;
}

.category-form-page .kanban-card--collapsed {
  padding-bottom: 8px;
}

.category-form-page .kanban-card__toggle {
  position: absolute;
  top: 8px;
  right: 32px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.category-form-page .kanban-card__toggle svg {
  width: 12px;
  height: 8px;
  transition: transform 0.15s ease;
}

.category-form-page .kanban-card--collapsed .kanban-card__toggle svg {
  transform: rotate(-90deg);
}

.category-form-page .kanban-card__action {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.category-form-page .kanban-card__toggle:hover,
.category-form-page .kanban-card__action:hover {
  background: #eef4ff;
}

@media (max-width: 760px) {
  .category-form-page .kanban {
    grid-template-columns: 1fr;
  }

  .category-form__grid {
    grid-template-columns: 1fr;
  }
}
