/* NormaX UI v2 — shared visual authority. Presentation only: no workflow or data rules live here. */

:root {
  --nx-v2-canvas: #f5f8fb;
  --nx-v2-surface: #ffffff;
  --nx-v2-surface-soft: #f8fbfd;
  --nx-v2-navy: #0a1931;
  --nx-v2-navy-soft: #1a3d63;
  --nx-v2-blue: #4a7fa7;
  --nx-v2-blue-soft: #eaf3f9;
  --nx-v2-border: #dce6ee;
  --nx-v2-muted: #637c91;
  --nx-v2-radius-sm: 8px;
  --nx-v2-radius-md: 12px;
  --nx-v2-radius-lg: 16px;
  --nx-v2-table-head-size: 10.5px;
  --nx-v2-table-body-size: 13px;
  --nx-v2-table-cell-y: 9px;
  --nx-v2-table-cell-x: 10px;
  --nx-v2-tab-height: 44px;
  --nx-v2-tab-font-size: 13px;
  --nx-v2-icon-size: 18px;
  --nx-v2-icon-stroke: 1.65;
  --nx-v2-field-height: 44px;
  --nx-v2-field-border: #aebfcd;
  --nx-v2-field-border-hover: #819eb3;
  --nx-v2-modal-body: #f6f9fb;
  --nx-v2-modal-gap: 12px;
}

html {
  background: var(--nx-v2-canvas);
}

body {
  color: var(--nx-v2-navy);
  background: var(--nx-v2-canvas);
  font-family: var(--ds-font-sans);
  font-variant-numeric: tabular-nums;
}

body,
button,
input,
select,
textarea {
  letter-spacing: -0.01em;
}

svg {
  stroke-width: 1.75;
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  background: var(--nx-v2-canvas);
}

.sidebar {
  width: 264px;
  gap: 14px;
  padding: 20px 16px;
  background: var(--nx-v2-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.sidebar::before {
  display: none;
}

.sidebar::after {
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-brand {
  padding: 2px 10px 6px;
}

.sidebar-brand img {
  max-width: 176px;
  max-height: 40px;
  filter: brightness(0) invert(1);
}

.company-locked-name {
  height: 40px;
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: var(--nx-v2-radius-sm);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

.nav-list {
  gap: 2px;
}

.nav-list button,
.sidebar-footer button {
  gap: 11px;
  min-height: 40px;
  border: 0;
  border-radius: var(--nx-v2-radius-sm);
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 550;
}

.nav-list button svg,
.sidebar-footer button svg {
  width: 18px;
  height: 18px;
  opacity: 0.82;
}

.nav-list button.nav-group-start {
  margin-top: 9px;
}

.nav-list button.active {
  color: #ffffff;
  background: rgba(179, 207, 229, 0.16);
  box-shadow: inset 2px 0 0 #b3cfe5;
}

.nav-list button:hover,
.sidebar-footer button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.075);
  transform: none;
}

.nav-problem-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  box-shadow: none;
  font-size: 10px;
}

.content {
  width: 100%;
  min-width: 0;
  padding: 34px clamp(26px, 3vw, 54px) 40px;
}

.content-wide {
  padding: 24px clamp(22px, 2.4vw, 38px) 34px;
}

.topbar {
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 26px;
}

.title-block h1,
.content-wide .title-block h1,
.module-title-block h1 {
  color: var(--nx-v2-navy);
  font-size: clamp(28px, 2.35vw, 38px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.title-block span,
.module-title-block span {
  max-width: 760px;
  margin-top: 9px;
  color: var(--nx-v2-muted);
  font-size: 13px;
  line-height: 1.55;
}

.topbar-actions {
  gap: 8px;
}

.primary-button,
.secondary-button,
.compact-command,
.detail-action,
.open-row-button,
.open-card-button {
  border-radius: var(--nx-v2-radius-sm);
  box-shadow: none;
  letter-spacing: -0.01em;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.primary-button,
.initial-items-card .primary-button,
.work-order-modal-actions .primary-button,
.product-modal-actions .primary-button,
.modal-actions .primary-button,
.finish-modal-actions .primary-button,
.problem-submit-button,
.save-button,
.add-button {
  border-color: var(--nx-v2-blue);
  background: var(--nx-v2-blue);
  box-shadow: none;
}

.primary-button:hover,
.initial-items-card .primary-button:hover,
.work-order-modal-actions .primary-button:hover,
.product-modal-actions .primary-button:hover,
.modal-actions .primary-button:hover,
.finish-modal-actions .primary-button:hover,
.problem-submit-button:hover,
.save-button:hover,
.add-button:hover {
  border-color: var(--nx-v2-navy-soft);
  background: var(--nx-v2-navy-soft);
  box-shadow: none;
  transform: none;
}

.secondary-button:hover,
.compact-command:hover,
.detail-action:hover {
  background: var(--nx-v2-blue-soft);
  transform: none;
}

input,
select,
textarea,
.field input,
.field select,
.field textarea {
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-sm);
  box-shadow: none;
}

.card,
.metric-card,
.dashboard-card,
.table-shell,
.product-form-card,
.product-kpi,
.work-order-kpi,
.items-table-card,
.detail-card,
.status-card,
.problem-detail-card,
.problem-table-card,
.products-table-card,
.product-assembly-card,
.station-card,
.settings-card,
.analytics-card,
.ds-section-card {
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-md);
  box-shadow: none;
}

.kpi-card,
.work-kpi,
.product-kpi,
.problem-kpis .work-kpi {
  box-shadow: none;
}

.table-wrap,
.work-order-table-wrap-desktop,
.products-table-wrap,
.stations-table-wrap,
.team-table-wrap,
.analytics-table-wrap,
.ds-table-wrap {
  border-color: var(--nx-v2-border);
  box-shadow: none;
}

table th {
  color: var(--nx-v2-muted);
  background: var(--nx-v2-surface-soft);
  font-size: var(--nx-v2-table-head-size);
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

table td {
  color: var(--nx-v2-navy-soft);
  font-size: var(--nx-v2-table-body-size);
  line-height: 1.4;
}

/* One typography contract for every primary data register. Earlier modules
   were built independently and used 12.16, 12.5, 13 and 14px table copy. */
.work-orders-screen .work-orders-table tbody td,
.shipment-table tbody td,
.archive-table tbody td,
.products-screen .products-table tbody td,
.materials-table tbody td,
.stations-screen .stations-table tbody td,
.team-overview .team-data-table tbody td,
.customers-screen .customers-table tbody td,
.global-problems-page .global-problem-table tbody td,
.scrap-screen .scrap-table tbody td,
.scrap-premium-screen .scrap-events-table-wrap tbody td,
.scrap-premium-screen .scrap-material-table tbody td {
  font-size: var(--nx-v2-table-body-size);
  line-height: 1.4;
  padding: var(--nx-v2-table-cell-y) var(--nx-v2-table-cell-x);
}

.work-orders-screen .work-orders-table thead th,
.shipment-table thead th,
.archive-table thead th,
.products-screen .products-table thead th,
.materials-table thead th,
.stations-screen .stations-table thead th,
.team-overview .team-data-table thead th,
.customers-screen .customers-table thead th,
.global-problems-page .global-problem-table thead th,
.scrap-screen .scrap-table thead th,
.scrap-premium-screen .scrap-events-table-wrap thead th,
.scrap-premium-screen .scrap-material-table thead th {
  font-size: var(--nx-v2-table-head-size);
  line-height: 1.2;
  padding: var(--nx-v2-table-cell-y) var(--nx-v2-table-cell-x);
}

/* Data registers use a flat site-like header surface. Legacy module-specific
   gradients are intentionally neutralized by the shared visual authority. */
main table thead,
main table thead th {
  background: var(--nx-v2-surface-soft) !important;
  background-image: none !important;
}

/* Column alignment is semantic and the header always follows its cells.
   Descriptive values start left; compact operational values are centered. */
.work-orders-screen .work-orders-table :is(th, td):is(:nth-child(1), :nth-child(2), :nth-child(3), :nth-child(4), :nth-child(5), :nth-child(10)),
.shipment-table :is(th, td):is(:nth-child(1), :nth-child(2), :nth-child(8)),
.archive-table :is(th, td):is(:nth-child(1), :nth-child(2)),
.products-screen .products-table :is(th, td):is(:nth-child(1), :nth-child(2)),
.materials-table table :is(th, td):is(:nth-child(1), :nth-child(2)),
.stations-screen .stations-table:not(.team-data-table) :is(th, td):is(:nth-child(1), :nth-child(2), :nth-child(6)),
.team-overview .team-data-table :is(th, td):is(:nth-child(1), :nth-child(5), :nth-child(6)),
.customers-screen .customers-table :is(th, td):not(:nth-child(9)),
.notes-screen .notes-table-shell :is(th, td):is(:nth-child(1), :nth-child(3), :nth-child(4)) {
  text-align: left;
}

.work-orders-screen .work-orders-table th:is(:nth-child(1), :nth-child(2), :nth-child(3), :nth-child(4), :nth-child(5), :nth-child(10)) .sort-header,
.shipment-table th:is(:nth-child(1), :nth-child(2), :nth-child(8)) .sort-header,
.archive-table th:is(:nth-child(1), :nth-child(2)) .sort-header,
.products-screen .products-table th:is(:nth-child(1), :nth-child(2)) .sort-header,
.materials-table table th:is(:nth-child(1), :nth-child(2)) .sort-header,
.stations-screen .stations-table:not(.team-data-table) th:is(:nth-child(1), :nth-child(2), :nth-child(6)) .sort-header,
.team-overview .team-data-table th:is(:nth-child(1), :nth-child(5), :nth-child(6)) .sort-header,
.customers-screen .customers-table th:not(:nth-child(9)) .sort-header,
.notes-screen .notes-table-shell th:is(:nth-child(1), :nth-child(3), :nth-child(4)) .sort-header {
  justify-content: flex-start;
  text-align: left;
}

.work-orders-screen .work-orders-table :is(th, td):nth-child(11),
.shipment-table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(9)),
.archive-table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8)),
.products-screen .products-table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9), :nth-child(10), :nth-child(11)),
.materials-table table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(10), :nth-child(11)),
.stations-screen .stations-table:not(.team-data-table) :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(7)),
.team-overview .team-data-table :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(4), :nth-child(7), :nth-child(8)),
.customers-screen .customers-table :is(th, td):nth-child(9),
.notes-screen .notes-table-shell :is(th, td):is(:nth-child(2), :nth-child(5), :nth-child(6)) {
  text-align: center;
}

