.production-flat-caption { display: none !important; }
body.prouz-overlay-navigation .dashboard > .content.production-content {
    padding-left: 16px !important;
    padding-right: 16px !important;
}
body.prouz-overlay-navigation .dashboard > .content.production-content > .topbar {
    padding-left: 64px !important;
}
body .production-toolbar #add-order-button {
    background: linear-gradient(155deg, #4c94cc 0%, #327ab5 48%, #22578b 100%) !important;
    border: 1px solid #397db5 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 7px rgba(28,72,116,.22) !important;
    color: #fff !important;
    transition: filter .15s ease, box-shadow .15s ease;
}
body .production-toolbar #add-order-button:hover {
    filter: brightness(1.06);
    transform: none !important;
}
body .production-toolbar > label > span { display: none !important; }
body .production-toolbar input,
body .production-toolbar select,
body .production-toolbar .production-actions button,
body .production-toolbar .production-actions a {
    height: 35px !important;
    min-height: 35px !important;
    box-sizing: border-box;
}

/* Keep the compact toolbar above legacy dense-layout rules. */
body .production-toolbar {
    grid-template-columns: minmax(180px, 1fr) 180px 180px max-content !important;
    align-items: end !important;
}
body .production-toolbar > label { min-width: 0; }
body .production-toolbar > label[hidden] { display: none !important; }
body .production-toolbar .production-actions {
    grid-column: auto !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
}
body .production-toolbar .production-icon-button {
    width: 35px !important;
    min-width: 35px !important;
    height: 35px !important;
    padding: 0 !important;
}
@media (max-width: 1050px) {
    body .production-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body .production-toolbar .production-search,
    body .production-toolbar .production-actions { grid-column: 1 / -1 !important; }
    body .production-toolbar .production-actions { flex-wrap: wrap !important; }
}

.production-content {
    min-width: 0;
}

.production-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.production-summary article {
    padding: 18px;
    border: 1px solid #dfe7f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 9px 28px rgba(32, 80, 137, .06);
}

.production-summary span {
    display: block;
    margin-bottom: 8px;
    color: #758292;
    font-size: 13px;
}

.production-summary strong {
    color: #173a5e;
    font-size: 28px;
}

.production-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 190px 190px auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 18px;
    padding: 17px;
    border: 1px solid #dfe7f0;
    border-radius: 18px;
    background: #fff;
}

.production-toolbar label,
.production-dialog label {
    display: grid;
    gap: 7px;
    margin: 0;
    color: #48586a;
    font-size: 13px;
    font-weight: 700;
}

.production-toolbar label[hidden] { display: none; }

.production-toolbar input,
.production-toolbar select,
.production-dialog input,
.production-dialog select,
.production-dialog textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: #172b3f;
    font: inherit;
}

.production-dialog textarea {
    resize: vertical;
}

.production-toolbar input:focus,
.production-toolbar select:focus,
.production-dialog input:focus,
.production-dialog select:focus,
.production-dialog textarea:focus {
    border-color: #205089;
    box-shadow: 0 0 0 3px rgba(32, 80, 137, .1);
}

.production-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: nowrap;
}

.production-actions button {
    white-space: nowrap;
}

