:root,
html.theme-light {
  --page-bg: #f4f6f8;
  --page-accent: radial-gradient(circle at top, rgba(32, 91, 72, 0.08), transparent 38%);
  --surface: #ffffff;
  --surface-muted: #f7f8fa;
  --surface-strong: #eef2f6;
  --text-primary: #17212b;
  --text-secondary: #5c6773;
  --border-color: rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 16px 36px rgba(15, 23, 42, 0.08);
  --shadow-hard: 0 14px 28px rgba(15, 23, 42, 0.12);
  --accent: #1f7a5a;
  --accent-soft: rgba(31, 122, 90, 0.14);
  --link-color: #1864ab;
  --input-bg: #ffffff;
  --overlay: rgba(11, 18, 32, 0.55);
}

.dashboard-page .dashboard-shell {
  padding-top: 1.25rem;
}

.dashboard-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--overlay);
  backdrop-filter: blur(1.5px);
}

.dashboard-loader.hidden {
  display: none;
}

.dashboard-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.28);
  border-top-color: var(--accent);
  animation: dashboard-spin 0.8s linear infinite;
}

.dashboard-loader-text {
  color: #f8fafc;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

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

@media (prefers-reduced-motion: reduce) {
  .dashboard-spinner {
    animation-duration: 1.8s;
  }
}

.dashboard-page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-page-title .ui.header {
  margin-bottom: 0.15rem;
}

.dashboard-subtitle,
.dashboard-panel-subtitle {
  color: rgba(0, 0, 0, 0.58);
  font-size: 0.92rem;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(34, 36, 38, 0.12);
  border-radius: 8px;
  background: #fff;
}

.dashboard-period {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
}

.dashboard-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid rgba(34, 36, 38, 0.12);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.74);
}

.dashboard-mode-toggle .ui.button {
  margin: 0;
  border-radius: 6px !important;
}

.dashboard-mode-toggle .ui.button.active {
  background: #128f78;
  color: #fff;
}

.dashboard-native-select {
  min-width: 9.5rem;
  height: 2.5rem;
  padding: 0 2rem 0 0.8rem;
  border: 1px solid rgba(34, 36, 38, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #1f2933;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-kpi-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 5.2rem;
  padding: 1rem;
  border: 1px solid rgba(34, 36, 38, 0.12);
  border-radius: 8px;
  background: #fff;
}

.dashboard-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 8px;
  background: rgba(18, 143, 120, 0.12);
  color: #128f78;
  flex: 0 0 auto;
}

.dashboard-kpi-value {
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 800;
  color: #111827;
}

.dashboard-kpi-label {
  margin-top: 0.35rem;
  color: rgba(0, 0, 0, 0.58);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.65fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(34, 36, 38, 0.12);
  border-radius: 8px;
  background: #fff;
}

.dashboard-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-panel-header .ui.header {
  margin: 0 0 0.15rem;
}

.dashboard-chart-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-legend-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  vertical-align: middle;
}

.dashboard-created-dot,
.dashboard-created-bar {
  fill: #16a34a;
  background: #16a34a;
}

.dashboard-edited-dot,
.dashboard-edited-bar {
  fill: #2563eb;
  background: #2563eb;
}

.dashboard-images-dot,
.dashboard-images-bar {
  fill: #f59e0b;
  background: #f59e0b;
}

.dashboard-chart {
  min-height: 18rem;
  overflow-x: auto;
}

.dashboard-chart-svg {
  width: 100%;
  min-width: 46rem;
  height: auto;
  display: block;
}

.dashboard-chart-gridline {
  stroke: rgba(17, 24, 39, 0.12);
  stroke-width: 1;
}

.dashboard-chart-axis {
  fill: rgba(17, 24, 39, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-quality-list,
.dashboard-status-list,
.dashboard-top-viewed-list {
  display: grid;
  gap: 0.65rem;
}

.dashboard-quality-row,
.dashboard-status-row,
.dashboard-viewed-item {
  border: 1px solid rgba(34, 36, 38, 0.1);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.78);
}

.dashboard-quality-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
}

.dashboard-quality-row span,
.dashboard-status-row span {
  color: rgba(0, 0, 0, 0.66);
  font-weight: 700;
}

.dashboard-quality-row strong,
.dashboard-status-row strong {
  font-size: 1.1rem;
}

.dashboard-status-row {
  padding: 0.8rem 0.9rem;
}

.dashboard-status-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.dashboard-status-track {
  height: 0.45rem;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.1);
}

.dashboard-status-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #128f78;
}

.dashboard-quality-score {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(34, 36, 38, 0.1);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.78);
}

.dashboard-quality-score-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.dashboard-quality-score-head span {
  color: rgba(0, 0, 0, 0.66);
  font-weight: 700;
}

.dashboard-quality-score-head strong {
  font-size: 1.5rem;
  line-height: 1;
  color: #128f78;
}

.dashboard-system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.65rem;
}

.dashboard-viewed-item {
  display: grid;
  grid-template-columns: auto 3.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  color: inherit;
  text-decoration: none;
}

.dashboard-viewed-item:hover {
  color: inherit;
  border-color: rgba(18, 143, 120, 0.45);
  background: rgba(18, 143, 120, 0.08);
}

.dashboard-viewed-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 8px;
  background: rgba(18, 143, 120, 0.12);
  color: #128f78;
  font-weight: 800;
}

.dashboard-viewed-item img {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f4f6;
}

.dashboard-viewed-text {
  min-width: 0;
}

.dashboard-viewed-text strong,
.dashboard-viewed-text span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-viewed-text strong {
  color: #111827;
}

.dashboard-viewed-text span,
.dashboard-viewed-meta span,
.dashboard-viewed-meta small {
  color: rgba(0, 0, 0, 0.58);
}

.dashboard-viewed-meta {
  text-align: right;
  white-space: nowrap;
}

.dashboard-viewed-meta strong,
.dashboard-viewed-meta span,
.dashboard-viewed-meta small {
  display: block;
}

.dashboard-empty {
  padding: 1rem;
  border: 1px dashed rgba(34, 36, 38, 0.16);
  border-radius: 8px;
  color: rgba(0, 0, 0, 0.58);
  font-weight: 700;
}

html.theme-dark .dashboard-subtitle,
html.theme-dark .dashboard-panel-subtitle,
html.theme-dark .dashboard-kpi-label,
html.theme-dark .dashboard-quality-row span,
html.theme-dark .dashboard-status-row span,
html.theme-dark .dashboard-viewed-text span,
html.theme-dark .dashboard-viewed-meta span,
html.theme-dark .dashboard-viewed-meta small,
html.theme-dark .dashboard-empty {
  color: rgba(226, 232, 240, 0.68);
}

html.theme-dark .dashboard-toolbar,
html.theme-dark .dashboard-kpi-card,
html.theme-dark .dashboard-panel {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(20, 33, 46, 0.92);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

html.theme-dark .dashboard-native-select {
  border-color: rgba(148, 163, 184, 0.22);
  background: #14212e;
  color: #e5eef7;
}

html.theme-dark .dashboard-mode-toggle {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.46);
}

html.theme-dark .dashboard-kpi-value,
html.theme-dark .dashboard-viewed-text strong {
  color: #f8fafc;
}

html.theme-dark .dashboard-quality-row,
html.theme-dark .dashboard-status-row,
html.theme-dark .dashboard-viewed-item,
html.theme-dark .dashboard-quality-score {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.46);
}

html.theme-dark .dashboard-quality-score-head span {
  color: rgba(226, 232, 240, 0.68);
}

html.theme-dark .dashboard-quality-score-head strong {
  color: #2dd4bf;
}

html.theme-dark .dashboard-viewed-item:hover {
  border-color: rgba(45, 212, 191, 0.42);
  background: rgba(20, 184, 166, 0.12);
}

html.theme-dark .dashboard-chart-gridline {
  stroke: rgba(226, 232, 240, 0.14);
}

html.theme-dark .dashboard-chart-axis {
  fill: rgba(226, 232, 240, 0.64);
}

html.theme-dark .dashboard-status-track {
  background: rgba(226, 232, 240, 0.12);
}

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

  .dashboard-chart-panel,
  .dashboard-top-viewed-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .dashboard-page-title,
  .dashboard-toolbar,
  .dashboard-toolbar-controls,
  .dashboard-period,
  .dashboard-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-page-title .ui.button,
  .dashboard-toolbar .ui.button,
  .dashboard-mode-toggle,
  .dashboard-native-select {
    width: 100%;
  }

  .dashboard-mode-toggle .ui.button {
    flex: 1 1 0;
  }

  .dashboard-kpi-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi-card {
    min-height: 4.6rem;
  }

  .dashboard-viewed-item {
    grid-template-columns: auto 3rem minmax(0, 1fr);
  }

  .dashboard-viewed-meta {
    grid-column: 3;
    text-align: left;
  }
}

html.theme-dark {
  --page-bg: #0f1722;
  --page-accent: radial-gradient(circle at top, rgba(74, 222, 128, 0.12), transparent 34%);
  --surface: #18212e;
  --surface-muted: #202b39;
  --surface-strong: #263243;
  --text-primary: #e7edf5;
  --text-secondary: #9fb0c3;
  --border-color: rgba(148, 163, 184, 0.18);
  --shadow-soft: 0 18px 40px rgba(2, 6, 23, 0.42);
  --shadow-hard: 0 20px 48px rgba(2, 6, 23, 0.52);
  --accent: #56c38e;
  --accent-soft: rgba(86, 195, 142, 0.16);
  --link-color: #80c7ff;
  --input-bg: #121a24;
  --overlay: rgba(2, 6, 23, 0.74);
}

html,
body {
  min-height: 100%;
  background: var(--page-accent), var(--page-bg);
  color: var(--text-primary);
}

body {
  transition: background-color .2s ease, color .2s ease;
}

a {
  color: var(--link-color);
}

div.ui.container,
.ui.segment,
.ui.card,
.ui.cards > .card,
.ui.menu,
.ui.table,
.ui.message,
.ui.modal,
.ui.dropdown .menu {
  color: var(--text-primary);
}

div.ui.stackable.menu,
.ui.segment,
.ui.cards > .card,
.ui.card,
.ui.message,
.pagePagination.pagination.ui.menu,
.ui.dropdown .menu,
.ui.modal,
.ui.table,
.ui.form textarea,
.ui.input input,
.ui.form input:not([type]),
.ui.form input[type="text"],
.ui.form input[type="number"],
.ui.form input[type="search"],
.ui.form input[type="password"],
.ui.form select,
.ui.selection.dropdown,
.ui.fluid.selection.dropdown {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-soft);
}

div.ui.stackable.menu,
.ui.segment,
.ui.cards > .card,
.ui.card,
.ui.modal,
.pagePagination.pagination.ui.menu {
  border-radius: 1rem !important;
}

div.ui.stackable.menu {
  margin-top: 1rem;
  padding: .25rem;
  align-items: stretch;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 103, 115, 0.34) transparent;
}

div.ui.stackable.menu::-webkit-scrollbar {
  height: .35rem;
}

div.ui.stackable.menu::-webkit-scrollbar-track {
  background: transparent;
}

div.ui.stackable.menu::-webkit-scrollbar-thumb {
  background: rgba(92, 103, 115, 0.28);
  border-radius: 999px;
}

div.ui.stackable.menu > .item,
div.ui.stackable.menu > .right.menu,
div.ui.stackable.menu > .right.menu > .item {
  flex: 0 0 auto;
  white-space: nowrap;
}

div.ui.stackable.menu > .right.menu {
  display: flex;
  align-items: stretch;
}

div.ui.stackable.menu .item,
div.ui.stackable.menu .item > a,
.ui.dropdown > .text,
.ui.dropdown .menu > .item,
.pagePagination.pagination.ui.menu .item,
.ui.table,
.ui.table th,
.ui.table td,
.ui.message,
.ui.modal > .header,
.ui.modal .content,
.ui.modal .actions {
  color: var(--text-primary) !important;
}

