:root .ops-app[data-theme] .almox-nav-link[aria-current='page'] {
  border-bottom-color: var(--ui-accent);
  color: var(--ui-accent);
}

.almox-heading {
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.almox-heading-actions {
  flex-wrap: wrap;
}

.almox-heading-actions .ops-button {
  white-space: nowrap;
}

.almox-branches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.almox-branches button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  color: var(--ui-muted);
  background: var(--ui-panel);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.almox-branches button:hover {
  color: var(--ui-text);
  background: var(--ui-raised);
}

.almox-branches button[aria-selected='true'] {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

:root .ops-app[data-theme] .almox-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 24px;
}

:root .ops-app[data-theme] .almox-warning-value {
  color: var(--ui-warning);
}

.almox-stock-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 22px;
}

:root .ops-app[data-theme] .almox-stock-filters .ops-search {
  flex: 1 1 280px;
  width: auto;
}

.almox-select-label {
  flex: 0 1 200px;
  min-width: 0;
}

.almox-select-label select,
.almox-history-filters input,
.almox-history-filters select,
.almox-fields input,
.almox-fields select,
.almox-fields textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 7px;
  color: var(--ui-text);
  background: var(--ui-input);
  font: inherit;
  font-size: 13px;
}

.almox-table-scroll {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--ui-border);
  scrollbar-width: thin;
  scrollbar-color: var(--ui-border-strong) var(--ui-panel);
}

.almox-table {
  width: 100%;
  min-width: 1030px;
  border-collapse: collapse;
  color: var(--ui-secondary);
  text-align: left;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.almox-table th {
  padding: 13px 16px;
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-muted);
  background: var(--ui-raised);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.almox-table td {
  max-width: 360px;
  padding: 17px 16px;
  border-bottom: 1px solid var(--ui-border);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.almox-table tbody tr:last-child td {
  border-bottom: 0;
}

.almox-table tbody tr:hover td {
  background: var(--ui-raised);
}

.almox-table td > strong {
  display: block;
  color: var(--ui-text);
  font-weight: 500;
}

.almox-table td > small {
  display: block;
  margin-top: 4px;
  color: var(--ui-subtle);
  font-size: 10px;
}

.almox-table .almox-number {
  text-align: right;
  white-space: nowrap;
}

.almox-code {
  padding: 5px 7px;
  border: 1px solid var(--ui-border);
  border-radius: 5px;
  color: var(--ui-secondary);
  background: var(--ui-raised);
  font-size: 11px;
  white-space: nowrap;
}

.almox-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.almox-status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.almox-status.is-ok,
.almox-status.is-entrada {
  color: var(--ui-success);
  background: var(--ui-success-soft);
}

.almox-status.is-low,
.almox-status.is-saida {
  color: var(--ui-warning);
  background: var(--ui-warning-soft);
}

.almox-status.is-empty {
  color: var(--ui-danger);
  background: var(--ui-danger-soft);
}

.almox-row-actions,
.almox-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

:root .ops-app[data-theme] .almox-row-actions .ops-button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 11px;
}

.almox-edit-button {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ui-muted);
  background: transparent;
  cursor: pointer;
}

.almox-edit-button:hover:not(:disabled) {
  border-color: var(--ui-border-strong);
  color: var(--ui-text);
  background: var(--ui-hover);
}

.almox-edit-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.almox-panel > .weighings-footer {
  flex-wrap: wrap;
}

.almox-history-filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(160px, 1fr) repeat(2, minmax(145px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 18px 22px;
}

.almox-history-filters label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--ui-muted);
  font-size: 11px;
}

.almox-history-table {
  min-width: 1400px;
}

.almox-history-table td:first-child {
  white-space: nowrap;
}

.almox-note-details {
  min-width: 150px;
  max-width: 280px;
}

.almox-note-details summary {
  color: var(--ui-accent);
  cursor: pointer;
}

.almox-note-details p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.almox-alert {
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1px solid var(--ui-warning);
  border-radius: 8px;
  color: var(--ui-warning);
  background: var(--ui-warning-soft);
  font-size: 12px;
  line-height: 1.7;
}

