.production-content {
    min-width: 0;
    padding: 20px 22px 34px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 400;
}

.production-content .topbar {
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.production-content .topbar h1 {
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -.025em;
}

.production-content .topbar .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .12em;
}

.production-content .topbar .muted {
    margin-top: 5px;
    font-size: 12px;
}

.production-content .user-badge {
    padding: 8px 11px;
    border-radius: 10px;
}

.production-content .user-badge span {
    font-size: 12px;
    font-weight: 600;
}

.production-content .user-badge small {
    font-size: 10px;
}

.production-summary {
    gap: 8px;
    margin-bottom: 10px;
}

.production-summary article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(32, 80, 137, .035);
}

.production-summary span {
    min-width: 0;
    margin: 0;
    font-size: 11px;
    font-weight: 450;
}

.production-summary strong {
    margin-left: 10px;
    font-size: 19px;
    font-weight: 650;
    line-height: 1;
}

.production-toolbar {
    grid-template-columns: minmax(260px, 1.5fr) minmax(170px, .55fr) auto;
    gap: 9px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
}

.production-toolbar label,
.production-dialog label {
    gap: 5px;
    font-size: 11px;
    font-weight: 550;
}

.production-toolbar input,
.production-toolbar select {
    min-height: 35px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.production-actions {
    gap: 7px;
}

.production-actions button {
    min-height: 35px;
    margin: 0;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.production-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    padding: 6px 11px;
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    background: #fff;
    color: #294b6b;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.production-error {
    margin-bottom: 10px;
}

.orders-list {
    gap: 8px;
}

.production-loading,
.production-empty {
    padding: 24px 16px;
    border-radius: 10px;
    font-size: 12px;
}

.production-order {
    border-radius: 10px;
    box-shadow: 0 3px 11px rgba(32, 80, 137, .045);
}

.production-order-main {
    grid-template-columns: minmax(230px, 1.55fr) 90px 105px minmax(150px, .75fr) auto;
    gap: 12px;
    padding: 9px 11px;
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.production-order-kicker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.production-order-title h2 {
    margin: 3px 0 2px;
    overflow: hidden;
    color: #192f45;
    font-size: 15px;
    font-weight: 620;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-order-title p {
    margin: 0;
    overflow: hidden;
    color: #667687;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-order-number {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .025em;
}

.production-order-metric {
    min-width: 0;
}

.production-order-metric span,
.production-order-metric small {
    display: block;
    margin: 0;
    color: #718091;
    font-size: 10px;
    line-height: 1.2;
}

.production-order-metric strong {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: #263f58;
    font-size: 12px;
    font-weight: 560;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-order-metric.danger strong,
.production-order-metric.danger small {
    color: #a84238;
}

.production-order-actions {
    display: flex;
    justify-content: flex-end;
}

.production-order-actions button {
    min-height: 30px;
    margin: 0;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 600;
}

.production-status {
    max-width: 100%;
    padding: 3px 6px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.production-status-select {
    min-height: 24px;
    margin: 0;
    padding: 3px 24px 3px 8px;
    border: 1px solid #dbe4ed;
    border-radius: 999px;
    background-color: #eef3f7;
    color: #5d7083;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
}

.production-status-select:focus {
    border-color: #205089;
    outline: 2px solid rgba(32, 80, 137, .14);
}

.production-status-select:disabled {
    cursor: wait;
    opacity: .65;
}

.production-order-note {
    padding: 5px 11px;
    border-top: 1px solid #edf1f5;
    background: #fff9ea;
    color: #6f603c;
    font-size: 11px;
    line-height: 1.35;
    white-space: pre-line;
}

.production-order-details {
    padding: 0;
    border-top: 1px solid #e8edf3;
}

.production-items-empty {
    padding: 8px 11px;
    color: #8995a2;
    font-size: 10px;
}

.production-items-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.production-items-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.production-items-table th {
    padding: 4px 8px;
    border-bottom: 1px solid #e5ebf1;
    background: #f5f8fb;
    color: #6f7e8e;
    font-size: 10px;
    font-weight: 550;
    line-height: 1.2;
    text-align: left;
}

.production-items-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #edf1f5;
    color: #2d4359;
    font-size: 11px;
    line-height: 1.25;
    vertical-align: top;
}

.production-items-table tbody tr:last-child td {
    border-bottom: 0;
}

.production-items-table tbody tr:hover td {
    background: #f9fbfd;
}

.production-items-table tbody tr[data-open-item] {
    cursor: pointer;
}

.production-items-table tbody tr[data-open-item]:focus-visible td {
    background: #edf5fc;
    outline: 2px solid #4b81b8;
    outline-offset: -2px;
}

.production-items-table th:nth-child(1) { width: 58px; }
.production-items-table th:nth-child(2) { width: auto; }
.production-items-table th:nth-child(3) { width: 90px; }
.production-items-table th:nth-child(4) { width: 145px; }
.production-items-table th:nth-child(5) { width: 120px; }

.production-item-number {
    color: #205089 !important;
    font-weight: 650;
    white-space: nowrap;
}

.production-item-info strong,
.production-item-info small,
.production-item-info span,
.production-item-dates span {
    display: block;
}

.production-item-info strong {
    color: #1c354e;
    font-size: 12px;
    font-weight: 600;
}

.production-item-info small,
.production-item-dates span {
    margin-top: 0;
    color: #68798a;
    font-size: 10px;
}

.production-item-info {
    overflow-wrap: anywhere;
    text-align: left;
    white-space: normal;
}

.production-item-specifications {
    margin-top: 1px;
    color: #40556a;
    font-size: 11px;
    line-height: 1.2;
    white-space: pre-line;
}

.production-item-notes {
    margin-top: 1px !important;
    color: #806329 !important;
    font-weight: 500;
    line-height: 1.2;
}

.production-item-quantity {
    white-space: nowrap;
}

.production-item-quantity strong {
    color: #203a54;
    font-size: 12px;
    font-weight: 620;
}

.production-item-quantity span {
    margin-left: 3px;
    color: #7c8997;
    font-size: 10px;
}

.production-dialog {
    border-radius: 18px;
}

.production-dialog form {
    padding: 22px;
}

.production-form-grid {
    gap: 13px;
}

.production-item-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(760px, calc(100vw - 270px));
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 18px 0 0 18px;
    background: #fff;
    box-shadow: -24px 0 70px rgba(13, 35, 58, .22);
}

.production-item-drawer::backdrop {
    background: rgba(17, 35, 54, .34);
    backdrop-filter: blur(2px);
}

.production-item-drawer[open] {
    animation: production-drawer-enter .18s ease-out;
}

@keyframes production-drawer-enter {
    from {
        opacity: .6;
        transform: translateX(28px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.production-drawer-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.production-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #e4eaf1;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.production-drawer-header > div {
    min-width: 0;
}

.production-drawer-header .eyebrow {
    margin: 0 0 5px;
    font-size: 10px;
}

.production-drawer-header h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #173550;
    font-size: 21px;
    font-weight: 630;
    line-height: 1.2;
}

.production-drawer-header .muted {
    margin: 6px 0 0;
    font-size: 11px;
}

.production-drawer-header .icon-button {
    flex: 0 0 auto;
    width: 34px;
    min-height: 34px;
    margin: 0;
}

.production-drawer-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 18px 0;
    border-bottom: 1px solid #e4eaf1;
}

.production-drawer-tabs button {
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 7px 12px 9px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 7px 7px 0 0;
    background: transparent;
    color: #718092;
    font-size: 12px;
    font-weight: 550;
}

.production-drawer-tabs button.active {
    border-bottom-color: #2e6eaa;
    color: #205089;
}

.production-tab-count {
    display: inline-grid;
    min-width: 18px;
    min-height: 18px;
    place-items: center;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e8eef5;
    color: #557086;
    font-size: 9px;
    line-height: 18px;
}

.production-drawer-tabs button.active .production-tab-count {
    background: #dceaf7;
    color: #205089;
}

.production-drawer-panel {
    min-height: 0;
    overflow-y: auto;
}

.production-drawer-panel[hidden] {
    display: none;
}

.production-drawer-panel form {
    min-height: 100%;
    padding: 18px 22px 0;
}

.production-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.production-card-grid .wide {
    grid-column: 1 / -1;
}

.production-card-grid label {
    display: grid;
    gap: 5px;
    color: #526273;
    font-size: 11px;
    font-weight: 550;
}

.production-card-grid input,
.production-card-grid select,
.production-card-grid textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #d6dfe8;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: #193249;
    font: inherit;
    font-size: 12px;
}

.production-card-grid textarea {
    resize: vertical;
    line-height: 1.4;
}

.production-card-grid input:focus,
.production-card-grid select:focus,
.production-card-grid textarea:focus {
    border-color: #4777aa;
    box-shadow: 0 0 0 3px rgba(32, 80, 137, .08);
}

.production-card-grid :disabled {
    opacity: 1;
    background: #f5f7fa;
    color: #4f6173;
    cursor: default;
}

.production-drawer-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 18px -22px 0;
    padding: 12px 22px;
    border-top: 1px solid #e4eaf1;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
}

.production-drawer-actions span {
    margin-right: auto;
    color: #68798a;
    font-size: 11px;
}

.production-drawer-actions button {
    width: auto;
    min-height: 36px;
    margin: 0;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 11px;
}

.production-history {
    display: grid;
    gap: 9px;
    padding: 18px 22px 26px;
    color: #718092;
    font-size: 12px;
}

.production-history-entry {
    padding: 12px 13px;
    border: 1px solid #e0e7ef;
    border-radius: 10px;
    background: #fafbfd;
}

.production-history-entry header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.production-history-entry strong {
    color: #29445f;
    font-size: 12px;
    font-weight: 600;
}

.production-history-entry time {
    color: #84909d;
    font-size: 10px;
    white-space: nowrap;
}

.production-history-entry ul {
    display: grid;
    gap: 4px;
    margin: 8px 0 0;
    padding-left: 17px;
    color: #56697b;
    font-size: 11px;
}

.production-materials-panel {
    min-height: 100%;
    padding: 16px 18px 0;
}

.production-materials-toolbar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
}