.ui.modal > .header,
.ui.modal > .content,
.ui.modal > .actions {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.ui.modal > .header {
  border-bottom-color: var(--border-color) !important;
}

.ui.modal > .actions {
  border-top-color: var(--border-color) !important;
}

.ui.modal .ui.table,
.ui.modal .ui.table thead th,
.ui.modal .ui.table tbody td {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.ui.modal .ui.table thead th {
  background: var(--surface-muted) !important;
}

html.theme-dark .ui.modal > .close.icon {
  color: var(--text-primary) !important;
  text-shadow: none !important;
}

.ui.modal > .close.icon {
  top: .85rem !important;
  right: .85rem !important;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: .55rem;
  color: var(--text-secondary) !important;
  text-shadow: none !important;
}

.ui.modal > .close.icon:hover,
.ui.modal > .close.icon:focus {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-primary) !important;
}

html.theme-dark .ui.modal > .close.icon:hover,
html.theme-dark .ui.modal > .close.icon:focus {
  background: rgba(148, 163, 184, 0.12);
}

.ui.modal .ui.form input:not([type]),
.ui.modal .ui.form input[type="text"],
.ui.modal .ui.form input[type="number"],
.ui.modal .ui.form input[type="search"],
.ui.modal .ui.form input[type="password"],
.ui.modal .ui.form select,
.ui.modal .ui.form textarea,
.ui.modal .ui.form .ui.selection.dropdown,
.ui.modal .ui.form .ui.action.input,
.ui.modal .ui.form .ui.action.input > input {
  width: 100%;
  min-height: 2.75rem;
  box-sizing: border-box;
}

.ui.modal .ui.form input:not([type]),
.ui.modal .ui.form input[type="text"],
.ui.modal .ui.form input[type="number"],
.ui.modal .ui.form input[type="search"],
.ui.modal .ui.form input[type="password"],
.ui.modal .ui.form select,
.ui.modal .ui.form textarea,
.ui.modal .ui.form .ui.selection.dropdown,
.ui.modal .ui.form .ui.action.input > input {
  border-radius: .75rem !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.ui.modal .ui.form .ui.selection.dropdown {
  display: flex;
  align-items: center;
  padding-top: .72rem !important;
  padding-bottom: .72rem !important;
}

.ui.modal .ui.form .ui.search.selection.dropdown > input.search {
  min-height: 2.75rem !important;
  height: 2.75rem !important;
  padding-top: .72rem !important;
  padding-bottom: .72rem !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.ui.modal .ui.form .ui.selection.dropdown > .text,
.ui.modal .ui.form .ui.selection.dropdown > .default.text {
  min-width: 0;
  max-width: calc(100% - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui.modal .ui.form .ui.selection.dropdown > .dropdown.icon {
  top: 50%;
  right: .8rem;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
  transform: translateY(-50%);
}

.ui.modal .ui.form .ui.action.input {
  position: relative;
  display: block;
}

.ui.modal .ui.form .ui.action.input > input {
  padding-right: 3.2rem !important;
}

.ui.modal .ui.form .ui.action.input > .ui.icon.button {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  z-index: 2;
  width: 2.55rem;
  min-width: 2.55rem;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: .55rem !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

.ui.modal .ui.form .ui.action.input > .ui.icon.button > .icon {
  margin: 0 !important;
  color: inherit !important;
}

.ui.modal .ui.form .ui.action.input > .ui.icon.button:hover,
.ui.modal .ui.form .ui.action.input > .ui.icon.button:focus {
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .ui.modal .ui.form .ui.action.input > .ui.icon.button:hover,
html.theme-dark .ui.modal .ui.form .ui.action.input > .ui.icon.button:focus {
  background: rgba(148, 163, 184, 0.12) !important;
}

.ui.modal .ui.form .ui.button.fluid {
  min-height: 2.75rem;
  border-radius: .75rem !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.ui.modal .ui.form .ui.button.fluid > .icon {
  margin-left: 0 !important;
}

.ui.modal .ui.form .ui.message,
.ui.modal .ui.form .ui.tiny.message {
  margin: .7rem 0 .9rem !important;
  padding: .72rem .85rem !important;
  border-radius: .65rem !important;
  line-height: 1.25;
  box-shadow: none !important;
}

.ui.modal .ui.form .ui.negative.message {
  background: rgba(185, 28, 28, 0.1) !important;
  border: 1px solid rgba(185, 28, 28, 0.28) !important;
  color: #991b1b !important;
}

.ui.modal .ui.form .ui.positive.message {
  background: rgba(22, 163, 74, 0.1) !important;
  border: 1px solid rgba(22, 163, 74, 0.28) !important;
  color: #166534 !important;
}

html.theme-dark .ui.modal .ui.form .ui.negative.message {
  background: rgba(127, 29, 29, 0.34) !important;
  border-color: rgba(248, 113, 113, 0.36) !important;
  color: #fecaca !important;
}

html.theme-dark .ui.modal .ui.form .ui.positive.message {
  background: rgba(20, 83, 45, 0.34) !important;
  border-color: rgba(74, 222, 128, 0.32) !important;
  color: #bbf7d0 !important;
}

.ui.modal .ui.form .field .prompt.label,
.ui.modal .ui.form .field.error .prompt.label,
.ui.modal .ui.form .fields.error .prompt.label {
  width: auto !important;
  min-height: 0 !important;
  margin-top: .45rem !important;
  padding: .58rem .72rem !important;
  border-radius: .58rem !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
}

#usersAdminModal #managedUsersTable td {
  vertical-align: middle;
}

#usersAdminModal #managedUsersTable .managed-user-login {
  min-width: 9rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

#usersAdminModal #managedUsersTable .managed-user-role-cell {
  min-width: 12rem;
}

#usersAdminModal #managedUsersTable .managed-user-status-cell {
  width: 8.5rem;
}

#usersAdminModal #managedUsersTable .managed-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  white-space: nowrap;
}

#usersAdminModal #managedUsersTable .managed-user-actions .ui.icon.button {
  width: 2.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .45rem !important;
}

#usersAdminModal #managedUsersTable .managed-user-actions .ui.icon.button > .icon {
  margin: 0 !important;
}

#appSettingsForm input:not([type]),
#appSettingsForm input[type="text"],
#appSettingsForm input[type="number"],
#appSettingsForm input[type="password"],
#appSettingsForm textarea,
#excelImportForm input[type="text"],
#excelImportForm input[type="file"] {
  width: 100%;
  min-height: 2.75rem;
  border-radius: .75rem !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box;
}

#appSettingsForm textarea {
  resize: vertical;
}

#excelImportForm input[type="file"] {
  padding: .72rem .95rem !important;
}

#appSettingsForm .ui.button,
#excelImportForm .ui.button {
  min-height: 2.75rem;
  border-radius: .75rem !important;
}

#itemsList {
  width: 100%;
  overflow: visible;
}

#itemsList > .ui.table {
  min-width: 44rem;
}

div.ui.stackable.menu.app-main-menu .item,
div.ui.stackable.menu.app-main-menu .item > a {
  display: flex;
  align-items: center;
  gap: .5rem;
}

div.ui.stackable.menu.app-main-menu .header.item > a {
  font-weight: 700;
}

.nav-menu-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: .72;
}

div.ui.stackable.menu.app-main-menu .active.item .nav-menu-icon,
div.ui.stackable.menu.app-main-menu .item:hover .nav-menu-icon,
div.ui.stackable.menu.app-main-menu .item:focus .nav-menu-icon {
  opacity: .95;
}

.nav-menu-text {
  white-space: nowrap;
}

div.ui.stackable.menu .active.item,
.pagePagination.pagination.ui.menu .active.item,
.ui.selection.dropdown .menu > .active.item {
  background: var(--accent-soft) !important;
  color: var(--text-primary) !important;
}

div.ui.stackable.menu .item:hover,
.pagePagination.pagination.ui.menu .item:hover,
.ui.dropdown .menu > .item:hover {
  background: var(--surface-muted) !important;
}

.ui.input input::placeholder,
.ui.form input::placeholder,
.ui.form textarea::placeholder {
  color: var(--text-secondary) !important;
}

.ui.dropdown > .dropdown.icon,
.ui.input > i.icon,
.ui.menu .item > i.icon {
  color: var(--text-secondary) !important;
}

#authCall > i.icon.red {
  color: #d14343 !important;
}

#authCall > i.icon.green {
  color: #1f7a5a !important;
}

html.theme-dark #authCall > i.icon.red {
  color: #f87171 !important;
}

html.theme-dark #authCall > i.icon.green {
  color: #56c38e !important;
}

html.theme-dark div.ui.stackable.menu {
  scrollbar-color: rgba(159, 176, 195, 0.34) transparent;
}

html.theme-dark div.ui.stackable.menu::-webkit-scrollbar-thumb {
  background: rgba(159, 176, 195, 0.3);
}

@media only screen and (max-width: 767px) {
  div.ui.stackable.menu {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    margin-top: .75rem;
  }

  div.ui.stackable.menu > .item,
  div.ui.stackable.menu > .right.menu > .item {
    width: auto !important;
  }

  div.ui.stackable.menu > .right.menu {
    width: auto !important;
    margin-left: 0 !important;
    flex-direction: row !important;
  }
}

@media only screen and (max-width: 1120px) {
  div.ui.stackable.menu.app-main-menu > .nav-menu-item-categories1c .nav-menu-text,
  div.ui.stackable.menu.app-main-menu > .nav-menu-item-properties .nav-menu-text,
  div.ui.stackable.menu.app-main-menu > .nav-menu-item-settings .nav-menu-text {
    display: none;
  }

  div.ui.stackable.menu.app-main-menu > .nav-menu-item-categories1c,
  div.ui.stackable.menu.app-main-menu > .nav-menu-item-properties,
  div.ui.stackable.menu.app-main-menu > .nav-menu-item-settings {
    justify-content: center;
    min-width: 3.05rem;
  }
}

@media only screen and (max-width: 920px) {
  div.ui.stackable.menu.app-main-menu > a.item .nav-menu-text {
    display: none;
  }

  div.ui.stackable.menu.app-main-menu > a.item {
    justify-content: center;
    min-width: 3.05rem;
  }
}

@media only screen and (max-width: 620px) {
  div.ui.stackable.menu.app-main-menu .app-brand-item .nav-menu-text {
    display: none;
  }

  div.ui.stackable.menu.app-main-menu .app-brand-item {
    justify-content: center;
    min-width: 3.05rem;
  }
}

.ui.selection.dropdown .menu,
.ui.dropdown .menu {
  border-radius: .9rem !important;
}

.ui.dimmer {
  background: var(--overlay) !important;
}

.theme-toggle-button {
  gap: .55rem;
  font-weight: 600;
}

.theme-toggle-button .theme-toggle-label {
  display: none;
}

.theme-toggle-button .theme-toggle-icon {
  margin: 0 !important;
}

html.theme-dark .ui.basic.segment,
html.theme-dark .ui.basic.segments .segment,
html.theme-dark .ui.basic.segment:not(.items-footer-pagination) {
  background: transparent !important;
  color: var(--text-primary) !important;
}

html.theme-dark,
html.theme-dark body,
html.theme-dark .ui.container,
html.theme-dark .messageholder,
html.theme-dark .field,
html.theme-dark .meta,
html.theme-dark .description,
html.theme-dark .header,
html.theme-dark .content,
html.theme-dark .extra.content,
html.theme-dark .stockrow,
html.theme-dark .columnstock,
html.theme-dark label,
html.theme-dark p,
html.theme-dark span,
html.theme-dark div {
  color: var(--text-primary);
}

html.theme-dark .ui.label {
  background: var(--surface-strong) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

html.theme-dark .ui.popup {
  background: var(--surface-strong) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-hard) !important;
}

html.theme-dark .ui.popup:before {
  background: var(--surface-strong) !important;
  box-shadow: 1px 1px 0 0 var(--border-color) !important;
}

html.theme-dark .ui.popup .header,
html.theme-dark .ui.popup .content,
html.theme-dark .ui.popup .description {
  color: var(--text-primary) !important;
}

.ui.popup.barcode-check-popup {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #17212b !important;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14) !important;
}

.ui.popup.barcode-check-popup:before {
  background: #ffffff !important;
  box-shadow: 1px 1px 0 0 rgba(15, 23, 42, 0.16) !important;
}

html.theme-dark .ui.popup.barcode-check-popup {
  background: #0b1220 !important;
  border-color: rgba(148, 163, 184, 0.46) !important;
  color: #f8fafc !important;
  text-shadow: none !important;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.64) !important;
}

html.theme-dark .ui.popup.barcode-check-popup:before {
  background: #0b1220 !important;
  box-shadow: 1px 1px 0 0 rgba(148, 163, 184, 0.46) !important;
}

html.theme-dark .ui.menu .item:before,
html.theme-dark .ui.table thead th,
html.theme-dark .ui.table td {
  border-color: var(--border-color) !important;
}

/* Dark mode: table header kept Fomantic's light #f9fafb background */
html.theme-dark .ui.table thead th {
  background: var(--surface-muted) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .ui.form .field > label,
html.theme-dark .ui.form .fields > label,
html.theme-dark .ui.form .inline.fields > label,
html.theme-dark .ui.form .inline.field > label,
html.theme-dark .ui.form label,
html.theme-dark .ui.checkbox label,
html.theme-dark .ui.form .ui.checkbox label,
html.theme-dark .ui.form .selection.dropdown > .default.text,
html.theme-dark .ui.form .selection.dropdown > .text,
html.theme-dark .ui.form .field .prompt.label,
html.theme-dark .ui.form .help,
html.theme-dark .ui.form .sub.header {
  color: var(--text-primary) !important;
}

html.theme-dark .ui.form .field.error > label,
html.theme-dark .ui.form .fields.error > label,
html.theme-dark .ui.form .field.error .input,
html.theme-dark .ui.form .field.error input,
html.theme-dark .ui.form .field.error textarea,
html.theme-dark .ui.form .field.error .selection.dropdown {
  color: var(--text-primary) !important;
}

html.theme-dark .ui.form .field .prompt.label,
html.theme-dark .ui.form .field.error .prompt.label,
html.theme-dark .ui.form .fields.error .prompt.label {
  background: #7f1d1d !important;
  border-color: rgba(248, 113, 113, 0.42) !important;
  color: #fee2e2 !important;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.34) !important;
}

html.theme-dark .ui.form .field .prompt.label:before,
html.theme-dark .ui.form .field.error .prompt.label:before,
html.theme-dark .ui.form .fields.error .prompt.label:before {
  background: #7f1d1d !important;
  border-color: rgba(248, 113, 113, 0.42) !important;
}

html.theme-dark .itemPriceHolder .ui.label.orange {
  background: #b45309 !important;
}

/* Dark mode: dropdown menu items — Fomantic 2.9 sets color with !important on .menu>.item */
html.theme-dark .ui.dropdown .menu > .item {
  color: var(--text-primary) !important;
  background: transparent !important;
}

html.theme-dark .ui.dropdown .menu > .item:hover {
  background: var(--surface-muted) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .ui.dropdown .menu > .item.active,
html.theme-dark .ui.dropdown .menu > .item.selected {
  background: var(--surface-strong) !important;
  color: var(--text-primary) !important;
}

/* Ensure dropdown menu always appears on top of segments with border-radius */
.ui.dropdown .menu {
  z-index: 1000 !important;
}

/* Dark mode: lift the open dropdown menu off the form.
   Fomantic's default flat shadow/background makes the popup merge with fields. */
html.theme-dark .ui.dropdown .menu {
  background: var(--surface-muted) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-soft) !important;
}

/* Prevent search-filter segment from clipping dropdown */
.search-filter-grid {
  overflow: visible !important;
}

/* Dark mode: checkbox box indicator */
html.theme-dark .ui.checkbox label:before {
  background: var(--input-bg) !important;
  border-color: rgba(148, 163, 184, 0.38) !important;
}

html.theme-dark .ui.checkbox input:checked ~ label:before,
html.theme-dark .ui.checkbox.checked label:before {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

html.theme-dark .ui.checkbox input:checked ~ label:after,
html.theme-dark .ui.checkbox.checked label:after {
  color: #fff !important;
}

/* Dark mode: colored messages */
html.theme-dark .ui.info.message {
  background: rgba(30, 58, 138, 0.26) !important;
  border: 1px solid rgba(96, 165, 250, 0.28) !important;
  color: #bfdbfe !important;
  box-shadow: none !important;
}

html.theme-dark .ui.info.message .header,
html.theme-dark .ui.info.message > .icon {
  color: #93c5fd !important;
}

html.theme-dark .ui.warning.message {
  background: rgba(120, 53, 15, 0.28) !important;
  border: 1px solid rgba(251, 191, 36, 0.28) !important;
  color: #fde68a !important;
  box-shadow: none !important;
}

html.theme-dark .ui.warning.message .header,
html.theme-dark .ui.warning.message > .icon {
  color: #fbbf24 !important;
}

html.theme-dark .ui.yellow.message {
  background: rgba(120, 53, 15, 0.28) !important;
  border: 1px solid rgba(251, 191, 36, 0.28) !important;
  color: #fde68a !important;
  box-shadow: none !important;
}

html.theme-dark .ui.yellow.message .header,
html.theme-dark .ui.yellow.message > .icon {
  color: #fbbf24 !important;
}

html.theme-dark .ui.negative.message,
html.theme-dark .ui.error.message {
  background: rgba(127, 29, 29, 0.34) !important;
  border: 1px solid rgba(248, 113, 113, 0.34) !important;
  color: #fecaca !important;
  box-shadow: none !important;
}

html.theme-dark .ui.negative.message .header,
html.theme-dark .ui.negative.message > .icon,
html.theme-dark .ui.error.message .header,
html.theme-dark .ui.error.message > .icon {
  color: #f87171 !important;
}

html.theme-dark .ui.positive.message,
html.theme-dark .ui.success.message {
  background: rgba(20, 83, 45, 0.34) !important;
  border: 1px solid rgba(74, 222, 128, 0.30) !important;
  color: #bbf7d0 !important;
  box-shadow: none !important;
}

html.theme-dark .ui.positive.message .header,
html.theme-dark .ui.positive.message > .icon,
html.theme-dark .ui.success.message .header,
html.theme-dark .ui.success.message > .icon {
  color: #4ade80 !important;
}

html.theme-dark #itemsCardHolder.ui.cards > .card,
html.theme-dark #itemsCardHolder .ui.card,
html.theme-dark #suppliersHolder.ui.cards > .card,
html.theme-dark #suppliersHolder .ui.card,
html.theme-dark #brandsHolder.ui.cards > .card,
html.theme-dark #brandsHolder .ui.card {
  background: #fdfefe !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.28) !important;
}

html.theme-dark #itemsCardHolder .ui.card,
html.theme-dark #itemsCardHolder .ui.card .header,
html.theme-dark #itemsCardHolder .ui.card .meta,
html.theme-dark #itemsCardHolder .ui.card .description,
html.theme-dark #itemsCardHolder .ui.card .content,
html.theme-dark #itemsCardHolder .ui.card .extra.content,
html.theme-dark #itemsCardHolder .ui.card .stockrow,
html.theme-dark #itemsCardHolder .ui.card .columnstock,
html.theme-dark #itemsCardHolder .ui.card a:not(.ui),
html.theme-dark #suppliersHolder .ui.card,
html.theme-dark #suppliersHolder .ui.card .header,
html.theme-dark #suppliersHolder .ui.card .meta,
html.theme-dark #suppliersHolder .ui.card .description,
html.theme-dark #suppliersHolder .ui.card .content,
html.theme-dark #suppliersHolder .ui.card .extra.content,
html.theme-dark #suppliersHolder .ui.card a:not(.ui),
html.theme-dark #brandsHolder .ui.card,
html.theme-dark #brandsHolder .ui.card .header,
html.theme-dark #brandsHolder .ui.card .meta,
html.theme-dark #brandsHolder .ui.card .description,
html.theme-dark #brandsHolder .ui.card .content,
html.theme-dark #brandsHolder .ui.card .extra.content,
html.theme-dark #brandsHolder .ui.card a:not(.ui) {
  color: #17212b !important;
}