.materials-table table :is(th, td):is(:nth-child(8), :nth-child(9)) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.materials-table table th:is(:nth-child(8), :nth-child(9)) .sort-header {
  justify-content: flex-end;
  text-align: right;
}

/* Product headers previously used a three-class centering selector. Keep the
   semantic descriptive columns left aligned at the same specificity. */
.products-screen .products-table.products-table-desktop thead th:is(:nth-child(1), :nth-child(2)),
.products-screen .products-table.products-table-landscape thead th:is(:nth-child(1), :nth-child(2), :nth-child(5)) {
  text-align: left;
}

.products-screen .products-table.products-table-desktop thead th:is(:nth-child(1), :nth-child(2)) .sort-header,
.products-screen .products-table.products-table-landscape thead th:is(:nth-child(1), :nth-child(2), :nth-child(5)) .sort-header {
  justify-content: flex-start;
  text-align: left;
}

/* Shared tab grammar. Primary navigation and in-card subnavigation use the
   same flat surface, type scale, underline, focus state and outline icons. */
.station-area-tabs,
.products-tabs,
.wo-detail-tabs,
.line-detail-tabs,
.global-problem-tabs,
.notes-tabs,
.analytics-tabs,
.material-detail-tabs,
.worker-tabs,
.worker-problem-subtabs,
.station-scope-tabs,
.operator-assignment-tabs {
  gap: 0;
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-sm);
  background: var(--nx-v2-surface);
  box-shadow: none;
  scrollbar-width: none;
}

.station-area-tabs::-webkit-scrollbar,
.products-tabs::-webkit-scrollbar,
.wo-detail-tabs::-webkit-scrollbar,
.line-detail-tabs::-webkit-scrollbar,
.global-problem-tabs::-webkit-scrollbar,
.notes-tabs::-webkit-scrollbar,
.analytics-tabs::-webkit-scrollbar,
.material-detail-tabs::-webkit-scrollbar,
.worker-tabs::-webkit-scrollbar,
.worker-problem-subtabs::-webkit-scrollbar,
.station-scope-tabs::-webkit-scrollbar,
.operator-assignment-tabs::-webkit-scrollbar {
  display: none;
}

.station-area-tabs > button,
.products-tabs > button,
.wo-detail-tabs > button,
.line-detail-tabs > button,
.global-problem-tabs > button,
.notes-tabs > button,
.analytics-tabs > button,
.material-detail-tabs > button,
.worker-tabs > button,
.worker-problem-subtabs > button,
.station-scope-tabs > button,
.operator-assignment-tabs > button {
  min-height: var(--nx-v2-tab-height);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 14px;
  color: var(--nx-v2-muted);
  background: transparent;
  box-shadow: none;
  font-size: var(--nx-v2-tab-font-size);
  font-weight: 650;
}

