* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    border: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

html {
    background-color: rgb(238, 241, 247);
    scroll-padding-top: 90px;
    --app-menu-sticky-offset: 5.8rem;
}

body {
    min-height: 100vh;
    min-width: 320px;
    max-width: 1180px;
    margin: 0 auto;
    background-color: white;
    color: rgba(0, 0, 0, 0.9);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

h1 {
    font-size: 2.35rem;
    line-height: 2.75rem;
    padding-top: 0.75rem;
}

h2 {
    font-size: 1.55rem;
    line-height: 2rem;
    padding-top: 1rem;
}

h3 {
    font-size: 1.2rem;
    line-height: 1.55rem;
    padding-top: 1rem;
    padding-bottom: 0.4rem;
}

p,
ul,
ol,
dl {
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 350;
    text-align: left;
}

p {
    padding-top: 0.8rem;
    padding-bottom: 0.25rem;
}

ul,
ol {
    padding-left: 20px;
}

a:link,
a:visited {
    color: rgba(0, 0, 0, 0.92);
    text-decoration: none;
}

a:hover {
    color: rgb(150, 5, 5);
}

a:active {
    color: rgb(5, 120, 5);
}

button,
input,
select,
textarea {
    font: inherit;
}

.textarea {
    padding: 0 20px 18px;
}

.topbanner {
    width: 100%;
    height: 112px;
    padding: 0 20px;
    background-color: white;
}

.topbanner table {
    width: 100%;
    height: 100%;
    border: none;
    border-collapse: collapse;
    background-color: rgb(0, 20, 120);
}

.topbanner td {
    overflow: hidden;
    white-space: nowrap;
}

.topbanner p {
    color: white;
    font-size: 3.2rem;
    line-height: 3.4rem;
}

.myfooter {
    padding: 14px 20px;
    font-size: 0.86rem;
}

.myfooter table {
    width: 100%;
    min-height: 1.6rem;
    border: none;
    border-collapse: collapse;
    background-color: rgb(0, 20, 120);
    color: white;
}

.myfooter td {
    line-height: 1.35rem;
}

.login {
    max-width: 420px;
    margin: 32px auto 44px;
}

.login h1 {
    padding-top: 0;
    padding-bottom: 10px;
    font-size: 2rem;
    line-height: 2.35rem;
}

.login form {
    display: grid;
    gap: 15px;
}

.login__field {
    display: grid;
    gap: 6px;
}

.login label {
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.95rem;
    line-height: 1.2rem;
    font-weight: 600;
}

.login input[type="text"],
.login input[type="password"] {
    width: 100%;
    border: 1px solid rgba(0, 20, 120, 0.24);
    border-radius: 4px;
    padding: 10px 11px;
    font-size: 1rem;
    line-height: 1.25rem;
}

.login input[type="submit"] {
    width: 100%;
    min-height: 2.55rem;
    border: 1px solid rgb(0, 20, 120);
    border-radius: 4px;
    background-color: rgb(0, 20, 120);
    color: white;
    cursor: pointer;
    font-weight: 650;
}

.login input[type="submit"]:hover {
    background-color: rgb(22, 46, 150);
}

.login__message {
    border-left: 4px solid rgb(150, 5, 5);
    padding: 9px 11px;
    background-color: rgb(255, 245, 245);
    color: rgb(130, 0, 0);
    font-size: 0.95rem;
    line-height: 1.3rem;
}

.login__message small {
    display: block;
    padding-top: 4px;
    color: #8a4b00;
}

.login__message--ok {
    border-left-color: rgb(5, 120, 5);
    background-color: rgb(244, 251, 244);
    color: rgb(3, 90, 3);
}

.app-menu {
    position: sticky;
    top: 0;
    z-index: 9;
    padding: 0 20px;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-style: normal;
}

.app-menu * {
    font-style: normal;
}

.app-menu__context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2rem;
    gap: 20px;
    border: 1px solid rgba(0, 20, 120, 0.14);
    border-bottom: none;
    padding: 0 14px;
    background-color: rgb(247, 248, 251);
}

.app-menu__plant,
.app-menu__user,
.app-menu__user-label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.app-menu__plant,
.app-menu__user {
    font-size: 0.9rem;
    line-height: 1.2rem;
    color: rgba(0, 0, 0, 0.78);
}

.app-menu__plant strong,
.app-menu__user strong,
.app-menu__breadcrumb-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-menu__clock {
    flex: 0 0 auto;
    color: rgba(0, 0, 0, 0.82);
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.app-menu__clock-separator {
    flex: 0 0 auto;
    color: rgba(0, 0, 0, 0.48);
}

.app-menu__user {
    position: relative;
}

.app-menu__user-settings,
.app-menu__logout {
    display: inline-flex;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    border-radius: 4px;
}

.app-menu__user-settings:link,
.app-menu__user-settings:visited,
.app-menu__logout:link,
.app-menu__logout:visited {
    color: rgb(0, 20, 120);
}

.app-menu__user-settings:hover,
.app-menu__user-settings:active,
.app-menu__logout:hover,
.app-menu__logout:active {
    background-color: rgba(0, 20, 120, 0.08);
    color: rgb(150, 5, 5);
}

.app-menu__user-settings:focus-visible,
.app-menu__logout:focus-visible {
    outline: 2px solid rgb(0, 20, 120);
    outline-offset: 1px;
}

.app-menu.is-touch .app-menu__user-settings,
.app-menu.is-touch .app-menu__logout {
    flex-basis: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
}

.app-menu__nav {
    display: flex;
    align-items: stretch;
    min-height: 2.35rem;
    border-left: 1px solid rgb(0, 20, 120);
    border-right: 1px solid rgb(0, 20, 120);
    background-color: rgb(0, 20, 120);
}

.app-menu__link,
.app-menu__dropdown-trigger {
    display: flex;
    align-items: center;
    min-height: 2.35rem;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 0.94rem;
    line-height: 1.2rem;
    font-weight: 500;
}

.app-menu__link {
    padding: 0 15px;
}

.app-menu__link:link,
.app-menu__link:visited,
.app-menu__dropdown-trigger {
    color: white;
}

.app-menu__link:hover,
.app-menu__dropdown-trigger:hover,
.app-menu__dropdown.is-open .app-menu__dropdown-trigger {
    background-color: rgb(22, 46, 150);
    color: white;
}

.app-menu__link.is-active,
.app-menu__dropdown.is-active .app-menu__dropdown-trigger {
    background-color: rgb(150, 5, 5);
    color: white;
    font-weight: 650;
}

.app-menu__dropdown {
    position: relative;
    padding-top: 0;
}

.app-menu__dropdown-link {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    align-self: stretch;
    padding: 0 8px 0 15px;
}

.app-menu__dropdown-link:link,
.app-menu__dropdown-link:visited,
.app-menu__dropdown-link:hover,
.app-menu__dropdown-link:active {
    color: white;
}

.app-menu__dropdown-toggle {
    display: none;
    flex: 0 0 2.1rem;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    font: inherit;
    touch-action: manipulation;
}

.app-menu__dropdown-toggle span {
    transition: transform 0.16s ease;
}

.app-menu__dropdown.is-open .app-menu__dropdown-toggle span {
    transform: rotate(180deg);
}

.app-menu__dropdown-toggle:focus-visible {
    outline: 2px solid white;
    outline-offset: -3px;
}

.app-menu__dropdown-list {
    position: absolute;
    left: 0;
    top: calc(100% + 1px);
    z-index: 20;
    display: none;
    min-width: 220px;
    border: 1px solid rgba(0, 20, 120, 0.18);
    padding: 4px 0;
    background-color: white;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.app-menu__dropdown.is-open > .app-menu__dropdown-list {
    display: block;
}

.app-menu.is-desktop .app-menu__dropdown:hover > .app-menu__dropdown-list {
    display: block;
}

.app-menu.is-touch .app-menu__nav {
    position: relative;
    flex-wrap: wrap;
    overflow: visible;
}

.app-menu.is-touch .app-menu__dropdown {
    position: relative;
}

.app-menu.is-touch .app-menu__dropdown-list {
    left: var(--app-submenu-shift-x, 0);
    right: auto;
    top: 100%;
    width: max-content;
    min-width: max(100%, 220px);
    max-width: calc(100vw - 10px);
}

.app-menu.is-touch .app-menu__dropdown-list a {
    overflow-wrap: anywhere;
    white-space: normal;
}

.app-menu.is-touch .app-menu__dropdown-toggle {
    display: flex;
    flex-basis: 2.75rem;
    min-height: 2.75rem;
}

.app-menu__dropdown-list a {
    display: block;
    padding: 9px 14px;
    font-size: 0.92rem;
    line-height: 1.2rem;
    white-space: nowrap;
}

.app-menu__dropdown-list a:hover {
    background-color: rgb(247, 248, 251);
    color: rgb(150, 5, 5);
}

.app-menu__dropdown-list a.is-active {
    background-color: rgb(238, 241, 250);
    color: rgb(0, 20, 120);
    font-weight: 650;
}

.app-menu__breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 1.35rem;
    border: 1px solid rgba(0, 20, 120, 0.14);
    border-top: none;
    padding: 2px 14px;
    overflow: hidden;
    background-color: rgb(247, 248, 251);
    color: rgba(0, 0, 0, 0.72);
    font-size: 1rem;
    line-height: 1.25rem;
    white-space: nowrap;
}

.app-menu__breadcrumb a:link,
.app-menu__breadcrumb a:visited {
    color: rgb(0, 20, 120);
    font-weight: 400;
}

.app-menu__breadcrumb a:hover {
    color: rgb(150, 5, 5);
}

.app-menu__breadcrumb-current {
    font-weight: 700;
}

.app-menu__breadcrumb-separator {
    color: rgba(0, 0, 0, 0.36);
}

.app-section {
    margin-top: 18px;
    border-top: 2px solid rgba(0, 20, 120, 0.16);
    padding-top: 14px;
}

.textarea > .app-section:first-child,
.textarea > .production-filter:first-child {
    border-top: none;
    padding-top: 0;
}

.app-section--compact {
    margin-top: 10px;
}

.app-section__header,
.app-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.app-section__header h2 {
    padding-top: 0;
}

.app-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

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

.app-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-tile {
    display: block;
    min-height: 112px;
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-radius: 6px;
    padding: 13px;
    background-color: rgb(247, 248, 251);
}

.app-tile:link,
.app-tile:visited,
.app-tile:hover {
    color: rgba(0, 0, 0, 0.92);
}

.app-tile:hover {
    border-color: rgb(150, 5, 5);
}

.app-tile.production-metric--alert,
.app-tile.production-metric--alert:link,
.app-tile.production-metric--alert:visited {
    border-color: rgba(150, 5, 5, 0.55);
    background-color: rgb(255, 235, 235);
    color: rgb(110, 0, 0);
}

.app-tile.production-metric--alert .app-tile__label,
.app-tile.production-metric--alert small {
    color: rgba(110, 0, 0, 0.78);
}

.app-tile.production-metric--alert:hover {
    border-color: rgb(150, 5, 5);
    background-color: rgb(255, 224, 224);
}

.app-tile--disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.app-tile--disabled:hover {
    border-color: rgba(0, 20, 120, 0.18);
}

.app-tile__label,
.app-kpi__label {
    display: block;
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.82rem;
    line-height: 1.1rem;
}

.app-tile strong {
    display: block;
    padding-top: 8px;
    font-size: 1.38rem;
    line-height: 1.55rem;
}

.app-tile small {
    display: block;
    padding-top: 4px;
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.88rem;
    line-height: 1.15rem;
}

.app-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.app-summary > div {
    min-width: 0;
    border-left: 4px solid rgb(0, 20, 120);
    padding: 10px 12px;
    background-color: rgb(247, 248, 251);
}

.app-summary strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1.4rem;
}