html.theme-dark #itemsCardHolder .ui.card .meta,
html.theme-dark #suppliersHolder .ui.card .meta,
html.theme-dark #brandsHolder .ui.card .meta {
  color: #617083 !important;
}

.unselectable {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.drag {
  border: 5px solid red;
  z-index: 1000;
}
.UppyDragDrop-One {
  width: 100px;
  height: 100px;
  background-color: red;
}
.outlined{
  border: 1px solid rgba(34,36,38,.15) !important;
}
#dropTarget{
  width: 100px;
  height: 100px;
  background-color: red;
}
#imageContainer{
  min-height: 130px;
  min-width: 120px;
  width: 100%;
  border: 1px solid lightgray;
  border-radius: 3px;
  margin: 0;
  padding-left: 5px;
  padding-right: 5px;
  z-index: 9;
}
#imageContainer .ui .small{
  margin: 5px;
}

#imageContainer .imageselected{
  background-color: limegreen;
}

#imageContainer .preimage{
  
}

.imagePreShow{
  width: 120px;
  height: auto;
}
#authDimmer.ui.dimmer {
  position: fixed!important;
}
.ui.card,
.ui.cards > .card {
  overflow: hidden !important;
}

.itemrowimage{
  width: 100%;
  position: relative;
}
.itemrowimage .image{
  width:100%!important;
  top: 0;
  left: 0;
  z-index: 9;
}
.itemrowimage .zoompanel{
  z-index: 10;
  opacity: 0.05;
  cursor: pointer;
  position: absolute;
  bottom: 0px;
}
.itemrowimage .zoompanel:hover{
  opacity: 0.1;
}

.imageholder{
  padding: 3px;
  margin: 3px;
  width: 350px!important;
  position: relative;
}
.imageholder .image{
  width:100%!important;
  top: 0;
  left: 0;
  z-index: 9;
}
.imageholder .trashicon{
  z-index: 10;
  opacity: 0.05;
  cursor: pointer;
  position: absolute;
  bottom: 10px;
  right: 15px;
}

.imageContainerholder{
  width: 100%;
  position: relative;
}

.imageContainerholder .imageHolderLabel{
  z-index: -1;
  left: 50%;
  top: 50%;
  opacity: 0.3;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
}

.columnstock {
  float: left;
  width: 50%;
}

/* Clear floats after the columns */
.stockrow:after {
  content: "";
  display: table;
  clear: both;
}

.rightFloatButton{
  position: fixed;
  bottom: 25px!important;
  right: 25px!important;
  z-index: 1000;
}

.ui.modal .scrolling.content {
  max-height: calc(70vh) !important;
  overflow-y: scroll !important;
  overflow-x: auto !important;
}

.itemPriceHolder{ 
  position: absolute;
  right: 13px;
  top: 5px;
  z-index: 9;
}

.mobile-card-button {
  margin-bottom: 12px;
}

.field-label-with-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
  margin-bottom: .45rem;
}

.field-label-with-action > label {
  margin: 0 auto 0 0 !important;
}

.field-label-with-action .button {
  flex: 0 0 auto;
}

.product-editor-page {
  --editor-field-height: 2.75rem;
  --editor-field-radius: .75rem;
  --editor-field-inner-radius: .55rem;
  --editor-field-shadow: none;
  --editor-field-shadow-focus: 0 0 0 3px rgba(31, 122, 90, 0.08);
  --editor-field-border: rgba(15, 23, 42, 0.08);
  --editor-placeholder: rgba(92, 103, 115, 0.58);
}

html.theme-dark .product-editor-page {
  --editor-field-shadow: none;
  --editor-field-shadow-focus: 0 0 0 3px rgba(86, 195, 142, 0.12);
  --editor-field-border: rgba(148, 163, 184, 0.12);
  --editor-placeholder: rgba(159, 176, 195, 0.62);
}

.product-editor-page #headerSearch {
  margin-bottom: 1rem;
}

.product-editor-page #headerSearch .ui.icon.input > input,
.product-editor-page .ui.form textarea,
.product-editor-page .ui.input input,
.product-editor-page .ui.form input:not([type]),
.product-editor-page .ui.form input[type="text"],
.product-editor-page .ui.form input[type="number"],
.product-editor-page .ui.form input[type="search"],
.product-editor-page .ui.form input[type="password"],
.product-editor-page .ui.form select,
.product-editor-page .ui.selection.dropdown,
.product-editor-page .ui.fluid.selection.dropdown {
  border-radius: var(--editor-field-radius, .75rem) !important;
  box-shadow: var(--editor-field-shadow) !important;
  border-color: var(--editor-field-border) !important;
}

.product-editor-page .ui.input input,
.product-editor-page .ui.form input:not([type]),
.product-editor-page .ui.form input[type="text"],
.product-editor-page .ui.form input[type="number"],
.product-editor-page .ui.form input[type="search"],
.product-editor-page .ui.form input[type="password"],
.product-editor-page .ui.form select,
.product-editor-page .ui.selection.dropdown {
  min-height: var(--editor-field-height, 2.75rem) !important;
}

.product-editor-page #headerSearch .ui.icon.input > input {
  border-radius: 999px !important;
  padding-right: 3.2rem !important;
}

.product-editor-page .ui.input input::placeholder,
.product-editor-page .ui.form input::placeholder,
.product-editor-page .ui.form textarea::placeholder,
.product-editor-page .ui.selection.dropdown > .default.text,
.product-editor-page .ui.multiple.dropdown > .default.text {
  color: var(--editor-placeholder) !important;
  font-weight: 400 !important;
}

.product-editor-page #buttonSearch {
  background: rgba(15, 23, 42, 0.09) !important;
  color: rgba(23, 33, 43, 0.5) !important;
  box-shadow: none !important;
}

html.theme-dark .product-editor-page #buttonSearch {
  background: rgba(148, 163, 184, 0.14) !important;
  color: rgba(231, 237, 245, 0.62) !important;
}

/* Search bar: tuck the search + AI buttons inside the field (like the
   barcode/code actions) instead of attached coloured blocks. */
#headerSearch .ui.action.input {
  position: relative;
}

#headerSearch .ui.action.input > input {
  width: 100% !important;
  padding-right: 5.1rem !important;
  /* The action input squares off the right corners for the (now embedded)
     buttons; restore a full pill so both ends match. */
  border-radius: 999px !important;
}

#headerSearch .ui.action.input > #buttonSearch,
#headerSearch .ui.action.input > #buttonSemanticSearch {
  position: absolute;
  top: 1px;
  bottom: 1px;
  z-index: 2;
  width: 2.35rem !important;
  min-width: 2.35rem !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

#headerSearch .ui.action.input > #buttonSearch {
  right: 2.6rem;
  color: var(--text-secondary) !important;
}

#headerSearch .ui.action.input > #buttonSemanticSearch {
  right: .3rem;
  color: #8b5cf6 !important;
}

#headerSearch .ui.action.input > #buttonSearch > .icon,
#headerSearch .ui.action.input > #buttonSemanticSearch > .icon {
  margin: 0 !important;
  color: inherit !important;
  opacity: .7;
}

#headerSearch .ui.action.input > #buttonSearch:hover,
#headerSearch .ui.action.input > #buttonSearch:focus {
  background: rgba(148, 163, 184, 0.14) !important;
  color: var(--text-primary) !important;
}

#headerSearch .ui.action.input > #buttonSemanticSearch:hover,
#headerSearch .ui.action.input > #buttonSemanticSearch:focus {
  background: rgba(139, 92, 246, 0.16) !important;
  color: #a78bfa !important;
}

.product-editor-page .ui.form input:focus,
.product-editor-page .ui.form textarea:focus,
.product-editor-page .ui.selection.dropdown.active,
.product-editor-page .ui.selection.active.dropdown {
  border-color: rgba(31, 122, 90, 0.22) !important;
  box-shadow: var(--editor-field-shadow), var(--editor-field-shadow-focus) !important;
}

html.theme-dark .product-editor-page .ui.form input:focus,
html.theme-dark .product-editor-page .ui.form textarea:focus,
html.theme-dark .product-editor-page .ui.selection.dropdown.active,
html.theme-dark .product-editor-page .ui.selection.active.dropdown {
  border-color: rgba(86, 195, 142, 0.32) !important;
}

/* The group prefix (#precode) shares a .field with the code input, so a
   "Код вже зайнятий" error puts .field.error on it too — which would tint
   the prefix dropdown (and its selected item) with Fomantic's pink error
   colour. The prefix isn't the invalid value, so keep it neutral. */
.product-editor-page .field.error #precode,
.product-editor-page .field.error #precode > .text {
  background: transparent !important;
  border-color: var(--editor-field-border) !important;
  color: var(--text-primary) !important;
}

.product-editor-page .field.error #precode .menu > .item,
.product-editor-page .field.error #precode .menu > .item.selected,
.product-editor-page .field.error #precode .menu > .item.active.selected {
  background: transparent !important;
  color: var(--text-primary) !important;
}

.product-editor-page .field.error #precode .menu > .item.selected,
.product-editor-page .field.error #precode .menu > .item.active.selected,
.product-editor-page .field.error #precode .menu > .item:hover {
  background: var(--surface-strong) !important;
}

.product-editor-page .ui.label,
.product-editor-page .ui.basic.label {
  background: var(--surface-muted) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

.product-editor-page .ui.multiple.dropdown > .label {
  background: var(--surface-strong) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: .55rem !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  margin: .18rem .28rem .18rem 0 !important;
  padding: .45rem .7rem !important;
}

#additemform .field-label-with-action,
#updateItemForm .field-label-with-action {
  align-items: flex-end;
  margin-bottom: .55rem;
}

#additemform .ai-action-button,
#updateItemForm .ai-action-button {
  border-radius: .55rem !important;
  box-shadow: none !important;
  min-width: 6.75rem;
}

#additemform .barcode-action-input,
#updateItemForm .barcode-action-input {
  position: relative;
  width: 100%;
}

#additemform .barcode-action-input > input,
#updateItemForm .barcode-action-input > input {
  width: 100% !important;
  padding-right: 5.35rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
}

#updateItemForm .barcode-action-input.keycrm-action-input > input {
  padding-right: 7.7rem !important;
}

#additemform .barcode-action-input > .ui.icon.button,
#updateItemForm .barcode-action-input > .ui.icon.button {
  position: absolute;
  top: 1px;
  bottom: 1px;
  z-index: 2;
  width: 2.35rem;
  min-width: 2.35rem;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

#additemform .barcode-action-input > .ui.icon.button > .icon,
#updateItemForm .barcode-action-input > .ui.icon.button > .icon {
  margin: 0 !important;
  color: inherit !important;
  opacity: .58;
}

#additemform .barcode-action-input > #generateBarcode,
#updateItemForm .barcode-action-input > #generateBarcode {
  right: 2.6rem;
}

#additemform .barcode-action-input > #openAdditionalBarcodes,
#updateItemForm .barcode-action-input > #openAdditionalBarcodes {
  right: .25rem;
}

#updateItemForm .barcode-action-input.keycrm-action-input > #generateBarcode {
  right: 4.95rem;
}

#updateItemForm .barcode-action-input.keycrm-action-input > #openAdditionalBarcodes {
  right: 2.6rem;
}

#updateItemForm .barcode-action-input.keycrm-action-input > #openKeycrmCodes {
  right: .25rem;
}

#additemform .barcode-action-input > .ui.icon.button:hover,
#additemform .barcode-action-input > .ui.icon.button:focus,
#updateItemForm .barcode-action-input > .ui.icon.button:hover,
#updateItemForm .barcode-action-input > .ui.icon.button:focus {
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--text-primary) !important;
}

html.theme-dark #additemform .barcode-action-input > .ui.icon.button:hover,
html.theme-dark #additemform .barcode-action-input > .ui.icon.button:focus,
html.theme-dark #updateItemForm .barcode-action-input > .ui.icon.button:hover,
html.theme-dark #updateItemForm .barcode-action-input > .ui.icon.button:focus {
  background: rgba(148, 163, 184, 0.12) !important;
}

#additemform .barcode-action-input > .ui.icon.button.loading,
#updateItemForm .barcode-action-input > .ui.icon.button.loading {
  color: transparent !important;
}

/* Generate-code button embedded inside the code input, same as the barcode
   actions: the prefix label sits on the left, the code fills the middle and
   the random/generate button is tucked into the right edge of the field. */
#additemform #allCodeHolder.code-action-input {
  position: relative;
  width: 100%;
}

#additemform #allCodeHolder.code-action-input > input#codenumber {
  padding-right: 2.85rem !important;
}