.station-area-tabs > button.active,
.station-area-tabs > button[aria-selected="true"],
.products-tabs > button.active,
.products-tabs > button[aria-selected="true"],
.wo-detail-tabs > button.active,
.wo-detail-tabs > button[aria-selected="true"],
.line-detail-tabs > button.active,
.line-detail-tabs > button[aria-selected="true"],
.global-problem-tabs > button.active,
.global-problem-tabs > button[aria-selected="true"],
.notes-tabs > button.active,
.notes-tabs > button[aria-selected="true"],
.analytics-tabs > button.active,
.analytics-tabs > button[aria-selected="true"],
.material-detail-tabs > button.active,
.material-detail-tabs > button[aria-selected="true"],
.worker-tabs > button.active,
.worker-tabs > button[aria-selected="true"],
.worker-problem-subtabs > button.active,
.worker-problem-subtabs > button[aria-selected="true"],
.station-scope-tabs > button.active,
.station-scope-tabs > button[aria-selected="true"],
.operator-assignment-tabs > button.active,
.operator-assignment-tabs > button[aria-selected="true"] {
  border-bottom-color: var(--nx-v2-blue);
  color: var(--nx-v2-navy);
  background: var(--nx-v2-blue-soft);
  box-shadow: none;
}

.station-area-tabs > button svg,
.products-tabs > button svg,
.wo-detail-tabs > button svg,
.line-detail-tabs > button svg,
.global-problem-tabs > button svg,
.notes-tabs > button svg,
.analytics-tabs > button svg,
.material-detail-tabs > button svg,
.worker-tabs > button svg,
.worker-problem-subtabs > button svg,
.station-scope-tabs > button svg,
.operator-assignment-tabs > button svg {
  width: 16px;
  height: 16px;
  color: var(--nx-v2-blue);
  stroke-width: var(--nx-v2-icon-stroke);
}

/* KPI pictograms follow the public site's thin outline treatment. Semantic
   colour remains on warnings; the decorative coloured tile is removed. */
.work-orders-screen .work-order-kpi[class*="tone-"] .soft-icon,
.products-screen .product-kpi[class*="tone-"] .soft-icon,
.items-summary-metric .soft-icon,
.base-stat .soft-icon,
.wo-number-card > .soft-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.work-orders-screen .work-order-kpi[class*="tone-"] .soft-icon svg,
.products-screen .product-kpi[class*="tone-"] .soft-icon svg,
.items-summary-metric .soft-icon svg,
.base-stat .soft-icon svg,
.wo-number-card > .soft-icon svg {
  width: var(--nx-v2-icon-size);
  height: var(--nx-v2-icon-size);
  stroke-width: var(--nx-v2-icon-stroke);
}

/* Filter disclosure contract: one calm primary row on desktop, with secondary
   criteria revealed intentionally instead of wrapping into accidental rows. */
.filter-disclosure-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.filter-disclosure-panel > .filter-primary-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.filter-disclosure-panel > .filter-primary-row > label {
  flex: 1 1 126px;
  min-width: 108px;
}

.filter-disclosure-panel > .filter-primary-row > :is(.work-search, .shipment-search, .archive-search, .product-search, .materials-search, .product-search-field),
.global-problem-filters > .filter-primary-row > label:first-child {
  flex: 1.8 1 230px;
  min-width: 190px;
}

.filter-disclosure-panel > .filter-primary-row > button {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
}

.filter-disclosure-panel > .filter-extra-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--nx-v2-border);
}

.filter-disclosure-panel > .filter-extra-row[hidden] {
  display: none;
}

.filter-disclosure-button svg:last-child {
  transition: transform 160ms ease;
}

.filter-disclosure-button.active svg:last-child {
  transform: rotate(180deg);
}

.filter-disclosure-button.active {
  border-color: var(--nx-v2-blue);
  color: var(--nx-v2-navy);
  background: var(--nx-v2-blue-soft);
}

.work-orders-screen .work-orders-desktop-filters.filter-disclosure-panel,
.products-toolbar.filter-disclosure-panel,
.products-filter-card.filter-disclosure-panel,
.shipment-filter-card.filter-disclosure-panel,
.archive-filter-card.filter-disclosure-panel,
.materials-toolbar.filter-disclosure-panel,
.notes-filter-card.filter-disclosure-panel,
.global-problem-filters.filter-disclosure-panel {
  grid-template-columns: minmax(0, 1fr);
}

.work-orders-screen .work-orders-desktop-filters.filter-disclosure-panel > .filter-primary-row,
.work-orders-screen .work-orders-desktop-filters.filter-disclosure-panel > .filter-extra-row {
  grid-column: 1 / -1;
  width: 100%;
}