.missing-data-banner {
    display: block;
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-radius: 6px;
    padding: 14px 16px;
    background-color: rgb(247, 248, 251);
    font-size: 1rem;
    line-height: 1.35rem;
    font-weight: 750;
}

.missing-data-banner:link,
.missing-data-banner:visited,
.missing-data-banner:hover {
    color: rgb(110, 0, 0);
}

.missing-data-banner.is-alerting {
    border-color: rgba(150, 5, 5, 0.62);
    background-color: rgb(255, 232, 232);
    animation: missing-data-pulse 6s ease-in-out infinite;
}

.missing-data-banner--empty {
    color: rgba(0, 0, 0, 0.72);
    font-weight: 650;
}

.missing-data-filter-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-left: 4px solid rgb(150, 5, 5);
    padding: 10px 12px;
    background-color: rgb(255, 242, 242);
}

.missing-data-filter-notice strong {
    display: block;
    font-size: 1rem;
    line-height: 1.35rem;
}

@keyframes missing-data-pulse {
    0%,
    33.333%,
    100% {
        box-shadow: 0 0 0 rgba(150, 5, 5, 0);
    }

    16.667% {
        box-shadow: 0 0 0 4px rgba(150, 5, 5, 0.2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .missing-data-banner.is-alerting {
        animation: none;
    }
}

.app-toolbar,
.app-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.app-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.app-form {
    max-width: 680px;
}

.app-toolbar label,
.app-form label {
    display: grid;
    gap: 5px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.app-toolbar input,
.app-toolbar select,
.app-form input,
.app-form select,
.app-form textarea {
    width: 100%;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 8px 9px;
    background-color: white;
}

.app-form textarea {
    resize: vertical;
}

.user-settings-form {
    max-width: 520px;
}

.user-settings-form__hint {
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.9rem;
    line-height: 1.35rem;
}

.user-settings-form__result {
    max-width: 520px;
}

.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    border: 1px solid rgb(0, 20, 120);
    border-radius: 4px;
    padding: 0 13px;
    background-color: rgb(0, 20, 120);
    color: white;
    cursor: pointer;
    font-size: 0.94rem;
    line-height: 1.1rem;
    font-weight: 650;
}

.app-button:link,
.app-button:visited,
.app-button:hover {
    color: white;
}

.app-button:hover {
    background-color: rgb(22, 46, 150);
}

.app-button--secondary {
    background-color: white;
    color: rgb(0, 20, 120);
}

.app-button--secondary:link,
.app-button--secondary:visited {
    color: rgb(0, 20, 120);
}

.app-button--secondary:hover {
    background-color: rgb(247, 248, 251);
    color: rgb(150, 5, 5);
}

.app-button--disabled,
.app-button--disabled:hover,
.app-button:disabled,
.app-button:disabled:hover {
    border-color: rgba(0, 20, 120, 0.18);
    background-color: rgb(247, 248, 251);
    color: rgba(0, 0, 0, 0.42);
    cursor: not-allowed;
}

.app-table-wrap {
    margin-top: 10px;
    overflow-x: auto;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
    line-height: 1.25rem;
}

.app-table th,
.app-table td {
    border-bottom: 1px solid rgba(0, 20, 120, 0.18);
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.app-table th {
    border-top: 1px solid rgba(0, 20, 120, 0.18);
    border-bottom: 2px solid rgba(0, 20, 120, 0.34);
    background-color: rgb(229, 234, 246);
    color: rgb(0, 20, 120);
    font-weight: 700;
    white-space: nowrap;
}

.app-sticky-table__bar {
    position: sticky;
    top: var(--app-menu-sticky-offset);
    z-index: 7;
    margin-top: -1px;
    border-top: 1px solid rgba(0, 20, 120, 0.16);
    border-bottom: 1px solid rgba(0, 20, 120, 0.18);
    padding: 8px 0 0;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.06);
}

.app-sticky-table__bar .setup-tabs {
    margin-top: 10px;
}

.app-sticky-table {
    --app-table-head-sticky-offset: var(--app-menu-sticky-offset);
}

.app-sticky-table .app-table-wrap {
    overflow-x: visible;
}

.app-sticky-table .app-table th {
    position: sticky;
    top: var(--app-table-head-sticky-offset);
    z-index: 6;
}

.app-table:not(.production-detail-table) tbody tr:nth-child(even) {
    background-color: rgb(238, 242, 249);
}

.app-table:not(.production-detail-table) tbody tr:nth-child(odd) {
    background-color: white;
}

[data-production-progress-control] .app-table tbody tr[data-execution-open="1"] {
    background-color: rgb(230, 246, 236);
}

[data-production-progress-control] .app-table tbody tr[data-execution-open="1"] td:first-child {
    box-shadow: inset 3px 0 rgb(48, 130, 78);
}

.app-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding-left: 0;
    list-style: none;
}

.app-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-radius: 6px;
    padding: 10px;
    background-color: white;
}

.app-steps span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background-color: rgb(0, 20, 120);
    color: white;
    font-size: 0.86rem;
    font-weight: 700;
}

.app-steps strong {
    font-size: 0.94rem;
    line-height: 1.15rem;
}

.production-workbench {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 14px;
    margin-top: 18px;
}

.production-panel {
    border: 1px solid rgba(0, 20, 120, 0.16);
    border-radius: 6px;
    padding: 14px;
    background-color: rgb(250, 251, 253);
}

.production-panel--controls {
    display: grid;
    gap: 12px;
}

.production-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.production-panel__header h2 {
    padding-top: 0;
}

.production-panel label {
    display: grid;
    gap: 5px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.production-panel input,
.production-panel select {
    width: 100%;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 8px 9px;
    background-color: white;
}

.production-checks {
    display: grid;
    gap: 8px;
    margin-top: 2px;
}

.production-checks label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.production-checks input {
    width: auto;
    margin-top: 2px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    border: 1px solid rgba(0, 20, 120, 0.2);
    border-radius: 999px;
    padding: 0 10px;
    background-color: white;
    color: rgb(0, 20, 120);
    font-size: 0.82rem;
    line-height: 1rem;
    font-weight: 650;
    white-space: nowrap;
}

.status-badge--draft {
    border-color: rgba(150, 5, 5, 0.22);
    color: rgb(150, 5, 5);
}

.production-run {
    display: grid;
    gap: 10px;
    padding-left: 0;
    list-style: none;
}

.production-run li {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    gap: 2px 9px;
    border-left: 3px solid rgba(0, 20, 120, 0.18);
    padding: 8px 0 8px 10px;
}

.production-run li.is-ready {
    border-left-color: rgb(0, 20, 120);
}

.production-run span {
    display: inline-flex;
    grid-row: span 2;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: rgb(0, 20, 120);
    color: white;
    font-size: 0.82rem;
    font-weight: 700;
}

.production-run strong {
    font-size: 0.98rem;
    line-height: 1.2rem;
}

.production-run small {
    color: rgba(0, 0, 0, 0.66);
    font-size: 0.86rem;
    line-height: 1.15rem;
}

.production-metric {
    min-height: 104px;
}

.production-calendar {
    min-width: 760px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 20, 120, 0.14);
    border-radius: 6px;
}