.production-icon-button {
    display: inline-flex;
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.production-icon-button svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.orders-list {
    display: grid;
    gap: 13px;
}

.production-loading,
.production-empty {
    padding: 34px 20px;
    border: 1px dashed #cfd9e4;
    border-radius: 18px;
    background: #fff;
    color: #718092;
    text-align: center;
}

.production-order {
    overflow: hidden;
    border: 1px solid #dfe7f0;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(32, 80, 137, .06);
}

.production-order-main {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(110px, .55fr)) auto;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

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

.production-order-title h2 {
    margin: 4px 0 6px;
    overflow-wrap: anywhere;
    font-size: 19px;
}

.production-order-title p {
    margin: 0;
}

.production-order-number {
    color: #205089;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.production-order-metric span {
    display: block;
    margin-bottom: 5px;
    color: #7b8795;
    font-size: 11px;
}

.production-order-metric strong {
    display: block;
    overflow-wrap: anywhere;
    color: #213d59;
    font-size: 14px;
}

.production-order-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.production-order-actions button {
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.production-status {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 6px 9px;
    border-radius: 999px;
    background: #edf2f7;
    color: #58697b;
    font-size: 11px;
    font-weight: 800;
}

.production-status.in_production {
    background: #e9f2fc;
    color: #205089;
}

.production-status.completed,
.production-status.shipped {
    background: #e8f5ef;
    color: #176b57;
}

.production-status.paused,
.production-status.paused_revision {
    background: #fff3d8;
    color: #815f00;
}

.production-status.cancelled {
    background: #fff0ef;
    color: #a33b32;
}

.production-order.overdue {
    border-color: #efc1bb;
}

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

.production-order-details[hidden] {
    display: none;
}

.production-items {
    display: grid;
    gap: 9px;
    padding-top: 14px;
}

.production-item {
    display: grid;
    grid-template-columns: 80px minmax(180px, 1fr) 100px 125px 150px;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e2e9f1;
    border-radius: 13px;
    background: #f8fafc;
}

.production-item-number {
    color: #205089;
    font-weight: 900;
}

.production-item-name {
    min-width: 0;
}

.production-item-name strong,
.production-item-name small {
    display: block;
    overflow-wrap: anywhere;
}

.production-item-name small {
    margin-top: 4px;
    color: #7b8794;
}

.production-item-value span {
    display: block;
    margin-bottom: 4px;
    color: #82909f;
    font-size: 10px;
}

.production-item-value strong {
    font-size: 13px;
}

.production-dialog {
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 30px);
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 90px rgba(10, 30, 52, .28);
}

.production-dialog::backdrop {
    background: rgba(15, 31, 49, .56);
    backdrop-filter: blur(3px);
}

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

.production-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

@media (max-width: 1050px) {
    .production-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .production-toolbar {
        grid-template-columns: minmax(220px, 1fr) 170px 170px auto;
    }

    .production-order-main {
        grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(110px, .5fr));
    }

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

@media (max-width: 720px) {
    .production-summary {
        grid-template-columns: 1fr 1fr;
        gap: 9px;
    }

    .production-summary article {
        padding: 14px;
    }

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

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

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

    .production-search { grid-column: 1 / -1; }

    .production-order-main {
        grid-template-columns: 1fr 1fr;
        gap: 13px;
        padding: 15px;
    }

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

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

    .production-item {
        grid-template-columns: 70px 1fr;
    }

    .production-item-value,
    .production-item .production-status {
        grid-column: span 1;
    }

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

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

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

.material-cost-link {
    text-align: left;
    white-space: normal;
}

.material-cost-dialog {
    width: min(980px, calc(100% - 28px));
    color: #20364d;
}

.material-cost-dialog .dialog-header,
.material-cost-body {
    padding: clamp(14px, 3vw, 24px);
}

.material-cost-dialog .dialog-header {
    margin: 0;
    border-bottom: 1px solid #dce7f2;
}

.material-cost-body {
    display: grid;
    gap: 16px;
}

.material-cost-total,
.material-cost-item header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
}

.material-cost-total,
.material-cost-item {
    min-width: 0;
    border: 1px solid #dce7f2;
    border-radius: 12px;
}

.material-cost-total {
    background: #eff6fd;
    padding: 14px 16px;
}

.material-cost-total strong {
    font-size: 1.3em;
}

.material-cost-note,
.material-cost-item p,
.material-cost-item h3 {
    margin: 0;
}

.material-cost-note,
.material-cost-table small {
    color: #526a83;
}

.material-cost-item header,
.material-cost-item > h3,
.material-cost-item p {
    padding: 12px 14px;
}

.material-cost-item h3 {
    font-size: 1em;
    overflow-wrap: anywhere;
}

.material-cost-table-scroll {
    overflow-x: auto;
    border-radius: 0 0 12px 12px;
}

.material-cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9em;
    font-variant-numeric: tabular-nums;
}

.material-cost-table th,
.material-cost-table td {
    padding: 9px 12px;
    border-top: 1px solid #dce7f2;
    vertical-align: top;
    text-align: right;
}

.material-cost-table th:first-child {
    text-align: left;
    min-width: 150px;
}

.material-cost-table td {
    white-space: nowrap;
}

.material-cost-table thead {
    background: #eff4fa;
}

.material-cost-table small {
    display: block;
    margin-top: 2px;
}

.material-cost-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 10px;
}

.material-cost-comparison .material-cost-total {
    display: grid;
    gap: 5px;
}


.material-cost-note.material-cost-over {
    color: #a12930;
    font-weight: 650;
}

.material-cost-item-heading {
    min-width: 0;
}

.material-cost-item-heading small {
    display: block;
    margin-top: 4px;
    color: #526a83;
}