@media (max-width: 760px) {
  .filter-disclosure-panel > .filter-primary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-disclosure-panel > .filter-primary-row > :is(.work-search, .shipment-search, .archive-search, .product-search, .materials-search, .product-search-field),
  .global-problem-filters > .filter-primary-row > label:first-child {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .filter-disclosure-panel > .filter-primary-row > label,
  .filter-disclosure-panel > .filter-primary-row > button {
    width: 100%;
    min-width: 0;
  }

  .filter-disclosure-panel > .filter-extra-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

table tr:hover td {
  background: #f8fbfd;
}

.status-badge,
.status-tag,
.priority-badge,
.product-type-badge,
.assembly-position-badge,
.product-heading-badge,
.ds-badge {
  border-radius: 999px;
  box-shadow: none;
}

.modal-backdrop {
  background: rgba(10, 25, 49, 0.48);
}

.modal-panel,
.flow-modal,
.ds-modal-card {
  border: 1px solid #c9d7e1;
  border-radius: var(--nx-v2-radius-lg);
  background: var(--nx-v2-surface);
  box-shadow: 0 22px 56px rgba(10, 25, 49, 0.2);
}

.flow-modal-head,
.work-order-modal-head,
.modal-header {
  border-bottom-color: var(--nx-v2-border);
  padding: 16px 18px;
  background: var(--nx-v2-surface);
}

.flow-modal-title h2,
.work-order-modal-head h2,
.modal-header h2 {
  margin: 0;
  color: var(--nx-v2-navy);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.flow-modal-title p,
.work-order-modal-head p,
.modal-header p {
  margin: 3px 0 0;
  color: var(--nx-v2-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.flow-modal-title > span,
.work-order-modal-head small,
.modal-header small {
  color: var(--nx-v2-blue);
  letter-spacing: 0.08em;
}

.flow-modal-footer,
.work-order-modal-actions,
.modal-actions {
  border-top-color: var(--nx-v2-border);
  padding: 12px 18px;
  background: var(--nx-v2-surface-soft);
}

/* Direct modal footers are a permanent action dock. The panel/body owns scrolling,
   so primary navigation never disappears below long phone or tablet forms. */
.modal-panel > footer,
.flow-modal > footer,
.modal-panel > :is(.flow-modal-footer, .work-order-modal-actions, .product-modal-actions, .station-modal-actions, .problem-modal-actions, .manual-segment-footer) {
  position: sticky;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid var(--nx-v2-border);
  background: var(--nx-v2-surface);
  box-shadow: 0 -8px 24px rgba(10, 25, 49, 0.07);
}

.flow-close-button,
.modal-close {
  width: 40px;
  height: 40px;
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-sm);
  color: var(--nx-v2-navy-soft);
  background: var(--nx-v2-surface);
  box-shadow: none;
}

.flow-close-button:hover,
.modal-close:hover {
  border-color: var(--nx-v2-field-border-hover);
  color: var(--nx-v2-navy);
  background: var(--nx-v2-blue-soft);
  transform: none;
}

/* Site-aligned icon language: a clear outline without a decorative tile behind it. */
.flow-modal-icon,
.flow-modal-icon .item-type-icon,
.nx-command-kpi > i,
.nx-command-row-icon,
.team-role-badge {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.flow-modal-icon,
.flow-modal-icon .item-type-icon {
  width: 30px;
  height: 30px;
  color: var(--nx-v2-blue);
}

.flow-modal-icon svg,
.flow-modal-icon .item-type-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.65;
}

.flow-modal-icon.danger,
.nx-command-kpi.warning > i,
.nx-command-row-icon.warning,
.nx-command-kpi.danger > i,
.nx-command-kpi.success > i,
.nx-command-row-icon.success {
  background: transparent;
}

.nx-command-kpi > i,
.nx-command-row-icon {
  width: 30px;
  height: 30px;
  border-radius: 0;
}

.nx-command-kpi > i svg,
.nx-command-row-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.65;
}

.team-role-badge {
  gap: 7px;
  min-height: 26px;
  padding: 3px 0;
  color: var(--nx-v2-navy-soft);
  font-weight: 650;
}

.team-role-badge > svg {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  color: var(--nx-v2-blue);
  stroke-width: 1.65;
}

/* Inputs must remain visually obvious in every data-entry modal. */
.modal-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal-panel select,
.modal-panel textarea,
.flow-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.flow-modal select,
.flow-modal textarea {
  min-height: var(--nx-v2-field-height);
  border: 1px solid var(--nx-v2-field-border);
  border-radius: var(--nx-v2-radius-sm);
  padding: 10px 12px;
  color: var(--nx-v2-navy);
  background: #f5faff;
  box-shadow: inset 0 1px 0 rgba(10, 25, 49, 0.025);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.35;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.modal-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
.modal-panel select:hover,
.modal-panel textarea:hover,
.flow-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
.flow-modal select:hover,
.flow-modal textarea:hover {
  border-color: var(--nx-v2-field-border-hover);
}

.modal-panel input::placeholder,
.modal-panel textarea::placeholder,
.flow-modal input::placeholder,
.flow-modal textarea::placeholder {
  color: #8799a8;
  opacity: 1;
}

.modal-panel input:focus,
.modal-panel select:focus,
.modal-panel textarea:focus,
.flow-modal input:focus,
.flow-modal select:focus,
.flow-modal textarea:focus {
  border-color: var(--nx-v2-blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(74, 127, 167, 0.14);
  outline: 0;
}

.modal-panel :is(input, select, textarea)[aria-invalid="true"],
.flow-modal :is(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--ds-danger, #e11d30);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.1);
}

.modal-panel input[readonly],
.modal-panel textarea[readonly],
.modal-panel input:disabled,
.modal-panel select:disabled,
.flow-modal input[readonly],
.flow-modal textarea[readonly],
.flow-modal input:disabled,
.flow-modal select:disabled {
  border-color: var(--nx-v2-border);
  background: var(--nx-v2-surface-soft);
}

/* One form grammar across every data-entry modal. Labels identify the action,
   editable controls stay visually foregrounded, and helper text stays quiet. */
.modal-panel :is(.field, .wo-modal-field, .material-field, .invoice-field, .customer-field, .problem-description-field) > span,
.flow-modal :is(.field, .wo-modal-field, .material-field, .invoice-field, .customer-field, .problem-description-field) > span {
  color: var(--nx-v2-navy-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-transform: none;
}

.modal-panel :is(.field, .wo-modal-field, .material-field, .invoice-field, .customer-field) > span > b,
.flow-modal :is(.field, .wo-modal-field, .material-field, .invoice-field, .customer-field) > span > b {
  color: var(--ds-danger, #e11d30);
}

.modal-panel :is(.field, .wo-modal-field, .material-field, .invoice-field, .customer-field) > small,
.flow-modal :is(.field, .wo-modal-field, .material-field, .invoice-field, .customer-field) > small {
  color: var(--nx-v2-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.runtime-custom-wizard .custom-wizard-body,
.runtime-problem-modal .problem-modal-body,
.product-wizard-body,
.team-member-body,
.station-wizard-body {
  background: var(--nx-v2-modal-body);
}

.runtime-custom-wizard :is(.panel-card, .manual-worker-picker, .manual-worker-minutes-panel, .manual-allocation-panel, .manual-final-summary),
.runtime-problem-modal :is(.problem-context-card, .flow-choice-section, .problem-description-field, .problem-attachments-section) {
  border: 1px solid var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-md);
  background: var(--nx-v2-surface);
  box-shadow: none;
}

.runtime-problem-modal :is(.flow-choice-section, .problem-description-field, .problem-attachments-section) {
  padding: 14px;
}

.runtime-problem-modal :is(.problem-card-options, .priority-card-options, .stop-work-options) button {
  border-color: var(--nx-v2-field-border);
  border-radius: var(--nx-v2-radius-sm);
  background: var(--nx-v2-surface);
  box-shadow: none;
}

.runtime-problem-modal :is(.problem-card-options, .priority-card-options, .stop-work-options) button.active {
  border-color: var(--nx-v2-blue);
  color: var(--nx-v2-navy);
  background: var(--nx-v2-blue-soft);
  box-shadow: inset 0 0 0 1px var(--nx-v2-blue);
}

/* Work entry uses its content height and keeps the editable controls prominent. */
.modal-panel.flow-modal.runtime-custom-wizard.manual-work-entry-modal.custom-workspace-shell {
  width: min(940px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100dvh - 32px);
}

.manual-work-entry-modal.runtime-custom-wizard .manual-work-entry-body {
  padding: 12px;
  background: var(--nx-v2-modal-body);
}

.manual-work-entry-modal .manual-result-card {
  gap: var(--nx-v2-modal-gap);
  padding: 14px;
}

.manual-work-entry-modal .manual-result-grid,
.manual-work-entry-modal .manual-result-readonly-grid {
  gap: 10px;
}

.manual-work-entry-modal .manual-segment-nav {
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--nx-v2-border);
  background: var(--nx-v2-surface);
}

.manual-work-entry-modal .manual-segment-nav button {
  min-height: 46px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--nx-v2-muted);
  background: transparent;
  box-shadow: none;
  font-size: 12.5px;
}

.manual-work-entry-modal .manual-segment-nav button.active {
  border-bottom-color: var(--nx-v2-blue);
  color: var(--nx-v2-navy);
  background: var(--nx-v2-blue-soft);
}

.manual-work-entry-modal .manual-result-grid .field > span,
.manual-work-entry-modal .manual-worker-search > span,
.manual-work-entry-modal .manual-worker-engagement > span,
.manual-work-entry-modal .manual-worker-allocation-primary span {
  color: var(--nx-v2-navy-soft);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.manual-work-entry-modal .manual-allocation-modes label {
  border-radius: var(--nx-v2-radius-sm);
  background: #ffffff;
  box-shadow: none;
}

.manual-work-entry-modal .manual-allocation-modes label:has(input:checked) {
  border-color: var(--nx-v2-blue);
  background: var(--nx-v2-blue-soft);
  box-shadow: none;
}

.manual-work-entry-modal .manual-readonly-control {
  border-color: #c8d9e5;
  color: var(--nx-v2-navy-soft);
  background: var(--nx-v2-blue-soft);
  font-size: 14px;
  font-weight: 700;
}

/* Progress modes are operational information, not helper copy. Keep both
   Komadno and Procentualno equally readable in tables, details and forms. */
.time-stack em,
.line-detail-card .line-empty-state > strong {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
}

.manual-work-entry-modal .manual-result-card .line-empty-state {
  min-height: 92px;
  place-items: start;
  align-content: center;
  padding: 14px 16px;
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-sm);
  background: var(--nx-v2-surface-soft);
  text-align: left;
}

.manual-work-entry-modal .manual-result-card .line-empty-state span {
  max-width: 440px;
  font-size: 12px;
  line-height: 1.45;
}

/* Every filter reset action has one label, icon and visual contract. */
.filter-reset-button,
button[data-action*="clear-"][data-action*="filter"],
button[data-action$="clear-filters"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-sm);
  color: var(--nx-v2-navy-soft);
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: none;
  white-space: nowrap;
}

.filter-reset-button svg,
button[data-action*="clear-"][data-action*="filter"] svg,
button[data-action$="clear-filters"] svg {
  width: 16px;
  height: 16px;
  color: var(--nx-v2-blue);
}

/* Legacy filter cards may style every nested span as a field label. Action
   captions always inherit the shared button typography and sentence case. */
.shipment-filter-card :is(.filter-reset-button, .filter-disclosure-button) > span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-transform: none;
}

.filter-reset-button:hover:not(:disabled) {
  border-color: var(--nx-v2-field-border-hover);
  color: var(--nx-v2-navy);
  background: var(--nx-v2-blue-soft);
}

.filter-reset-button:disabled {
  opacity: 0.48;
}

/* The initial custom-item decision is intentionally compact. The full workspace
   is only used after the user has chosen a creation path. */
.modal-panel.flow-modal.runtime-custom-wizard.custom-choice-shell {
  width: min(760px, calc(100vw - 32px));
  max-width: min(760px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100dvh - 32px);
}

.runtime-custom-wizard.custom-choice-shell .custom-wizard-body {
  padding: 16px;
  background: var(--nx-v2-surface-soft);
}

.runtime-custom-wizard.custom-choice-shell .custom-choice-grid {
  gap: 12px;
  min-height: 0;
  align-content: start;
}

.runtime-custom-wizard.custom-choice-shell .custom-start-card.flow-source-card {
  min-height: 142px;
  padding: 16px;
  border-left-width: 1px;
  box-shadow: none;
}

.runtime-custom-wizard.custom-choice-shell .custom-start-card .choice-icon {
  width: 28px;
  height: 28px;
  border-radius: 0;
  color: var(--nx-v2-blue);
  background: transparent;
}

.runtime-custom-wizard.custom-choice-shell .custom-start-card .choice-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.65;
}

.runtime-custom-wizard.custom-choice-shell .custom-start-card.flow-source-card b {
  min-height: 36px;
  padding: 0 12px;
}

/* Problem details: content-driven columns, quiet outline icons and one clear
   information hierarchy. Semantic status colours remain unchanged. */
.modal-panel.problem-detail-modal.runtime-problem-detail-modal {
  width: min(1000px, calc(100vw - 32px));
}

.runtime-problem-detail-modal .problem-detail-grid-page {
  align-items: stretch;
}

.runtime-problem-detail-modal .problem-activity-card {
  min-height: 100%;
  align-self: stretch;
}

.runtime-problem-detail-modal .activity-avatar {
  border: 0;
  border-radius: 0;
  color: var(--nx-v2-blue);
  background: transparent;
  box-shadow: none;
}

.runtime-problem-detail-modal .activity-avatar svg {
  width: 19px;
  height: 19px;
  stroke-width: var(--nx-v2-icon-stroke);
}

/* Operation measurement labels remain readable beside the compact progress ring. */
main .operation-progress-block small {
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0;
}

.runtime-problem-detail-modal .flow-icon-chip,
.runtime-problem-detail-modal .problem-detail-meta .soft-icon,
.runtime-problem-detail-modal .problem-context-strip .soft-icon {
  width: 24px;
  height: 24px;
  border-radius: 0;
  color: var(--nx-v2-blue);
  background: transparent;
  box-shadow: none;
}

.runtime-problem-detail-modal .flow-icon-chip svg,
.runtime-problem-detail-modal .problem-detail-meta .soft-icon svg,
.runtime-problem-detail-modal .problem-context-strip .soft-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.65;
}

.runtime-problem-detail-modal .problem-source-note {
  border-color: var(--nx-v2-border);
  color: var(--nx-v2-navy-soft);
  background: var(--nx-v2-blue-soft);
}

.runtime-problem-detail-modal .problem-detail-meta small,
.runtime-problem-detail-modal .problem-context-strip small {
  color: var(--nx-v2-muted);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

/* Machine editing is a compact two-column form, not a full workspace. */
.modal-panel.flow-modal.machine-master-modal {
  width: min(720px, calc(100vw - 32px));
  max-width: min(720px, calc(100vw - 32px));
}

.machine-master-form {
  gap: 14px 16px;
  padding: 18px 20px 20px;
  background: var(--nx-v2-modal-body);
}

.machine-master-form textarea {
  min-height: 82px;
}

.machine-filter-card {
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 0.9fr) minmax(140px, 0.65fr) auto;
  align-items: end;
}

.machines-table {
  min-width: 820px;
  table-layout: auto;
}

.machines-table th:nth-child(1),
.machines-table td:nth-child(1) {
  width: 112px;
  white-space: nowrap;
}

.machines-table th:nth-child(2),
.machines-table td:nth-child(2) {
  width: auto;
  min-width: 170px;
}

.machines-table th:nth-child(3),
.machines-table td:nth-child(3) {
  width: 210px;
}

.machines-table th:nth-child(4),
.machines-table td:nth-child(4) {
  width: 145px;
}

.machines-table th:nth-child(5),
.machines-table td:nth-child(5) {
  width: 106px;
}

.machines-table th:nth-child(6),
.machines-table td:nth-child(6) {
  width: 168px;
}

.machine-station-cell strong,
.machine-table-code {
  font-size: var(--nx-v2-table-body-size);
  font-weight: 650;
}

.machine-station-cell small {
  font-size: 11.5px;
}

.machine-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.machine-row-actions .icon-action {
  width: 36px;
  height: 36px;
}

.machine-status-action {
  min-height: 36px;
  padding-inline: 10px;
  font-size: 11.5px;
}

/* Column alignment follows data semantics everywhere: descriptive content is
   left aligned, numerical content is right aligned, and short operational
   states/actions are centered. */
.machines-table :is(th, td):nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.machines-table th:nth-child(4) .sort-header {
  justify-content: flex-end;
  text-align: right;
}

.machines-table :is(th, td):nth-child(5) {
  text-align: center;
}

.machines-table th:nth-child(5) .sort-header {
  justify-content: center;
}

.global-problem-table th,
.problems-overview .problem-table th {
  text-align: center;
}

.global-problem-table th .sort-header,
.problems-overview .problem-table th .sort-header {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.global-problem-table td,
.problems-overview .problem-table td {
  text-align: center;
}

.global-problem-table :is(th, td):is(:nth-child(1), :nth-child(8)),
.problems-overview .problem-table :is(th, td):is(:nth-child(1), :nth-child(7)) {
  font-variant-numeric: tabular-nums;
}

.global-problem-table :is(th, td):is(:nth-child(3), :nth-child(6), :nth-child(8)),
.problems-overview .problem-table :is(th, td):nth-child(4) {
  text-align: left;
}

.global-problem-table :is(th, td):is(:nth-child(3), :nth-child(6), :nth-child(8)) .sort-header,
.problems-overview .problem-table :is(th, td):nth-child(4) .sort-header {
  justify-content: flex-start;
  text-align: left;
}

.global-problem-operator {
  justify-content: center;
  gap: 7px;
  font-weight: 600;
  white-space: nowrap;
}

.global-problem-operator > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--nx-v2-blue);
  stroke-width: var(--nx-v2-icon-stroke);
}

.machine-mobile-card {
  box-shadow: none;
}

.machine-mobile-card footer {
  align-items: center;
}

@media (max-width: 1180px) {
  .machine-filter-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .machine-filter-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .machine-master-form {
    padding: 14px;
  }

  .machine-mobile-card {
    gap: 10px;
    padding: 13px;
  }

  .machine-mobile-card footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .machine-mobile-card footer button {
    width: 100%;
  }
}

/* Scrap uses the same light outline icon language as the public site. */
.scrap-premium-kpi-icon,
.scrap-premium-empty > span,
.scrap-guidance-card > header > span,
.scrap-material-cost > header span,
.scrap-premium-detail .modal-icon,
.scrap-explainability-modal .modal-icon {
  border: 0;
  border-radius: 0;
  color: var(--nx-v2-blue);
  background: transparent;
  box-shadow: none;
}

.scrap-premium-kpi-icon svg,
.scrap-premium-empty > span svg,
.scrap-guidance-card > header > span svg,
.scrap-material-cost > header span svg,
.scrap-premium-detail .modal-icon svg,
.scrap-explainability-modal .modal-icon svg {
  stroke-width: 1.65;
}

.scrap-analysis-grid {
  align-items: start;
}

.scrap-premium-empty,
.scrap-premium-loading {
  min-height: 104px;
  padding: 18px;
}

.scrap-material-section > .scrap-premium-empty {
  border: 1px solid var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-md);
  background: var(--nx-v2-surface);
}

