/* A compact native dropdown keeps the language choice in the header. */
.language-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  margin: 0;
}
.language-switch:has(details[open]) { z-index: 60; }
.language-switch summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid #dce3df;
  border-radius: 9px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}
.language-switch summary::-webkit-details-marker { display: none; }
.language-switch summary:hover,
.language-switch details[open] summary { background: #f1f5f3; }
.language-switch summary:focus-visible,
.language-switch button:focus-visible {
  outline: 2px solid #287a50;
  outline-offset: 2px;
}
.language-switch summary svg { width: 16px; height: 16px; flex: none; }
.language-switch-short { display: none; }
.language-switch summary .language-switch-chevron { width: 12px; height: 12px; }
.language-switch details[open] .language-switch-chevron { transform: rotate(180deg); }
.language-switch-options {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 60;
  min-inline-size: 148px;
  padding: 4px;
  border: 1px solid #dce3df;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(12, 24, 20, .12);
}
.language-switch button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #475569;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: start;
  cursor: pointer;
}
.language-switch button[aria-current="true"] {
  color: #164b35;
  background: #e8f3ed;
  font-weight: 600;
}
.language-switch button:hover { background: #f1f5f3; }
.language-switch-check { font-size: 15px; line-height: 1; }
.login-language-switch {
  display: flex;
  justify-content: flex-end;
  margin-block-end: 20px;
}
.erp-mobile-brand-short { display: none; }

/* Keep layout independent of the physical direction of the document. */
:root { --erp-inline-direction: 1; }
html[dir="rtl"] { --erp-inline-direction: -1; }
.main-content { margin-inline: 0; }
.mobile-nav { inset-inline-start: 0; }
.mobile-sidebar {
  inset-inline-start: 0;
  border-inline-end: 1px solid #e5e7eb;
  transform: translateX(calc(-100% * var(--erp-inline-direction)));
}
#mobileDrawer:checked ~ .mobile-sidebar {
  inset-inline-start: 72px;
  transform: translateX(0);
}
.mobile-nav .nav-tooltip { inset-inline-start: 56px; }
.mobile-nav .nav-app-tooltip { inset-inline-start: 64px; }
.nav-children { padding-inline-start: 8px; }
.nav-shortcut-caret, .erp-user-avatar { margin-inline-start: 4px; }
.nav-link, .dd-menu li a { text-align: start; }
.nav-active-marker { inset-inline-end: 0; }
.erp-company-controls, .erp-company-identity, .erp-company-name { min-inline-size: 0; }
.erp-company-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-header-actions { flex-shrink: 0; }
.erp-global-search-icon { inset-inline-start: 12px; }
.erp-global-search-shortcut { inset-inline-end: 8px; }
#erp-global-search {
  padding-inline-start: 36px;
  padding-inline-end: 56px;
}
#filter-panel {
  inset-inline-end: 0;
  transform: translateX(0);
}
#filter-panel.filter-panel-closed {
  transform: translateX(calc(100% * var(--erp-inline-direction)));
}

html[dir="rtl"] .login-submit > svg { transform: scaleX(-1); }

/* The form theme removes native select arrows and draws its own. Keep the
   glyph on the inline end in RTL, with enough room for the selected text. */
html[dir="rtl"] select:not([multiple]):not([size]):not(.select2-hidden-accessible) {
  background-position: left 10px center;
  background-size: 16px 16px;
  padding-left: 32px;
  padding-right: 12px;
}
html[dir="rtl"] .aligned select:not([multiple]):not([size]):not(.select2-hidden-accessible) {
  /* erp-theme.css uses important padding on form controls. */
  padding-left: 32px !important;
  padding-right: 12px !important;
}

/* Select2 has a separate positioned arrow and optional clear button. Its
   original right-side overrides out-rank the vendor's RTL positioning. */
html[dir="rtl"] .select2-selection--single .select2-selection__arrow {
  left: 4px !important;
  right: auto !important;
}
html[dir="rtl"] .select2-selection--single .select2-selection__rendered {
  padding-left: 46px !important;
  padding-right: 12px !important;
}
html[dir="rtl"] .select2-selection--single .select2-selection__clear {
  left: 26px;
  right: auto;
}

html[dir="rtl"] #floating-action-select {
  background-position: left 0.75rem center;
  padding-left: 2.25rem;
  padding-right: 0.75rem;
}
html[dir="rtl"] #changelist .actions select {
  background-position: left 10px center;
  padding-left: 32px;
  padding-right: 4px;
}
html[dir="rtl"] #grid-picker .gp-facet-select {
  background-position: left 0.375rem center;
  padding-left: 1.5rem;
  padding-right: 0.5rem;
}
html[dir="rtl"] #dma-modal-form select {
  background-position: left 0.75rem center;
  padding-left: 2.25rem;
  padding-right: 0.75rem;
}
html[dir="rtl"] .dd-item, html[dir="rtl"] .th.col-resizable {
  align-items: right;
}
@media (min-width: 768px) {
  .main-content { margin-inline-start: 80px; }
  .main-content.has-context-sidebar { margin-inline-start: 292px; }
  .mobile-sidebar {
    inset-inline-start: 72px;
    transform: translateX(0);
  }
  #sidebarToggle:checked ~ .mobile-sidebar {
    transform: translateX(calc(-200% * var(--erp-inline-direction)));
  }
  #sidebarToggle:checked ~ .main-content {
    /* Reset the older compiled rule's physical margin before its logical replacement. */
    margin-left: 0;
    margin-right: 0;
    margin-inline-start: 80px;
  }
}
@media (min-width: 768px) and (max-width: 1279px) {
  /* A second row keeps search and all account controls usable beside an open sidebar. */
  .erp-main-header {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 8px;
    padding-inline: 12px;
  }
  .erp-main-header > .erp-company-controls { flex: 1; }
  .erp-main-header > [data-global-search] { order: 1; flex: 1 0 100%; }
}
@media (max-width: 767px) {
  .erp-header-actions > .language-switch { display: none; }
  .erp-main-header { padding-inline: 12px; }
  .erp-mobile-header { gap: 8px; }
  .erp-mobile-header > label, .erp-mobile-header > button { flex-shrink: 0; }
  .erp-mobile-header .language-switch summary {
    width: 40px;
    height: 40px;
    justify-content: center;
    gap: 2px;
    padding: 0;
  }
  .erp-mobile-header .language-switch-globe,
  .erp-mobile-header .language-switch-current { display: none; }
  .erp-mobile-header .language-switch-short { display: inline; line-height: 1; }
  .erp-mobile-header .language-switch-chevron { width: 10px; }
}
@media (max-width: 359px) {
  .erp-mobile-brand-full { display: none; }
  .erp-mobile-brand-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-sidebar, .main-content, #filter-panel { transition: none; }
}
[dir="rtl"] .confirm-popover {
  right: auto;
  left: 0;
}

.confirm-popover {
  max-inline-size: calc(100vw - 2rem);
}

.confirm-popover .confirm-actions {
  flex-shrink: 0;
}