.production-calendar__row {
    display: grid;
    grid-template-columns: 130px repeat(5, minmax(110px, 1fr));
}

.production-calendar__row > * {
    min-height: 2.55rem;
    border-right: 1px solid rgba(0, 20, 120, 0.12);
    border-bottom: 1px solid rgba(0, 20, 120, 0.12);
    padding: 8px;
    font-size: 0.88rem;
    line-height: 1.1rem;
}

.production-calendar__row > *:last-child {
    border-right: none;
}

.production-calendar__row:last-child > * {
    border-bottom: none;
}

.production-calendar__row--head > * {
    background-color: rgb(229, 234, 246);
    color: rgb(0, 20, 120);
    font-weight: 700;
}

.production-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.production-slot--empty {
    color: rgba(0, 0, 0, 0.55);
    background-color: rgba(0, 20, 120, 0.04);
}

.production-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 14px;
    border-top: 2px solid rgba(0, 20, 120, 0.16);
    padding-top: 14px;
}

.orders-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.articles-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr)) minmax(240px, 2fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.colors-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.colors-filter label {
    display: grid;
    gap: 4px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.88rem;
    font-weight: 650;
}

.colors-filter select,
.colors-filter input {
    width: 100%;
    min-height: 2.2rem;
    border: 1px solid rgba(0, 20, 120, 0.24);
    border-radius: 4px;
    padding: 6px 8px;
    background-color: white;
}

.colors-edit-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(0, 20, 120, 0.14);
    padding: 9px 0;
}

.colors-edit-bar[hidden] {
    display: none;
}

.colors-edit-bar > span {
    margin-right: auto;
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.88rem;
    font-weight: 650;
}

.colors-result-count {
    padding: 0 0 8px;
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.88rem;
    font-weight: 650;
}

.colors-table select {
    width: 100%;
    min-width: 180px;
    min-height: 2.1rem;
    border: 1px solid rgba(0, 20, 120, 0.3);
    border-radius: 4px;
    padding: 5px 7px;
    background-color: white;
}

.articles-filter label {
    display: grid;
    gap: 4px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.88rem;
    font-weight: 650;
}

.articles-filter select,
.articles-filter input {
    width: 100%;
    min-height: 2.2rem;
    border: 1px solid rgba(0, 20, 120, 0.24);
    border-radius: 4px;
    padding: 6px 8px;
    background-color: white;
}

.articles-result-count {
    padding: 0 0 8px;
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.88rem;
    font-weight: 650;
}

.articles-table tbody tr[data-article-row] {
    cursor: pointer;
}

.articles-table tbody tr[data-article-row]:hover,
.articles-table tbody tr[data-article-row]:focus {
    outline: 2px solid rgba(0, 20, 120, 0.28);
    outline-offset: -2px;
    background-color: rgb(239, 243, 253);
}

.article-detail-dialog {
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.article-detail-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.46);
}

.article-detail-dialog form {
    display: grid;
    gap: 18px;
    padding: 20px;
}

.article-detail-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(0, 20, 120, 0.16);
    padding-bottom: 12px;
}

.article-detail-dialog__header h2 {
    margin: 2px 0 0;
}

.article-detail-readonly {
    margin: 0;
    border-radius: 4px;
    padding: 9px 11px;
    background-color: rgb(245, 246, 249);
    color: rgba(0, 0, 0, 0.72);
    font-size: 0.88rem;
}

.article-dialog-close {
    border: 0;
    padding: 6px;
    background: transparent;
    color: rgb(0, 20, 120);
    cursor: pointer;
    font-size: 1.3rem;
}

.article-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.article-detail-grid label {
    display: grid;
    align-content: start;
    gap: 5px;
    color: rgba(0, 0, 0, 0.65);
    font-size: 0.82rem;
}

.article-detail-grid strong {
    min-height: 2.15rem;
    border-radius: 4px;
    padding: 7px 8px;
    background-color: rgb(245, 246, 249);
    color: rgba(0, 0, 0, 0.88);
    font-size: 0.92rem;
}

.article-detail-grid select {
    width: 100%;
    min-height: 2.15rem;
    border: 1px solid rgba(0, 20, 120, 0.3);
    border-radius: 4px;
    padding: 6px 8px;
    background-color: white;
}

.article-detail-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid rgba(0, 20, 120, 0.16);
    padding-top: 14px;
}

.order-state-editor {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    border-top: 1px solid rgba(0, 20, 120, 0.16);
    padding: 10px 0;
}

.order-state-editor__filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 10px;
    align-items: end;
}

.order-state-editor__filters label,
.order-state-editor__commands label {
    display: grid;
    gap: 4px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.84rem;
    line-height: 1.1rem;
}

.order-state-editor__filters .order-state-editor__notes-filter {
    display: flex;
    min-height: 2.15rem;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-radius: 4px;
    padding: 6px 8px;
    background-color: rgba(229, 234, 246, 0.55);
    font-weight: 700;
}

.order-state-editor__notes-filter input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    flex: 0 0 auto;
}

.order-state-editor select,
.order-state-editor input[type="search"],
.order-state-editor__row-state {
    width: 100%;
    min-height: 2.15rem;
    border: 1px solid rgba(0, 20, 120, 0.24);
    border-radius: 4px;
    padding: 6px 8px;
    background-color: white;
}

.order-state-editor__commands {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.order-state-editor__commands > span {
    margin-right: auto;
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.88rem;
    font-weight: 650;
}

.order-state-editor__commands label {
    min-width: 210px;
}

.order-state-editor__select-column {
    width: 1%;
    min-width: 42px;
    text-align: center !important;
}

.order-state-editor__select-column input {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
}

.order-delivery-editor {
    display: grid;
    gap: 5px;
}

.order-delivery-editor[hidden] {
    display: none;
}

.order-delivery-editor input[type="datetime-local"] {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(0, 20, 120, 0.3);
    border-radius: 4px;
    padding: 5px 4px;
    background-color: white;
    font: inherit;
}

.order-delivery-editor label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(0, 0, 0, 0.74);
    font-size: 0.76rem;
    font-weight: 700;
}

.order-delivery-editor input[type="checkbox"] {
    margin: 0;
}

.orders-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    white-space: nowrap;
}

.orders-sort-button:focus-visible {
    outline: 2px solid rgb(0, 20, 120);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.data-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.optimization-filter {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 14px;
}

.production-filter label {
    display: grid;
    gap: 5px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.orders-filter label {
    display: grid;
    gap: 5px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.data-filter label {
    display: grid;
    gap: 5px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.optimization-filter label {
    display: grid;
    gap: 5px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.optimization-filter__check {
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 2.25rem;
}

.production-filter select,
.production-filter__readonly,
.orders-filter select,
.data-filter select,
.optimization-filter select,
.optimization-filter input[type="number"] {
    width: 100%;
    min-height: 2.25rem;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 8px 9px;
    background-color: white;
}

.optimization-filter input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.production-filter__readonly {
    display: flex;
    align-items: center;
}

.optimization-scenario {
    border-top: 1px solid rgba(0, 20, 120, 0.14);
    padding: 10px 0;
}

.optimization-scenario:first-of-type {
    border-top: 0;
}

.optimization-scenario summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    padding: 4px 0 12px;
}

.optimization-scenario summary strong,
.optimization-table strong {
    display: block;
}

.optimization-scenario summary small,
.optimization-table small {
    display: block;
    margin-top: 2px;
    color: rgba(0, 0, 0, 0.58);
}

.optimization-scenario__state {
    text-align: right;
}

.optimization-order-warning {
    display: grid;
    gap: 3px;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(175, 35, 35, 0.32);
    border-radius: 6px;
    background-color: rgb(255, 241, 241);
    color: rgb(128, 24, 24);
    font-size: 0.88rem;
    line-height: 1.2rem;
}

.optimization-order-warning strong {
    color: rgb(112, 18, 18);
}

.optimization-table__row--blocked {
    background-color: rgb(255, 246, 246);
    color: rgb(120, 31, 31);
}

.optimization-table__row--blocked small {
    color: rgba(120, 31, 31, 0.72);
}

.optimization-resource-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin: 14px 0;
}

.optimization-resource-panel {
    border: 1px solid rgba(0, 20, 120, 0.16);
    border-radius: 6px;
    padding: 12px;
    background-color: rgb(250, 251, 255);
}

.optimization-resource-panel h3 {
    margin: 0 0 8px;
    color: rgb(0, 20, 120);
    font-size: 1rem;
}

.optimization-resource-panel p {
    margin: 0 0 10px;
    color: rgba(0, 0, 0, 0.68);
}

.optimization-setup-characteristic-heading {
    display: grid;
    gap: 2px;
    margin-bottom: 8px;
}

.optimization-setup-characteristic-heading h3 {
    margin: 0;
}

.optimization-setup-characteristic-heading span {
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.82rem;
    font-weight: 600;
}

.optimization-threshold-row-group > td {
    background-color: white;
}

.optimization-threshold-row-group.optimization-threshold-row-group--alternate > td {
    background-color: rgb(241, 244, 251);
}

.optimization-resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 7px;
}

.optimization-resource-option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 8px;
    border: 1px solid rgba(0, 20, 120, 0.12);
    border-radius: 5px;
    padding: 8px;
    background-color: white;
}

.optimization-resource-option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    margin-top: 2px;
}