.production-material-search-wrap {
    position: relative;
    display: grid;
    gap: 5px;
}

.production-material-search-wrap label {
    color: #526273;
    font-size: 11px;
    font-weight: 550;
}

.production-material-search-wrap input {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #d6dfe8;
    border-radius: 8px;
    outline: none;
    color: #193249;
    font: inherit;
    font-size: 12px;
}

.production-material-search-wrap input:focus {
    border-color: #4777aa;
    box-shadow: 0 0 0 3px rgba(32, 80, 137, .08);
}

.production-materials-toolbar > button {
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 11px;
}

.production-material-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #d8e1ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(24, 49, 73, .16);
}

.production-material-results button {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    border-radius: 0;
    background: #fff;
    color: #263f58;
    text-align: left;
}

.production-material-results button:last-child {
    border-bottom: 0;
}

.production-material-results button:hover,
.production-material-results button:focus-visible {
    background: #f1f6fb;
}

.production-material-results strong,
.production-material-results span {
    display: block;
}

.production-material-results strong {
    font-size: 11px;
    font-weight: 600;
}

.production-material-results span,
.production-material-result-empty {
    margin-top: 2px;
    color: #788696;
    font-size: 10px;
}

.production-material-result-empty {
    padding: 12px;
}

.production-materials-summary {
    margin: 12px 0 7px;
    color: #657789;
    font-size: 11px;
}