.almox-alert.is-error {
  border-color: var(--ui-danger);
  color: var(--ui-danger);
  background: var(--ui-danger-soft);
}

.almox-alert.is-success {
  border-color: var(--ui-success);
  color: var(--ui-success);
  background: var(--ui-success-soft);
}

:root .ops-app[data-theme] :is(.almox-delete-button, .almox-delete-confirm) {
  border-color: var(--ui-danger);
  color: var(--ui-danger);
  background: var(--ui-danger-soft);
}

:root .ops-app[data-theme] :is(.almox-delete-button, .almox-delete-confirm):hover:not(:disabled) {
  border-color: var(--ui-danger);
  background: var(--ui-hover);
}

.almox-delete-description {
  margin: 0 0 18px;
  color: var(--ui-secondary);
  font-size: 13px;
  line-height: 1.8;
}

.almox-balance-preview + .almox-delete-description {
  margin-top: 18px;
}

:root .ops-app[data-theme] .almox-dialog {
  width: min(700px, 100%);
}

.almox-form-body {
  min-height: 0;
}

.almox-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  border: 0;
}

.almox-fields label {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  color: var(--ui-secondary);
  font-size: 12px;
}

.almox-fields textarea {
  resize: vertical;
  line-height: 1.7;
}

.almox-fields :disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.almox-field-wide {
  grid-column: 1 / -1;
}

.almox-fixed-unit {
  display: grid;
  align-content: start;
  gap: 9px;
}

.almox-fixed-unit > span {
  color: var(--ui-muted);
  font-size: 12px;
}

.almox-fixed-unit strong {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  color: var(--ui-text);
  font-size: 14px;
}

.almox-fixed-unit small {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 400;
}

.almox-form-note {
  align-self: end;
  margin: 0;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.7;
}

.almox-form-body > .almox-alert {
  margin-top: 18px;
  margin-bottom: 0;
}

.almox-balance-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  color: var(--ui-muted);
  background: var(--ui-raised);
}

.almox-balance-preview > div {
  display: grid;
  gap: 7px;
}

.almox-balance-preview span {
  color: var(--ui-muted);
  font-size: 11px;
}

.almox-balance-preview strong {
  color: var(--ui-text);
  font-size: 27px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.almox-balance-preview strong.is-danger {
  color: var(--ui-danger);
}

.almox-balance-preview small {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 400;
}

@media screen and (max-width: 1200px) {
  :root .ops-app[data-theme] .ops-primary-nav :is(#production-menu, #import-menu) {
    right: 0;
    left: auto;
  }

  .vessel-traffic-panel {
    scroll-margin-top: 124px;
  }

  .almox-history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .almox-history-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .almox-nav-label {
    display: none;
  }

  :root .ops-app[data-theme] .almox-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .almox-branches {
    gap: 6px;
  }

  .almox-branches button {
    gap: 5px;
    padding: 10px 6px;
    font-size: 11px;
    line-height: 1.5;
  }

  .almox-branches button svg {
    display: none;
  }

  :root .ops-app[data-theme] .ops-primary-nav #production-menu {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .almox-heading-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root .ops-app[data-theme] .almox-heading-actions .ops-button {
    min-height: 42px;
    padding: 0 8px;
    font-size: 11px;
  }

  .almox-stock-filters,
  .almox-history-filters {
    padding: 16px;
  }

  .almox-select-label {
    flex: 1 1 130px;
  }

  .almox-history-filters .almox-history-search,
  .almox-history-filters > .ops-button {
    grid-column: 1 / -1;
  }

  .almox-select-label select,
  .almox-history-filters input,
  .almox-history-filters select,
  .almox-fields input,
  .almox-fields select,
  .almox-fields textarea {
    font-size: 16px;
  }

  .almox-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  .almox-balance-preview {
    padding: 14px;
  }

  .almox-balance-preview strong {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  :root .ops-app[data-theme] .almox-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}