.optimization-resource-option input[type="checkbox"]:disabled + span {
    color: rgba(0, 0, 0, 0.62);
}

.optimization-resource-option small {
    display: block;
    color: rgba(0, 0, 0, 0.58);
}

.optimization-resource-availability {
    display: grid;
    gap: 2px;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(0, 20, 120, 0.1);
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.78rem;
    line-height: 1.35;
}

.optimization-resource-availability > span {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
}

.optimization-resource-availability i {
    width: 0.85rem;
    flex: 0 0 auto;
    color: rgb(43, 73, 151);
    text-align: center;
}

.optimization-resource-availability strong {
    color: inherit;
    font-size: inherit;
}

.optimization-resource-count--critical {
    color: rgb(154, 20, 20);
    font-weight: 800;
}

.optimization-resource-article-table {
    max-height: 23rem;
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-radius: 4px;
    overflow: auto;
}

.optimization-resource-article-table .app-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 rgba(0, 20, 120, 0.34);
}

.optimization-performance-list {
    display: grid;
    gap: 10px;
}

.optimization-performance {
    border: 1px solid rgba(0, 20, 120, 0.16);
    border-radius: 6px;
    background-color: rgb(252, 252, 253);
}

.optimization-performance.is-selected {
    border-color: rgba(22, 104, 66, 0.5);
    background-color: rgb(248, 253, 250);
}

.optimization-performance__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 11px 12px;
}

.optimization-performance__selector {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    cursor: pointer;
}

.optimization-performance__selector input[type="checkbox"],
.optimization-performance-null input[type="checkbox"],
.optimization-performance-boolean input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    margin: 2px 0 0;
}

.optimization-performance__selector strong,
.optimization-performance__selector small,
.optimization-performance__result span,
.optimization-performance__result small {
    display: block;
}

.optimization-performance__selector small,
.optimization-performance__result small,
.optimization-performance-parameter small {
    margin-top: 2px;
    color: rgba(0, 0, 0, 0.58);
    font-size: 0.8rem;
    line-height: 1rem;
}

.optimization-performance__result {
    min-width: 110px;
    text-align: right;
}

.optimization-performance__parameters {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 10px;
    border-top: 1px solid rgba(0, 20, 120, 0.12);
    padding: 12px;
}

.optimization-performance__parameters[hidden] {
    display: none;
}

.optimization-performance-parameter {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.optimization-performance-parameter > label:first-child {
    min-height: 2.4rem;
}

.optimization-performance-parameter input[type="text"],
.optimization-performance-parameter input[type="number"],
.optimization-performance-parameter input[type="datetime-local"],
.optimization-performance-parameter select {
    width: 100%;
    min-width: 0;
    min-height: 2.25rem;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 7px 8px;
    background-color: white;
}

.optimization-performance-null,
.optimization-performance-boolean {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    width: fit-content;
    color: rgba(0, 0, 0, 0.72);
    font-size: 0.84rem;
}

.optimization-performance-actions {
    justify-content: space-between;
    margin-top: 12px;
}

.optimization-performance-selection--invalid {
    color: rgb(154, 20, 20);
    font-weight: 700;
}

.optimization-run-config-section {
    display: grid;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid rgba(0, 20, 120, 0.12);
}

.optimization-run-config-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.optimization-run-config-section > select,
.optimization-run-config-operator select,
.optimization-run-config-horizon input {
    width: 100%;
    min-height: 2.3rem;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 7px 8px;
    background-color: white;
}

.optimization-run-config-heading strong,
.optimization-run-config-heading small,
.optimization-run-config-horizon strong,
.optimization-run-config-horizon small {
    display: block;
}

.optimization-run-config-heading small,
.optimization-run-config-horizon small {
    margin-top: 2px;
    color: rgba(0, 0, 0, 0.58);
    font-size: 0.8rem;
}

.optimization-run-config-title > strong {
    color: rgb(0, 20, 120);
    font-size: 1.12rem;
    line-height: 1.35;
}

.optimization-run-config-parameters,
.optimization-run-config-operator-parameters {
    border-left: 3px solid rgba(43, 73, 151, 0.42);
    padding-left: 12px;
}

.optimization-run-config-parameters[hidden],
.optimization-run-config-operator[hidden],
.optimization-run-config-operator-parameters[hidden] {
    display: none;
}

.optimization-run-config-operators {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.optimization-run-config-operator {
    display: grid;
    align-content: start;
    gap: 9px;
    min-width: 0;
}

.optimization-run-config-operator > label {
    display: grid;
    gap: 5px;
}

.optimization-run-config-horizon {
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 420px);
    align-items: end;
}

.optimization-table td:nth-child(5),
.optimization-table td:nth-child(7) {
    white-space: nowrap;
}

.optimization-table--compact th,
.optimization-table--compact td {
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 0.86rem;
    line-height: 1.1rem;
}

.optimization-table--compact small {
    padding-top: 1px;
    font-size: 0.78rem;
    line-height: 0.95rem;
}

.optimization-table--compact input[type="checkbox"] {
    width: 0.95rem;
    height: 0.95rem;
    min-height: 0;
    margin: 0;
}

.optimization-form {
    max-width: 760px;
}

.optimization-mini-form {
    display: grid;
    gap: 8px;
    min-height: auto;
}

.optimization-mini-form label {
    display: grid;
    gap: 4px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.88rem;
    line-height: 1.15rem;
}

.optimization-mini-form input,
.optimization-mini-form select,
.optimization-mini-form textarea {
    width: 100%;
    min-height: 2.1rem;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 7px 8px;
    background-color: white;
}

.optimization-mini-form textarea {
    resize: vertical;
}

.optimization-mini-form > .app-button {
    width: max-content;
    justify-self: start;
}

.optimization-create {
    margin-top: 10px;
}

.optimization-create > summary {
    width: max-content;
    list-style: none;
    cursor: pointer;
}

.optimization-create > summary::-webkit-details-marker {
    display: none;
}

.optimization-create[open] > summary {
    margin-bottom: 10px;
}

.app-section__header > .optimization-create--wide[open] {
    flex: 1 0 100%;
    width: 100%;
}

.optimization-create--wide > summary {
    margin-left: auto;
}

.optimization-create--wide > .optimization-mini-form {
    width: 100%;
}

.optimization-mini-form__actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.optimization-mini-form__actions > .app-button {
    width: max-content;
}

.optimization-sequence,
.optimization-stage,
.optimization-run {
    margin-top: 14px;
    border: 1px solid rgba(0, 20, 120, 0.16);
    border-radius: 6px;
    background-color: rgb(250, 251, 253);
}

.optimization-sequence {
    padding: 12px;
}

.optimization-stage,
.optimization-run {
    padding: 0;
}

.optimization-node-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
}

.optimization-sequence > .optimization-node-head {
    border-bottom: 1px solid rgba(0, 20, 120, 0.12);
    padding: 0 0 10px;
}

.optimization-stage-orders > summary.optimization-node-head,
.optimization-run > summary.optimization-node-head {
    list-style: none;
    cursor: pointer;
}

.optimization-stage-orders > summary.optimization-node-head::-webkit-details-marker,
.optimization-run > summary.optimization-node-head::-webkit-details-marker {
    display: none;
}

.optimization-node-head strong {
    display: block;
    font-size: 1rem;
    line-height: 1.25rem;
}

.optimization-node-head small {
    display: block;
    padding-top: 3px;
    color: rgba(0, 0, 0, 0.66);
}

.optimization-node-head__meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.88rem;
}

.optimization-node-head__meta .app-button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.optimization-node-body {
    border-top: 1px solid rgba(0, 20, 120, 0.12);
    padding: 10px 12px 12px;
    background-color: white;
}

.optimization-node-body--runs {
    background-color: rgb(250, 251, 253);
}

.optimization-popup-lock {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background-color: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(2px);
}

.optimization-popup-lock[hidden] {
    display: none;
}

.optimization-popup-lock > div {
    max-width: 420px;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 6px;
    padding: 18px 20px;
    background-color: white;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    text-align: center;
}

.optimization-popup-lock strong,
.optimization-popup-lock span {
    display: block;
}

.optimization-popup-lock span {
    padding-top: 6px;
    color: rgba(0, 0, 0, 0.68);
}

.optimization-run-detail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.optimization-run-detail strong {
    display: block;
    padding-top: 4px;
    font-size: 0.96rem;
}

.optimization-results-context {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 14px;
    border: 1px solid rgba(0, 20, 120, 0.16);
    background-color: rgba(0, 20, 120, 0.14);
}

.optimization-results-context > div {
    min-width: 0;
    padding: 11px 12px;
    background-color: rgb(250, 251, 253);
}

.optimization-results-context strong,
.optimization-results-context small {
    display: block;
    overflow-wrap: anywhere;
}

.optimization-results-context strong {
    padding-top: 3px;
}

.optimization-results-context small {
    padding-top: 2px;
    color: rgba(0, 0, 0, 0.62);
}

