.otido-admin-content .db-editor-title {
    margin: 0;
}

.constructor-small-link,
.constructor-recipe-code {
    color: #64748b;
    font-size: 12px;
    text-decoration: none;
}

.constructor-shelf-tabs,
.constructor-engineering-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.constructor-shelf-tab,
.constructor-engineering-item {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
}

.constructor-shelf-tab {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
}

.constructor-shelf-tab.is-active,
.constructor-engineering-item.is-selected {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1d4ed8;
}

.constructor-shelf-tab:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.constructor-shelf-tab--create {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

.constructor-shelf-tab--create:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #1d4ed8;
}

.constructor-shelf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.constructor-shelf-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.constructor-create-shelf {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.constructor-create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: min(280px, 100%);
    margin: 0;
    padding: 8px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    background: #eff6ff;
}

.constructor-create-form[hidden] {
    display: none;
}

.constructor-inline-form {
    display: flex;
    gap: 5px;
    margin: 0;
}

.constructor-action-input,
.constructor-search,
.constructor-selected-item input {
    box-sizing: border-box;
    min-height: 32px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #334155;
    background: #fff;
    font: inherit;
}

.constructor-action-input {
    width: 150px;
}

.constructor-action-btn,
.constructor-save-btn {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    color: #334155;
    background: #f8fafc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.mat-checkbox-scroll {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 270px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
}

.component-table-zebra {
    overflow-y: auto;
    scroll-behavior: smooth;
}

.otido-admin-wrap .constructor-type-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

.otido-admin-wrap .constructor-type-actions .btn-edit,
.otido-admin-wrap .constructor-type-actions .btn-action-delete {
    height: 24px;
    min-height: 24px;
    padding: 4px 10px;
    line-height: 1;
}

.constructor-calc-settings {
    min-height: 32px;
    padding: 6px 10px;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
}

.constructor-calc-settings .component-form-buttons {
    margin: 0;
}

.constructor-shelf-tools .component-form-buttons,
.constructor-create-shelf > .component-form-buttons,
.constructor-create-form .component-form-buttons {
    width: auto;
    margin: 0;
}

.constructor-modal[hidden] {
    display: none;
}

.constructor-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 16px;
}

.constructor-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
}

.constructor-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .25);
}

.constructor-modal__header,
.constructor-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.constructor-modal__footer {
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
    border-bottom: 0;
}

.constructor-modal__header h5 {
    margin: 0;
    color: #1e293b;
    font-size: 16px;
}

.constructor-modal__close {
    border: 0;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.constructor-modal__body {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.constructor-modal__item {
    margin: 0 0 4px;
    color: #1d4ed8;
    font-weight: 700;
}

.constructor-modal__hint {
    padding: 8px 10px;
    border-left: 3px solid #93c5fd;
    color: #475569;
    background: #eff6ff;
    font-size: 12px;
    line-height: 1.45;
}

.constructor-modal__hint code {
    color: #1d4ed8;
    font-family: Consolas, monospace;
    font-weight: 700;
}

.constructor-modal__label {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.constructor-modal__field {
    width: 100%;
    min-height: 84px;
    box-sizing: border-box;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    color: #1e293b;
    font: inherit;
}

.constructor-modal__field:focus {
    border-color: #2563eb;
    outline: 2px solid #bfdbfe;
}

@media (max-width: 520px) {
    .constructor-modal {
        padding: 8px;
    }

    .constructor-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .constructor-modal__footer button {
        width: 100%;
    }
}

.mat-checkbox-line {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    cursor: pointer;
    font-size: 12px;
}

.mat-checkbox-line:nth-child(even) {
    background: #f1f5f9;
}

.mat-checkbox-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mat-checkbox-label small {
    color: #94a3b8;
}

.component-table-zebra {
    max-width: 100%;
    margin: 0;
}

.component-table-zebra__table {
    width: 100%;
    border-collapse: collapse;
}

.component-table-zebra__table th,
.component-table-zebra__table td {
    padding: 8px 10px;
    border-bottom: 1px solid #cbd5e1;
    text-align: left;
    vertical-align: middle;
}

.component-table-zebra__table th {
    color: #475569;
    background-color: #f8fafc;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: inset 0 -2px 0 #cbd5e1;
}

.component-table-zebra__table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.component-table-zebra__name {
    color: #1e293b;
    font-size: 13px;
    font-weight: 400 !important;
}

.component-table-zebra__empty {
    padding: 16px;
    color: #64748b;
    text-align: center;
}

.component-form-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.component-form-buttons .btn-action-add {
    min-height: 34px;
    padding: 6px 16px;
}

.constructor-action-btn--muted {
    color: #64748b;
}

.constructor-counter,
.constructor-selected-count {
    min-width: 22px;
    padding: 3px 6px;
    border-radius: 10px;
    color: #475569;
    background: #e2e8f0;
    font-size: 11px;
    text-align: center;
}

.constructor-engineering-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 120px;
    padding: 8px 10px;
    font-size: 13px;
}

.constructor-engineering-item small {
    color: #94a3b8;
    font-size: 10px;
}

.constructor-recipe {
    margin-top: 12px;
}

.constructor-recipe-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.constructor-recipe-column {
    min-width: 0;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #f8fafc;
}

.constructor-column-head h5 {
    margin: 0;
    color: #334155;
    font-size: 13px;
}

.constructor-subtabs {
    display: flex;
    gap: 4px;
    margin: 8px 0;
}

.constructor-subtab {
    padding: 6px 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
}

.constructor-subtab.is-active {
    border-bottom-color: #64748b;
    color: #334155;
    font-weight: 700;
}

.constructor-search {
    width: 100%;
    margin-bottom: 6px;
}

.constructor-stock-list,
.constructor-selected-list {
    max-height: 270px;
    overflow-y: auto;
}

.constructor-stock-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 12px;
}

.constructor-stock-item:nth-child(even) {
    background: #f1f5f9;
}

.constructor-stock-item small {
    color: #94a3b8;
    font-size: 10px;
}

.constructor-stock-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.constructor-tab-panel {
    display: none;
}

.constructor-tab-panel.is-active {
    display: block;
}

.constructor-selected-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1fr 1fr;
    gap: 6px;
    align-items: center;
    padding: 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    font-size: 11px;
}

.constructor-selected-item label {
    display: grid;
    gap: 2px;
    color: #64748b;
    font-size: 10px;
}

.constructor-selected-item input {
    width: 100%;
    min-height: 26px;
    padding: 4px 6px;
    font-size: 11px;
}

.constructor-save-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    background: #e2e8f0;
}

@media (max-width: 700px) {
    .constructor-recipe-columns {
        grid-template-columns: 1fr;
    }

    .constructor-shelf-actions,
    .constructor-inline-form {
        width: 100%;
    }

    .constructor-action-input {
        flex: 1;
    }

    .constructor-engineering-item {
        flex: 1 1 42%;
    }

    .mat-checkbox-scroll {
        max-height: 220px;
    }

    .component-table-zebra__table thead {
        display: none;
    }

    .component-table-zebra__table,
    .component-table-zebra__table tbody,
    .component-table-zebra__table tr,
    .component-table-zebra__table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .component-table-zebra__table tr {
        padding: 5px 0;
        border-bottom: 1px solid #cbd5e1;
    }

    .component-table-zebra__table td {
        display: grid;
        grid-template-columns: 100px minmax(0, 1fr);
        gap: 6px;
        border: 0;
    }
}

@media (max-width: 420px) {
    .constructor-selected-item {
        grid-template-columns: 1fr;
    }

    .constructor-stock-list,
    .constructor-selected-list {
        max-height: 220px;
    }
}