.production-materials-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e1e8ef;
    border-radius: 10px;
}

.production-materials-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    table-layout: fixed;
}

.production-materials-table th,
.production-materials-table td {
    padding: 6px 7px;
    border-bottom: 1px solid #e9eef3;
    color: #344b61;
    font-size: 10px;
    line-height: 1.25;
    text-align: left;
    vertical-align: middle;
}

.production-materials-table th {
    background: #f5f8fb;
    color: #718092;
    font-weight: 550;
}

.production-materials-table tbody tr:last-child td {
    border-bottom: 0;
}

.production-materials-table tr.has-shortage td {
    background: #fff9f6;
}

.production-materials-table th:nth-child(1) { width: 230px; }
.production-materials-table th:nth-child(2),
.production-materials-table th:nth-child(3) { width: 92px; }
.production-materials-table th:nth-child(4),
.production-materials-table th:nth-child(5),
.production-materials-table th:nth-child(6),
.production-materials-table th:nth-child(7) { width: 64px; }
.production-materials-table th:nth-child(8) { width: 34px; }

.production-material-name strong,
.production-material-name span {
    display: block;
}

.production-material-name strong {
    color: #213c56;
    font-size: 11px;
    font-weight: 580;
}

.production-material-name span {
    margin-top: 2px;
    color: #7a8794;
    font-size: 9px;
}

