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

[hidden] {
    display: none !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-separator {
    padding: 0 4px;
    color: rgba(0, 0, 0, 0.32);
}

.app-menu__logout:link,
.app-menu__logout:visited {
    color: rgb(0, 20, 120);
    font-weight: 500;
}

.app-menu__logout:hover,
.app-menu__logout:active {
    color: rgb(150, 5, 5);
}

.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--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;
}

.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;
}

.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 {
    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;
}

.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;
}

.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(260px, 0.9fr) minmax(360px, 1.5fr);
    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-resource-list {
    display: grid;
    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-count--critical {
    color: rgb(154, 20, 20);
    font-weight: 800;
}

.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-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;
}

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

.optimization-packet {
    padding: 12px;
}

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

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

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

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

.optimization-sequence-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;
}

.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 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-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 td:first-child {
    border-left: 5px solid var(--state-color);
}

.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;
}

.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;
    }

    .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,
    .data-filter,
    .optimization-filter {
        grid-template-columns: 1fr;
    }

    .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-resource-layout {
        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 {
        align-items: stretch;
        flex-direction: column;
    }

    .app-button {
        width: 100%;
    }

    .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;
    }
}