#additemform #allCodeHolder.code-action-input > #btn-pick-free {
  position: absolute;
  top: 1px;
  bottom: 1px;
  right: .3rem;
  z-index: 2;
  width: 2.35rem !important;
  min-width: 2.35rem !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

#additemform #allCodeHolder.code-action-input > #btn-pick-free > .icon {
  margin: 0 !important;
  color: inherit !important;
  opacity: .58;
}

#additemform #allCodeHolder.code-action-input > #btn-pick-free:hover,
#additemform #allCodeHolder.code-action-input > #btn-pick-free:focus {
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--text-primary) !important;
}

html.theme-dark #additemform #allCodeHolder.code-action-input > #btn-pick-free:hover,
html.theme-dark #additemform #allCodeHolder.code-action-input > #btn-pick-free:focus {
  background: rgba(148, 163, 184, 0.12) !important;
}

#additemform #itemname-count,
#updateItemForm #itemname-count {
  display: block;
  margin-top: .35rem;
  text-align: right;
  font-size: .78rem;
  line-height: 1.2;
  color: var(--text-secondary);
}

#additemform #itemname-warning,
#updateItemForm #itemname-warning {
  margin-top: .3rem;
  font-size: .82rem;
}

#additemform textarea,
#updateItemForm textarea {
  min-height: 5.5rem;
  resize: vertical;
}

#additemform .ui.dropdown,
#updateItemForm .ui.dropdown {
  min-height: var(--editor-field-height, 2.75rem);
}

#additemform .ui.input,
#updateItemForm .ui.input,
#additemform .ui.selection.dropdown,
#updateItemForm .ui.selection.dropdown,
#additemform .ui.button.fluid,
#updateItemForm .ui.button.fluid {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#additemform .ui.input,
#updateItemForm .ui.input {
  min-height: var(--editor-field-height, 2.75rem);
}

#additemform .ui.left.icon.input,
#updateItemForm .ui.left.icon.input {
  position: relative;
  width: 100%;
}

#additemform .ui.left.icon.input > input,
#updateItemForm .ui.left.icon.input > input {
  width: 100% !important;
  padding-left: 3.05rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
}

#additemform .ui.left.icon.input > textarea,
#updateItemForm .ui.left.icon.input > textarea {
  width: 100% !important;
  padding-left: 3.05rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
  box-sizing: border-box;
}

#additemform .ui.left.icon.input > i.icon,
#updateItemForm .ui.left.icon.input > i.icon,
#additemform .ui.right.labeled.left.icon.input > i.icon,
#updateItemForm .ui.right.labeled.left.icon.input > i.icon {
  position: absolute;
  top: 50%;
  left: .85rem;
  z-index: 2;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1 !important;
  color: var(--text-secondary) !important;
  opacity: .72;
  transform: translateY(-50%);
  pointer-events: none;
}

#additemform .ui.right.labeled.left.icon.input > input,
#updateItemForm .ui.right.labeled.left.icon.input > input {
  padding-left: 3.05rem !important;
}

#additemform .ui.left.labeled.input > .ui.label,
#updateItemForm .ui.left.labeled.input > .ui.label,
#additemform .ui.right.labeled.input > .ui.label,
#updateItemForm .ui.right.labeled.input > .ui.label,
#additemform .ui.right.labeled.left.icon.input > .ui.label,
#updateItemForm .ui.right.labeled.left.icon.input > .ui.label {
  min-width: 3.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .8rem !important;
  line-height: 1 !important;
  font-weight: 700;
}

#additemform .ui.left.labeled.input,
#updateItemForm .ui.left.labeled.input {
  position: relative;
  width: 100%;
}

#additemform #allCodeHolder,
#updateItemForm #allCodeHolder {
  min-height: var(--editor-field-height, 2.75rem);
}

#additemform #allCodeHolder > #precode,
#updateItemForm #allCodeHolder > #precode {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 1px;
  z-index: 3;
  min-width: 4rem;
  display: flex;
  align-items: center;
  gap: .2rem;
  margin: 0 !important;
  padding: 0 .7rem !important;
  border: 0 !important;
  border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-weight: 700;
  line-height: 1 !important;
  box-shadow: none !important;
}

#additemform #allCodeHolder > #precode > .text,
#updateItemForm #allCodeHolder > #precode > .text {
  min-width: 2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#additemform #allCodeHolder > #precode > .dropdown.icon,
#updateItemForm #allCodeHolder > #precode > .dropdown.icon {
  position: static;
  width: auto;
  height: auto;
  margin: 0 !important;
  transform: none;
}

#additemform #allCodeHolder > #precode + input,
#updateItemForm #allCodeHolder > #precode + input {
  width: 100% !important;
  padding-left: 4.85rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
}

#additemform .ui.left.labeled.input > label.ui.label,
#updateItemForm .ui.left.labeled.input > label.ui.label,
#additemform .ui.right.labeled.left.icon.input > .ui.basic.label,
#updateItemForm .ui.right.labeled.left.icon.input > .ui.basic.label {
  position: absolute;
  top: 1px;
  bottom: 1px;
  z-index: 2;
  margin: 0 !important;
  border: 0 !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
}

#additemform .ui.left.labeled.input > label.ui.label,
#updateItemForm .ui.left.labeled.input > label.ui.label {
  left: 1px;
  border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
}

#additemform .ui.left.labeled.input > label.ui.label + input,
#updateItemForm .ui.left.labeled.input > label.ui.label + input {
  width: 100% !important;
  padding-left: 4.1rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
}

#additemform .price-calculator-input > label.ui.label + input,
#updateItemForm .price-calculator-input > label.ui.label + input {
  padding-right: 2.95rem !important;
}

#additemform .price-calculator-input > .retail-price-calculator,
#updateItemForm .price-calculator-input > .retail-price-calculator {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  z-index: 2;
  width: 2.45rem;
  min-width: 2.45rem;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

#additemform .price-calculator-input > .retail-price-calculator > .icon,
#updateItemForm .price-calculator-input > .retail-price-calculator > .icon {
  margin: 0 !important;
  color: inherit !important;
  opacity: .62;
}

#additemform .price-calculator-input > .retail-price-calculator:hover,
#additemform .price-calculator-input > .retail-price-calculator:focus,
#updateItemForm .price-calculator-input > .retail-price-calculator:hover,
#updateItemForm .price-calculator-input > .retail-price-calculator:focus {
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--text-primary) !important;
}

html.theme-dark #additemform .price-calculator-input > .retail-price-calculator:hover,
html.theme-dark #additemform .price-calculator-input > .retail-price-calculator:focus,
html.theme-dark #updateItemForm .price-calculator-input > .retail-price-calculator:hover,
html.theme-dark #updateItemForm .price-calculator-input > .retail-price-calculator:focus {
  background: rgba(148, 163, 184, 0.12) !important;
}

.ui.popup.retail-price-calculator-popup {
  width: 14rem;
  max-width: calc(100vw - 2rem);
  padding: .9rem !important;
  box-sizing: border-box;
}

.retail-price-calculator-content,
.retail-price-calculator-content .ui.form,
.retail-price-calculator-content .ui.form .field,
.retail-price-calculator-content .retail-price-markup-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.retail-price-calculator-content .ui.form .field {
  margin-bottom: .65rem;
}

.retail-price-calculator-content .retail-price-markup-input {
  position: relative;
  display: block;
}

.retail-price-calculator-content .retail-price-markup-input > input.retail-price-markup {
  width: 100% !important;
  padding-right: 3.15rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
  box-sizing: border-box;
}

.retail-price-calculator-content .retail-price-markup-input > .ui.basic.label {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  z-index: 2;
  min-width: 2.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 .65rem !important;
  border: 0 !important;
  border-left: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  line-height: 1 !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

.retail-price-calculator-content .retail-price-calculator-error {
  margin: -.1rem 0 .65rem;
  color: #b91c1c;
  font-size: .82rem;
  line-height: 1.25;
}

html.theme-dark .retail-price-calculator-content .retail-price-calculator-error {
  color: #fca5a5;
}

html.theme-dark .retail-price-calculator-content .retail-price-markup-input > .ui.basic.label {
  border-left-color: rgba(148, 163, 184, 0.14) !important;
}

#additemform .ui.right.labeled.left.icon.input,
#updateItemForm .ui.right.labeled.left.icon.input {
  position: relative;
  width: 100%;
}

#additemform .ui.right.labeled.left.icon.input > input,
#updateItemForm .ui.right.labeled.left.icon.input > input {
  width: 100% !important;
  padding-right: 6.35rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
}

#additemform .ui.right.labeled.left.icon.input > input#itemlength,
#additemform .ui.right.labeled.left.icon.input > input#itemwidth,
#additemform .ui.right.labeled.left.icon.input > input#itemheight,
#additemform .ui.right.labeled.left.icon.input > input#itemcbm,
#additemform .ui.right.labeled.left.icon.input > input#itemweight,
#updateItemForm .ui.right.labeled.left.icon.input > input#itemlength,
#updateItemForm .ui.right.labeled.left.icon.input > input#itemwidth,
#updateItemForm .ui.right.labeled.left.icon.input > input#itemheight,
#updateItemForm .ui.right.labeled.left.icon.input > input#itemcbm,
#updateItemForm .ui.right.labeled.left.icon.input > input#itemweight {
  padding-right: 3.75rem !important;
}

#additemform .ui.right.labeled.left.icon.input.volume-calculator-input > input#itemcbm,
#updateItemForm .ui.right.labeled.left.icon.input.volume-calculator-input > input#itemcbm {
  padding-right: 6.3rem !important;
}

#additemform .ui.right.labeled.left.icon.input > .ui.basic.label,
#updateItemForm .ui.right.labeled.left.icon.input > .ui.basic.label {
  right: 1px;
  max-width: 5.9rem;
  border-left: 1px solid rgba(15, 23, 42, 0.08) !important;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
  font-size: .78rem;
  line-height: 1.05 !important;
}

html.theme-dark #additemform .ui.left.labeled.input > label.ui.label,
html.theme-dark #updateItemForm .ui.left.labeled.input > label.ui.label {
  border-right-color: rgba(148, 163, 184, 0.14) !important;
}

html.theme-dark #additemform #allCodeHolder > #precode,
html.theme-dark #updateItemForm #allCodeHolder > #precode {
  border-right-color: rgba(148, 163, 184, 0.14) !important;
}

html.theme-dark #additemform .ui.right.labeled.left.icon.input > .ui.basic.label,
html.theme-dark #updateItemForm .ui.right.labeled.left.icon.input > .ui.basic.label {
  border-left-color: rgba(148, 163, 184, 0.14) !important;
}

#additemform #brands.ui.dropdown > .text,
#updateItemForm #brands.ui.dropdown > .text,
#additemform #brands.ui.dropdown .menu > .item,
#updateItemForm #brands.ui.dropdown .menu > .item {
  display: flex;
  align-items: center;
  gap: .65rem;
}

#additemform #brands.ui.dropdown,
#updateItemForm #brands.ui.dropdown,
#additemform #suppliers.ui.dropdown,
#updateItemForm #suppliers.ui.dropdown,
#additemform #itemrank.ui.dropdown,
#updateItemForm #itemrank.ui.dropdown,
#additemform #itemStatus.ui.dropdown,
#updateItemForm #itemStatus.ui.dropdown {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  min-height: var(--editor-field-height, 2.75rem);
  height: var(--editor-field-height, 2.75rem);
  padding-top: .72rem !important;
  padding-bottom: .72rem !important;
}

#additemform #brands.ui.search.dropdown > input.search,
#updateItemForm #brands.ui.search.dropdown > input.search,
#additemform #suppliers.ui.search.dropdown > input.search,
#updateItemForm #suppliers.ui.search.dropdown > input.search,
#additemform #itemStatus.ui.search.dropdown > input.search,
#updateItemForm #itemStatus.ui.search.dropdown > input.search {
  min-height: var(--editor-field-height, 2.75rem) !important;
  height: var(--editor-field-height, 2.75rem) !important;
  padding-top: .72rem !important;
  padding-bottom: .72rem !important;
}

#additemform #brands.ui.dropdown > .dropdown.icon,
#updateItemForm #brands.ui.dropdown > .dropdown.icon,
#additemform #suppliers.ui.dropdown > .dropdown.icon,
#updateItemForm #suppliers.ui.dropdown > .dropdown.icon,
#additemform #itemrank.ui.dropdown > .dropdown.icon,
#updateItemForm #itemrank.ui.dropdown > .dropdown.icon,
#additemform #itemStatus.ui.dropdown > .dropdown.icon,
#updateItemForm #itemStatus.ui.dropdown > .dropdown.icon {
  top: 50%;
  right: .8rem;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
  transform: translateY(-50%);
}

#additemform #brands.ui.dropdown > .text,
#updateItemForm #brands.ui.dropdown > .text,
#additemform #suppliers.ui.dropdown > .text,
#updateItemForm #suppliers.ui.dropdown > .text,
#additemform #itemrank.ui.dropdown > .text,
#updateItemForm #itemrank.ui.dropdown > .text,
#additemform #itemStatus.ui.dropdown > .text,
#updateItemForm #itemStatus.ui.dropdown > .text {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: auto;
  min-width: 0;
  max-width: 100%;
  padding-right: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#additemform #brands.ui.dropdown .menu,
#updateItemForm #brands.ui.dropdown .menu,
#additemform #suppliers.ui.dropdown .menu,
#updateItemForm #suppliers.ui.dropdown .menu {
  width: max-content !important;
  min-width: 100% !important;
  max-width: min(32rem, calc(100vw - 3rem)) !important;
}

#additemform #brands.ui.dropdown .menu > .item,
#updateItemForm #brands.ui.dropdown .menu > .item,
#additemform #suppliers.ui.dropdown .menu > .item,
#updateItemForm #suppliers.ui.dropdown .menu > .item {
  min-height: 2.8rem;
  white-space: nowrap;
}

#additemform #brands.ui.dropdown > .text img.ui.avatar.image,
#updateItemForm #brands.ui.dropdown > .text img.ui.avatar.image,
#additemform #brands.ui.dropdown .menu > .item img.ui.avatar.image,
#updateItemForm #brands.ui.dropdown .menu > .item img.ui.avatar.image {
  width: 2.6rem !important;
  height: 1.35rem !important;
  min-width: 2.6rem;
  object-fit: contain;
  object-position: center;
  border-radius: .4rem;
  background: rgba(255, 255, 255, 0.92);
  padding: .15rem;
  box-shadow: none !important;
}

html.theme-dark #additemform #brands.ui.dropdown .menu > .selected.item,
html.theme-dark #updateItemForm #brands.ui.dropdown .menu > .selected.item {
  background: rgba(86, 195, 142, 0.16) !important;
  color: var(--text-primary) !important;
}

#additemform #propertiesDropDown.ui.dropdown .menu,
#updateItemForm #propertiesDropDown.ui.dropdown .menu {
  max-width: min(32rem, calc(100vw - 3rem)) !important;
}