.scrap-insight-card,
.scrap-premium-kpi,
.scrap-material-quantities,
.scrap-material-cost,
.scrap-guidance-card,
.scrap-events-card {
  box-shadow: none;
}

/* Analytics surfaces share one restrained card treatment while their business
   calculations and navigation stay untouched. */
.analytics-topbar,
.analytics-work-orders-panel,
.analytics-new-analysis,
.analytics-work-order-choice,
.analytics-empty-state {
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-md);
  box-shadow: none;
}

.analytics-work-orders-home {
  gap: 16px;
}

.analytics-screen {
  gap: 14px;
}

.analytics-topbar {
  min-width: 0;
  overflow: hidden;
  padding: 0 12px;
  border-radius: var(--nx-v2-radius-md);
  box-shadow: none;
}

.analytics-tabs {
  width: 100%;
  min-width: 0;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.analytics-tabs::-webkit-scrollbar {
  display: none;
}

.analytics-tabs button,
.operational-analytics-screen .analytics-tabs button {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 0 16px;
  border-bottom-width: 2px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 600;
  scroll-snap-align: start;
}

.analytics-tabs button.active {
  color: var(--nx-v2-navy);
  border-color: var(--nx-v2-blue);
  background: #f1f7fb;
}

.analytics-tabs button svg {
  width: 17px;
  height: 17px;
  color: var(--nx-v2-blue);
  stroke-width: 1.65;
}

.analytics-work-orders-panel {
  padding: 22px 24px;
}

.analytics-work-orders-heading > span {
  min-width: 36px;
  height: 36px;
  border-radius: var(--nx-v2-radius-sm);
  color: var(--nx-v2-blue);
  background: var(--nx-v2-blue-soft);
}

.analytics-work-orders-controls {
  gap: 10px;
  margin: 16px 0;
}

.analytics-work-orders-controls input,
.analytics-work-orders-controls select {
  min-height: 42px;
}

.analytics-work-order-choice {
  padding: 12px 14px;
  border-radius: 10px;
  background: #ffffff;
}

.analytics-empty-state {
  min-height: 76px;
  align-content: center;
  padding: 16px 18px;
  background: var(--nx-v2-surface-soft);
}

.operational-analytics-toolbar,
.operational-analytics-screen .analytics-chart-card,
.operational-analytics-screen .analytics-table-card,
.operational-analytics-screen .operational-kpi-card {
  border-color: var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-md);
  box-shadow: none;
}