.optimization-results-counts {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.optimization-results-counts span {
    border-left: 3px solid rgba(0, 20, 120, 0.34);
    padding: 4px 8px;
    background-color: rgb(247, 248, 251);
    white-space: nowrap;
}

.optimization-results-notice,
.optimization-results-empty {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    border: 1px solid rgba(160, 90, 0, 0.24);
    padding: 10px 12px;
    background-color: rgb(255, 249, 235);
    color: rgba(90, 45, 0, 0.92);
}

.optimization-results-empty {
    border-color: rgba(0, 20, 120, 0.18);
    background-color: rgb(247, 248, 251);
    color: rgba(0, 0, 0, 0.76);
}

.optimization-results-empty strong,
.optimization-results-empty span {
    display: block;
}

.optimization-results-empty span {
    padding-top: 3px;
}

.optimization-results-table-wrap {
    max-height: min(66vh, 720px);
    overflow: auto;
}

.optimization-results-table {
    min-width: 780px;
}

.optimization-results-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0;
}

.optimization-results-table th > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    width: 100%;
    min-height: 3rem;
    border: 0;
    padding: 8px 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    white-space: nowrap;
}

.optimization-results-table th > button:hover,
.optimization-results-table th > button:focus-visible {
    background-color: rgb(216, 224, 242);
}

.optimization-results-table th small {
    display: block;
    color: rgba(0, 20, 120, 0.7);
    font-size: 0.76rem;
    font-weight: 600;
}

.optimization-results-table tbody tr:nth-child(even) {
    background-color: rgb(248, 249, 252);
}

.optimization-results-value {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.optimization-results-pareto {
    color: rgb(12, 105, 58);
    font-weight: 700;
    white-space: nowrap;
}

.optimization-results-tail {
    color: rgba(0, 0, 0, 0.62);
}

.optimization-results-solution-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: rgb(0, 20, 120);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.optimization-results-solution-link:hover,
.optimization-results-solution-link:focus-visible {
    color: rgb(150, 5, 5);
}

.optimization-results-table tr.is-gantt-selected {
    background-color: rgb(236, 242, 252);
}

.optimization-run-results-page.optimization-run-results-page--gantt-open {
    width: 100%;
    max-width: none;
}

.optimization-gantt-section {
    scroll-margin-top: 12px;
}

.optimization-gantt-zoom {
    display: inline-grid;
    grid-template-columns: 2.25rem minmax(78px, auto) 2.25rem;
    align-items: center;
    min-height: 2.25rem;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    background-color: white;
}

.optimization-gantt-zoom button {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.2rem;
    border: 0;
    background: transparent;
    color: rgb(0, 20, 120);
    cursor: pointer;
}

.optimization-gantt-zoom button:hover,
.optimization-gantt-zoom button:focus-visible {
    background-color: rgb(235, 239, 249);
    color: rgb(150, 5, 5);
}

.optimization-gantt-zoom output {
    border-right: 1px solid rgba(0, 20, 120, 0.14);
    border-left: 1px solid rgba(0, 20, 120, 0.14);
    padding: 0 8px;
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
}

.optimization-gantt-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    color: rgba(0, 0, 0, 0.72);
    font-size: 0.88rem;
    font-weight: 650;
}

.optimization-gantt-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.optimization-gantt-legend i {
    display: inline-block;
    width: 24px;
    height: 11px;
    border: 1px solid;
}

.optimization-gantt-legend__setup {
    border-color: rgb(60, 64, 70) !important;
    background-color: rgba(60, 64, 70, 0.78);
}

.optimization-gantt-legend__production {
    border-color: rgb(20, 100, 165) !important;
    background-color: rgba(50, 145, 205, 0.58);
}

.optimization-gantt-root {
    --optimization-gantt-layer-availability: 1;
    --optimization-gantt-layer-grid: 2;
    --optimization-gantt-layer-activity: 3;
    --optimization-gantt-layer-activity-focus: 4;
    --optimization-gantt-layer-now: 5;
    --optimization-gantt-layer-delivery: 6;
    --optimization-gantt-layer-axis: 10;
    --optimization-gantt-layer-header: 20;
    --optimization-gantt-layer-corner: 30;
    margin-top: 10px;
}

.optimization-gantt-scroll {
    max-height: 72vh;
    border: 1px solid rgba(0, 20, 120, 0.2);
    overflow: auto;
    background-color: white;
}

.optimization-gantt-scroll--editor {
    width: 100%;
    height: 100%;
    max-height: none;
}

.optimization-gantt-canvas {
    width: 100%;
    min-width: 100%;
}

.optimization-gantt-header {
    position: sticky;
    top: 0;
    z-index: var(--optimization-gantt-layer-header);
    display: grid;
    min-height: 62px;
    border-bottom: 2px solid rgba(0, 20, 120, 0.3);
    background-color: rgb(229, 234, 246);
}

.optimization-gantt-corner,
.optimization-gantt-resource-header {
    display: flex;
    min-width: 0;
    padding: 8px 10px;
}

.optimization-gantt-corner {
    position: sticky;
    left: 0;
    z-index: var(--optimization-gantt-layer-corner);
    align-items: center;
    border-right: 2px solid rgba(0, 20, 120, 0.28);
    background-color: rgb(229, 234, 246);
    color: rgb(0, 20, 120);
    font-weight: 700;
}

.optimization-gantt-resource-header {
    justify-content: center;
    flex-direction: column;
    border-right: 1px solid rgba(0, 20, 120, 0.18);
    text-align: center;
}

.optimization-gantt-resource-header strong,
.optimization-gantt-resource-header small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.optimization-gantt-resource-header--eligible {
    background-color: rgb(211, 240, 216);
}

.optimization-gantt-resource-header strong {
    color: rgb(0, 20, 120);
}

.optimization-gantt-resource-header small {
    padding-top: 3px;
    color: rgba(0, 0, 0, 0.64);
}

.optimization-gantt-timeline {
    display: grid;
    min-height: 120px;
}

.optimization-gantt-axis {
    position: sticky;
    left: 0;
    z-index: var(--optimization-gantt-layer-axis);
    border-right: 2px solid rgba(0, 20, 120, 0.28);
    background-color: rgb(250, 251, 253);
}

.optimization-gantt-axis-tick {
    position: absolute;
    right: 9px;
    left: 0;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.8rem;
    line-height: 1rem;
    text-align: right;
    white-space: nowrap;
}

.optimization-gantt-axis-tick--primary {
    color: rgb(0, 20, 120);
    font-size: 0.88rem;
    font-weight: 750;
}

.optimization-gantt-axis-tick--secondary {
    color: rgba(0, 0, 0, 0.66);
    font-weight: 550;
}

.optimization-gantt-lanes {
    position: relative;
    min-width: 0;
    isolation: isolate;
}

.optimization-gantt-grid-line {
    position: absolute;
    right: 0;
    left: 0;
    z-index: var(--optimization-gantt-layer-grid);
    pointer-events: none;
}

.optimization-gantt-grid-line--primary {
    border-top: 1px solid rgba(0, 20, 120, 0.56);
}

.optimization-gantt-grid-line--secondary {
    border-top: 1px dashed rgba(0, 20, 120, 0.32);
}

.optimization-gantt-lane-grid {
    position: absolute;
    inset: 0;
    z-index: auto;
    display: grid;
}

.optimization-gantt-lane {
    position: relative;
    min-width: 0;
    border-right: 1px solid rgba(0, 20, 120, 0.14);
    background-color: rgba(255, 255, 255, 0.72);
}

.optimization-gantt-lane:nth-child(even) {
    background-color: rgba(246, 248, 252, 0.76);
}

.optimization-gantt-lane--calendar {
    background-color: rgb(232, 235, 240);
}

.optimization-gantt-lane--calendar:nth-child(even) {
    background-color: rgb(225, 229, 235);
}

.optimization-gantt-lane--eligible,
.optimization-gantt-lane--eligible:nth-child(even),
.optimization-gantt-lane--calendar.optimization-gantt-lane--eligible,
.optimization-gantt-lane--calendar.optimization-gantt-lane--eligible:nth-child(even) {
    background-color: rgb(211, 240, 216);
}

.optimization-gantt-lane--eligible .optimization-gantt-availability {
    background-color: rgb(231, 248, 234);
}

.optimization-gantt-availability {
    position: absolute;
    right: 0;
    left: 0;
    z-index: var(--optimization-gantt-layer-availability);
    background-color: rgba(255, 255, 255, 0.82);
    pointer-events: none;
}

.optimization-gantt-lane-empty {
    position: absolute;
    top: 12px;
    right: 10px;
    left: 10px;
    z-index: var(--optimization-gantt-layer-activity);
    color: rgba(0, 0, 0, 0.46);
    font-size: 0.78rem;
    text-align: center;
}

.optimization-gantt-block {
    appearance: none;
    position: absolute;
    right: 9px;
    left: 9px;
    z-index: var(--optimization-gantt-layer-activity);
    min-height: 2px;
    border: 1px solid;
    border-radius: 3px;
    overflow: hidden;
    padding: 1px 4px;
    font-size: 0.7rem;
    line-height: 0.85rem;
    text-align: center;
    cursor: default;
}

.optimization-gantt-block:focus-visible {
    z-index: var(--optimization-gantt-layer-activity-focus);
    outline: 2px solid rgb(150, 5, 5);
    outline-offset: 1px;
}