html.theme-dark #additemform #propertiesDropDown.ui.dropdown,
html.theme-dark #updateItemForm #propertiesDropDown.ui.dropdown {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
}

html.theme-dark #additemform #propertiesDropDown.ui.dropdown .menu > .selected.item,
html.theme-dark #updateItemForm #propertiesDropDown.ui.dropdown .menu > .selected.item {
  background: rgba(86, 195, 142, 0.16) !important;
  color: var(--text-primary) !important;
}

html.theme-dark #additemform #propertiesDropDown.ui.multiple.dropdown > .label,
html.theme-dark #updateItemForm #propertiesDropDown.ui.multiple.dropdown > .label {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  box-shadow: none !important;
}

html.theme-dark #additemform #propertiesDropDown.ui.multiple.dropdown > .label > .delete.icon,
html.theme-dark #updateItemForm #propertiesDropDown.ui.multiple.dropdown > .label > .delete.icon {
  color: var(--text-secondary) !important;
}

html.theme-dark #additemform #propertiesDropDown.ui.multiple.dropdown > .label > .delete.icon:hover,
html.theme-dark #updateItemForm #propertiesDropDown.ui.multiple.dropdown > .label > .delete.icon:hover {
  color: var(--text-primary) !important;
}

#additemform #convertToCbm,
#updateItemForm #convertToCbm {
  position: absolute;
  top: 1px;
  right: 3.05rem;
  bottom: 1px;
  z-index: 3;
  width: 2.45rem;
  min-width: 2.45rem;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-left: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: var(--editor-field-inner-radius, .55rem) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

#additemform #convertToCbm > .icon,
#updateItemForm #convertToCbm > .icon {
  margin: 0 !important;
  color: inherit !important;
  opacity: .68;
}

#additemform #convertToCbm:hover,
#additemform #convertToCbm:focus,
#updateItemForm #convertToCbm:hover,
#updateItemForm #convertToCbm:focus {
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--text-primary) !important;
}

html.theme-dark #additemform #convertToCbm,
html.theme-dark #updateItemForm #convertToCbm {
  border-left-color: rgba(148, 163, 184, 0.14) !important;
}

html.theme-dark #additemform #convertToCbm:hover,
html.theme-dark #additemform #convertToCbm:focus,
html.theme-dark #updateItemForm #convertToCbm:hover,
html.theme-dark #updateItemForm #convertToCbm:focus {
  background: rgba(148, 163, 184, 0.12) !important;
}

#additemform #selectCategory,
#additemform #selectCategory1c,
#additemform #selectProperties,
#updateItemForm #selectCategory,
#updateItemForm #selectCategory1c,
#updateItemForm #selectProperties {
  min-height: var(--editor-field-height, 2.75rem) !important;
  height: var(--editor-field-height, 2.75rem) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 .95rem 0 3.05rem !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
  box-shadow: var(--editor-field-shadow) !important;
}

#additemform #createKeycrmProduct,
#updateItemForm #openKeycrmCodes,
#updateItemForm #openWarehouseCells,
#updateItemForm #openShelfLimits,
#updateItemForm #updateKeycrmProduct,
#additemform #btn-pick-free,
#updateItemForm #btn-pick-free {
  min-height: var(--editor-field-height, 2.75rem) !important;
  height: var(--editor-field-height, 2.75rem) !important;
  border-radius: var(--editor-field-radius, .75rem) !important;
  box-shadow: var(--editor-field-shadow) !important;
}

#additemform #createKeycrmProduct > .icon,
#updateItemForm #openKeycrmCodes > .icon,
#updateItemForm #openWarehouseCells > .icon,
#updateItemForm #openShelfLimits > .icon,
#updateItemForm #updateKeycrmProduct > .icon,
#additemform #btn-pick-free > .icon,
#updateItemForm #btn-pick-free > .icon {
  margin: 0 !important;
}

#additemform .fields > .field,
#updateItemForm .fields > .field {
  min-width: 0;
}

.items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: .35rem 0 .9rem;
}

.items-toolbar-left,
.items-toolbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
}

.items-toolbar-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.items-range-filter {
  display: flex;
  align-items: flex-end;
  gap: .7rem;
  flex-wrap: wrap;
  margin: -.25rem 0 1rem;
  padding: .7rem;
  border: 1px solid var(--border-color);
  border-radius: .75rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.items-range-filter-group {
  min-width: 8.6rem;
  flex: 1 1 9.4rem;
}

.items-range-filter-group label {
  display: block;
  margin: 0 0 .28rem;
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
}

.items-range-filter-group input {
  width: 100%;
  min-height: 2.55rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border-color);
  border-radius: .55rem;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, .04);
}

.items-range-filter-group input:focus {
  border-color: rgba(31, 122, 90, .45);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(31, 122, 90, .12);
}

.items-range-filter-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 0 0 auto;
}

.items-range-filter-actions .ui.button {
  min-height: 2.55rem;
  margin: 0;
}

.items-property-sidebar .items-range-filter {
  display: block;
  margin: .75rem 0 0;
  padding: .75rem 0 0;
  border: 0;
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.items-sidebar-filter-title,
.items-price-range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 .52rem;
  color: var(--text-primary);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
}

.items-price-range-header label {
  margin: 0;
  font: inherit;
}

.items-price-range-header .icon {
  margin: 0 !important;
  color: var(--text-secondary);
  font-size: .8rem;
}

.items-date-range-filter {
  margin-bottom: .85rem;
}

.items-date-range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}

.items-property-sidebar .items-range-filter-group {
  min-width: 0;
  margin-bottom: 0;
}

.items-property-sidebar .items-range-filter-group input {
  min-height: 2.32rem;
  padding: .55rem .62rem;
  font-size: .9rem;
}

.items-price-range-filter {
  margin-bottom: .8rem;
}

.items-price-range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .45rem;
  margin-bottom: .65rem;
}

.items-price-range-inputs input {
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  padding: .5rem .58rem;
  border: 1px solid var(--border-color);
  border-radius: .55rem;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, .04);
}

.items-price-range-inputs span {
  color: var(--text-secondary);
  font-weight: 700;
}

.items-price-slider {
  position: relative;
  height: 1.65rem;
  margin: .15rem .16rem .2rem;
}

.items-price-slider::before,
.items-price-slider-track {
  position: absolute;
  top: 50%;
  height: .2rem;
  border-radius: 999px;
  transform: translateY(-50%);
}

.items-price-slider::before {
  content: '';
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, .14);
}

.items-price-slider-track {
  left: 0;
  right: 0;
  background: #1fb968;
}

.items-price-range-control {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 1.65rem;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
}

.items-price-range-control::-webkit-slider-runnable-track {
  height: .2rem;
  background: transparent;
  border: 0;
}

.items-price-range-control::-moz-range-track {
  height: .2rem;
  background: transparent;
  border: 0;
}

.items-price-range-control::-webkit-slider-thumb {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: -.52rem;
  border: 0;
  border-radius: 999px;
  background: #1fb968;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
}

.items-price-range-control::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border: 0;
  border-radius: 999px;
  background: #1fb968;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
  cursor: pointer;
  pointer-events: auto;
}

.items-price-range-control:focus {
  outline: 0;
}

.items-price-range-control:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(31, 185, 104, .16);
}

.items-price-range-control:focus::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(31, 185, 104, .16);
}

.items-property-sidebar .items-range-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}

.items-property-sidebar .items-range-filter-actions .ui.button {
  min-height: 2.32rem;
  padding: .55rem .45rem;
  font-size: .86rem;
}

.items-property-sidebar .items-range-filter-actions .ui.button > .icon {
  margin-right: .28rem !important;
}

.items-footer-pagination.ui.basic.segment {
  padding: .75rem 0 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.items-main-layout {
  display: grid;
  grid-template-columns: minmax(15.5rem, 18rem) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  transition: grid-template-columns .18s ease;
}

.items-main-layout.is-property-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.items-results-pane {
  min-width: 0;
}

.items-property-sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: .64rem;
  border: 1px solid var(--border-color);
  border-radius: .9rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: padding .18s ease, max-height .18s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 103, 115, 0.26) transparent;
}

.items-property-sidebar::-webkit-scrollbar {
  width: .35rem;
}

.items-property-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.items-property-sidebar::-webkit-scrollbar-thumb {
  background: rgba(92, 103, 115, 0.26);
  border-radius: 999px;
}

html.theme-dark .items-property-sidebar {
  scrollbar-color: rgba(159, 176, 195, 0.28) transparent;
}

html.theme-dark .items-property-sidebar::-webkit-scrollbar-thumb {
  background: rgba(159, 176, 195, 0.28);
}

.items-property-sidebar.is-collapsed {
  display: none;
}

.items-property-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border-color);
}

.items-property-toolbar-toggle {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: .55rem;
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(16,24,40,.06);
  cursor: pointer;
}

.items-property-toolbar-toggle:hover,
.items-property-toolbar-toggle.is-active {
  background: var(--surface-strong);
  color: var(--text-primary);
}

.items-property-toolbar-toggle.is-active {
  border-color: rgba(31, 122, 90, 0.28);
  background: var(--accent-soft);
}

.items-property-toolbar-toggle .icon {
  margin: 0 !important;
}

.search-property-filter-row {
  display: flex;
  align-items: stretch;
  gap: .75rem;
  width: 100%;
}

.search-property-filter-row .items-property-toolbar-toggle {
  flex: 0 0 auto;
  min-height: 3rem;
  white-space: nowrap;
}

.search-property-filter-row .filterCode.ui.dropdown {
  flex: 1 1 11rem;
  min-width: 9.5rem;
  max-width: 100%;
  min-height: 3rem;
  display: flex;
  align-items: center;
  padding-right: 2.6rem !important;
}

.search-property-filter-row .filterCode.ui.dropdown > .text {
  display: block;
  max-width: 100%;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-property-filter-row .filterCode.ui.dropdown > .dropdown.icon {
  position: absolute !important;
  top: 50%;
  right: .8rem;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
  transform: translateY(-50%);
}

.items-property-sidebar-title {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
}

.items-property-sidebar-summary {
  margin-top: .2rem;
  color: var(--text-secondary);
  font-size: .82rem;
}

.items-property-active {
  margin-bottom: .65rem;
}

.items-property-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .35rem;
}

.items-property-actions.has-reset {
  grid-template-columns: 1fr auto;
}

.items-property-apply,
.items-property-reset {
  width: 100%;
  min-height: 2.1rem;
  padding: .38rem .6rem;
  border: 1px solid rgba(31, 122, 90, 0.22);
  border-radius: .65rem;
  background: var(--accent-soft);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
}