.operational-analytics-toolbar-main {
  padding: 10px 12px;
}

.operational-analytics-screen .analytics-kpi-grid {
  gap: 10px;
}

.operational-analytics-screen .operational-kpi-card {
  min-height: 102px;
  gap: 5px;
  padding: 14px 16px;
}

.operational-analytics-screen .operational-kpi-card div {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 0;
  color: var(--nx-v2-blue);
  background: transparent;
}

.operational-analytics-screen .operational-kpi-card div svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.65;
}

.operational-analytics-screen .operational-kpi-card span,
.operational-analytics-screen .operational-kpi-card small {
  color: var(--nx-v2-muted);
  font-size: 12px;
}

.operational-analytics-screen .operational-kpi-card strong {
  color: var(--nx-v2-navy);
  font-size: clamp(18px, 1.45vw, 23px);
  font-weight: 650;
}

.operational-analytics-screen .operational-management-grid {
  grid-template-columns: minmax(320px, 0.78fr) minmax(620px, 1.55fr);
  gap: 10px;
}

.operational-ranking-card {
  padding: 16px;
}

.operational-ranking-card > header {
  margin-bottom: 12px;
}

.operational-ranking-chart i b {
  background: var(--nx-v2-blue);
}

.operational-analytics-screen .analytics-table th,
.operational-analytics-screen .analytics-table td {
  padding: 11px 12px;
  font-size: 12px;
}