.optimization-gantt-block span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.optimization-gantt-block--setup {
    border-color: rgb(60, 64, 70);
    background-color: rgb(96, 100, 106);
    color: white;
}

.optimization-gantt-block--production {
    border-color: rgb(20, 100, 165);
    background-color: rgb(132, 188, 222);
    color: rgb(0, 42, 92);
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 0.9rem;
}

.optimization-gantt-scroll--editor .optimization-gantt-block--production {
    cursor: grab;
    touch-action: none;
}

.optimization-gantt-block--production.optimization-gantt-block--drag-selected {
    outline: 2px solid rgb(109, 58, 160);
    outline-offset: 2px;
}

.optimization-gantt-block--production.optimization-gantt-block--delivery {
    border: 2px solid var(--optimization-gantt-delivery-color);
}

.optimization-gantt-delivery-badge {
    position: absolute;
    right: 9px;
    z-index: var(--optimization-gantt-layer-delivery);
    transform: translateY(-100%);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: max-content;
    padding: 2px 4px;
    border-radius: 2px;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1rem;
    white-space: nowrap;
    pointer-events: none;
}

.optimization-gantt-delivery-badge__hard {
    width: 12px;
    height: 12px;
    flex: none;
}

.opt-gantt-delivery-key--on-time { color: rgb(24, 112, 57); }
.opt-gantt-delivery-key--late { color: rgb(164, 79, 0); }
.opt-gantt-delivery-key--very-late { color: rgb(184, 35, 35); }

.optimization-gantt-drag-ghost .optimization-gantt-delivery-badge {
    display: inline-flex;
    overflow: visible;
    top: auto;
    right: 0;
    bottom: 0;
    transform: none;
}

.optimization-gantt-drag-ghost .optimization-gantt-delivery-badge span {
    font-weight: 700;
}

.optimization-gantt-drag-ghost {
    position: fixed;
    z-index: 1000;
    right: auto;
    left: 0;
    box-sizing: border-box;
    margin: 0;
    opacity: 0.58;
    pointer-events: none;
    transform: none;
    will-change: top, left;
    overflow: visible;
}

.optimization-gantt-drag-ghost--invalid {
    box-shadow: 0 0 0 2px rgba(170, 35, 35, 0.4);
}

body.opt-gantt-drag-active,
body.opt-gantt-drag-active * {
    cursor: grabbing !important;
    user-select: none !important;
}

.optimization-gantt-block .optimization-gantt-block__description,
.optimization-gantt-block .optimization-gantt-block__quantity {
    font-weight: 400;
}

.optimization-gantt-block .optimization-gantt-block__description {
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.optimization-gantt-block .optimization-gantt-block__quantity[hidden] {
    display: none;
}

.optimization-gantt-now-line {
    position: absolute;
    right: 0;
    left: 0;
    z-index: var(--optimization-gantt-layer-now);
    border-top: 2px solid rgb(185, 32, 32);
    pointer-events: none;
}

.optimization-gantt-now-line::before {
    position: absolute;
    top: -5px;
    left: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: rgb(185, 32, 32);
    content: '';
}

/* Editor Gantt: popup operativo a piena area, senza navigazione applicativa. */
body.opt-gantt-editor-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
    overflow: hidden;
    background-color: white;
}

.opt-gantt-editor-page > .myfooter {
    display: none;
}

.opt-gantt-editor {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    overflow: hidden;
    padding: 0;
    background-color: white;
}

.opt-gantt-editor__topbar {
    position: relative;
    z-index: 20;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border-bottom: 1px solid rgba(0, 20, 120, 0.2);
    padding: 6px 10px;
    background-color: white;
}

.opt-gantt-editor__title {
    flex: 0 0 auto;
    color: rgb(0, 20, 120);
    font-size: 1.05rem;
    line-height: 1.25rem;
}

.opt-gantt-editor__title small {
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.8rem;
    font-weight: 500;
}

.opt-gantt-editor__status {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.78rem;
    white-space: nowrap;
    scrollbar-width: thin;
}

.opt-gantt-editor__badge {
    border-radius: 999px;
    padding: 3px 7px;
    background-color: #eef2f6;
}

.opt-gantt-editor__badge[data-state="ready"] {
    background-color: #dff3e5;
    color: #195c2c;
}

.opt-gantt-editor__badge[data-state="error"] {
    background-color: #f9dddd;
    color: #8a1f1f;
}