.items-property-reset {
  width: auto;
  border-color: var(--border-color);
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.items-property-list {
  display: flex;
  flex-direction: column;
  gap: .12rem;
}

.items-property-node {
  min-width: 0;
}

.items-property-row {
  display: flex;
  align-items: flex-start;
  gap: .12rem;
  min-width: 0;
}

.items-property-toggle,
.items-property-toggle-spacer {
  width: .92rem;
  min-width: .92rem;
  height: 1.78rem;
}

.items-property-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.items-property-toggle:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.items-property-toggle .dropdown.icon {
  margin: 0 !important;
  transform: rotate(-90deg);
  transition: transform .16s ease;
}

.items-property-toggle.is-expanded .dropdown.icon {
  transform: rotate(0deg);
}

.items-property-option,
.items-property-group {
  width: 100%;
  min-height: 1.78rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .38rem;
  padding: .28rem .38rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.items-property-option {
  cursor: default;
  font-weight: 500;
}

.items-property-group {
  color: var(--text-secondary);
  font-weight: 700;
}

.items-property-option:hover,
.items-property-group:hover {
  background: var(--surface-muted);
  border-color: var(--border-color);
}

.items-property-option.is-selected {
  background: var(--accent-soft);
  border-color: rgba(31, 122, 90, 0.24);
  font-weight: 700;
}

.items-property-option.is-add {
  border-color: rgba(24, 100, 171, 0.24);
  background: rgba(24, 100, 171, 0.1);
}

.items-property-check {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: .34rem;
  flex: 1 1 auto;
  cursor: pointer;
}

.items-property-checkbox {
  width: .88rem;
  min-width: .88rem;
  height: .88rem;
  margin: .12rem 0 0;
}

.items-property-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.2;
}

.items-property-option-actions {
  display: flex;
  align-items: center;
  gap: .22rem;
  flex: 0 0 auto;
}

.items-property-mode-toggle {
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.items-property-mode-icon {
  width: .78rem;
  height: .78rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.items-property-mode-toggle.is-filter {
  border-color: rgba(31, 122, 90, 0.28);
  background: var(--accent-soft);
  color: var(--text-primary);
}

.items-property-mode-toggle.is-add {
  border-color: rgba(24, 100, 171, 0.28);
  background: rgba(24, 100, 171, 0.14);
  color: var(--text-primary);
}

.items-property-option-count {
  flex: 0 0 auto;
  min-width: 1.45rem;
  padding: .08rem .32rem;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
}

.items-property-children {
  margin-left: .62rem;
  padding-left: .32rem;
  border-left: 1px solid rgba(148, 163, 184, 0.24);
}

.items-property-node.depth-1 .items-property-option,
.items-property-node.depth-1 .items-property-group {
  min-height: 1.76rem;
}

.items-property-node.depth-2 .items-property-option,
.items-property-node.depth-2 .items-property-group {
  min-height: 1.72rem;
  font-size: .92rem;
}

.items-property-empty {
  padding: .75rem .2rem;
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.35;
}

html.theme-dark .items-property-sidebar {
  background: var(--surface) !important;
}

html.theme-dark .items-property-reset {
  border-color: rgba(86, 195, 142, 0.28);
}

html.theme-dark .items-property-toolbar-toggle.is-active {
  border-color: rgba(86, 195, 142, 0.32);
}

html.theme-dark .items-property-option.is-add {
  border-color: rgba(128, 199, 255, 0.24);
  background: rgba(128, 199, 255, 0.12);
}

html.theme-dark .items-property-mode-toggle.is-add {
  border-color: rgba(128, 199, 255, 0.28);
  background: rgba(128, 199, 255, 0.14);
}

html.theme-dark .items-property-children {
  border-left-color: rgba(148, 163, 184, 0.22);
}

.items-toolbar-control.ui.dropdown {
  min-width: 10rem;
  max-width: none;
  min-height: 3rem;
  padding: .8rem 2.6rem .8rem 1rem !important;
  display: flex;
  align-items: center;
  border-radius: .55rem;
  box-shadow: 0 1px 2px rgba(16,24,40,.06);
  font-size: 1rem !important;
}

.items-toolbar-control.ui.dropdown > .text {
  display: block;
  max-width: 100%;
  line-height: 1.15;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.items-toolbar-control.ui.dropdown > .dropdown.icon {
  width: 2.4rem;
  height: 100%;
  top: 50%;
  left: .9rem;
  margin: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.items-toolbar-control-wide.ui.dropdown,
.items-toolbar-control-wide.filterCategory1c {
  min-width: 17rem;
  max-width: 22rem;
}

.items-toolbar-control-small.ui.dropdown {
  min-width: 8rem;
}

.items-search-pagination-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .5rem 0 .25rem;
}

.items-search-pagination-bar .pagePagination.pagination.ui.menu {
  flex: 1 1 auto;
}

.pagePagination.pagination.ui.menu {
  margin: 0;
  min-height: 2.65rem;
  display: inline-flex;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: center;
  padding: .25rem;
  background: var(--surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-soft);
}

.pagePagination.pagination.ui.menu:empty {
  display: none !important;
}

.items-toolbar-center:empty,
.items-footer-pagination:empty {
  display: none !important;
}

.pagePagination.pagination.ui.menu .item {
  min-height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.45rem;
  border-radius: .65rem !important;
  margin: 0 .08rem !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.pagePagination.pagination.ui.menu .item:hover {
  background: var(--surface-muted) !important;
  border-color: var(--border-color) !important;
}

.pagePagination.pagination.ui.menu .active.item,
.pagePagination.pagination.ui.menu .item.active {
  background: var(--surface-strong) !important;
  border-color: rgba(31, 122, 90, 0.28) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 90, 0.08);
}

html.theme-dark .pagePagination.pagination.ui.menu .active.item,
html.theme-dark .pagePagination.pagination.ui.menu .item.active {
  background: rgba(86, 195, 142, 0.14) !important;
  border-color: rgba(86, 195, 142, 0.32) !important;
  box-shadow: inset 0 0 0 1px rgba(86, 195, 142, 0.08);
}

.filterCategory1c {
  position: relative;
}

.filterCategory1cTrigger {
  width: 100%;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: .95rem;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.filterCategory1cTrigger:hover,
.filterCategory1c.is-open .filterCategory1cTrigger {
  border-color: rgba(31, 122, 90, 0.32);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.filterCategory1cLabel {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.filterCategory1cTrigger .dropdown.icon {
  margin: 0 !important;
  color: var(--text-secondary);
  transition: transform .18s ease;
}

.filterCategory1c.is-open .filterCategory1cTrigger .dropdown.icon {
  transform: rotate(180deg);
}

.filterCategory1cMenu {
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  z-index: 40;
  width: min(54rem, calc(100vw - 2rem));
  display: none;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}

.filterCategory1c.is-open .filterCategory1cMenu {
  display: block;
}

.category1c-mega-menu {
  display: grid;
  grid-template-columns: minmax(15rem, 1.05fr) minmax(16rem, 1.15fr) minmax(16rem, 1.15fr);
  height: 26rem;
  background: var(--surface);
}

.category1c-mega-column {
  padding: .85rem;
  border-right: 1px solid var(--border-color);
  background: var(--surface);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 103, 115, 0.38) transparent;
}

.category1c-mega-column:last-child {
  border-right: 0;
}

.category1c-mega-column-roots {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(244, 247, 250, 0.98) 100%);
}

.category1c-mega-column-middle,
.category1c-mega-column-final {
  background: var(--surface-muted);
}

.category1c-mega-column-title {
  margin-bottom: .55rem;
  padding: .4rem .55rem;
  position: sticky;
  top: 0;
  z-index: 1;
  background: inherit;
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.category1c-mobile-back {
  display: none;
}

.category1c-mega-all,
.category1c-mega-root,
.category1c-mega-child,
.category1c-mega-leaf {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-height: 2.7rem;
  padding: .62rem .75rem;
  border: 0;
  border-radius: .8rem;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.category1c-mega-all:hover,
.category1c-mega-root:hover,
.category1c-mega-child:hover,
.category1c-mega-leaf:hover,
.category1c-mega-root.is-active,
.category1c-mega-child.is-active {
  background: var(--surface-strong);
}

.category1c-mega-all.is-selected,
.category1c-mega-root.is-selected,
.category1c-mega-child.is-selected,
.category1c-mega-leaf.is-selected {
  background: var(--accent-soft);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 90, 0.18);
}

.category1c-mega-root + .category1c-mega-root,
.category1c-mega-child + .category1c-mega-child,
.category1c-mega-leaf + .category1c-mega-leaf {
  margin-top: .12rem;
}

.category1c-mega-option-label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.category1c-mega-root .icon,
.category1c-mega-child .icon,
.category1c-mega-leaf .icon {
  margin: 0 !important;
  color: var(--text-secondary);
  font-size: .95rem;
}

.category1c-mega-empty {
  padding: .8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.category1c-mega-column::-webkit-scrollbar {
  width: .55rem;
}

.category1c-mega-column::-webkit-scrollbar-thumb {
  background: rgba(92, 103, 115, 0.35);
  border-radius: 999px;
}

.category1c-mega-column::-webkit-scrollbar-track {
  background: transparent;
}

html.theme-dark .filterCategory1cMenu {
  border-color: rgba(71, 85, 105, 0.45);
  background: #0f172a;
  color: #e5eef7;
  box-shadow: 0 1.4rem 3rem rgba(2, 6, 23, 0.42);
}

html.theme-dark .category1c-mega-menu {
  background: #0f172a;
}

html.theme-dark .category1c-mega-column {
  border-right-color: rgba(71, 85, 105, 0.35);
  background: #0f172a;
  scrollbar-color: rgba(148, 163, 184, 0.42) transparent;
}

html.theme-dark .category1c-mega-column-roots {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
}

html.theme-dark .category1c-mega-column-middle,
html.theme-dark .category1c-mega-column-final {
  background: rgba(15, 23, 42, 0.96);
}

html.theme-dark .category1c-mega-column-title,
html.theme-dark .category1c-mega-root .icon,
html.theme-dark .category1c-mega-child .icon,
html.theme-dark .category1c-mega-leaf .icon,
html.theme-dark .category1c-mega-empty {
  color: #94a3b8;
}

html.theme-dark .category1c-mega-all,
html.theme-dark .category1c-mega-root,
html.theme-dark .category1c-mega-child,
html.theme-dark .category1c-mega-leaf {
  color: #e2e8f0;
}

html.theme-dark .category1c-mega-all:hover,
html.theme-dark .category1c-mega-root:hover,
html.theme-dark .category1c-mega-child:hover,
html.theme-dark .category1c-mega-leaf:hover,
html.theme-dark .category1c-mega-root.is-active,
html.theme-dark .category1c-mega-child.is-active {
  background: rgba(30, 41, 59, 0.96);
}

html.theme-dark .category1c-mega-all.is-selected,
html.theme-dark .category1c-mega-root.is-selected,
html.theme-dark .category1c-mega-child.is-selected,
html.theme-dark .category1c-mega-leaf.is-selected {
  background: rgba(16, 185, 129, 0.18);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.28);
}

html.theme-dark .category1c-mega-column::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
}

@media (max-width: 980px) {
  .filterCategory1cMenu {
    width: min(32rem, calc(100vw - 1rem));
    left: auto;
    right: 0;
  }

  .category1c-mega-menu {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: none;
  }

  .category1c-mega-column {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    max-height: 12rem;
  }

  .category1c-mega-column:last-child {
    border-bottom: 0;
  }
}

.category1c-tree-scroll {
  max-height: 26rem;
  overflow: auto;
  padding: .55rem;
}

.category1c-tree-all,
.category1c-tree-option {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 2.35rem;
  padding: .5rem .75rem;
  border: 0;
  border-radius: .75rem;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}

.category1c-tree-all:hover,
.category1c-tree-option:hover,
.category1c-tree-root-toggle:hover,
.category1c-tree-toggle:hover {
  background: var(--surface-muted);
}

.category1c-tree-all.is-selected,
.category1c-tree-option.is-selected {
  background: rgba(31, 122, 90, 0.12);
  color: var(--text-primary);
  font-weight: 600;
}

.category1c-tree-root {
  margin-top: .35rem;
  padding-top: .35rem;
  border-top: 1px solid var(--border-color);
}

.category1c-tree-root:first-of-type {
  margin-top: .55rem;
}

.category1c-tree-root-header,
.category1c-tree-node-row {
  display: flex;
  align-items: center;
  gap: .2rem;
}

.category1c-tree-root-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: .55rem .5rem;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: .88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: left;
  cursor: pointer;
}

.category1c-tree-root-title:hover {
  color: var(--text-primary);
}

.category1c-tree-root-toggle,
.category1c-tree-toggle {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: .65rem;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.category1c-tree-toggle .dropdown.icon,
.category1c-tree-root-toggle .dropdown.icon {
  margin: 0 !important;
  transition: transform .16s ease;
}

.category1c-tree-toggle.is-expanded .dropdown.icon,
.category1c-tree-root-toggle.is-expanded .dropdown.icon {
  transform: rotate(0deg);
}

.category1c-tree-toggle .dropdown.icon,
.category1c-tree-root-toggle .dropdown.icon {
  transform: rotate(-90deg);
}

.category1c-tree-toggle-spacer {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
}

.category1c-tree-root-children,
.category1c-tree-children {
  margin-left: .8rem;
  padding-left: .6rem;
  border-left: 1px solid rgba(148, 163, 184, 0.28);
}

.category1c-tree-root-children.is-empty {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.category1c-tree-node {
  margin-top: .12rem;
}

.category1c-tree-node.depth-1 > .category1c-tree-node-row .category1c-tree-option {
  font-weight: 600;
}

.admin-tree-page {
  background: var(--page-accent), var(--page-bg);
}

.admin-tree-shell {
  padding-bottom: 5rem;
}

.admin-tree-page .admin-tree-shell > .field > .container {
  margin-top: 1rem;
  padding: 1.25rem 1.35rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
}

.admin-tree-page .ui.dividing.header {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-bottom: .9rem;
  border-bottom-color: var(--border-color) !important;
}

.admin-tree-page #categoriesHolder.ui.styled.accordion,
.admin-tree-page #propertiesHolder.ui.styled.accordion {
  background: transparent !important;
  border: 1px solid var(--border-color) !important;
  border-radius: .95rem !important;
  box-shadow: none !important;
  overflow: hidden;
}

.admin-tree-page #categoriesHolder.ui.styled.accordion .title,
.admin-tree-page #propertiesHolder.ui.styled.accordion .title {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 3rem;
  padding: .95rem 1rem !important;
  background: var(--surface-muted) !important;
  border-top: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.admin-tree-page #categoriesHolder.ui.styled.accordion > .title:first-child,
.admin-tree-page #propertiesHolder.ui.styled.accordion > .title:first-child {
  border-top: 0 !important;
}

.admin-tree-page #categoriesHolder.ui.styled.accordion .title:hover,
.admin-tree-page #propertiesHolder.ui.styled.accordion .title:hover {
  background: var(--surface-strong) !important;
}

.admin-tree-page #categoriesHolder.ui.styled.accordion .content,
.admin-tree-page #propertiesHolder.ui.styled.accordion .content {
  padding: .9rem 1rem 1rem !important;
  background: var(--surface) !important;
  border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
}

.admin-tree-page #categoriesHolder .ui.list,
.admin-tree-page #propertiesHolder .ui.list,
.admin-tree-page #categoriesHolder .ui.list .list,
.admin-tree-page #propertiesHolder .ui.list .list {
  margin: 0 !important;
}

.admin-tree-page #categoriesHolder .ui.list > .item,
.admin-tree-page #propertiesHolder .ui.list > .item,
.admin-tree-page #categoriesHolder .ui.list .list > .item,
.admin-tree-page #propertiesHolder .ui.list .list > .item {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
}

.admin-tree-page #categoriesHolder .tree-row,
.admin-tree-page #propertiesHolder .tree-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .45rem;
  border-radius: .5rem;
  transition: background-color .12s ease;
}

.admin-tree-page #categoriesHolder .tree-row:hover,
.admin-tree-page #propertiesHolder .tree-row:hover {
  background: var(--surface-muted);
}

.admin-tree-page #categoriesHolder .ui.list .list,
.admin-tree-page #propertiesHolder .ui.list .list {
  margin: .1rem 0 0 .85rem !important;
  padding-left: .8rem;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-tree-page #categoriesHolder .tree-row > span,
.admin-tree-page #propertiesHolder .tree-row > span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  color: var(--text-primary) !important;
}

.admin-tree-page .item.has-children > .tree-row > span,
.admin-tree-page .item.has-children > .tree-row > .tree-toggle {
  cursor: pointer;
}

.admin-tree-page #categoriesHolder .tree-row > .tree-toggle,
.admin-tree-page #propertiesHolder .tree-row > .tree-toggle {
  margin: 0 .1rem 0 0 !important;
  color: var(--text-secondary);
  opacity: .8;
  transition: transform .15s ease;
}

.admin-tree-page .item.has-children.collapsed > .tree-row > .tree-toggle {
  transform: rotate(-90deg);
}

.admin-tree-page .item.has-children.collapsed > .list {
  display: none !important;
}

.admin-tree-page button.editcategory.ui.icon.button,
.admin-tree-page button.addchild.ui.icon.button {
  margin: 0 !important;
  min-width: 1.7rem;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0 !important;
  border-radius: .45rem !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-secondary) !important;
  opacity: .4;
  transition: opacity .12s ease, background-color .12s ease, color .12s ease;
}

.admin-tree-page .tree-row:hover > button.editcategory.ui.icon.button,
.admin-tree-page .tree-row:hover > button.addchild.ui.icon.button {
  opacity: 1;
}

.admin-tree-page button.editcategory.ui.icon.button:hover,
.admin-tree-page button.addchild.ui.icon.button:hover {
  background: var(--surface-strong) !important;
  color: var(--text-primary) !important;
  opacity: 1;
}

.admin-tree-page .rightFloatButton {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1fb56e, #168e56) !important;
  box-shadow: 0 18px 32px rgba(22, 142, 86, 0.28) !important;
}

.admin-tree-page .ui.tiny.modal,
.admin-tree-page .ui.tiny.modal > .header,
.admin-tree-page .ui.tiny.modal .content,
.admin-tree-page .ui.tiny.modal .actions {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
}

.admin-tree-page .ui.tiny.modal .actions {
  border-top: 1px solid var(--border-color) !important;
}

.admin-tree-page .ui.tiny.modal .scrolling.content {
  background: var(--surface-muted) !important;
}

.admin-tree-page .ui.tiny.modal p {
  margin: 0 0 .45rem;
  color: var(--text-secondary) !important;
}

.admin-tree-page .ui.tiny.modal .ui.input,
.admin-tree-page .ui.tiny.modal .ui.input input {
  width: 100%;
}

.admin-tree-page .ui.tiny.modal .ui.input input {
  background: var(--surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.admin-tree-page .imageContainerholder #imageContainer {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
}

.admin-tree-page .imageContainerholder .imageHolderLabel {
  color: var(--text-secondary) !important;
}

html.theme-dark .admin-tree-page #categoriesHolder.ui.styled.accordion,
html.theme-dark .admin-tree-page #propertiesHolder.ui.styled.accordion {
  background: transparent !important;
}

