@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Variable.woff2") format("woff2 supports variations"),
         url("fonts/Vazirmatn-Variable.woff2") format("woff2-variations");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

/*
 * Shared master-data list surface. One global copy of the list-page pattern - header actions,
 * error banner, toolbar, skeleton, table and mobile cards - used by the master-data pages that do
 * not need their own scoped layout. Colors come from the shared tokens only. Stage 10 replaced the
 * former per-page "pilot" copies with this block.
 */
.gamma-list-page{display:grid;gap:12px}
.gamma-list-page .primary-action,.gamma-list-page .secondary-action{min-height:44px;padding-inline:14px;display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:8px;font:inherit;font-weight:650;text-decoration:none;cursor:pointer;white-space:nowrap}
.gamma-list-page .primary-action{color:#fff;background:var(--gamma-primary);border:1px solid var(--gamma-primary)}
.gamma-list-page .primary-action:hover:not(:disabled){background:var(--gamma-primary-hover)}
.gamma-list-page .primary-action:disabled{cursor:not-allowed;opacity:.55}
.gamma-list-page .primary-action svg{width:19px;height:19px}
.gamma-list-page .primary-action:focus-visible,.gamma-list-page .icon-action:focus-visible{outline:3px solid var(--gamma-focus);outline-offset:2px}
.gamma-list-page .page-error{padding:10px 12px;display:flex;align-items:center;gap:8px;color:var(--gamma-danger-text);background:var(--gamma-danger-soft);border:1px solid var(--gamma-danger-border);border-radius:8px}
.gamma-list-page .page-error svg{width:19px;height:19px}
.gamma-list-card{min-width:0;overflow:hidden;background:var(--gamma-surface);border:1px solid var(--gamma-border);border-radius:10px}
.gamma-list-toolbar{min-height:60px;padding:8px 12px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-block-end:1px solid var(--gamma-border)}
.gamma-list-identity{min-width:160px;display:flex;align-items:center;gap:10px}
.gamma-list-identity>div{display:grid}
.gamma-list-identity strong{font-size:15px;font-weight:750}
.gamma-list-identity small{color:var(--gamma-text-muted);font-size:12px}
.gamma-list-icon{width:36px;height:36px;display:grid;place-items:center;color:var(--gamma-primary);background:#eef4ff;border-radius:8px}
.gamma-list-icon svg{width:20px;height:20px}
.gamma-list-tools{min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:8px}
.gamma-list-tools .filter-select{width:170px}
.gamma-list-page .search-field{position:relative;width:min(280px,28vw);margin:0}
.gamma-list-page .search-field>svg{position:absolute;z-index:2;inset-inline-start:12px;inset-block-start:50%;width:18px;height:18px;color:var(--gamma-text-muted);pointer-events:none;transform:translateY(-50%)}
.gamma-list-page .search-field .mud-input-control{width:100%;min-height:40px}
.gamma-list-page .search-field .mud-input-slot{padding-inline-start:38px}
.gamma-list-page .icon-action{width:40px;height:40px;display:inline-grid;place-items:center;color:var(--gamma-text-muted);background:transparent;border:1px solid transparent;border-radius:8px;cursor:pointer}
.gamma-list-page .icon-action:disabled{cursor:not-allowed;opacity:.5}
.gamma-list-page .icon-action svg{width:18px;height:18px}
.gamma-list-page .toolbar-action{width:44px;height:44px;background:var(--gamma-surface);border-color:var(--gamma-border)}
.gamma-list-page .toolbar-action:hover:not(:disabled),.gamma-list-page .row-actions button:hover:not(:disabled){color:var(--gamma-primary);background:#eef4ff;border-color:#bfdbfe}
.gamma-list-page .row-actions{display:flex;align-items:center;justify-content:center;gap:3px}
.gamma-list-page .name-cell{min-width:0;display:grid}
.gamma-list-page .name-cell small{color:var(--gamma-text-muted);font-size:12px}
.gamma-list-page .technical-value{font-family:Consolas,"Courier New",monospace}
.gamma-list-skeleton{min-height:200px;padding:12px;display:grid;align-content:start;gap:8px}
.gamma-list-skeleton>div{height:44px;background:linear-gradient(90deg,#eef1f5 25%,#f8fafc 50%,#eef1f5 75%);background-size:200% 100%;border-radius:6px;animation:gamma-list-shimmer 1.3s ease-in-out infinite}
@keyframes gamma-list-shimmer{from{background-position:100% 0}to{background-position:-100% 0}}
.gamma-list-grid{border:0}
.gamma-list-grid .mud-table-head .mud-table-cell{height:40px;font-size:12px;font-weight:750;text-align:start}
.gamma-list-grid .mud-table-body .mud-table-cell{height:44px;padding-block:4px;text-align:start;border-color:#edf0f4}
.gamma-list-form{padding:4px 4px 16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.gamma-list-form label{display:grid;align-content:start;gap:6px;font-weight:650}
.gamma-list-form label>span{color:var(--gamma-text-muted);font-size:12px}
.gamma-list-form label.full{grid-column:1/-1}
.gamma-list-form .mud-input-control,.gamma-list-form .mud-select{width:100%;min-height:42px}
.gamma-list-form-actions{margin-inline:-16px;margin-block-end:-16px;padding:12px 16px;display:flex;justify-content:flex-end;gap:8px;background:#fbfcfd;border-block-start:1px solid var(--gamma-border)}
.gamma-list-form-actions>button:not(.primary-action){min-height:44px;padding-inline:14px;background:var(--gamma-surface);border:1px solid var(--gamma-border);border-radius:8px;font:inherit;cursor:pointer}
@media(max-width:1000px){.gamma-list-toolbar{align-items:stretch;flex-direction:column}.gamma-list-tools{flex-wrap:wrap;justify-content:stretch}.gamma-list-page .search-field{width:auto;flex:1 1 100%}}
@media(max-width:700px){.gamma-list-form{grid-template-columns:1fr}.gamma-list-form label.full{grid-column:auto}.gamma-list-tools .filter-select{width:100%}}
@media(prefers-reduced-motion:reduce){.gamma-list-skeleton>div{animation:none}}

:root {
    --gamma-bg: #f5f7fa;
    --gamma-surface: #ffffff;
    --gamma-sidebar: #182230;
    --gamma-primary: #2563eb;
    --gamma-primary-hover: #1d4ed8;
    --gamma-accent: #0f9f8f;
    --gamma-warning: #d97706;
    --gamma-danger: #dc2626;
    --gamma-text: #172033;
    --gamma-text-muted: #667085;
    --gamma-border: #dde3ea;
    --gamma-focus: rgba(37, 99, 235, 0.22);

    /*
     * Model visual identity. The Models workspace is product-centred: its accent, icon tiles, summary
     * header band, and stepper use these tokens and never page-local colors. White text on
     * --gamma-model-accent and --gamma-model-accent-text on --gamma-model-accent-soft meet WCAG AA.
     */
    --gamma-model-accent: #7c3aed;
    --gamma-model-accent-hover: #6d28d9;
    --gamma-model-accent-soft: #f5f3ff;
    --gamma-model-accent-border: #ddd6fe;
    --gamma-model-accent-text: #5b21b6;
    --gamma-model-hero: linear-gradient(135deg, #f5f3ff 0%, #eef4ff 100%);

    /*
     * Model workspace surfaces. The model experience is product-centred and roomier, so its pages
     * tint their page ground, board borders and cards through these tokens instead of page-local
     * gradients. Stage 10 moved the model work and model subcontracting pages onto them.
     */
    --gamma-model-page: linear-gradient(145deg, #f7f4ff 0%, #ffffff 32%);
    --gamma-model-card: linear-gradient(160deg, #ffffff, #faf8ff);
    --gamma-model-board-border: #d8d0ed;
    --gamma-model-board-shadow: 0 10px 28px rgba(70, 59, 112, 0.125);
    --gamma-model-heading: #493f72;

    /*
     * Component visual identity. The component experience is compact and operational: a denser
     * green accent, no page tint, and tighter surfaces. Component pages express identity only
     * through these tokens. --gamma-component-accent-text on --gamma-component-accent-soft and
     * white on --gamma-component-accent meet WCAG AA.
     */
    --gamma-component-accent: #0f766e;
    --gamma-component-accent-hover: #115e59;
    --gamma-component-accent-soft: #ecfdf5;
    --gamma-component-accent-border: #a7f3d0;
    --gamma-component-accent-text: #115e59;
    --gamma-component-heading: #1c5e57;

    /*
     * Inventory identity: stock and purchase receipts. Kept distinct from both production
     * experiences so an inventory page never reads as a model or component page.
     */
    --gamma-inventory-accent: #047857;
    --gamma-inventory-accent-hover: #065f46;
    --gamma-inventory-accent-soft: #ecfdf3;
    --gamma-inventory-accent-border: #a7f3d0;
    --gamma-inventory-accent-text: #065f46;

    /* Shared feedback surfaces, so a page never invents its own error or warning colors. */
    --gamma-danger-soft: #fff5f5;
    --gamma-danger-border: #fecaca;
    --gamma-danger-text: #991b1b;
    --gamma-warning-soft: #fffbeb;
    --gamma-warning-border: #fde68a;
    --gamma-warning-text: #92400e;
    --gamma-positive-soft: #ecfdf3;
    --gamma-positive-border: #a7f3d0;
    --gamma-positive-text: #067647;
}

html, body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    color: var(--gamma-text);
    background: var(--gamma-bg);
    font-size: 14px;
}

button, input, select, option, optgroup, textarea,
.mud-typography, .mud-button-root, .mud-input, .mud-table-root {
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

.mud-input-control,
.mud-select {
    margin-top: 0;
}

.mud-input-outlined-border,
.mud-paper,
.mud-table-root {
    border-color: var(--gamma-border);
}

.mud-table-root {
    color: var(--gamma-text);
    background: transparent;
}

.mud-table-head {
    color: #475467;
    background: #f8fafc;
}

.mud-table-cell {
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    text-align: start;
}

.mud-table-row:hover {
    background: #f7faff;
}

a, .btn-link {
    color: var(--gamma-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--gamma-primary);
    border-color: var(--gamma-primary);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px var(--gamma-focus);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4w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UgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.size-vector{padding:14px;display:flex;flex-wrap:wrap;gap:8px}.size-pill{min-width:52px;padding:8px 12px;text-align:center;background:#eef4ff;border:1px solid #bfd3ff;border-radius:8px;font-weight:750}.size-pill.inactive{color:#9a6700;background:#fffbeb;border-color:#fde68a}.empty.compact{min-height:80px;width:100%}.size-range-editor{max-height:520px;overflow:auto;display:grid;gap:12px}.size-range-editor>p{margin:0;color:var(--gamma-text-muted)}.size-range-editor section{padding:10px;border:1px solid var(--gamma-border);border-radius:8px}.size-range-editor section>div{margin-block-start:8px;display:flex;flex-wrap:wrap;gap:7px}.size-choice{min-width:68px;padding:8px 10px;display:flex;align-items:center;gap:7px;background:#f8fafc;border:1px solid var(--gamma-border);border-radius:8px;cursor:pointer}.size-choice.unavailable{color:#9a6700;background:#fffbeb}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Direct manufacturing setup preview */
.generated-route{display:flex;align-items:center;gap:9px;padding:10px 12px;color:#344054;text-decoration:none;border:1px solid #e3e8ef;border-radius:10px;background:#fbfcfe}.generated-route:hover{border-color:#a5b4fc;background:#f7f7ff}.generated-route>span{display:grid;flex:1}.generated-route small{color:var(--gamma-text-muted)}.generated-route svg{width:18px;height:18px;color:#4f46e5}.preview-workspace{display:grid;gap:14px;max-height:70vh;overflow:auto;padding:2px 4px 4px}.preview-intro{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:16px;border:1px solid #e0e4ff;border-radius:14px;background:linear-gradient(135deg,#f6f7ff,#fff)}.preview-intro h3,.preview-intro p{margin:3px 0}.preview-intro p{max-width:730px;color:var(--gamma-text-muted);line-height:1.75}.preview-factory{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;padding:7px 10px;color:#087f6d;border-radius:999px;background:#e8f8f4;font-size:13px;font-weight:750}.preview-loading{min-height:220px}.preview-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.preview-summary span{display:flex;align-items:baseline;gap:6px;padding:11px;border:1px solid #e8ebf2;border-radius:11px;background:#fff;color:var(--gamma-text-muted);font-size:13px}.preview-summary b{color:#312e81;font-size:18px}.preview-layers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start}.preview-layer{overflow:hidden;border:1px solid #e5e8ef;border-top:4px solid #10a58f;border-radius:13px;background:#fff}.preview-layer.assembly{border-top-color:#4f46e5}.preview-layer.finishing{border-top-color:#e09a18}.preview-layer>header{display:flex;align-items:center;gap:9px;padding:12px;background:#f8fbfa}.preview-layer.assembly>header{background:#f7f7ff}.preview-layer.finishing>header{background:#fffaf0}.preview-layer header small,.preview-layer header h4{display:block;margin:0}.preview-layer header small{color:var(--gamma-text-muted)}.preview-layer header h4{margin-top:2px;font-size:14px}.layer-number{width:31px;height:31px;display:grid;place-items:center;flex:0 0 auto;color:#fff;border-radius:9px;background:#10a58f;font-weight:850}.assembly .layer-number{background:#4f46e5}.finishing .layer-number{background:#e09a18}.preview-steps{display:grid;padding:8px}.preview-step{display:grid;grid-template-columns:27px 1fr;gap:8px;padding:9px 4px}.preview-step+.preview-step{border-top:1px dashed #e1e5ec}.step-order{width:25px;height:25px;display:grid;place-items:center;border-radius:50%;background:#eef1f6;color:#667085;font-size:12px;font-weight:800}.preview-step strong{font-size:13px}.step-bindings{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}.binding{padding:3px 6px;border-radius:6px;background:#f2f4f7;color:#596579;font-size:10px}.binding.input{background:#eff8ff;color:#175cd3}.binding.output{background:#ecfdf3;color:#067647}.binding.final{background:#fff4e5;color:#b54708;font-weight:750}.inventory-boundary{display:flex;align-items:flex-start;gap:10px;padding:13px 14px;border:1px solid #f2d690;border-radius:12px;background:#fff9e8;color:#7a5208}.inventory-boundary strong,.inventory-boundary p{display:block;margin:0}.inventory-boundary p{margin-top:3px;line-height:1.7;font-size:13px}.generation-notes{padding:10px 12px;border:1px solid #e5e8ef;border-radius:10px;background:#fafbfc}.generation-notes summary{cursor:pointer;font-weight:750}.generation-notes p{margin:8px 0 0;padding:7px 9px;border-radius:7px;background:#fff}.generation-notes p.error{color:#991b1b;background:#fff1f2}.generation-notes p.warning{color:#8a5b07;background:#fff8e6}.generation-assurance{display:flex;align-items:center;gap:8px;padding:11px;color:#067467;border-radius:10px;background:#ecfdf8}.generate-form{padding-top:2px}@media(max-width:950px){.preview-layers{grid-template-columns:1fr}.preview-summary{grid-template-columns:1fr 1fr}}@media(max-width:600px){.preview-intro{flex-direction:column}.preview-summary{grid-template-columns:1fr}.preview-factory{white-space:normal}}
