/* Shared density for list and definition screens. */
.app-main{padding-top:18px}.page-heading{margin-bottom:14px}.page-heading h1{font-size:25px}.panel{margin-bottom:14px}.panel-heading{padding:11px 16px}.summary-strip>div{padding:10px 16px}.summary-strip{margin-bottom:14px}
.compact-table th,.compact-table td{padding:5px 9px;vertical-align:middle;font-size:13px}.compact-table tbody tr{height:39px}.compact-table input:not([type=checkbox]),.compact-table select,.compact-table textarea{width:100%;height:29px;min-height:29px;padding:3px 6px;background:transparent;border:1px solid transparent;border-radius:4px;font-size:13px;min-width:0;color:var(--text)}
.compact-table input:hover,.compact-table select:hover,.compact-table textarea:hover{border-color:var(--border-strong);background:white}.compact-table input:focus,.compact-table select:focus,.compact-table textarea:focus{background:white;border-color:var(--brand);outline:2px solid var(--brand-soft)}
.compact-table .number-cell{width:102px}.compact-table .number-cell input{text-align:right}.compact-table .cell-title{white-space:nowrap}.compact-table .row-action{width:115px;position:relative}.compact-table .row-action button{padding:2px 5px}.compact-table [data-save-status]{font-size:11px;color:var(--muted);white-space:nowrap}.compact-table .save-error [data-save-status]{display:block;white-space:normal;min-width:170px;color:var(--danger)}.compact-table .is-dirty{background:#fffbea}.compact-table .save-error{background:var(--danger-bg)}
.tabs-toolbar{display:flex;align-items:center;gap:16px;justify-content:space-between;margin-bottom:12px;border-bottom:1px solid var(--border);flex-wrap:wrap}.tabs-toolbar .section-tabs{margin:0;border:0;flex-shrink:0}.tabs-toolbar .filter-bar{padding:0;border:0;background:none;gap:7px;margin-left:auto}.tabs-toolbar .search-field input{width:220px}.tabs-toolbar input,.tabs-toolbar select{height:32px;min-height:32px;padding-top:4px;padding-bottom:4px}.tabs-toolbar .filter-count{display:none}
.client-grid{table-layout:fixed;min-width:1160px}.client-grid th:nth-child(1){width:19%}.client-grid th:nth-child(2){width:10%}.client-grid th:nth-child(3){width:13%}.client-grid th:nth-child(4){width:20%}.client-grid th:nth-child(5){width:13%}.client-grid th:nth-child(6){width:9%}.client-grid th:nth-child(7){width:9%}.client-grid th:nth-child(8){width:7%}.client-grid .row-action{white-space:nowrap}.client-grid [data-save-status]:empty{display:none}
.bom-editor .form-grid{display:grid;grid-template-columns:repeat(5,minmax(90px,1fr));padding:12px 16px;gap:12px}.bom-editor .field{margin:0}.bom-editor .field label{font-size:12px}.bom-editor .input{min-height:32px;height:32px;padding:4px 7px}.bom-editor .form-actions{padding:10px 16px}.bom-notes{padding:10px 16px}.bom-notes summary{cursor:pointer;color:var(--muted);font-size:13px}.bom-notes textarea{width:100%;min-height:90px;margin-top:8px}.bom-editor .formset{padding:0 16px 10px}.bom-editor .formset-actions{display:flex;align-items:center;gap:12px;padding:6px 0}.bom-editor [data-deleted=true]{display:none}.bom-editor [name$="-DELETE"]{display:none}.bom-editor .errorlist{font-size:12px;color:var(--danger);padding-left:15px;margin:2px 0}.bom-editor .section-heading{padding:8px 16px;margin:0}.bom-editor .row-action{width:65px}
.followup-fields-table tbody th,.followup-fields-table tbody td{padding-top:5px;padding-bottom:5px}.followup-field-source{display:inline;margin-left:8px}.followup-field-name{line-height:1.3}.followup-field-value .cell-meta{display:inline;margin-left:6px;font-size:10px}
.order-source-note{padding:9px 16px;color:var(--muted);font-size:12px}.order-source-note summary{cursor:pointer}.order-source-note p{margin:6px 0}.order-products td:first-child{font-weight:600}.order-products td{padding-top:9px;padding-bottom:9px}.order-products .numeric{font-variant-numeric:tabular-nums}.order-products .lot-link{font:12px ui-monospace,monospace}
@media(max-width:1000px){.tabs-toolbar .filter-bar{margin:0 0 8px}.bom-editor .form-grid{grid-template-columns:repeat(3,1fr)}}

.calendar-options,.grain-switch{display:flex;align-items:center;gap:8px}.grain-switch{gap:0;border:1px solid var(--border-strong);border-radius:5px;overflow:hidden}.grain-switch a{font-size:12px;padding:5px 10px;border-right:1px solid var(--border)}.grain-switch a:last-child{border:0}.grain-switch a[aria-current]{background:var(--brand);color:white;font-weight:650}.calendar-footer{padding:6px 12px;display:flex;justify-content:space-between;font-size:11px;border-top:1px solid var(--border)}
[data-calendar-pan]{cursor:grab;touch-action:pan-y}.is-panning{cursor:grabbing;user-select:none}.is-panning .schedule-track{transform:translateX(var(--pan-offset))}.schedule-segment{cursor:pointer}.segment-observed{background:#eee6fa;color:#61428b;border-color:#b7a0d4}.segment-trial{background:#f0eff3;color:#6b6572;border-color:#c7c1ce;border-style:dashed}.segment-working{background:#f0f6f1;color:#487c57;border-color:#bed4c3;border-style:dashed;font-weight:400}.legend-observed{background:#eee6fa;color:#b7a0d4}.legend-working{background:#f0f6f1;color:#bed4c3}.calendar-M .segment-working,.calendar-Y .segment-working{padding:0;font-size:0}.calendar-M .schedule-hours>span:last-child,.calendar-Y .schedule-hours>span:last-child,.calendar-W .schedule-hours>span:last-child{transform:translateX(-50%);padding:0}
.team-matrix{min-width:1160px}.team-matrix th{font-size:11px;white-space:nowrap}.team-matrix td{white-space:nowrap}.team-matrix input[type=checkbox]{accent-color:var(--brand);width:15px;height:15px;cursor:pointer}.role-check{text-align:center}.team-matrix td:nth-child(2){width:235px}.team-matrix .row-action{width:80px}.cell-popover{position:relative;font-size:12px}.cell-popover>summary{cursor:pointer;color:var(--brand);list-style:none}.cell-popover>summary::after{content:' ⌄'}.cell-popover>div{position:fixed;z-index:12;min-width:150px;padding:12px;background:white;border:1px solid var(--border-strong);border-radius:7px;box-shadow:0 8px 25px #1c2b4224}.cell-popover label{display:flex;align-items:center;gap:6px;padding:3px 0}.hours-popover>div{min-width:270px}.hours-popover input[type=time]{width:100px;margin-left:auto}.hours-popover input[type=date]{width:145px}.working-days{display:flex;gap:7px}.working-days label{display:flex;flex-direction:column;gap:1px}.team-matrix .cell-popover input:not([type=checkbox]){border-color:var(--border)}.team-matrix + .caption{margin-top:6px}

.client-grid select{padding-right:17px;font-size:12px}.client-grid [name=name]{font-weight:550}.notes-popover>div{width:360px}.notes-popover textarea{height:140px;white-space:pre-wrap;border-color:var(--border)}

.editor.bom-editor{padding:0}.bom-editor .section-heading{min-height:32px;padding:5px 16px}.bom-editor .field label{margin-bottom:3px}.bom-editor .input{height:29px;min-height:29px}.bom-editor .compact-table tbody tr{height:34px}.bom-editor .compact-table td{padding-top:2px;padding-bottom:2px}.bom-editor .compact-table [type=checkbox]{height:15px;min-height:15px;width:15px}.bom-editor .compact-table label{font-size:12px}.bom-editor .panel-heading{margin:0}.planning-metrics .metric small{display:none}.planning-metrics .metric{padding:6px 12px}

.compact-table .row-action [data-save-status]{position:absolute;right:6px;bottom:0;max-width:calc(100% - 8px);overflow:hidden;text-overflow:ellipsis;font-size:9px;line-height:11px}.compact-table .save-error .row-action [data-save-status]{position:static;max-width:none;overflow:visible;white-space:normal}

/* Dense workspaces: one row, one task, readable column groups. */
.component-matrix tbody tr{height:31px}.component-matrix td{padding:4px 12px;font-size:12px}.component-matrix .component-code{color:var(--muted);font-size:11px}.component-matrix th:first-child{width:40%}
.volume-control{display:flex;align-items:center;gap:7px;font-size:12px}.volume-control input{width:76px;height:29px;min-height:29px;padding:3px 7px;border:1px solid var(--border-strong);border-radius:5px;text-align:right}
.recipe-matrix{table-layout:fixed;min-width:1420px}.recipe-matrix th,.recipe-matrix td{padding:4px 3px;text-align:center;font-size:11px}.recipe-matrix thead th{white-space:normal;line-height:1.3}.recipe-matrix th small{display:block;font-size:10px;font-weight:400;color:var(--muted)}.recipe-matrix .recipe-name{width:212px;position:sticky;left:0;z-index:2;background:white;text-align:left;padding-left:10px;border-right:1px solid var(--border)}.recipe-matrix thead .recipe-name{background:var(--surface-alt,#f5f7fa)}.recipe-matrix .cell-title{display:block;white-space:normal;font-size:12px;line-height:1.35;font-weight:650}.recipe-version{font-size:10px;color:var(--muted)}.recipe-matrix tbody tr{height:47px}.recipe-matrix .matrix-groups th{background:#f2f5fa;padding-top:7px;padding-bottom:7px}.matrix-groups th:not(:first-child){border-left:1px solid var(--border)}.matrix-groups span{font-weight:400;color:var(--muted);font-size:10px}.recipe-matrix .process-heading{width:122px}.recipe-matrix .process-cell{border-left:1px solid var(--border);width:122px}.recipe-matrix input{padding:2px 3px;text-align:right;height:25px;min-height:25px;font-size:11px;font-variant-numeric:tabular-nums}.recipe-matrix input[type=number]{appearance:textfield;-moz-appearance:textfield}.recipe-matrix input::-webkit-inner-spin-button,.recipe-matrix input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.recipe-matrix input:disabled{opacity:1;color:var(--text);cursor:default}.recipe-matrix .process-targets{display:flex;gap:3px;justify-content:center}.process-targets label{display:flex;align-items:center;gap:1px;min-width:0}.process-targets label input{width:40px;min-width:0}.process-targets label span{font-size:9px;color:var(--muted)}.recipe-matrix .source-quantity{background:#fff5dd}.recipe-matrix .row-action{width:56px;white-space:nowrap}.recipe-settings{display:inline-block}.recipe-settings>div{width:325px;white-space:normal;text-align:left}.recipe-settings label{justify-content:space-between;gap:10px}.recipe-settings label input{width:96px;border-color:var(--border)}.recipe-settings p{font-size:11px;line-height:1.5}.recipe-matrix .save-error .row-action [data-save-status]{position:absolute;z-index:5;right:0;top:100%;background:#fff0f0;border:1px solid #e8bcbc;border-radius:4px;padding:6px;min-width:240px}

.client-grid th:nth-child(1){width:16%}.client-grid th:nth-child(2){width:20%}.client-grid th:nth-child(3){width:12%}.client-grid th:nth-child(4){width:22%}.client-grid th:nth-child(5){width:13%}.client-grid th:nth-child(6){width:8%}.client-grid th:nth-child(7){width:5%}.client-grid th:nth-child(8){width:4%}.client-grid tbody tr{height:36px}.client-grid .commercial-stage{width:fit-content;max-width:100%;border:1px solid transparent;border-radius:5px;padding:3px 18px 3px 8px;font-weight:600}.client-grid .stage-prospect{background:#eef1f5;color:#536173}.client-grid .stage-qualified{background:#e9eeff;color:#3548a3}.client-grid .stage-commitment{background:#fff0cf;color:#8a5600}.client-grid .stage-customer{background:#dff3e8;color:#236749}.client-grid .stage-lost{background:#fae7e9;color:#9c3546}
.production-actions{display:flex;align-items:center;gap:8px;padding:0 0 10px;position:relative}.production-records{display:flex;gap:18px;margin-left:auto;font-size:12px}.factory-all{border-top:1px solid var(--border);margin-top:6px}.planning-inbox>summary{list-style:none;cursor:pointer}.planning-inbox>summary::-webkit-details-marker{display:none}.planning-inbox[open]>summary{background:var(--brand-soft);border-color:var(--brand)}.planning-inbox-panel{position:absolute;top:42px;right:0;z-index:8;background:white;width:430px;max-width:100%;max-height:65vh;overflow:auto;border:1px solid var(--border-strong);box-shadow:0 10px 40px #1c2b4230;border-radius:8px}.planning-inbox-panel .panel-heading{flex-wrap:wrap;gap:8px}.planning-inbox-panel .panel-heading h2{font-size:14px}.planning-inbox-panel .panel-heading a{font-size:11px}.planning-inbox-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border-bottom:1px solid var(--border)}.planning-inbox-item p{margin:5px 0;font-size:12px}.planning-inbox-item>div:last-child{display:grid;gap:7px;text-align:right;white-space:nowrap;font-size:12px}.planning-order-list>summary{cursor:pointer;padding:10px 14px;font-size:12px;font-weight:600}.production-workspace .planning-metrics .metric{display:flex;align-items:center;gap:12px;padding:7px 12px}.production-workspace .planning-metrics .metric strong{font-size:19px;order:-1}.production-workspace .planning-metrics .metric span{font-size:12px}.production-workspace .planning-metrics{margin-bottom:10px}.production-workspace .planning-toolbar{flex-wrap:wrap;gap:8px}
.receipt-editor{padding:16px;max-width:1500px}.receipt-grid{display:grid;grid-template-columns:1.7fr 1.4fr 1.1fr .7fr 1fr;gap:12px}.receipt-editor .field{margin:0}.receipt-editor label{font-size:12px;margin-bottom:4px}.receipt-editor .input{height:32px;min-height:32px;padding:4px 7px;font-size:13px}.receipt-bottom{display:flex;align-items:end;gap:20px;margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}.receipt-reference{flex:1;max-width:630px}.receipt-buttons{display:flex;gap:8px;margin-left:auto}.receipt-empty{margin:12px 0 0;color:#8a5600;font-size:12px}.receipt-editor .errorlist{margin:3px 0;padding:0;list-style:none;color:var(--danger);font-size:12px}
@media(max-width:1000px){.receipt-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.receipt-bottom{flex-wrap:wrap}.receipt-buttons{margin-left:0}.production-actions{flex-wrap:wrap}.production-records{margin-left:0}}
.recipe-matrix .process-targets label:first-child input{width:42px}.recipe-matrix .process-targets label:nth-child(2) input{width:30px}.recipe-matrix .process-targets label{flex-shrink:0}.recipe-matrix .recipe-name{width:200px}.recipe-matrix .process-heading{overflow-wrap:normal;hyphens:auto}.recipe-matrix-panel .table-scroll{scrollbar-width:thin}
.production-workspace .planning-metrics .metric{flex-direction:row;justify-content:flex-start}.recipe-matrix .process-heading{font-size:10px}.recipe-matrix .process-cell{font-size:10px}