html.theme-dark .admin-tree-page #categoriesHolder.ui.styled.accordion .title,
html.theme-dark .admin-tree-page #propertiesHolder.ui.styled.accordion .title {
  background: rgba(255, 255, 255, 0.04) !important;
  border-top-color: rgba(148, 163, 184, 0.16) !important;
}

html.theme-dark .admin-tree-page #categoriesHolder.ui.styled.accordion .title:hover,
html.theme-dark .admin-tree-page #propertiesHolder.ui.styled.accordion .title:hover {
  background: rgba(255, 255, 255, 0.07) !important;
}

html.theme-dark .admin-tree-page #categoriesHolder.ui.styled.accordion .content,
html.theme-dark .admin-tree-page #propertiesHolder.ui.styled.accordion .content {
  background: rgba(255, 255, 255, 0.02) !important;
  border-top-color: rgba(148, 163, 184, 0.14) !important;
}

html.theme-dark .admin-tree-page #categoriesHolder .ui.list > .item,
html.theme-dark .admin-tree-page #propertiesHolder .ui.list > .item,
html.theme-dark .admin-tree-page #categoriesHolder .ui.list .list > .item,
html.theme-dark .admin-tree-page #propertiesHolder .ui.list .list > .item {
  background: transparent !important;
}

html.theme-dark .admin-tree-page #categoriesHolder .tree-row:hover,
html.theme-dark .admin-tree-page #propertiesHolder .tree-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

html.theme-dark .admin-tree-page #categoriesHolder .ui.list .list,
html.theme-dark .admin-tree-page #propertiesHolder .ui.list .list {
  border-left-color: rgba(148, 163, 184, 0.18) !important;
}

html.theme-dark .admin-tree-page button.editcategory.ui.icon.button,
html.theme-dark .admin-tree-page button.addchild.ui.icon.button {
  background: transparent !important;
  border: 0 !important;
  color: var(--text-secondary) !important;
}

html.theme-dark .admin-tree-page button.editcategory.ui.icon.button:hover,
html.theme-dark .admin-tree-page button.addchild.ui.icon.button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .admin-tree-page .rightFloatButton {
  box-shadow: 0 22px 34px rgba(0, 0, 0, 0.42) !important;
}

@media only screen and (max-width: 767px) {
  .items-main-layout {
    grid-template-columns: 1fr;
  }

  .items-main-layout.is-property-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .items-property-sidebar {
    position: static;
    max-height: 18rem;
  }

  .items-property-sidebar.is-collapsed {
    display: none;
  }

  .items-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: .75rem;
  }

  .items-toolbar-left,
  .items-toolbar-right,
  .items-toolbar-center {
    width: 100%;
  }

  .items-toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }

  .items-toolbar-right {
    justify-content: flex-end;
  }

  .items-toolbar-center {
    justify-content: flex-start;
    order: 3;
  }

  .pagePagination.pagination.ui.menu {
    width: 100%;
    justify-content: flex-start;
  }

  .items-search-pagination-bar {
    flex-wrap: wrap;
  }

  .items-toolbar-control.ui.dropdown {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .items-toolbar-control.ui.dropdown .menu {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    max-height: min(14rem, 42vh) !important;
    overflow-y: auto !important;
    border-radius: 0 0 .75rem .75rem !important;
  }

  .items-toolbar-control.ui.dropdown .menu > .item {
    min-height: 2.35rem;
    padding: .72rem .9rem !important;
    white-space: normal;
  }

  .filterCategory1c {
    width: 100% !important;
    max-width: 100% !important;
  }

  .filterCategory1cMenu {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(20rem, 58vh);
    overflow: hidden;
    border-radius: .85rem;
  }

  .filterCategory1c.is-open {
    z-index: 70;
  }

  .category1c-mega-menu {
    display: block;
    min-height: 0;
    max-height: min(20rem, 58vh);
    overflow-y: auto;
  }

  .category1c-mega-column {
    max-height: none;
    padding: .55rem;
    border-right: 0;
    border-bottom: 0;
  }

  .category1c-mega-menu.mobile-level-roots .category1c-mega-column-middle,
  .category1c-mega-menu.mobile-level-roots .category1c-mega-column-final,
  .category1c-mega-menu.mobile-level-middle .category1c-mega-column-roots,
  .category1c-mega-menu.mobile-level-middle .category1c-mega-column-final,
  .category1c-mega-menu.mobile-level-final .category1c-mega-column-roots,
  .category1c-mega-menu.mobile-level-final .category1c-mega-column-middle {
    display: none;
  }

  .category1c-mega-menu.mobile-level-roots .category1c-mega-column-roots,
  .category1c-mega-menu.mobile-level-middle .category1c-mega-column-middle,
  .category1c-mega-menu.mobile-level-final .category1c-mega-column-final {
    display: block;
  }

  .category1c-mega-column-title {
    min-height: 2.25rem;
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .25rem;
    padding: .32rem .45rem;
    position: static;
    font-size: .72rem;
  }

  .category1c-mobile-back {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: .55rem;
    background: var(--surface-strong);
    color: var(--text-primary);
    cursor: pointer;
  }

  .category1c-mobile-back .icon {
    margin: 0 !important;
  }

  .category1c-mega-all,
  .category1c-mega-root,
  .category1c-mega-child,
  .category1c-mega-leaf {
    min-height: 2.2rem;
    padding: .48rem .55rem;
    border-radius: .55rem;
    white-space: normal;
  }

  .items-range-filter {
    align-items: stretch;
  }

  .items-range-filter-group,
  .items-range-filter-actions {
    width: 100%;
    flex: 1 1 100%;
  }

  .items-range-filter-actions {
    flex-wrap: wrap;
  }

  .items-range-filter-actions .ui.button {
    flex: 1 1 10rem;
  }

  .items-property-toolbar-toggle {
    width: 100%;
  }

  .search-property-filter-row {
    flex-direction: column;
  }

  .search-property-filter-row .filterCode.ui.dropdown {
    width: 100%;
  }
}

.ui.selection.dropdown.active, .ui.selection.dropdown{
}

.category-tree-modal .scrolling.content {
  background: #fff;
}

.category-tree-accordion.ui.styled.accordion {
  border: 1px solid rgba(34,36,38,.12);
  border-radius: .4rem;
  box-shadow: none;
}

.category-tree-accordion.ui.styled.accordion .title.category-tree-root-title {
  background: #fafafa;
  font-weight: 700;
  padding: 1rem 1.1rem;
}

.category-tree-accordion.ui.styled.accordion .content {
  padding: .9rem 1rem 1rem;
}

.category-tree-panel {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.category-tree-node {
  position: relative;
}

.category-tree-row {
  display: flex;
  align-items: flex-start;
}

.category-tree-checkbox.ui.checkbox {
  width: 100%;
  min-height: 2rem;
  padding: .35rem .6rem;
  border-radius: .45rem;
  background: #fff;
}

.category-tree-checkbox.ui.checkbox:hover {
  background: #f7f7f7;
}

.category-tree-checkbox.ui.checkbox label {
  display: block;
  line-height: 1.4;
  padding-left: 2rem !important;
  color: rgba(0,0,0,.78);
}

.category-tree-checkbox.ui.checkbox label:before,
.category-tree-checkbox.ui.checkbox label:after {
  top: .45rem !important;
}

.category-tree-children {
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 2px solid #e4e7eb;
}

.category-tree-children.depth-1 {
  margin-top: .2rem;
}

.category-tree-node.depth-1 > .category-tree-row .category-tree-checkbox {
  background: #fcfcfc;
}

.category-tree-node.depth-2 > .category-tree-row .category-tree-checkbox {
  background: #f8fafc;
}

.category-tree-node.depth-3 > .category-tree-row .category-tree-checkbox {
  background: #f3f6f9;
}

.category-tree-empty {
  color: rgba(0,0,0,.45);
  font-size: .95rem;
  padding: .25rem .2rem;
}

html.theme-dark .category-tree-modal,
html.theme-dark .category-tree-modal .header,
html.theme-dark .category-tree-modal .content,
html.theme-dark .category-tree-modal .actions {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .category-tree-modal .scrolling.content {
  background: var(--surface-muted) !important;
}

html.theme-dark .category-tree-modal .actions {
  border-top: 1px solid var(--border-color) !important;
}

html.theme-dark .category-tree-accordion.ui.styled.accordion {
  background: transparent !important;
  border-color: var(--border-color) !important;
}

html.theme-dark .category-tree-accordion.ui.styled.accordion .title.category-tree-root-title {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-primary) !important;
}

html.theme-dark .category-tree-accordion.ui.styled.accordion .title.category-tree-root-title:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

html.theme-dark .category-tree-accordion.ui.styled.accordion .title .dropdown.icon {
  color: var(--text-secondary) !important;
}

html.theme-dark .category-tree-accordion.ui.styled.accordion .content {
  background: transparent !important;
}

html.theme-dark .category-tree-checkbox.ui.checkbox {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

html.theme-dark .category-tree-checkbox.ui.checkbox:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

html.theme-dark .category-tree-checkbox.ui.checkbox label {
  color: var(--text-primary) !important;
}

html.theme-dark .category-tree-checkbox.ui.checkbox label:before {
  background: rgba(15, 23, 34, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.36) !important;
}

html.theme-dark .category-tree-checkbox.ui.checkbox.checked label:before,
html.theme-dark .category-tree-checkbox.ui.checkbox.checked label:after {
  color: var(--text-primary) !important;
}

html.theme-dark .category-tree-children {
  border-left-color: rgba(148, 163, 184, 0.2) !important;
}

html.theme-dark .category-tree-node.depth-1 > .category-tree-row .category-tree-checkbox {
  background: rgba(255, 255, 255, 0.035) !important;
}

html.theme-dark .category-tree-node.depth-2 > .category-tree-row .category-tree-checkbox {
  background: rgba(255, 255, 255, 0.05) !important;
}

html.theme-dark .category-tree-node.depth-3 > .category-tree-row .category-tree-checkbox {
  background: rgba(255, 255, 255, 0.07) !important;
}

html.theme-dark .category-tree-empty {
  color: var(--text-secondary) !important;
}

.logs-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logs-page-title .ui.header {
  margin: 0;
}

.logs-filter-panel {
  overflow: hidden;
  padding: 1rem 1.05rem !important;
}

.logs-filter-grid {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: .85rem 1rem;
  align-items: end;
}

.logs-filter-search {
  grid-column: span 5;
}

.logs-filter-method {
  grid-column: span 2;
}

.logs-filter-user {
  grid-column: span 4;
}

.logs-filter-endpoint {
  grid-column: span 5;
}

.logs-filter-status,
.logs-filter-short {
  grid-column: span 2;
}

.logs-filter-date {
  grid-column: span 3;
}

.logs-filter-sort {
  grid-column: span 4;
}

.logs-filter-grid .field {
  min-width: 0;
  margin: 0 !important;
}

.logs-filter-grid .field > label {
  margin-bottom: .4rem !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary) !important;
  font-size: .82rem !important;
  font-weight: 700;
}

.logs-filter-grid input,
.logs-filter-grid select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 2.65rem !important;
  min-height: 2.65rem !important;
  padding: .65rem .85rem !important;
  border: 1px solid var(--border-color) !important;
  border-radius: .58rem !important;
  background: var(--input-bg) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

.logs-filter-grid input:focus,
.logs-filter-grid select:focus {
  border-color: rgba(31, 122, 90, 0.35) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.08) !important;
}

.logs-filter-grid .logs-native-select {
  cursor: pointer;
}

.logs-page input[type="datetime-local"] {
  min-height: 2.65rem;
  color-scheme: light;
}

html.theme-dark .logs-page input[type="datetime-local"] {
  color-scheme: dark;
}

/* Search bar buttons */
#buttonSearch.search-btn {
  background: var(--surface-strong) !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  border-color: var(--border-color) !important;
  transition: background-color .18s ease, color .18s ease;
}

#buttonSearch.search-btn:hover {
  background: var(--surface-muted) !important;
  color: var(--text-primary) !important;
}

html.theme-dark #buttonSearch.search-btn {
  background: rgba(148, 163, 184, 0.12) !important;
  color: rgba(231, 237, 245, 0.62) !important;
}

html.theme-dark #buttonSearch.search-btn:hover {
  background: rgba(148, 163, 184, 0.2) !important;
  color: var(--text-primary) !important;
}

/* Semantic search button */
#buttonSemanticSearch.semantic-search-btn {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: #fff;
  border-radius: 0 999px 999px 0;
  border: none;
  padding: 0 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
#buttonSemanticSearch.semantic-search-btn:hover {
  opacity: 0.85;
}

/* Score badge on semantic result cards */
.semantic-score-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  z-index: 11;
  opacity: 0.92;
}
.semantic-score-badge .magic.icon {
  font-size: 0.72rem;
  margin-right: 3px;
}

html.theme-dark #buttonSemanticSearch.semantic-search-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
}

.logs-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: .65rem;
  margin-top: .9rem;
}

.logs-actions .ui.button {
  min-width: 8.7rem;
  border-radius: .58rem !important;
}

.logs-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: .85rem;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.logs-table-wrap .ui.table {
  min-width: 64rem;
  margin: 0;
  border: 0 !important;
  box-shadow: none !important;
}

.logs-table-wrap .ui.table thead th {
  background: var(--surface-strong) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
  box-shadow: none !important;
}

.logs-table-wrap .ui.table tbody td {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

.logs-table-wrap .ui.table tbody tr:hover td {
  background: var(--surface-muted) !important;
}

.logs-sort-link {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.logs-sort-link:hover {
  color: var(--accent);
}

.logs-endpoint-cell {
  min-width: 16rem;
  max-width: 34rem;
}

.logs-endpoint-cell div,
.logs-endpoint-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logs-endpoint-cell small {
  margin-top: .2rem;
  color: var(--text-secondary);
}

.logs-details-pre {
  min-height: 18rem;
  max-height: min(68vh, 44rem);
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: .7rem;
  background: var(--surface-muted);
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.logs-page #apiLogDetailsModal.ui.modal,
.logs-page #apiLogDetailsModal.ui.modal > .header,
.logs-page #apiLogDetailsModal.ui.modal > .content,
.logs-page #apiLogDetailsModal.ui.modal > .actions {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
}

.logs-page #apiLogDetailsModal.ui.modal > .header {
  border-bottom: 1px solid var(--border-color) !important;
}

.logs-page #apiLogDetailsModal.ui.modal > .actions {
  border-top: 1px solid var(--border-color) !important;
}

.logs-page #apiLogDetailsModal.ui.modal > .content {
  padding: 1.35rem !important;
}

.logs-page #apiLogDetailsModal .ui.button {
  border-radius: .58rem !important;
}