.operational-analytics-screen .analytics-table th {
  color: var(--nx-v2-muted);
  background: var(--nx-v2-surface-soft);
  font-size: 10.5px;
}

/* Analytics initialization is a business form, not a narrow confirmation box. */
.modal-panel.flow-modal.wo-analytics-settings-modal.is-start {
  width: min(980px, calc(100vw - 32px));
  max-width: min(980px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
}

.wo-analytics-settings-modal.is-start .wo-analytics-modal-body {
  grid-template-columns: minmax(280px, 0.88fr) minmax(380px, 1.12fr);
  align-items: start;
  gap: 14px 18px;
  padding: 20px 24px;
}

.wo-analytics-settings-modal.is-start .wo-analytics-neutral-message,
.wo-analytics-settings-modal.is-start .wo-analytics-error {
  grid-column: 1 / -1;
  grid-row: 1;
}

.wo-analytics-settings-modal.is-start .wo-analytics-field:has([data-field="baseCurrency"]) {
  grid-column: 1;
  grid-row: 2;
}

.wo-analytics-settings-modal.is-start .wo-analytics-field:has([data-field="contractedValueNetVat"]) {
  grid-column: 1;
  grid-row: 3;
}

.wo-analytics-settings-modal.is-start .wo-analytics-field:has([data-field="laborHourCost"]) {
  grid-column: 1;
  grid-row: 4;
}

.wo-analytics-settings-modal.is-start .wo-analytics-external-start {
  grid-column: 2;
  grid-row: 2 / span 3;
}

.wo-analytics-settings-modal.is-start .wo-analytics-material-start {
  grid-column: 1 / -1;
  grid-row: 5;
}

.wo-analytics-settings-modal .wo-analytics-external-start,
.wo-analytics-settings-modal .wo-analytics-material-start {
  align-self: start;
  padding: 15px;
  border: 1px solid var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-md);
  background: var(--nx-v2-surface-soft);
}

.wo-analytics-settings-modal .wo-analytics-external-start > header {
  padding-top: 0;
  border-top: 0;
}

.wo-analytics-settings-modal .wo-finance-attachment-section {
  padding: 12px;
  border-radius: var(--nx-v2-radius-sm);
  background: #ffffff;
}

.modal-panel.flow-modal.wo-analytics-settings-modal.is-edit {
  width: min(760px, calc(100vw - 32px));
}

.wo-analytics-settings-modal.is-edit .wo-analytics-modal-body {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.wo-analytics-settings-modal.is-edit .wo-analytics-field:last-child {
  grid-column: 1 / -1;
}

.content-signature {
  margin-top: 42px;
  opacity: 0.34;
}

.content-signature img {
  width: 92px;
}

.login-premium .login-brand-panel,
.brand.large {
  background: var(--nx-v2-navy);
  box-shadow: none;
}

.login-premium .login-brand-logo,
.brand.large img,
.position-label-card > header img {
  filter: brightness(0) invert(1);
}

.login-premium .login-brand-logo {
  width: min(100%, 300px);
}

.login-premium .login-form-logo {
  width: min(100%, 240px);
}

.login-premium .login-contact-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-premium .login-contact-links .login-support {
  margin: 0;
}

.official-site-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nx-v2-blue);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
}

.official-site-link:hover {
  color: var(--nx-v2-navy-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.official-site-link svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.7;
}

.settings-account-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.settings-official-site {
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--nx-v2-border);
  border-radius: var(--nx-v2-radius-sm);
  background: var(--nx-v2-surface-soft);
}

.settings-official-site > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-official-site strong {
  color: var(--nx-v2-navy-soft);
  font-size: 13px;
}

.settings-official-site small {
  color: var(--nx-v2-blue);
  font-size: 12px;
}