.opt-gantt-editor__message {
    min-width: 0;
    flex: 1 1 18rem;
    overflow: hidden;
    padding: 0;
    color: rgba(0, 0, 0, 0.68);
    font-size: 0.78rem;
    line-height: 1.1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opt-gantt-editor__message[data-kind="error"] {
    color: #9a2020;
}

.opt-gantt-editor__message[data-kind="success"] {
    color: #176331;
}

.opt-gantt-editor__close {
    flex: 0 0 auto;
    gap: 6px;
    min-width: 2.25rem;
    padding: 0.42rem 0.65rem;
}

.opt-gantt-editor__workspace {
    min-width: 0;
    min-height: 0;
    padding: 6px 0;
}

.opt-gantt-editor__workspace .optimization-gantt-root {
    width: 100%;
    height: 100%;
    margin: 0;
}

.opt-gantt-editor__workspace .optimization-gantt-header {
    min-height: 48px;
}

.opt-gantt-editor__footer {
    position: sticky;
    bottom: 0;
    z-index: 30;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    border-top: 1px solid rgba(0, 20, 120, 0.25);
    padding: 5px 9px;
    background-color: white;
    box-shadow: 0 -3px 9px rgba(0, 0, 0, 0.08);
}

.opt-gantt-editor__commands,
.opt-gantt-editor__view-options {
    display: flex;
    min-width: max-content;
    align-items: center;
    gap: 5px;
}

.opt-gantt-editor__footer-scroll {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.opt-gantt-editor__footer .app-button {
    padding: 0.42rem 0.62rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

.opt-gantt-editor__print-controls {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 2px;
    border-left: 1px solid rgba(0, 20, 120, 0.2);
    padding-left: 5px;
}

.opt-gantt-editor__print-orientation {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.opt-gantt-editor__print-orientation .app-button[aria-pressed="true"] {
    border-color: rgb(0, 20, 120);
    background-color: rgb(0, 20, 120);
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.opt-gantt-editor__landscape-icon {
    transform: rotate(90deg);
}

.opt-gantt-editor__view-options label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.78rem;
    white-space: nowrap;
}

.opt-gantt-editor__view-options input {
    width: 5rem;
    min-height: 2rem;
    border: 1px solid rgba(0, 20, 120, 0.25);
    border-radius: 3px;
    padding: 2px 5px;
}

.opt-gantt-editor__scale {
    min-width: 5.4rem;
    color: rgba(0, 0, 0, 0.65);
    font-size: 0.76rem;
    text-align: center;
    white-space: nowrap;
}

.opt-gantt-editor__legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(0, 0, 0, 0.67);
    font-size: 0.76rem;
    white-space: nowrap;
}

.opt-gantt-editor__legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.opt-gantt-editor__legend i {
    display: inline-block;
    width: 18px;
    height: 9px;
    border: 1px solid;
}

.opt-gantt-editor__validation {
    position: relative;
    flex: 0 0 auto;
}

.opt-gantt-editor__validation summary {
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 0.42rem 0.62rem;
    color: rgb(0, 20, 120);
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
}

.opt-gantt-editor__validation summary::-webkit-details-marker {
    display: none;
}

.opt-gantt-editor__validation-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: min(34rem, calc(100vw - 18px));
    max-height: 42vh;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 5px;
    overflow: auto;
    padding: 10px 12px;
    background-color: white;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
}

.opt-gantt-editor__violations {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.84rem;
}

.opt-gantt-editor__preview .optimization-gantt-scroll {
    border-color: #df9e1c;
    box-shadow: inset 0 0 0 1px #df9e1c;
}

@media (max-width: 760px) {
    .opt-gantt-editor__message,
    .opt-gantt-editor__legend,
    .opt-gantt-editor__button-label {
        display: none;
    }

    .opt-gantt-editor__topbar {
        gap: 7px;
    }
}

.optimization-run-results-page .app-button i,
.optimization-node-head__meta .app-button i {
    margin-right: 6px;
}

.production-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.production-legend__item {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-left: 5px solid var(--state-color);
    border-radius: 4px;
    padding: 0 8px;
    background-color: white;
    background-color: color-mix(in srgb, var(--state-color) 52%, white);
    font-size: 0.82rem;
    line-height: 1rem;
    font-weight: 600;
}

.production-department {
    margin-top: 16px;
}

.production-department h3 {
    padding-top: 0;
}

.production-resource-grid {
    display: grid;
    grid-template-columns: repeat(var(--resource-count), minmax(180px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 3px;
}

.production-resource-column {
    min-width: 180px;
    border: 1px solid rgba(0, 20, 120, 0.14);
    border-radius: 6px;
    background-color: rgb(250, 251, 253);
}

.production-resource-column h4 {
    position: sticky;
    top: 0;
    border-bottom: 2px solid rgba(0, 20, 120, 0.28);
    border-radius: 6px 6px 0 0;
    padding: 8px 10px;
    background-color: rgb(229, 234, 246);
    color: rgb(0, 20, 120);
    font-size: 0.94rem;
    line-height: 1.15rem;
}

.production-order-card {
    display: grid;
    gap: 3px;
    margin: 8px;
    border: 1px solid rgba(0, 0, 0, 0.11);
    border-left: 5px solid var(--state-color);
    border-radius: 5px;
    padding: 8px;
    background-color: white;
    background-color: color-mix(in srgb, var(--state-color) 54%, white);
    font-size: 0.86rem;
    line-height: 1.12rem;
}

.production-order-card--interactive,
.production-detail-row--interactive {
    cursor: pointer;
}

.production-order-card--blocked,
.production-detail-row--blocked {
    opacity: 0.68;
}

.production-order-card--blocked {
    background-color: rgb(244, 245, 247);
}

.production-detail-row--blocked {
    background-color: rgb(244, 245, 247);
}

.production-order-card--interactive:hover,
.production-order-card--interactive:focus,
.production-detail-row--interactive:hover,
.production-detail-row--interactive:focus {
    outline: 2px solid rgba(0, 20, 120, 0.38);
    outline-offset: 2px;
}

.production-order-card strong {
    font-size: 0.98rem;
    line-height: 1.15rem;
}

.production-order-card small,
.production-detail-table small {
    display: block;
    color: rgba(0, 0, 0, 0.66);
    font-size: 0.82rem;
    line-height: 1.1rem;
}

.production-order-card em {
    color: rgba(0, 0, 0, 0.72);
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 650;
}

.production-state-blocked-note {
    color: rgb(154, 52, 18);
    font-weight: 700;
}

.production-time-value {
    color: rgba(0, 0, 0, 0.88);
    font-weight: 750;
}

.is-late {
    color: rgb(150, 5, 5);
    font-weight: 700;
}

.production-detail-table tbody tr {
    background-color: white;
    background-color: color-mix(in srgb, var(--state-color) 50%, white);
}

.production-detail-table tbody tr.has-missing-data {
    background-color: rgb(255, 236, 236);
}

.production-detail-table tbody tr.has-order-notes-filter {
    box-shadow: inset 0 0 0 2px rgba(173, 112, 0, 0.2);
}

.production-detail-table td:first-child {
    border-left: 5px solid var(--state-color);
}

.orders-program-table .order-state-editor__select-column {
    border-left: 0;
}

.orders-program-table tbody .order-state-editor__select-column + td {
    border-left: 5px solid var(--state-color);
}

.orders-page .app-sticky-table {
    max-width: 100%;
    min-width: 0;
    isolation: isolate;
}

.orders-page .app-sticky-table__bar {
    background-color: rgb(255, 255, 255);
}

.orders-page .app-sticky-table .app-table-wrap {
    max-width: 100%;
    overflow-x: clip;
}

.orders-program-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: clamp(0.76rem, 0.72rem + 0.16vw, 0.88rem);
    line-height: 1.12rem;
}

.orders-program-table th,
.orders-program-table td {
    min-width: 0;
    padding: 7px 5px;
    overflow-wrap: anywhere;
}

.orders-program-table thead th {
    z-index: 6;
    background-color: rgb(229, 234, 246);
    background-clip: padding-box;
    box-shadow: inset 0 -2px rgba(0, 20, 120, 0.34);
    white-space: normal;
}

.orders-program-table select {
    min-width: 0;
    max-width: 100%;
}

.orders-program-table .orders-sort-button {
    align-items: flex-start;
    white-space: normal;
}

.orders-program-table .production-note {
    width: auto;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.production-note-cell {
    width: 1%;
}

.production-note {
    display: -webkit-box;
    width: max-content;
    max-width: 180px;
    overflow: hidden;
    white-space: normal;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.production-note--alert {
    color: rgb(150, 5, 5);
    font-weight: 800;
}

a.production-note--alert:link,
a.production-note--alert:visited {
    color: rgb(150, 5, 5);
    text-decoration: none;
}

a.production-note--alert:hover,
a.production-note--alert:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.production-progress-dialog {
    width: min(820px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 6px;
    padding: 0;
    color: rgba(0, 0, 0, 0.9);
}

.production-progress-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.36);
}

.production-progress-form {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.production-progress-form__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 20, 120, 0.16);
    padding-bottom: 10px;
}

.production-progress-form__header strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.55rem;
}

.production-progress-form__close {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid rgba(0, 20, 120, 0.2);
    border-radius: 4px;
    background-color: white;
    color: rgb(0, 20, 120);
    cursor: pointer;
    font-size: 1.45rem;
    line-height: 1rem;
    font-weight: 700;
}

.production-progress-summary {
    display: grid;
    grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.production-progress-summary > div {
    min-width: 0;
    border-left: 4px solid rgb(0, 20, 120);
    padding: 8px 10px;
    background-color: rgb(247, 248, 251);
}

.production-progress-summary strong,
.production-progress-summary small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-progress-summary strong {
    font-size: 0.96rem;
    line-height: 1.25rem;
}

.production-progress-summary small {
    color: rgba(0, 0, 0, 0.66);
    font-size: 0.82rem;
    line-height: 1.1rem;
}

.production-progress-state {
    display: grid;
    max-width: 360px;
    gap: 5px;
    color: rgba(0, 0, 0, 0.76);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.production-progress-state select,
.production-progress-state input,
.production-progress-datetime-row input,
.utc-datetime-field input,
.utc-calendar__bar select {
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 7px 8px;
    background-color: white;
}

.production-progress-state small {
    color: rgba(0, 0, 0, 0.62);
    font-size: 0.82rem;
    line-height: 1.05rem;
}

.production-progress-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(0, 0, 0, 0.78);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.production-progress-check input {
    width: 1rem;
    height: 1rem;
}

.production-progress-date-list {
    display: grid;
    gap: 8px;
}

.production-progress-datetime-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(138px, 0.7fr) minmax(96px, 0.45fr) auto;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(0, 20, 120, 0.12);
    border-radius: 6px;
    padding: 8px;
    background-color: rgb(250, 251, 253);
    color: rgba(0, 0, 0, 0.78);
    font-size: 0.92rem;
    line-height: 1.2rem;
}

.production-progress-datetime-row span {
    font-weight: 650;
}

.production-progress-datetime-row input {
    min-width: 0;
}

.calendar-button {
    min-height: 2.05rem;
    border: 1px solid rgba(0, 20, 120, 0.24);
    border-radius: 4px;
    padding: 0 10px;
    background-color: white;
    color: rgb(0, 20, 120);
    cursor: pointer;
    font-weight: 700;
}

.calendar-button:hover,
.calendar-button:focus {
    background-color: rgb(229, 234, 246);
}

.utc-datetime-field {
    border: 1px solid rgba(0, 20, 120, 0.14);
    border-radius: 6px;
    padding: 10px;
    background-color: rgb(250, 251, 253);
}

.utc-datetime-field h3 {
    padding-top: 0;
    font-size: 1rem;
    line-height: 1.25rem;
}

.utc-datetime-field label {
    display: grid;
    gap: 5px;
    margin-top: 8px;
    color: rgba(0, 0, 0, 0.72);
    font-size: 0.9rem;
}

.utc-datetime-field input[type='time'] {
    width: 9rem;
}

.utc-calendar-dialog {
    width: min(470px, calc(100vw - 28px));
    max-height: min(720px, calc(100vh - 28px));
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 6px;
    padding: 0;
    color: rgba(0, 0, 0, 0.9);
}

.utc-calendar-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.36);
}

.utc-calendar-dialog__body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.utc-calendar {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.utc-calendar__bar {
    display: grid;
    grid-template-columns: minmax(86px, 0.8fr) 2.15rem minmax(110px, 1fr) 2.15rem;
    gap: 6px;
    align-items: center;
}

.utc-calendar__bar button,
.utc-calendar__month-label,
.utc-calendar__day {
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.utc-calendar__bar button {
    min-height: 2.15rem;
    color: rgb(0, 20, 120);
    font-size: 1.2rem;
    font-weight: 700;
}

.utc-calendar__month-label {
    min-height: 2.15rem;
    padding: 0 8px;
    color: rgb(0, 20, 120);
    font-size: 0.92rem;
    line-height: 1.1rem;
    font-weight: 700;
}

.utc-calendar__bar [data-utc-month] {
    grid-column: 3;
}

.utc-calendar__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.utc-calendar__day {
    min-height: 2.65rem;
    padding: 4px;
    text-align: center;
}

.utc-calendar__day span,
.utc-calendar__day strong {
    display: block;
}

.utc-calendar__day span {
    color: rgba(0, 0, 0, 0.58);
    font-size: 0.68rem;
    line-height: 0.9rem;
}

.utc-calendar__day strong {
    font-size: 0.92rem;
    line-height: 1.08rem;
}

.utc-calendar__day:hover,
.utc-calendar__day.is-selected {
    border-color: rgb(0, 20, 120);
    background-color: rgb(229, 234, 246);
}

.production-progress-utc-note {
    border-left: 4px solid rgb(150, 5, 5);
    padding: 9px 11px;
    background-color: rgb(255, 247, 247);
    color: rgba(0, 0, 0, 0.78);
    font-size: 0.92rem;
    line-height: 1.25rem;
}

.data-check-table small {
    display: block;
    color: rgba(0, 0, 0, 0.66);
    font-size: 0.82rem;
    line-height: 1.1rem;
}

.data-missing-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 150px;
}

.data-missing-list span {
    display: inline-flex;
    align-items: center;
    min-height: 1.45rem;
    border: 1px solid rgba(150, 5, 5, 0.18);
    border-radius: 4px;
    padding: 0 7px;
    background-color: rgb(255, 245, 245);
    color: rgb(150, 5, 5);
    font-size: 0.8rem;
    line-height: 1rem;
    font-weight: 650;
}

.setup-table select {
    width: 100%;
    min-width: 150px;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
    padding: 7px 8px;
    background-color: white;
}

.setup-table small {
    display: block;
    color: rgba(0, 0, 0, 0.66);
    font-size: 0.82rem;
    line-height: 1.1rem;
}

.setup-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

.setup-tabs {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    border-bottom: 1px solid rgba(0, 20, 120, 0.18);
}

.setup-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 2.2rem;
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    padding: 0 13px;
    background-color: rgb(247, 248, 251);
    color: rgb(0, 20, 120);
    font-size: 0.94rem;
    line-height: 1.1rem;
    font-weight: 650;
}

.setup-tabs a:hover,
.setup-tabs a.is-active {
    background-color: rgb(0, 20, 120);
    color: white;
}

@media (max-width: 720px) {
    .app-sticky-table .app-table-wrap {
        overflow-x: auto;
    }

    .app-sticky-table__bar,
    .app-sticky-table .app-table th {
        position: static;
    }

    .app-sticky-table__bar {
        box-shadow: none;
    }

    .orders-page .app-sticky-table .app-table-wrap {
        overflow-x: auto;
    }

    .orders-program-table {
        min-width: 1050px;
        table-layout: auto;
    }

    .topbanner p {
        font-size: 2rem;
        line-height: 2.25rem;
    }

    .app-grid--four,
    .app-toolbar,
    .app-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-workbench {
        grid-template-columns: 1fr;
    }

    .production-filter,
    .orders-filter,
    .articles-filter,
    .colors-filter,
    .order-state-editor__filters,
    .data-filter,
    .optimization-filter {
        grid-template-columns: 1fr;
    }

    .article-detail-grid {
        grid-template-columns: 1fr;
    }

    .article-detail-dialog__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .colors-edit-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .colors-edit-bar > span {
        margin-right: 0;
    }

    .order-state-editor__commands {
        align-items: stretch;
        flex-direction: column;
    }

    .order-state-editor__commands > span {
        margin-right: 0;
    }

    .optimization-scenario summary {
        grid-template-columns: 1fr;
    }

    .optimization-scenario__state {
        text-align: left;
    }

    .optimization-node-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .optimization-node-head__meta {
        justify-content: flex-start;
    }

    .optimization-run-detail {
        grid-template-columns: 1fr;
    }

    .optimization-results-context {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-progress-summary {
        grid-template-columns: 1fr;
    }

    .production-progress-datetime-row {
        grid-template-columns: 1fr;
    }

    .optimization-resource-layout {
        grid-template-columns: 1fr;
    }

    .optimization-resource-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .optimization-performance__parameters {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .optimization-run-config-operators,
    .optimization-run-config-horizon {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 550px) {
    .textarea,
    .topbanner,
    .myfooter,
    .app-menu {
        padding-left: 5px;
        padding-right: 5px;
    }

    h1 {
        font-size: 1.9rem;
        line-height: 2.25rem;
    }

    .topbanner {
        height: 86px;
    }

    .app-menu {
        box-shadow: 0 3px 9px rgba(0, 0, 0, 0.08);
    }

    .app-menu__context {
        gap: 10px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .app-menu__plant,
    .app-menu__user {
        flex: 1 1 0;
    }

    .app-menu__user {
        justify-content: flex-end;
    }

    .app-menu__breadcrumb {
        overflow-x: auto;
    }

    .app-menu__link,
    .app-menu__dropdown-link {
        padding-left: 12px;
        padding-right: 12px;
        white-space: nowrap;
    }

    .app-grid--three,
    .app-grid--four,
    .app-summary,
    .app-toolbar,
    .app-steps {
        grid-template-columns: 1fr;
    }

    .app-section__header,
    .app-actions,
    .missing-data-filter-notice {
        align-items: stretch;
        flex-direction: column;
    }

    .app-button {
        width: 100%;
    }

    .optimization-performance__header,
    .optimization-performance__parameters {
        grid-template-columns: 1fr;
    }

    .optimization-performance__result {
        text-align: left;
    }

    .optimization-results-context {
        grid-template-columns: 1fr;
    }

    .login {
        max-width: none;
        margin-top: 24px;
    }

    .production-panel__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .production-calendar {
        min-width: 680px;
    }

    .production-resource-grid {
        grid-template-columns: 1fr;
    }
}

/* Controllo avanzamento: azioni e scelta della destinazione ERP. */
[data-production-progress-control] .fielddata-ignored-filter {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
[data-production-progress-control] .fielddata-ignored-filter input {
    width: auto;
}
[data-production-progress-control] tr[data-execution-ignored="1"] > td {
    background-color: #f2f2f2;
    color: #555;
}
.fielddata-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 40px;
}
.fielddata-row-actions .app-button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fielddata-action-message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-left: 3px solid #25805f;
    background-color: #eef6f1;
}
.fielddata-action-message--error {
    border-left-color: #a33333;
    background-color: #fff2f2;
}
.fielddata-action-dialog {
    width: min(620px, calc(100vw - 28px));
}
.fielddata-action-dialog .production-progress-form__header .app-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    flex: 0 0 36px;
}
.fielddata-action-dialog [hidden] {
    display: none !important;
}
.fielddata-action-dialog p {
    margin: 0;
    overflow-wrap: anywhere;
}
.fielddata-order-options {
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    max-height: 280px;
    overflow-y: auto;
}
.fielddata-order-options legend {
    font-weight: 600;
    margin-bottom: 8px;
}
.fielddata-order-options label {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 4px;
    border-bottom: 1px solid #dedede;
    cursor: pointer;
}
.fielddata-order-options label:has(input:checked) {
    background-color: #eef6f1;
}
.fielddata-order-options strong,
.fielddata-order-options small {
    display: block;
    overflow-wrap: anywhere;
}
.fielddata-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.fielddata-dialog-actions .app-button {
    width: auto;
    min-width: 100px;
}

/* Barra e area di lavoro della pagina ordini. */
.orders-page .orders-toolbar {
    position: sticky;
    top: var(--app-menu-sticky-offset, 0px);
    /* Sotto il menu principale (9), sopra i comandi della tabella (7). */
    z-index: 8;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) minmax(240px, 2fr);
    padding: 12px;
    background: white;
    border: 1px solid rgba(0, 20, 120, 0.18);
    border-radius: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}
.orders-toolbar > label { min-width: 0; }
.orders-toolbar input[type="search"] {
    width: 100%;
    min-width: 0;
    min-height: 2.25rem;
    padding: 8px 9px;
    border: 1px solid rgba(0, 20, 120, 0.22);
    border-radius: 4px;
}
.orders-toolbar .app-actions { grid-column: -4 / -1; justify-content: flex-end; }
.orders-toolbar .orders-toolbar__notes {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 8px;
}
.orders-toolbar__notes input { width: 1.05rem; height: 1.05rem; margin: 0; }
.orders-summary { margin-top: 14px; }
.orders-summary > summary { cursor: pointer; font-weight: 650; padding: 8px 0; }
.orders-page .orders-workspace .app-sticky-table__bar {
    top: calc(var(--app-menu-sticky-offset, 0px) + var(--orders-toolbar-height, 0px));
}
.orders-page .orders-workspace .app-table-wrap {
    overflow: auto;
    max-height: var(--orders-table-height, 65vh);
    overscroll-behavior: auto;
    scrollbar-gutter: stable;
}
.orders-page .orders-workspace .orders-program-table {
    min-width: 1450px;
    table-layout: fixed;
}
.orders-page .orders-workspace .orders-program-table th {
    position: sticky;
    top: 0;
    background-clip: border-box;
}
.orders-program-table .orders-state-col { width: 155px; }
.orders-program-table .orders-article-col { width: 180px; }
.orders-program-table .orders-delivery-col { width: 210px; }
.orders-program-table .orders-selection-col { width: 48px; }
.orders-page .orders-program-table .order-state-editor__select-column {
    width: 48px;
    min-width: 48px;
    padding: 7px 10px;
    vertical-align: middle;
}
.orders-program-table .order-state-editor__select-column label {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}
.orders-program-table [hidden] { display: none !important; }
.orders-workspace [data-order-visible-count] { color: rgba(0, 0, 0, 0.7); }
@media (max-width: 1000px) {
    .orders-page .orders-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .orders-toolbar__search, .orders-toolbar .app-actions { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .orders-page .orders-toolbar { position: static; }
    .orders-page .orders-workspace .app-sticky-table__bar { position: static; }
    .orders-toolbar .app-actions { justify-content: flex-start; }
    .orders-page .orders-workspace .app-table-wrap { max-height: 65vh; }
}

.orders-program-table .orders-search-match,
.articles-table .orders-search-match {
    background-color: #ffe066;
    color: #1f1f1f;
    border-radius: 2px;
    padding: 0;
    font: inherit;
}