html.theme-dark .logs-table-wrap {
  background: var(--surface) !important;
}

html.theme-dark .logs-page #apiLogDetailsModal.ui.modal,
html.theme-dark .logs-page #apiLogDetailsModal.ui.modal > .header,
html.theme-dark .logs-page #apiLogDetailsModal.ui.modal > .content,
html.theme-dark .logs-page #apiLogDetailsModal.ui.modal > .actions {
  background: #111a26 !important;
  color: var(--text-primary) !important;
}

html.theme-dark .logs-page #apiLogDetailsModal .logs-details-pre {
  background: #1b2838 !important;
  border-color: rgba(148, 163, 184, 0.2) !important;
  color: #eef5ff !important;
}

html.theme-dark .logs-table-wrap .ui.table thead th {
  background: #111a26 !important;
  color: var(--text-primary) !important;
}

html.theme-dark .logs-table-wrap .ui.table tbody td {
  background: var(--surface) !important;
}

html.theme-dark .logs-table-wrap .ui.table tbody tr:hover td {
  background: var(--surface-muted) !important;
}

@media only screen and (max-width: 1120px) {
  .logs-filter-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .logs-filter-search {
    grid-column: span 5;
  }

  .logs-filter-method {
    grid-column: span 3;
  }

  .logs-filter-user {
    grid-column: span 4;
  }

  .logs-filter-endpoint {
    grid-column: span 5;
  }

  .logs-filter-status {
    grid-column: span 2;
  }

  .logs-filter-date {
    grid-column: span 3;
  }

  .logs-filter-sort {
    grid-column: span 4;
  }

  .logs-filter-short {
    grid-column: span 2;
  }
}

@media only screen and (max-width: 860px) {
  .logs-filter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .logs-filter-search,
  .logs-filter-user,
  .logs-filter-endpoint,
  .logs-filter-sort {
    grid-column: span 6;
  }

  .logs-filter-method,
  .logs-filter-status,
  .logs-filter-date,
  .logs-filter-short {
    grid-column: span 3;
  }
}

@media only screen and (max-width: 767px) {
  .logs-page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .logs-page-title .ui.button {
    width: 100%;
  }

  .logs-filter-grid {
    grid-template-columns: 1fr;
  }

  .logs-filter-search,
  .logs-filter-method,
  .logs-filter-user,
  .logs-filter-endpoint,
  .logs-filter-status,
  .logs-filter-date,
  .logs-filter-sort,
  .logs-filter-short {
    grid-column: auto;
  }

  .logs-actions .ui.button {
    width: 100%;
  }

  .logs-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .logs-table-wrap .ui.table {
    min-width: 0;
    width: 100%;
    border: 0 !important;
    background: transparent !important;
  }

  .logs-table-wrap .ui.table thead {
    display: none;
  }

  .logs-table-wrap .ui.table tbody,
  .logs-table-wrap .ui.table tr,
  .logs-table-wrap .ui.table td {
    display: block !important;
    width: 100% !important;
  }

  .logs-table-wrap .ui.table tbody tr {
    margin: 0 0 .7rem;
    padding: .72rem;
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    background: var(--surface) !important;
    box-shadow: var(--shadow-soft);
  }

  .logs-table-wrap .ui.table tbody td {
    display: grid !important;
    grid-template-columns: minmax(4.8rem, 30%) minmax(0, 1fr);
    align-items: start;
    gap: .55rem;
    min-height: 0;
    padding: .2rem 0 !important;
    border: 0 !important;
    text-align: left !important;
    background: transparent !important;
  }

  .logs-table-wrap .ui.table tbody td::before {
    content: attr(data-label);
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.25;
  }

  .logs-endpoint-cell {
    min-width: 0;
    max-width: none;
  }

  .logs-endpoint-cell div,
  .logs-endpoint-cell small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .logs-table-wrap .show-log-details {
    width: 2.15rem;
    min-width: 2.15rem;
    height: 2.15rem;
    min-height: 2.15rem;
    padding: 0 !important;
  }
}

@media only screen and (max-width: 767px) {
  body {
    overflow-x: hidden;
  }

  .ui.container {
    width: auto !important;
    margin-left: .65rem !important;
    margin-right: .65rem !important;
  }

  .ui.segment,
  .ui.raised.segment,
  .ui.basic.segment {
    max-width: 100% !important;
  }

  .ui.modal {
    width: calc(100vw - 1rem) !important;
    max-width: calc(100vw - 1rem) !important;
  }

  .ui.modal > .header,
  .ui.modal > .content,
  .ui.modal > .actions,
  .ui.modal .scrolling.content {
    padding-left: .85rem !important;
    padding-right: .85rem !important;
  }

  .ui.modal > .content,
  .ui.modal .scrolling.content {
    overflow-x: auto !important;
  }

  .ui.modal .ui.table {
    min-width: 34rem;
  }

  .ui.modal .responsive-card-table {
    min-width: 0 !important;
    width: 100% !important;
    border: 0 !important;
    background: transparent !important;
  }

  .ui.modal .responsive-card-table thead {
    display: none;
  }

  .ui.modal .responsive-card-table tbody {
    display: block;
    width: 100% !important;
  }

  .ui.modal .responsive-card-table tr {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    align-items: end;
    column-gap: .7rem;
    row-gap: .45rem;
    margin: 0 0 .58rem;
    padding: .68rem;
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
  }

  .ui.modal .responsive-card-table td {
    display: block !important;
    width: auto !important;
    min-width: 0;
    padding: .18rem 0 !important;
    border: 0 !important;
  }

  .ui.modal .responsive-card-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin: 0 0 .2rem;
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.15;
  }

  .ui.modal .responsive-card-table td[data-label] {
    display: block !important;
  }

  .ui.modal .responsive-card-table td[colspan]::before {
    display: none;
  }

  .ui.modal .responsive-card-table td[colspan] {
    display: block !important;
    grid-column: 1 / -1;
  }

  .ui.modal .responsive-card-table .ui.dropdown,
  .ui.modal .responsive-card-table .ui.input,
  .ui.modal .responsive-card-table .ui.selection.dropdown,
  .ui.modal .responsive-card-table select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .ui.modal .responsive-card-table .responsive-card-actions,
  .ui.modal .responsive-card-table .managed-user-actions {
    display: flex;
    justify-content: flex-start;
    gap: .4rem;
    white-space: nowrap;
  }

  .ui.modal .responsive-card-table .responsive-card-actions .ui.icon.button,
  .ui.modal .responsive-card-table .managed-user-actions .ui.icon.button {
    width: 2.15rem;
    min-width: 2.15rem;
    height: 2.15rem;
    min-height: 2.15rem;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ui.modal .responsive-card-table .responsive-card-actions .ui.icon.button > .icon,
  .ui.modal .responsive-card-table .managed-user-actions .ui.icon.button > .icon {
    margin: 0 !important;
  }

  #usersAdminModal #managedUsersTable .managed-user-login {
    min-width: 0;
    font-size: .98rem;
  }

  #usersAdminModal #managedUsersTable .managed-user-role-cell,
  #usersAdminModal #managedUsersTable .managed-user-status-cell {
    min-width: 0;
  }

  #usersAdminModal #managedUsersTable .managed-user-status-cell .ui.label {
    margin: 0 !important;
  }

  #keycrmPartnerTokensTable.responsive-card-table tr,
  #keycrmCodesTable.responsive-card-table tr {
    grid-template-columns: minmax(7.2rem, 1fr) minmax(7.2rem, 1fr) auto;
  }

  #additionalBarcodesTable.responsive-card-table tr {
    grid-template-columns: minmax(11rem, 1fr) auto;
  }

  #managedUsersTable.responsive-card-table tr {
    grid-template-columns: minmax(7rem, 1fr) minmax(8rem, 1fr) minmax(5.8rem, auto) auto;
  }

  #managedUserPermissionsTable.responsive-card-table tr {
    grid-template-columns: minmax(4.8rem, .7fr) minmax(10rem, 1.6fr) minmax(7rem, 1fr);
  }

  .ui.modal .ui.form .fields {
    display: flex !important;
    flex-direction: column !important;
    gap: .85rem;
  }

  .ui.modal .ui.form .fields > .field,
  .ui.modal .ui.form .field {
    width: 100% !important;
    min-width: 0;
  }

  .ui.modal .actions {
    display: flex;
    flex-direction: column-reverse;
    gap: .6rem;
  }

  #usersAdminModal > .actions {
    flex-direction: column;
  }

  .ui.modal .actions .ui.button {
    width: 100%;
    margin: 0 !important;
  }

  #appSettingsForm .ui.button,
  #excelImportForm .ui.button,
  #downloadCatalogImportTemplate,
  #openApiLogs,
  #openUsersAdmin,
  #openKeycrmTokens {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #excelImportForm input[type="file"] {
    font-size: .9rem;
  }

  #itemsList {
    margin-top: .75rem;
    padding-bottom: .5rem;
    -webkit-overflow-scrolling: touch;
  }

  #itemsList > .ui.table {
    min-width: 42rem;
    margin-bottom: 0;
  }

  .product-editor-page .ui.form .fields,
  #additemform .fields,
  #updateItemForm .fields {
    display: flex !important;
    flex-direction: column !important;
    gap: .8rem;
  }

  .product-editor-page .ui.form .fields > .field,
  #additemform .fields > .field,
  #updateItemForm .fields > .field {
    width: 100% !important;
    min-width: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .field-label-with-action {
    align-items: stretch;
    flex-direction: column;
    gap: .45rem;
  }

  .field-label-with-action .button {
    width: 100%;
  }

  #additemform #btn-pick-free,
  #updateItemForm #btn-pick-free {
    min-width: 100%;
  }

  #additemform #createKeycrmProduct,
  #updateItemForm #openKeycrmCodes,
  #updateItemForm #openWarehouseCells,
  #updateItemForm #openShelfLimits,
  #updateItemForm #updateKeycrmProduct {
    width: 100%;
  }

  .product-editor-page #headerSearch {
    margin-bottom: .75rem;
  }

  .imageContainerholder {
    min-height: 9rem;
  }

  .imageContainerholder .imageHolderLabel {
    width: calc(100% - 1.5rem);
    max-width: 18rem;
    white-space: normal;
    line-height: 1.25;
    font-size: 1rem !important;
  }

  .rightFloatButton {
    right: 1rem !important;
    bottom: 1rem !important;
  }
}

/* Users admin page */
.users-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.users-page-header h2.ui.header {
  margin: 0;
}

.perm-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.perm-panel-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.perm-cell {
  display: block;
  width: 2rem;
  height: 1.75rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1.75rem;
  text-align: center;
  padding: 0;
  background: #f3f3f3;
  color: #bbb;
  margin: 0 auto;
  transition: background 0.1s, color 0.1s;
}
.perm-cell.allow {
  background: #21ba45;
  color: #fff;
  border-color: #1a9438;
}
.perm-cell.deny {
  background: #db2828;
  color: #fff;
  border-color: #b22222;
}
.perm-cell:hover { opacity: 0.8; }

.perm-role-dot {
  display: block;
  font-size: 0.55em;
  line-height: 1.2;
  text-align: center;
  color: #ddd;
}
.perm-role-dot.granted { color: #21ba45; }

.perm-matrix-cell {
  text-align: center !important;
  vertical-align: middle !important;
  padding: 4px 6px !important;
}
.perm-matrix thead th {
  text-align: center;
  white-space: nowrap;
  padding: 6px 8px !important;
}
.perm-matrix tbody td:first-child {
  padding: 5px 8px !important;
}

/* === Settings page === */

.settings-page .ui.vertical.pointing.fluid.menu {
  background: var(--surface) !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-soft);
  border-radius: 1rem !important;
}

.settings-page .ui.vertical.pointing.fluid.menu .item {
  color: var(--text-primary) !important;
}

.settings-page .ui.vertical.pointing.fluid.menu .item:before {
  background: var(--border-color) !important;
}

.settings-page .ui.vertical.pointing.fluid.menu .item:hover {
  background: var(--surface-muted) !important;
  color: var(--text-primary) !important;
}

.settings-page .ui.vertical.pointing.fluid.menu .active.item {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  color: var(--text-primary) !important;
}

.settings-page .ui.table thead th {
  background: var(--surface-muted) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.settings-page .ui.table tbody tr:hover > td {
  background: var(--surface-muted) !important;
}

.settings-page .ui.labeled.action.input > .ui.label {
  background: var(--surface-muted) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

html.theme-dark .settings-page .ui.yellow.message {
  background: rgba(120, 53, 15, 0.35) !important;
  border: 1px solid rgba(251, 191, 36, 0.35) !important;
  color: #fde68a !important;
  box-shadow: none !important;
}

html.theme-dark .settings-page .ui.yellow.message > .icon {
  color: #fbbf24 !important;
}

html.theme-dark .settings-page .ui.info.message {
  background: rgba(30, 58, 138, 0.28) !important;
  border: 1px solid rgba(96, 165, 250, 0.32) !important;
  color: #bfdbfe !important;
  box-shadow: none !important;
}

html.theme-dark .settings-page .ui.info.message > .icon {
  color: #60a5fa !important;
}

/* Dark mode: plain (non-coloured) buttons in the admin cards kept
   Fomantic's light grey #e0e1e2, looking out of place on the dark cards. */
html.theme-dark .settings-page .ui.cards .ui.button:not(.primary):not(.positive):not(.negative):not(.blue):not(.green):not(.red) {
  background: var(--surface-strong) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
}

html.theme-dark .settings-page .ui.cards .ui.button:not(.primary):not(.positive):not(.negative):not(.blue):not(.green):not(.red):hover,
html.theme-dark .settings-page .ui.cards .ui.button:not(.primary):not(.positive):not(.negative):not(.blue):not(.green):not(.red):focus {
  background: var(--surface-muted) !important;
  color: var(--text-primary) !important;
}

/* Dark mode: admin-card descriptions kept Fomantic's near-black
   rgba(0,0,0,.68), barely legible on the dark cards. */
html.theme-dark .settings-page .ui.cards .card .description,
html.theme-dark .settings-page .ui.cards .card .meta {
  color: var(--text-secondary) !important;
}

html.theme-dark .settings-page .ui.checkbox label:before {
  background: var(--input-bg) !important;
  border-color: rgba(148, 163, 184, 0.36) !important;
}

html.theme-dark .settings-page .ui.checkbox.checked label:before {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

html.theme-dark .settings-page .ui.checkbox label:after {
  color: var(--surface) !important;
}

.semantic-query-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .85rem;
  margin: .5rem 0 .75rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: .88rem;
}

.semantic-query-chip strong {
  color: var(--text-primary);
}

.semantic-query-chip .magic.icon {
  color: var(--accent);
  margin: 0;
  font-size: .85em;
}

/* Semantic search loading state */
.semantic-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  gap: 1.25rem;
}

.semantic-loading-text {
  color: var(--text-secondary);
  font-size: .95rem;
  text-align: center;
}