.mobile-app-bar,
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 980px) {
  :root {
    --nx-mobile-nav-height: 64px;
  }

  /* iOS zooms focused form controls below 16px; keep every phone/tablet input stable. */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  .modal-panel > footer,
  .flow-modal > footer,
  .modal-panel > :is(.flow-modal-footer, .work-order-modal-actions, .product-modal-actions, .station-modal-actions, .problem-modal-actions, .manual-segment-footer) {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .work-order-card [data-action="send-order-shipment"].shipment-action-locked:disabled {
    border-color: #c7d4de;
    color: #718396;
    background: #eef3f6;
    box-shadow: inset 0 0 0 1px rgba(10, 25, 49, 0.03);
    opacity: 1;
    cursor: not-allowed;
  }

  .work-order-card [data-action="send-order-shipment"].shipment-action-locked:disabled svg {
    color: #718396;
  }

  html,
  body,
  #root {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    min-width: 0;
    padding: 0;
    overscroll-behavior: none;
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell > .sidebar {
    display: none;
  }

  .mobile-app-bar {
    position: relative;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: calc(58px + env(safe-area-inset-top));
    padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: var(--nx-v2-navy);
    box-shadow: 0 6px 18px rgba(10, 25, 49, 0.12);
  }

  .mobile-app-bar img {
    width: 112px;
    height: 26px;
    object-fit: contain;
    filter: brightness(0) invert(1);
  }

  .mobile-app-bar div {
    display: grid;
    min-width: 0;
  }

  .mobile-app-bar span {
    overflow: hidden;
    color: #b3cfe5;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .mobile-app-bar strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 15px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content,
  .content-wide {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--nx-mobile-nav-height) + 24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    scrollbar-gutter: stable;
  }

  /* The legacy dashboard used a full-viewport height and visible overflow. In the
     fixed mobile shell that put its final row underneath the bottom navigation. */
  .content.content-dashboard,
  .content.content-dashboard:has(.nx-dashboard-overview) {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--nx-mobile-nav-height) + 24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .topbar {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
  }

  .title-block h1,
  .content-wide .title-block h1,
  .module-title-block h1 {
    font-size: clamp(25px, 7.5vw, 32px);
  }

  .title-block span,
  .module-title-block span {
    font-size: 12px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .content-dashboard .nx-command-header-actions {
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  }

  .content-dashboard .nx-command-company-logo {
    width: 104px;
    max-width: 104px;
    height: 52px;
  }

  .content-dashboard .notification-panel {
    position: fixed;
    top: calc(222px + env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    left: max(16px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - 286px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .content-dashboard .notification-panel > div {
    max-height: inherit;
  }

  .content-dashboard .notification-item > span {
    grid-row: auto;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(var(--mobile-nav-count, 4), minmax(0, 1fr));
    min-height: calc(var(--nx-mobile-nav-height) + env(safe-area-inset-bottom));
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 2px solid #b7d4e7;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -10px 28px rgba(10, 25, 49, 0.12);
  }

  .mobile-bottom-nav > button,
  .mobile-more-menu > summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    min-height: 54px;
    border: 0;
    border-radius: var(--nx-v2-radius-sm);
    padding: 4px 3px;
    color: #71879a;
    background: transparent;
    font-size: 10px;
    font-weight: 650;
    list-style: none;
    text-align: center;
  }

  .mobile-bottom-nav > button::-webkit-details-marker,
  .mobile-more-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-bottom-nav > button svg,
  .mobile-more-menu > summary svg {
    width: 20px;
    height: 20px;
  }

  .mobile-bottom-nav > button.active,
  .mobile-more-menu.active > summary,
  .mobile-more-menu[open] > summary {
    color: var(--nx-v2-navy-soft);
    background: var(--nx-v2-blue-soft);
  }

  .mobile-bottom-nav .nav-problem-badge {
    position: absolute;
    top: 1px;
    left: calc(50% + 7px);
  }

  .mobile-more-menu {
    min-width: 0;
  }

  .mobile-more-panel {
    position: fixed;
    right: 10px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 81;
    overflow: hidden;
    max-height: calc(100dvh - 98px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border: 1px solid var(--nx-v2-border);
    border-radius: var(--nx-v2-radius-lg);
    background: var(--nx-v2-surface);
    box-shadow: 0 24px 60px rgba(10, 25, 49, 0.2);
  }

  .mobile-more-panel > header {
    display: grid;
    gap: 2px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--nx-v2-border);
    background: var(--nx-v2-surface-soft);
  }

  .mobile-more-panel > header span {
    color: var(--nx-v2-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .mobile-more-panel > header strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow-y: auto;
    max-height: calc(100dvh - 185px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 10px;
  }

  .mobile-more-grid button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 46px;
    border: 0;
    border-radius: var(--nx-v2-radius-sm);
    padding: 0 11px;
    color: var(--nx-v2-navy-soft);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
  }

  .mobile-more-grid button.active,
  .mobile-more-grid button:hover {
    color: var(--nx-v2-navy);
    background: var(--nx-v2-blue-soft);
  }

  .mobile-more-grid button svg {
    width: 18px;
    height: 18px;
    color: var(--nx-v2-blue);
  }

  .analytics-topbar {
    padding: 0 6px;
  }

  .analytics-tabs {
    scroll-snap-type: x proximity;
  }

  .analytics-tabs button,
  .operational-analytics-screen .analytics-tabs button {
    min-width: 138px;
    min-height: 48px;
    justify-content: flex-start;
    padding: 0 12px;
    white-space: normal;
  }

  .analytics-work-orders-panel {
    padding: 16px;
  }

  .analytics-work-orders-heading h2 {
    font-size: 23px;
    line-height: 1.15;
  }

  .analytics-work-orders-heading p {
    font-size: 13px;
    line-height: 1.45;
  }

  .analytics-work-orders-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 14px 0;
  }

  .analytics-work-orders-controls label {
    grid-column: auto;
  }

  .operational-analytics-screen .analytics-kpi-grid,
  .operational-analytics-screen .analytics-kpi-grid:has(.operational-kpi-card) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .operational-analytics-screen .operational-kpi-card,
  .operational-analytics-screen .operational-kpi-card:nth-child(n + 4) {
    display: grid;
    min-height: 116px;
    padding: 12px;
  }

  .operational-analytics-screen .operational-management-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-signature {
    display: none;
  }

  .modal-panel.flow-modal.runtime-custom-wizard.manual-work-entry-modal.custom-workspace-shell {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
}

@media (max-width: 480px) {
  .mobile-more-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-actions > button {
    flex: 1 1 150px;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .modal-panel.flow-modal.runtime-custom-wizard.custom-choice-shell {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .runtime-custom-wizard.custom-choice-shell .custom-choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-panel.flow-modal.runtime-custom-wizard.manual-work-entry-modal.custom-workspace-shell {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal-panel.flow-modal.wo-analytics-settings-modal.is-start,
  .modal-panel.flow-modal.wo-analytics-settings-modal.is-edit {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .wo-analytics-settings-modal.is-start .wo-analytics-modal-body,
  .wo-analytics-settings-modal.is-edit .wo-analytics-modal-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .wo-analytics-settings-modal.is-start .wo-analytics-neutral-message,
  .wo-analytics-settings-modal.is-start .wo-analytics-error,
  .wo-analytics-settings-modal.is-start .wo-analytics-field:has([data-field="baseCurrency"]),
  .wo-analytics-settings-modal.is-start .wo-analytics-field:has([data-field="contractedValueNetVat"]),
  .wo-analytics-settings-modal.is-start .wo-analytics-field:has([data-field="laborHourCost"]),
  .wo-analytics-settings-modal.is-start .wo-analytics-external-start,
  .wo-analytics-settings-modal.is-start .wo-analytics-material-start,
  .wo-analytics-settings-modal.is-edit .wo-analytics-field:last-child {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