.production-materials-table input {
    width: 100%;
    min-height: 30px;
    padding: 4px 6px;
    border: 1px solid #d8e0e8;
    border-radius: 6px;
    background: #fff;
    color: #1e3a54;
    font: inherit;
    font-size: 11px;
    text-align: right;
}

.production-materials-table input:focus {
    border-color: #4777aa;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(32, 80, 137, .08);
}

.production-materials-table input:disabled {
    border-color: transparent;
    background: transparent;
    color: #344b61;
}

.production-material-shortage {
    color: #b13c30 !important;
    font-weight: 650;
}

.production-material-remove {
    width: 27px;
    min-height: 27px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #a64c43;
    font-size: 17px;
    font-weight: 400;
}

.production-material-remove:hover {
    background: #fff0ef;
}

.production-materials-empty {
    padding: 24px 12px !important;
    color: #81909e !important;
    text-align: center !important;
}

@media (max-width: 1100px) {
    .production-order-main {
        grid-template-columns: minmax(210px, 1.4fr) 88px 105px minmax(135px, .7fr);
    }

    .production-order-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .production-item-drawer {
        width: min(760px, calc(100vw - 40px));
    }
}

@media (max-width: 760px) {
    .production-content {
        padding: 14px 11px 28px;
    }

    .production-summary {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .production-summary article {
        padding: 8px 10px;
    }

    .production-summary strong {
        font-size: 17px;
    }

    .production-toolbar {
        grid-template-columns: 1fr;
        padding: 8px;
    }

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

    .production-order-main {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
        padding: 9px;
    }

    .production-order-title,
    .production-order-actions {
        grid-column: 1 / -1;
    }

    .production-order-title h2,
    .production-order-title p {
        white-space: normal;
    }

    .production-items-table {
        min-width: 780px;
    }

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

    .production-form-grid .wide {
        grid-column: auto;
    }

    .production-dialog form {
        padding: 17px;
    }

    .production-item-drawer {
        width: 100vw;
        border-radius: 0;
    }

    .production-drawer-header {
        padding: 16px 15px 13px;
    }

    .production-drawer-panel form,
    .production-history {
        padding-right: 15px;
        padding-left: 15px;
    }

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

    .production-card-grid .wide {
        grid-column: auto;
    }

    .production-drawer-actions {
        margin-right: -15px;
        margin-left: -15px;
        padding-right: 15px;
        padding-left: 15px;
    }

    .production-materials-panel {
        padding-right: 11px;
        padding-left: 11px;
    }

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

    .production-materials-toolbar > button {
        width: 100%;
    }
}


/* Quick status width fix */
.production-items-table th:nth-child(5) {
    width: 180px;
}

.production-status-select {
    width: 100%;
    min-width: 155px;
    box-sizing: border-box;
}

.production-status-select:focus,
.production-status-select:focus-visible {
    border-color: #9bb6d2 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(32, 80, 137, .10) !important;
}
