:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #69746f;
  --line: #dfe5e1;
  --surface: #ffffff;
  --surface-soft: #f5f7f5;
  --surface-warm: #f7f5ef;
  --green: #187b57;
  --green-dark: #105c41;
  --green-soft: #e8f5ee;
  --amber: #b86b13;
  --amber-soft: #fff4df;
  --red: #ba3d3d;
  --red-soft: #fff0ef;
  --blue: #2c65b8;
  --blue-soft: #edf4ff;
  --shadow: 0 14px 45px rgba(30, 48, 40, .08);
  --radius: 18px;
  --sidebar: 244px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #eef1ee; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface-soft); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(24, 123, 87, .28);
  outline-offset: 2px;
}
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .52; cursor: not-allowed; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 12px 18px; color: #fff; background: var(--green-dark); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.mobile-only { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 22px 16px; color: #edf8f2; background: #17392d; box-shadow: 10px 0 34px rgba(22, 50, 40, .08); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #17392d; background: #d7f058; font-size: 21px; font-weight: 900; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.brand strong, .brand small, .sidebar-user strong, .sidebar-user small, .legacy-link strong, .legacy-link small { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.02em; }
.brand small, .sidebar-user small, .legacy-link small { margin-top: 2px; color: #a9c5b8; font-size: 11px; }
.workspace-nav { display: grid; gap: 5px; }
.nav-item { position: relative; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-radius: 12px; color: #c9dbd2; background: transparent; text-align: left; cursor: pointer; transition: background .16s, color .16s, transform .16s; }
.nav-item-link { text-decoration: none; font: inherit; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item:active { transform: scale(.99); }
.nav-item.is-active { color: #fff; background: rgba(215, 240, 88, .15); }
.nav-item.is-active::before { content: ""; position: absolute; left: -16px; width: 4px; height: 25px; border-radius: 0 5px 5px 0; background: #d7f058; }
.nav-icon { font-size: 20px; color: #d7f058; }
.nav-count { min-width: 22px; padding: 3px 6px; border-radius: 999px; color: #17392d; background: #d7f058; font-size: 11px; font-weight: 800; text-align: center; }
.sidebar-spacer { flex: 1; }
.legacy-link, .sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 13px; color: inherit; text-decoration: none; }
.legacy-link { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.055); }
.legacy-link:hover { background: rgba(255,255,255,.1); }
.legacy-link > span:first-child { color: #d7f058; font-size: 20px; }
.future-link { width: 100%; border-color: rgba(215,240,88,.22); text-align: left; cursor: pointer; }
.sidebar-user { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); border-radius: 0; }
.avatar { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; color: #17392d; background: #e6eee9; font-weight: 800; }

.app-body { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 16px 30px; border-bottom: 1px solid rgba(221, 228, 223, .88); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.topbar h1 { margin: 2px 0 0; font-size: 24px; letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 750; }
.status-pill > span { width: 8px; height: 8px; border-radius: 50%; background: #9aa49f; box-shadow: 0 0 0 4px rgba(154,164,159,.12); }
.status-pill.status-online { color: var(--green-dark); border-color: #bddfce; background: var(--green-soft); }
.status-pill.status-online > span { background: #25a66e; box-shadow: 0 0 0 4px rgba(37,166,110,.13); }
.status-pill.status-error { color: #8c2d2d; border-color: #e9c2c0; background: var(--red-soft); }
.status-pill.status-error > span { background: var(--red); }

main { max-width: 1640px; margin: 0 auto; padding: 30px; }
.workspace { animation: workspace-in .2s ease both; }
@keyframes workspace-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.workspace-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 24px; }
.workspace-heading h2 { margin: 4px 0 5px; font-size: clamp(27px, 2.8vw, 42px); line-height: 1.04; letter-spacing: -.05em; }
.workspace-heading p:last-child { max-width: 710px; margin: 0; color: var(--muted); line-height: 1.5; }
.workspace-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.button, .icon-button, .filter-chip, .expert-toggle { border: 0; cursor: pointer; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 17px; border-radius: 11px; font-weight: 780; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 8px 20px rgba(24,123,87,.2); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-secondary { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.button-quiet { padding-left: 0; color: var(--green); background: transparent; box-shadow: none; }
.button-wide { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: var(--ink); background: #edf1ee; font-size: 20px; }

.gate-panel { max-width: 650px; margin: 10vh auto 0; padding: 44px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.gate-panel h2 { margin: 16px 0 8px; font-size: 28px; }
.gate-panel p { margin: 0 auto 22px; color: var(--muted); line-height: 1.55; }
.gate-spinner { width: 42px; height: 42px; margin: 0 auto; border: 4px solid #dbe8e1; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate-panel.is-error .gate-spinner { border: 0; animation: none; }
.gate-panel.is-error .gate-spinner::before { content: "!"; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--red); font-weight: 900; }

.catalog-shell, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 24px rgba(30, 48, 40, .045); }
.catalog-shell { padding: 22px; }
.standard-calculator-note { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #c7d9f4; border-radius: 13px; background: var(--blue-soft); }
.standard-calculator-note > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; background: var(--blue); font-size: 18px; font-weight: 900; }
.standard-calculator-note > div { display: grid; gap: 3px; min-width: 0; }
.standard-calculator-note strong { font-size: 12px; }
.standard-calculator-note small { color: #55708e; font-size: 10px; line-height: 1.4; }
.catalog-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.catalog-summary article { display: flex; align-items: center; gap: 11px; min-height: 70px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfb; }
.catalog-summary article > span:last-child { display: grid; gap: 2px; }
.catalog-summary small { color: var(--muted); font-size: 10px; }
.catalog-summary strong { font-size: 21px; letter-spacing: -.035em; }
.summary-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; font-weight: 900; }
.summary-ready { color: var(--green-dark); background: var(--green-soft); }
.summary-draft { color: #8b5b1d; background: var(--amber-soft); }
.summary-route { color: var(--blue); background: var(--blue-soft); }
.summary-online { color: #5d3d94; background: #efe9fb; }
.online-product-fieldset .check-card > span { display: grid; gap: 2px; }
.online-product-fieldset .check-card small { color: var(--muted); font-size: 10px; font-weight: 500; }
.equipment-map { margin-top: 18px; padding: 15px; border: 1px solid #c7d9f4; border-radius: 12px; background: var(--blue-soft); }
.equipment-map .panel-heading { margin-bottom: 10px; }
.equipment-map-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 9px; }
.equipment-map-card { display: grid; gap: 3px; padding: 10px; border: 1px solid rgba(40,100,173,.18); border-radius: 10px; background: rgba(255,255,255,.82); }
.equipment-map-card strong { font-size: 11px; }
.equipment-map-card small, .equipment-map > small { color: #55708e; font-size: 9px; line-height: 1.4; }
.product-online-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; color: #5d3d94; font-size: 9px; font-weight: 800; }
.catalog-toolbar, .filter-bar { display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap; }
.catalog-toolbar { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.search-field { min-height: 44px; display: flex; align-items: center; gap: 8px; flex: 1 1 310px; max-width: 520px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(24,123,87,.1); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.filter-chip { min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 750; }
.filter-chip.is-active { color: var(--green-dark); border-color: #a8d3bf; background: var(--green-soft); }
.catalog-section { padding-top: 24px; }
.catalog-section-secondary { margin-top: 24px; border-top: 1px solid var(--line); }
.catalog-section-blocked { margin-top: 24px; padding: 20px; border: 1px solid #ecd7bd; border-radius: 15px; background: #fffaf4; }
.section-explanation { margin: 8px 0 0; color: #795d3b; font-size: 11px; line-height: 1.45; }
.section-title-row, .panel-heading, .modal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-title-row h3, .panel-heading h3, .panel-heading h4 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.025em; }
.section-title-row small, .count-label { color: var(--muted); font-size: 12px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 15px; }
.product-card { position: relative; min-height: 190px; display: flex; flex-direction: column; align-items: flex-start; padding: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--ink); text-align: left; transition: transform .16s, border .16s, box-shadow .16s; }
.product-card:hover { transform: translateY(-2px); border-color: #acd3c0; box-shadow: 0 10px 24px rgba(25, 83, 60, .09); }
.product-card.starter-card { background: linear-gradient(140deg, #f7fbf8 0%, #edf6f0 100%); }
.product-card.product-ready { border-color: #c9e0d5; }
.product-card.product-needs-price { background: #fcfcfb; }
.product-card.product-preview { border-color: #e5c893; background: #fffbf3; }
.product-card.product-approval { border-color: #c9d7ee; background: #f7faff; }
.product-card.product-blocked { border-color: #e3d8ca; background: #faf8f5; }
.product-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; border-radius: 11px; color: var(--green-dark); background: rgba(215,240,88,.62); font-size: 19px; font-weight: 800; }
.product-card strong { font-size: 15px; }
.product-card small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.product-card .product-location { overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; }
.product-card .product-price { margin-top: auto; padding-top: 15px; color: var(--green-dark); font-weight: 850; }
.product-card .product-price-warning { margin-top: 5px; color: #8b5b1d; font-size: 9px; }
.product-card .product-readiness { min-height: 25px; margin-top: 7px; font-size: 9px; font-weight: 720; }
.product-card .product-readiness-ready { color: var(--green-dark); }
.product-card .product-readiness-preview { color: #8b5b1d; }
.product-card .product-readiness-approval { color: #315f98; }
.product-card .product-readiness-blocked { color: #89512f; }
.product-card .product-state { position: absolute; right: 12px; top: 12px; padding: 4px 7px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.8); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.product-card .product-state-ready { color: var(--green-dark); background: var(--green-soft); }
.product-card .product-state-preview { color: #79510e; background: var(--amber-soft); }
.product-card .product-state-approval { color: #315f98; background: var(--blue-soft); }
.product-card .product-state-blocked { color: #85442e; background: #f8e9dd; }
.product-actions { width: 100%; display: flex; gap: 7px; margin-top: 12px; }
.product-actions .button { flex: 1; }
.button-compact { min-height: 36px; padding: 7px 10px; font-size: 11px; }

.workbench-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.workbench-head h3 { margin: 2px 0 0; font-size: 25px; }
.revision-badge { margin-left: auto; padding: 6px 10px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 750; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .7fr); gap: 18px; align-items: start; }
.workbench.is-calculator-only .workbench-grid { grid-template-columns: minmax(340px, 620px); }
.panel { padding: 22px; }
.calculation-panel { position: sticky; top: 106px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading > div { display: flex; align-items: center; gap: 9px; }
.panel-heading small { color: var(--muted); }
.step-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: #fff; background: var(--green); font-size: 12px; font-weight: 900; }
.section-gap { margin-top: 28px; }
.required-note { padding: 5px 8px; border-radius: 8px; color: #8b5b1d; background: var(--amber-soft); font-size: 10px; font-weight: 750; }
.form-grid { display: grid; gap: 14px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field > span, .field-group legend { color: #3f4b46; font-size: 12px; font-weight: 760; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #d7ded9; border-radius: 10px; color: var(--ink); background: #fff; outline: 0; }
.field textarea { min-height: 82px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(24,123,87,.09); }
.field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid { border-color: var(--red); }
.field-wide { grid-column: 1 / -1; }
.field-group { margin: 18px 0 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.field-group legend { padding: 0 5px; }
.field-group > small, .field-help { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-card { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 12px; cursor: pointer; }
.check-card input { accent-color: var(--green); }
.tier-list { display: grid; gap: 9px; }
.tier-row { display: grid; grid-template-columns: 1fr 1.4fr 40px; gap: 8px; align-items: end; padding: 11px; border-radius: 12px; background: var(--surface-soft); }
.tier-row .icon-button { width: 40px; height: 44px; color: var(--red); background: var(--red-soft); }
.formula-builder-intro { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 11px; align-items: center; margin: 4px 0 14px; padding: 13px 14px; border: 1px solid #c9dcd3; border-radius: 12px; background: linear-gradient(135deg,#f2faf6,#fbfdfc); }
.formula-builder-intro > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #fff; background: var(--green); font-size: 20px; font-weight: 900; }
.formula-builder-intro strong, .formula-builder-intro small { display: block; }
.formula-builder-intro small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.formula-base-fields { margin-bottom: 14px; }
.formula-stage-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin: 2px 0 9px; }
.formula-stage-heading strong { font-size: 12px; }
.formula-stage-heading small { color: var(--muted); font-size: 10px; }
.formula-preview { margin-top: 13px; padding: 14px; border: 1px solid #c7d9f4; border-radius: 12px; background: linear-gradient(135deg,#f3f7fd,#fbfdff); }
.formula-preview-head { display: flex; gap: 9px; align-items: center; }
.formula-preview-head > span { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 900; }
.formula-preview-head strong, .formula-preview-head small { display: block; }
.formula-preview-head small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.formula-status-ready { color: var(--green-dark) !important; }
.formula-status-warning { color: var(--red) !important; }
.formula-status-draft { color: #806217 !important; }
.formula-expression { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #294d7c; background: rgba(255,255,255,.78); font-size: 12px; font-weight: 780; line-height: 1.5; }
.formula-example { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.formula-options-group { background: #fcfdfc; }
.formula-parameter-list { display: grid; gap: 10px; }
.formula-parameter-row { display: grid; grid-template-columns: minmax(110px,.75fr) minmax(160px,1.25fr) auto 40px; gap: 8px; align-items: end; padding: 11px; border-radius: 12px; background: var(--surface-soft); }
.formula-parameter-row .formula-choice-lines { grid-column: 1 / -1; }
.formula-parameter-row textarea { min-height: 92px; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 11px; }
.formula-parameter-row .icon-button { width: 40px; height: 44px; color: var(--red); background: var(--red-soft); }
.formula-parameter-preserved { padding: 11px 13px; border: 1px dashed #cdd8d1; border-radius: 11px; color: var(--muted); font-size: 11px; }
.recipe-edit-row { display: grid; grid-template-columns: minmax(120px,1fr) minmax(100px,.7fr) minmax(140px,1.2fr) 40px; gap: 8px; align-items: end; padding: 11px; border-radius: 12px; background: var(--surface-soft); }
.recipe-edit-row.material-row { grid-template-columns: minmax(180px,1.4fr) minmax(110px,.7fr) 40px; }
.recipe-edit-row .icon-button { width: 40px; height: 44px; color: var(--red); background: var(--red-soft); }
.expert-toggle { margin-top: 18px; padding: 5px 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 780; }
.expert-settings { margin-top: 11px; padding: 15px; border: 1px dashed #cdd8d1; border-radius: 12px; background: #fafcfb; }
.safety-note { display: flex; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: #305344; }
.safety-note > span { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--green); font-size: 12px; font-weight: 900; }
.safety-note p { margin: 0; font-size: 11px; line-height: 1.45; }
.form-actions, .modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.state-tag { padding: 5px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 800; }
.dynamic-parameters { display: grid; gap: 12px; margin: 14px 0; }
.route-preview { display: grid; gap: 5px; margin: 14px 0; padding: 11px 13px; border: 1px solid #c7d9f4; border-radius: 11px; color: #294d7c; background: var(--blue-soft); }
.route-preview-head { display: flex; align-items: center; gap: 7px; }
.route-preview small { line-height: 1.45; }
.route-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(40, 100, 173, .1); }
.client-price-hint { margin: 10px 0 2px; padding: 9px 11px; border-radius: 10px; color: var(--muted); background: var(--surface-soft); font-size: 10px; line-height: 1.45; }
.client-price-active { color: var(--green-dark); background: var(--green-soft); }
.client-price-general { color: #76501e; background: var(--amber-soft); }
.quote-empty { display: grid; place-items: center; min-height: 180px; margin-top: 18px; border: 1px dashed #d4ddd7; border-radius: 14px; color: var(--muted); text-align: center; }
.quote-empty span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-soft); color: var(--green); font-size: 20px; font-weight: 900; }
.quote-empty p { max-width: 220px; margin: -20px 0 0; font-size: 12px; }
.quote-result { margin-top: 18px; padding: 17px; border-radius: 15px; color: #eaf7f0; background: #17392d; box-shadow: 0 15px 34px rgba(23,57,45,.18); }
.quote-result .eyebrow { color: #d7f058; }
.quote-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0 14px; border-bottom: 1px solid rgba(255,255,255,.14); }
.quote-total span { color: #adcbc0; font-size: 12px; }
.quote-total strong { color: #fff; font-size: 30px; letter-spacing: -.04em; }
.quote-breakdown { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 13px 0; font-size: 11px; }
.quote-breakdown dt { color: #adcbc0; }
.quote-breakdown dd { margin: 0; text-align: right; }
.receipt-line { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.14); color: #adcbc0; font-size: 10px; }
.receipt-line code { overflow: hidden; color: #eaf7f0; text-overflow: ellipsis; }
.job-create-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
.quote-result .field > span { color: #c5dacf; }
.quote-result .field input, .quote-result .field select, .quote-result .field textarea { border-color: rgba(255,255,255,.14); color: #fff; background: rgba(255,255,255,.08); }
.quote-result .field small { color: #9db9ae; font-size: 9px; }
.job-confirmation-note { margin: 0; padding: 9px 11px; border-radius: 9px; color: #c5dacf; background: rgba(255,255,255,.07); font-size: 10px; line-height: 1.45; }
.price-proposal { border-color: #e6c685; background: #fffaf0; }
.price-proposal > small { color: #76501e; }
.quote-confirmation { display: grid; gap: 10px; margin-top: 13px; padding: 13px; border: 1px solid rgba(215,240,88,.36); border-radius: 11px; background: rgba(255,255,255,.08); }
.quote-confirmation[hidden] { display: none; }
.quote-confirmation > p { margin: 0; color: #c5dacf; font-size: 10px; line-height: 1.45; }
.quote-confirmation .field { margin-top: 9px; }
.confirmation-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.filter-bar { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.production-workday { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(420px, 1.2fr); gap: 14px; align-items: end; margin-bottom: 14px; padding: 14px 16px; border: 1px solid #b9ddca; border-radius: 14px; background: var(--green-soft); }
.production-workday[hidden] { display: none; }
.workday-summary { display: grid; gap: 3px; }
.workday-summary p { margin: 0; }
.workday-summary strong { font-size: 14px; }
.workday-summary small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.workday-form { display: grid; grid-template-columns: minmax(135px, .45fr) minmax(190px, 1fr) auto; gap: 9px; align-items: end; }
.production-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.production-summary button { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.production-summary button:hover, .production-summary button.is-active { border-color: #9bcab4; background: var(--green-soft); }
.production-summary small { color: var(--muted); line-height: 1.25; }
.production-summary strong { font-size: 22px; }
.compact-field { width: min(260px, 100%); }
.compact-field input, .compact-field select { min-height: 39px; padding: 7px 10px; }
.grow { max-width: none; }
.production-layout { display: grid; grid-template-columns: minmax(380px, .82fr) minmax(450px, 1.18fr); gap: 16px; align-items: start; }
.queue-panel { padding: 13px; }
.queue-panel .panel-heading { padding: 6px 7px 12px; margin: 0; }
.job-list { display: grid; gap: 8px; }
.job-card { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.job-card:hover, .job-card.is-active { border-color: #9bcab4; background: #f7fbf8; }
.job-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.job-number { font-size: 12px; font-weight: 900; }
.priority-mark { width: 8px; height: 8px; border-radius: 50%; background: #82908a; }
.priority-high .priority-mark { background: var(--amber); }
.priority-urgent .priority-mark { background: var(--red); box-shadow: 0 0 0 4px rgba(186,61,61,.1); }
.job-card h4 { margin: 0; font-size: 14px; }
.job-card small { display: block; margin-top: 4px; color: var(--muted); }
.job-card .job-client { color: #3d5d4f; }
.job-card .job-overdue { color: var(--red); font-weight: 780; }
.job-status, .approval-state { align-self: start; padding: 5px 8px; border-radius: 999px; color: #3d5d4f; background: var(--green-soft); font-size: 9px; font-weight: 850; white-space: nowrap; text-transform: uppercase; }
.detail-panel { min-height: 430px; }
.detail-loading { padding: 42px 20px; color: var(--muted); text-align: center; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.detail-header h3 { margin: 3px 0; font-size: 22px; }
.detail-header p { margin: 0; color: var(--muted); }
.detail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 16px 0; }
.detail-metrics > div { padding: 11px; border-radius: 11px; background: var(--surface-soft); }
.detail-metrics small, .warehouse-summary small { display: block; color: var(--muted); font-size: 10px; }
.detail-metrics strong { display: block; margin-top: 4px; font-size: 13px; }
.job-readiness { margin: 4px 0 18px; padding: 15px; border: 1px solid; border-radius: 14px; }
.job-readiness-ready { border-color: #b9ddca; background: var(--green-soft); }
.job-readiness-attention { border-color: #eccb9f; background: #fffaf2; }
.job-readiness-head { display: flex; align-items: center; gap: 11px; }
.job-readiness-head h4 { margin: 2px 0; font-size: 16px; }
.job-readiness-head small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.job-readiness-mark { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 11px; color: #fff; background: var(--green); font-weight: 900; }
.job-readiness-attention .job-readiness-mark { background: var(--amber); }
.job-readiness-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.readiness-check { display: grid; grid-template-columns: 21px minmax(0, 1fr); gap: 1px 7px; align-items: center; min-width: 0; padding: 9px 10px; border: 1px solid rgba(91, 114, 102, .15); border-radius: 10px; background: rgba(255,255,255,.72); }
.readiness-check-mark { grid-row: span 2; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; color: #fff; background: var(--green); font-size: 10px; font-weight: 900; }
.readiness-check.needs-attention .readiness-check-mark { background: var(--amber); }
.readiness-check strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.readiness-check small { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.job-readiness-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.job-readiness-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.detail-section { padding: 15px 0; border-top: 1px solid var(--line); }
.detail-section h4 { margin: 0 0 10px; font-size: 13px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.detail-section-head h4 { margin: 0; }
.detail-section-head small { color: var(--muted); font-size: 10px; }
.detail-data { display: grid; grid-template-columns: minmax(130px, .65fr) minmax(0, 1.35fr); gap: 7px 14px; margin: 0; padding: 12px; border-radius: 11px; background: var(--surface-soft); font-size: 11px; }
.detail-data dt { color: var(--muted); }
.detail-data dd { margin: 0; overflow-wrap: anywhere; font-weight: 720; }
.imposition-data { border: 1px solid #c7d9f4; background: var(--blue-soft); }
.material-cards, .equipment-list, .file-list { display: grid; gap: 8px; }
.material-card, .equipment-card, .file-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.material-card { align-items: flex-start; flex-direction: column; gap: 3px; }
.material-card small, .equipment-card small, .file-row small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.material-availability { margin-top: 5px; padding: 4px 7px; border-radius: 999px; color: #3f6252; background: var(--green-soft); font-size: 9px; font-weight: 850; }
.material-shortage, .material-missing, .material-unapproved, .material-no-balance { color: #84551d; background: var(--amber-soft); }
.material-unknown { color: var(--muted); background: var(--surface-soft); }
.equipment-card { display: grid; grid-template-columns: 9px minmax(0, 1fr); }
.equipment-card small { grid-column: 2; }
.equipment-state { grid-row: span 2; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: #8a9690; }
.equipment-online_unverified { background: var(--green); }
.equipment-maintenance { background: var(--amber); }
.equipment-offline { background: var(--red); }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.person-card { display: grid; align-content: start; gap: 5px; min-height: 112px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.person-card > small { color: var(--muted); font-size: 10px; }
.person-card > span { color: var(--muted); font-size: 11px; }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 7px; }
.approval-list { display: grid; gap: 8px; }
.approval-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.approval-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.approval-card > small { color: var(--muted); font-size: 10px; }
.approval-document, .approval-comment { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-soft); font-size: 10px; line-height: 1.45; }
.approval-comment { color: #71491b; background: var(--amber-soft); }
.approval-rejected { color: #8c3d35; background: var(--red-soft); }
.approval-pending { color: #8b5b1d; background: var(--amber-soft); }
.approval-actions { margin-top: 10px; }
.file-version-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; padding: 11px; border: 1px dashed #b8ccc1; border-radius: 11px; background: #fafcfb; }
.file-version-actions small { flex: 1 1 100%; color: var(--muted); font-size: 9px; line-height: 1.45; }
.file-row { justify-content: space-between; }
.file-row > span:first-child { min-width: 0; display: grid; gap: 3px; }
.file-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-placeholder { display: grid; gap: 4px; margin: 0; padding: 12px; border: 1px dashed #ccd5cf; border-radius: 11px; color: var(--muted); background: #fbfcfb; font-size: 11px; line-height: 1.45; }
.detail-warning { margin: 9px 0 0; padding: 9px 11px; border-radius: 9px; color: #76501e; background: var(--amber-soft); font-size: 11px; }
.recipe-list, .event-list { display: grid; gap: 8px; padding: 0; list-style: none; }
.recipe-list li, .event-list li { position: relative; padding: 9px 11px 9px 34px; border-radius: 10px; background: var(--surface-soft); font-size: 12px; line-height: 1.45; }
.recipe-list li::before { content: attr(data-sequence); position: absolute; left: 9px; top: 9px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 6px; color: #fff; background: var(--green); font-size: 9px; font-weight: 900; }
.event-list li::before { content: ""; position: absolute; left: 14px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.transition-form { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 9px; align-items: end; }

.warehouse-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.warehouse-summary article { padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.warehouse-summary strong { display: block; margin-top: 4px; font-size: 25px; letter-spacing: -.035em; }
.warehouse-summary .summary-alert { border-color: #efc7a6; background: #fff8f1; }
.resource-locations { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.resource-location-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.resource-location-card:hover, .resource-location-card.is-active { border-color: #75b696; background: var(--green-soft); }
.resource-location-card strong, .resource-location-card span { display: block; }
.resource-location-card strong { font-size: 12px; }
.resource-location-card span { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.resource-tabs { display: flex; gap: 6px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #f5f7f6; width: fit-content; }
.resource-tabs button { border: 0; border-radius: 9px; padding: 9px 16px; background: transparent; color: var(--muted); font-weight: 780; cursor: pointer; }
.resource-tabs button.is-active { background: #fff; color: var(--green); box-shadow: 0 1px 4px #193d2c18; }
.resource-tabs span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; border-radius: 999px; background: var(--green-soft); font-size: 9px; }
.resource-search { max-width: 540px; margin-bottom: 12px; }
.equipment-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.equipment-summary span { padding: 7px 10px; border-radius: 999px; background: #edf3f0; color: #456256; font-size: 10px; font-weight: 750; }
.equipment-catalog, .equipment-location-group { display: grid; gap: 12px; }
.equipment-location-group { margin-bottom: 22px; }
.equipment-location-head { display: flex; align-items: center; justify-content: space-between; }
.equipment-location-head h3 { margin: 0; font-size: 16px; }
.equipment-resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.equipment-resource-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.equipment-resource-card h4 { margin: 9px 0 4px; font-size: 13px; line-height: 1.3; }
.equipment-resource-card .button { margin-top: auto; }
.equipment-resource-maintenance, .equipment-resource-offline { background: #faf8f6; }
.equipment-resource-head { display: flex; align-items: center; gap: 7px; }
.equipment-status-copy, .equipment-model, .equipment-validation { color: var(--muted); font-size: 9px; line-height: 1.4; }
.equipment-model { margin: 0 0 10px; }
.equipment-validation { display: block; margin: 9px 0 12px; }
.capability-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.capability-chips span { padding: 4px 6px; border-radius: 6px; background: #eef4f1; color: #3f5b4f; font-size: 8px; font-weight: 740; }
.equipment-assigned-card { display: grid; gap: 5px; padding: 12px; border: 1px solid #76b697; border-radius: 11px; background: var(--green-soft); }
.assignment-label { color: var(--green); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.equipment-card .button { grid-column: 2; justify-self: start; }
.job-equipment { color: var(--green) !important; font-weight: 740; }
.stock-unapproved-note { max-width: 300px; color: #9b4a18 !important; font-weight: 720; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.movement-history-list { display: grid; gap: 9px; max-height: 58vh; overflow-y: auto; }
.movement-history-card { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.movement-history-card p { margin: 3px 0; }
.movement-history-card > span, .movement-history-card small, .movement-history-card time { color: var(--muted); font-size: 10px; }
.movement-history-head { display: flex; justify-content: space-between; gap: 10px; }
.table-panel { padding: 0; overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #fafbfa; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: 12px; }
tbody tr:hover { background: #fbfcfb; }
.stock-name strong, .stock-name small { display: block; }
.stock-name small { margin-top: 3px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.quantity-available { color: var(--green-dark); font-weight: 850; }
.approval-pending { color: #8b5b1d; background: var(--amber-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-action { min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--green-dark); background: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }
.row-action-primary { color: #fff; border-color: var(--green); background: var(--green); }

.empty-state { padding: 46px 20px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 14px; color: var(--green); background: var(--green-soft); font-size: 20px; font-weight: 900; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); }
.empty-state p { max-width: 400px; margin: auto; line-height: 1.5; }

.modal { width: min(580px, calc(100% - 26px)); max-height: calc(100vh - 26px); padding: 0; overflow: auto; border: 0; border-radius: 20px; background: transparent; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(13, 31, 24, .54); backdrop-filter: blur(4px); }
.modal-card { margin: 0; padding: 25px; border: 0; border-radius: 20px; background: #fff; text-align: center; }
.modal-card-wide { text-align: left; }
.modal-card h2 { margin: 7px 0; font-size: 23px; }
.modal-card > p { margin: 0; color: var(--muted); line-height: 1.5; }
.modal-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: auto; border-radius: 50%; color: #fff; background: var(--green); font-weight: 900; }
.confirm-details { display: grid; grid-template-columns: 1fr auto; gap: 8px 15px; margin: 17px 0 0; padding: 14px; border-radius: 12px; background: var(--surface-soft); text-align: left; font-size: 12px; }
.confirm-details dt { color: var(--muted); }
.confirm-details dd { margin: 0; font-weight: 750; text-align: right; }
.modal-head { margin-bottom: 18px; }
.modal-head h2 { margin: 3px 0 0; }
.modal-head small { color: var(--muted); }
.version-warning { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding: 11px 13px; border-radius: 11px; color: #76501e; background: var(--amber-soft); font-size: 11px; }
.free-position-preview { margin-top: 16px; padding: 14px; border: 1px solid #bddfce; border-radius: 12px; color: var(--green-dark); background: var(--green-soft); line-height: 1.5; }
.future-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.future-actions small { grid-column: 1 / -1; color: var(--muted); line-height: 1.45; }

.receipt-tray { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: min(390px, calc(100% - 28px)); padding: 17px; border: 1px solid #b9d8c8; border-radius: 16px; background: #f7fff9; box-shadow: 0 18px 55px rgba(23,57,45,.2); }
.receipt-tray-head { display: flex; justify-content: space-between; align-items: center; }
.receipt-tray p { margin: 5px 0 12px; color: var(--muted); font-size: 12px; }
.receipt-tray dl { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin: 0 0 10px; font-size: 11px; }
.receipt-tray dt { color: var(--muted); }
.receipt-tray dd { margin: 0; max-width: 230px; overflow: hidden; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; text-overflow: ellipsis; }
.receipt-tray > small { color: var(--green-dark); font-size: 10px; }
.toast-region { position: fixed; top: 100px; right: 20px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100% - 28px)); pointer-events: none; }
.toast { padding: 13px 15px; border: 1px solid #e8c5c2; border-radius: 12px; color: #7f2b2b; background: var(--red-soft); box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; animation: toast-in .18s ease both; }
.toast.info { color: var(--blue); border-color: #c7d9f4; background: var(--blue-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Unified CopyFoto OS shell. Mirrors the approved role-workspace reference. */
:root { --red: #ef1722; --ink: #17191a; --muted: #71736f; --line: #dfdfd9; --surface-soft: #f4f3ef; --sidebar: 84px; --shadow: 0 14px 44px rgba(26,28,27,.07); }
html, body { background: #f4f3ef; }
.app-shell { display: block; width: 100%; min-width: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); height: 100vh; align-items: center; gap: 0; padding: 18px 9px; overflow: hidden; color: #fff; background: #17191a; box-shadow: none; }
.app-body { width: calc(100% - var(--sidebar)); min-width: 0; margin-left: var(--sidebar); }
.brand { justify-content: center; width: 48px; height: 48px; padding: 0; text-decoration: none; }
.brand-mark { width: 48px; height: 48px; border-radius: 15px; color: #fff; background: var(--red); font-size: 15px; box-shadow: none; }
.workspace-nav { width: 100%; display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; margin-top: 28px; overflow-y: auto; scrollbar-width: none; }
.workspace-nav::-webkit-scrollbar { display: none; }
.nav-item { position: relative; width: 100%; min-height: 45px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; padding: 5px 3px; border-radius: 12px; color: #999; text-align: center; }
.nav-item:hover, .nav-item.is-active { color: #fff; background: #2a2d2e; }
.nav-item.is-active::before { left: -9px; top: 9px; width: 3px; height: 27px; border-radius: 0; background: var(--red); }
.nav-icon { color: inherit; font-size: 19px; line-height: 1; }
.nav-item small { display: block; color: inherit; font-size: 8px; line-height: 1.1; }
.nav-count { position: absolute; right: 5px; top: 2px; min-width: 16px; padding: 2px 4px; color: #fff; background: var(--red); font-size: 8px; }
.sidebar-spacer { display: none; }
.rail-action { flex: 0 0 auto; margin-top: 5px; }
.sidebar-user { flex: 0 0 auto; justify-content: center; width: 100%; margin-top: 8px; padding: 9px 0 0; border-top-color: #303233; }
.avatar { flex-basis: 39px; width: 39px; height: 39px; color: #17191a; background: #f3d477; }
.topbar { min-height: 66px; height: 66px; padding: 0 28px; border-color: var(--line); }
.topbar > div:first-of-type { display: flex; align-items: center; gap: 13px; }
.topbar h1 { margin: 0; font-size: 15px; letter-spacing: 0; }
.demo-badge { padding: 5px 8px; border-radius: 7px; color: #725600; background: #fff0c8; font-size: 9px; font-weight: 900; letter-spacing: .09em; }
main { width: 100%; max-width: none; min-width: 0; padding: 26px; }
#workspace-root, .workspace, .catalog-shell, .panel { min-width: 0; }
#workspace-root, .workspace:not([hidden]) { display: block; width: 100%; max-width: none; }
.catalog-shell, .production-layout, .resource-grid, .filter-bar { width: 100%; max-width: none; }
.workspace-heading { align-items: flex-end; margin: 4px 0 22px; }
.workspace-heading h2 { margin: 7px 0 7px; font-size: 32px; letter-spacing: -.045em; }
.workspace-heading p:last-child { font-size: 13px; }
.eyebrow { color: var(--red); font-size: 9px; font-weight: 900; }
.button-primary { background: var(--red); box-shadow: none; }
.button-primary:hover:not(:disabled) { background: #cf111b; }
.filter-chip.is-active { color: #b71920; border-color: #ffbbb8; background: #ffe7e5; }
.catalog-shell, .panel { border-color: var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.catalog-shell { padding: 20px; }
.catalog-summary { gap: 8px; margin-bottom: 14px; }
.catalog-summary article { min-height: 58px; padding: 9px 12px; border-radius: 12px; }
.catalog-summary strong { font-size: 19px; }
.catalog-toolbar { padding-bottom: 15px; }
.catalog-section { padding-top: 18px; }
.product-grid { grid-template-columns: repeat(auto-fit,minmax(min(205px,100%),1fr)); gap: 9px; margin-top: 12px; }
.product-group-block { width: 100%; padding: 18px 0 6px; border-top: 1px solid var(--line); }
.product-group-block:first-child { padding-top: 4px; border-top: 0; }
.product-group-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.product-group-heading h4 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.02em; }
.product-group-heading small { color: var(--muted); }
.product-group-count { min-width: 32px; padding: 6px 9px; border-radius: 999px; color: #93151b; background: #ffe8e7; font-size: 12px; font-weight: 900; text-align: center; }
.stock-live-note { color: #177b52; font-weight: 800; }
.product-card { min-height: 155px; padding: 14px; border-radius: 13px; }
.product-card:hover { border-color: #ffb6b9; box-shadow: 0 10px 24px rgba(126,28,33,.08); }
.formula-builder-intro > span, .step-number, .modal-icon { background: var(--red); }
.formula-preview { border-color: #ffc9c9; background: #fff7f5; }
.formula-preview-head > span { background: var(--red); }
.formula-expression { color: #8f2228; }

@media (max-width: 1080px) {
  :root { --sidebar: 82px; }
  .brand > span:last-child, .nav-item > span:nth-child(2), .legacy-link > span:last-child, .sidebar-user > span:last-child { display: none; }
  .brand, .legacy-link, .sidebar-user { justify-content: center; }
  .brand { padding: 0; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 8px; }
  .nav-count { position: absolute; right: 6px; top: 5px; }
  .workbench-grid { grid-template-columns: 1fr; }
  .calculation-panel { position: static; }
  .production-layout { grid-template-columns: 1fr; }
  .production-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .production-workday { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .mobile-only { display: inline-grid !important; }
  .app-shell { display: block; }
  .app-body { width: 100%; margin-left: 0; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: min(286px, calc(100vw - 42px)); height: 100dvh; transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.is-open { transform: none; }
  .brand > span:last-child, .nav-item > span:nth-child(2), .legacy-link > span:last-child, .sidebar-user > span:last-child { display: block; }
  .brand, .legacy-link, .sidebar-user { justify-content: flex-start; }
  .nav-item { grid-template-columns: 27px 1fr auto; justify-items: stretch; }
  .nav-count { position: static; }
  .topbar { min-height: 72px; padding: 12px 14px; }
  .topbar h1 { font-size: 18px; }
  .topbar .eyebrow, #refresh-current { display: none; }
  .status-pill { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  main { padding: 18px 13px 90px; }
  .workspace-heading { align-items: stretch; flex-direction: column; }
  .workspace-heading h2 { font-size: 30px; }
  .workspace-heading .button { width: 100%; }
  .workspace-heading-actions { width: 100%; }
  .catalog-shell, .panel { padding: 16px; border-radius: 15px; }
  .catalog-toolbar { align-items: stretch; }
  .catalog-summary { grid-template-columns: 1fr; }
  .standard-calculator-note { grid-template-columns: 34px minmax(0, 1fr); align-items: start; }
  .standard-calculator-note > span { width: 34px; height: 34px; }
  .standard-calculator-note > .button { grid-column: 1 / -1; width: 100%; }
  .search-field { flex-basis: 100%; max-width: none; }
  .filter-chip { flex: 1 1 auto; }
  .section-title-row { align-items: flex-start; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { min-height: 184px; padding: 13px; }
  .two-columns, .three-columns, .check-grid, .job-create-form, .transition-form, .workday-form { grid-template-columns: 1fr; }
  .future-actions { grid-template-columns: 1fr; }
  .tier-row { grid-template-columns: 1fr 1fr 40px; }
  .recipe-edit-row, .recipe-edit-row.material-row, .formula-parameter-row { grid-template-columns: 1fr; }
  .formula-parameter-row .formula-choice-lines { grid-column: auto; }
  .recipe-edit-row .icon-button { width: 100%; }
  .production-layout { display: block; }
  .production-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-grid { grid-template-columns: 1fr; }
  .job-readiness-grid { grid-template-columns: 1fr; }
  .job-readiness-actions .button { flex: 1 1 100%; }
  .file-row { align-items: stretch; flex-direction: column; }
  .file-row .inline-actions .button { flex: 1; }
  .detail-panel { margin-top: 14px; min-height: 260px; }
  .warehouse-summary { gap: 7px; }
  .warehouse-summary article { padding: 12px; }
  .warehouse-summary strong { font-size: 20px; }
  .responsive-table table { min-width: 780px; }
  .modal-card { padding: 20px 16px; }
  .receipt-tray { left: 14px; right: 14px; bottom: 14px; width: auto; }
}

@media (max-width: 430px) {
  .product-grid { grid-template-columns: 1fr; }
  .catalog-shell { padding: 13px; }
  .topbar-actions .status-pill { max-width: 126px; padding-inline: 9px; font-size: 10px; }
  .workspace-heading h2 { font-size: 27px; }
  .tier-row { grid-template-columns: 1fr 1fr 38px; }
  .field > span { font-size: 11px; }
  .warehouse-summary { grid-template-columns: 1fr; }
  .production-summary { grid-template-columns: 1fr 1fr; }
  .product-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
