:root {
  --green-950: #102f2a;
  --green-900: #173d36;
  --green-800: #1e5047;
  --green-700: #2e6b5e;
  --green-100: #e5efeb;
  --paper: #f3f1ea;
  --surface: #fffefa;
  --ink: #1f2926;
  --muted: #6f7b77;
  --line: #dfded7;
  --amber: #d99a45;
  --amber-soft: #fcf1df;
  --red: #a64b43;
  --red-soft: #fae9e6;
  --blue-soft: #e8eff2;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(11, 40, 33, .18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); font: 13px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 252px; flex-direction: column; color: #edf4f1; background: var(--green-950); padding: 23px 17px 18px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 6px 18px; }
.brand-mark { display: flex; width: 31px; height: 31px; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 10px; background: #f5e8d1; padding: 8px; transform: rotate(-4deg); }
.brand-mark span { width: 4px; border-radius: 4px; background: var(--green-900); }
.brand-mark span:nth-child(1) { height: 9px; }.brand-mark span:nth-child(2) { height: 15px; }.brand-mark span:nth-child(3) { height: 12px; }
.brand-name { font-family: Georgia, serif; font-size: 17px; letter-spacing: -.02em; }
.brand-subtitle { color: #8fa7a0; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.prototype-badge { margin-left: auto; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; color: #e8bf85; background: rgba(255,255,255,.05); padding: 3px 7px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.nav { display: flex; flex: 1; flex-direction: column; gap: 3px; overflow-y: auto; padding-top: 6px; }
.nav-label { margin: 17px 10px 5px; color: #6f8b83; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-item { display: flex; width: 100%; align-items: center; gap: 11px; border: 0; border-radius: 10px; color: #a9bdb7; background: transparent; padding: 10px 11px; font-size: 11px; font-weight: 650; text-align: left; cursor: pointer; transition: .16s; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 var(--amber); }
.nav-icon { width: 18px; color: #86a199; font-size: 16px; text-align: center; }
.nav-item.active .nav-icon { color: #e6bb7c; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 13px; }
.reset-button { width: 100%; border: 0; color: #78928b; background: transparent; margin-bottom: 8px; padding: 5px; font-size: 9px; cursor: pointer; }
.reset-button:hover { color: #d9e4e0; }
.user-card { display: flex; align-items: center; gap: 9px; border-radius: 12px; background: rgba(255,255,255,.055); padding: 9px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--green-950); background: #c8d8d2; font-size: 10px; font-weight: 850; }
.user-card-copy { min-width: 0; }.user-card strong, .user-card span { display: block; }.user-card strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }.user-card-copy span { color: #8fa7a0; font-size: 9px; }
.online-dot { width: 7px; height: 7px; flex: 0 0 auto; margin-left: auto; border-radius: 50%; background: #79bd8c; box-shadow: 0 0 0 3px rgba(121,189,140,.12); }

.main-shell { min-height: 100vh; margin-left: 252px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 29px 38px 9px; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: .055em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 2.6vw, 34px); font-weight: 500; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.role-switcher { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 5px 7px 5px 11px; box-shadow: 0 1px 0 rgba(255,255,255,.7); }
.role-switcher span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.role-switcher select { max-width: 290px; border: 0; outline: 0; background: #f3f1eb; border-radius: 7px; padding: 7px 9px; font-size: 11px; font-weight: 680; }
.role-pill { border-radius: 99px; color: var(--green-700); background: var(--green-100); padding: 7px 10px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.page-content { padding: 24px 38px 48px; }

.role-notice { display: flex; align-items: center; gap: 12px; border: 1px solid #cddbd6; border-radius: 13px; color: #315c52; background: #f5faf7; margin-bottom: 17px; padding: 11px 14px; }
.role-notice-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--green-100); font-weight: 800; }
.role-notice strong { display: block; font-size: 11px; }.role-notice p { margin: 1px 0 0; color: #698078; font-size: 10px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; letter-spacing: -.025em; }
.section-head p { margin: 5px 0 0; color: var(--muted); }
.section-subhead { margin: 27px 0 11px; }.section-subhead h3 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }.section-subhead p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 10px; color: #fff; background: var(--green-900); padding: 9px 15px; font-weight: 750; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover:not(:disabled) { background: var(--green-700); transform: translateY(-1px); }.button:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }.button.secondary:hover:not(:disabled) { background: #f9f8f3; }
.button.ghost { border: 1px solid transparent; color: var(--muted); background: transparent; }.button.ghost:hover:not(:disabled) { color: var(--ink); background: #f2f1eb; }
.button.small { min-height: 31px; padding: 6px 10px; font-size: 10px; }.plus { font-size: 17px; font-weight: 400; line-height: .8; }
.text-button { border: 0; color: var(--green-700); background: transparent; padding: 0; font-size: 10px; font-weight: 800; cursor: pointer; }.danger-text { color: var(--red); }
.muted { color: var(--muted); font-size: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 125px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; }
.metric-card.hero { color: #fff; border-color: transparent; background: var(--green-900); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 780; letter-spacing: .03em; text-transform: uppercase; }.hero .metric-label { color: #b7cbc6; }
.metric-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: var(--green-700); background: var(--green-100); font-size: 15px; }.hero .metric-icon { color: #f0c78e; background: rgba(255,255,255,.11); }
.metric-value { margin-top: 13px; font-family: Georgia, serif; font-size: 30px; line-height: 1; letter-spacing: -.035em; }.metric-value small { margin-left: 3px; font-size: 14px; }.metric-meta { margin-top: 9px; color: var(--muted); font-size: 10px; }.hero .metric-meta { color: #a8beb8; }
.hero-ring { position: absolute; right: -42px; bottom: -64px; width: 148px; height: 148px; border: 22px solid rgba(255,255,255,.055); border-radius: 50%; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .8fr); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(255,255,255,.8); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 20px 14px; }.card-header h3 { margin: 0; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }.card-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.activity-card { grid-column: 1/-1; }.task-list { padding: 0 18px 17px; }.task-row { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 10px; border-top: 1px solid #eceae4; padding: 12px 2px; }.task-row:first-child { border-top: 0; }.task-check { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: var(--green-700); background: var(--green-100); }.task-row strong,.task-row span { display: block; }.task-row strong { font-size: 11px; }.task-row span { color: var(--muted); font-size: 9px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 4px 20px 20px; }.quick-action { display: flex; min-height: 102px; flex-direction: column; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfaf6; padding: 12px; text-align: left; cursor: pointer; transition: .16s; }.quick-action:hover { border-color: #aabfb8; background: #fff; transform: translateY(-1px); }.quick-action > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; color: var(--green-700); background: var(--green-100); font-size: 15px; }.quick-action strong { font-size: 10px; }.quick-action small { color: var(--muted); font-size: 8px; }
.empty-compact { color: var(--muted); padding: 24px; font-size: 10px; text-align: center; }

.table-card { overflow: auto; }.data-table { width: 100%; border-collapse: collapse; }.data-table th { color: #77827f; background: #faf9f5; padding: 10px 14px; font-size: 8px; font-weight: 850; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }.data-table td { border-top: 1px solid #eceae4; padding: 12px 14px; vertical-align: middle; }.data-table tbody tr:hover { background: #fbfaf6; }.data-table .number { font-variant-numeric: tabular-nums; text-align: right; }.data-table .action-cell { text-align: right; white-space: nowrap; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; }.doc-link { border: 0; color: var(--green-700); background: transparent; padding: 0; font-weight: 850; cursor: pointer; }.type-chip { display: inline-block; border-radius: 7px; color: #53605d; background: #efeee9; padding: 4px 7px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; color: var(--green-700); background: var(--green-100); padding: 4px 8px; font-size: 8px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }.status:before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }.status.draft { color: #6d7280; background: #eeeef1; }.status.planned { color: #6d7280; background: #eeeef1; }.status.materials-prepared,.status.partially-received { color: #976427; background: var(--amber-soft); }.status.issued-to-production { color: #355f87; background: #eaf3fb; }.status.voided { color: var(--red); background: var(--red-soft); }
.status.posted-with-warning { color: #976427; background: var(--amber-soft); }
.button.danger { color: #fff; background: var(--red); }
.sku-cell { display: flex; min-width: 210px; align-items: center; gap: 9px; }.sku-glyph { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: var(--green-700); background: var(--green-100); font-family: Georgia, serif; font-weight: 700; }.sku-cell strong,.sku-cell span { display: block; }.sku-cell strong { font-size: 10px; }.sku-cell span { color: var(--muted); font-size: 8px; }.negative-number { color: var(--red); font-weight: 800; }.empty-state { padding: 45px 20px; color: var(--muted); text-align: center; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 12px 15px; }.search { flex: 1; max-width: 370px; }.search input { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fbfaf7; padding: 9px 11px; }.search input:focus { border-color: #92aaa3; box-shadow: 0 0 0 3px rgba(45,98,88,.09); }.location-toggle { display: flex; gap: 3px; border-radius: 9px; background: #efeee8; padding: 3px; }.location-toggle button { border: 0; border-radius: 7px; color: var(--muted); background: transparent; padding: 5px 9px; font-size: 9px; font-weight: 750; cursor: pointer; }.location-toggle button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 6px rgba(20,40,35,.08); }.location-hidden { display: none; }
.inventory-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 17px; }.inventory-summary-four { grid-template-columns: repeat(4,1fr); }.location-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 17px 19px; }.location-card:after { position: absolute; right: -18px; bottom: -30px; width: 95px; height: 95px; border: 16px solid var(--green-100); border-radius: 50%; content: ""; }.location-card span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }.location-card strong { display: block; margin-top: 3px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }.location-card small { color: var(--muted); font-size: 9px; }.stock-state { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 750; }.stock-state:before { width: 6px; height: 6px; border-radius: 50%; background: #4b946b; content: ""; }.stock-state.negative { color: var(--red); }.stock-state.negative:before,.stock-state.zero:before { background: var(--red); }
.policy-strip,.audit-banner { display: flex; align-items: center; gap: 15px; border: 1px solid #ead7b9; border-radius: 12px; color: #79562e; background: var(--amber-soft); margin-bottom: 16px; padding: 11px 14px; }.policy-strip strong,.audit-banner strong { flex: 0 0 auto; font-size: 10px; text-transform: uppercase; }.policy-strip span,.audit-banner span { font-size: 10px; }.audit-banner { border-color: #cbdcd6; color: #315c52; background: #f2f8f5; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 17px; }.feature-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 14px; }.feature-card > span { display: block; color: var(--amber); font-family: Georgia, serif; font-size: 17px; }.feature-card strong { display: block; margin: 3px 0; font-size: 11px; }.feature-card p { margin: 0; color: var(--muted); font-size: 9px; }
.upload-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; margin-bottom: 18px; }.upload-card { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 17px; }.upload-card.locked { opacity: .68; }.upload-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--green-700); background: var(--green-100); font-size: 17px; }.upload-card h3 { margin: 0; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }.upload-card p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }.file-button { grid-row: span 2; }.file-status { grid-column: 2/3; color: var(--muted); font-size: 8px; }.validate-button { grid-column: 3; grid-row: 2; }.permission-note { border-radius: 8px; color: var(--muted); background: #f1f0eb; padding: 6px 8px; font-size: 8px; }.valid-mark { color: #3c8a64; font-weight: 900; }

.drawer-backdrop,.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(12,29,26,.48); backdrop-filter: blur(2px); }.drawer { position: fixed; inset: 0 0 0 auto; z-index: 60; width: min(720px, 100vw); overflow: auto; background: var(--surface); box-shadow: -20px 0 70px rgba(8,28,23,.18); transform: translateX(102%); transition: transform .25s ease; }.drawer.open { transform: translateX(0); }.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,254,250,.96); padding: 22px 25px 16px; backdrop-filter: blur(8px); }.drawer-head h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }.drawer-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }.close-button { display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 18px; cursor: pointer; }.transaction-form { padding: 21px 25px 100px; }.form-section { margin-bottom: 23px; }.form-section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 11px; font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }.form-section-title small { color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: 0; text-transform: none; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }.field { display: flex; flex-direction: column; gap: 5px; }.field.full { grid-column: 1/-1; }.field > span,.field label { color: #5e6966; font-size: 9px; font-weight: 750; }.field input,.field select,.field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fbfaf7; padding: 10px 11px; }.field textarea { min-height: 66px; resize: vertical; }.field input:focus,.field select:focus,.field textarea:focus { border-color: #8ca69e; box-shadow: 0 0 0 3px rgba(45,98,88,.08); background: #fff; }.line-list { display: flex; flex-direction: column; gap: 8px; }.form-line { display: grid; grid-template-columns: minmax(180px,1.5fr) minmax(100px,.7fr) 92px 30px; align-items: end; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fbfaf7; padding: 9px; }.form-line.simple { grid-template-columns: minmax(210px,1.5fr) 110px 30px; }.form-line label { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }.form-line input,.form-line select { width: 100%; min-width: 0; border: 1px solid #dedcd4; border-radius: 8px; background: #fff; margin-top: 4px; padding: 8px; }.remove-line { display: grid; width: 29px; height: 35px; place-items: center; border: 0; color: #a07069; background: transparent; cursor: pointer; }.add-line { width: 100%; margin-top: 9px; border: 1px dashed #b9c8c3; border-radius: 10px; color: var(--green-700); background: #f4f8f6; padding: 9px; font-size: 10px; font-weight: 750; cursor: pointer; }.form-total { display: flex; align-items: center; justify-content: space-between; border-radius: 11px; color: var(--green-900); background: var(--green-100); margin-top: 11px; padding: 10px 13px; }.form-total span { font-size: 9px; font-weight: 750; text-transform: uppercase; }.form-total strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; }.form-footer { position: fixed; right: 0; bottom: 0; z-index: 3; display: flex; width: min(720px,100vw); justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); background: rgba(255,254,250,.96); padding: 14px 25px; backdrop-filter: blur(8px); }.helper-note { border-left: 3px solid var(--amber); border-radius: 0 9px 9px 0; color: #74562f; background: var(--amber-soft); padding: 10px 12px; font-size: 9px; }
.template-empty { border: 1px dashed #bfcac6; border-radius: 11px; color: var(--muted); background: #f8faf8; padding: 24px; font-size: 10px; text-align: center; }.template-lines { display: flex; max-height: 390px; flex-direction: column; gap: 5px; overflow: auto; padding-right: 4px; }.template-row { display: grid; grid-template-columns: 24px 1fr 95px 22px; align-items: center; gap: 8px; border: 1px solid #e2e1db; border-radius: 9px; background: #fbfaf7; padding: 7px; }.template-row .line-number { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 6px; color: var(--muted); background: #ecebe6; font-size: 8px; }.template-row strong,.template-row small { display: block; }.template-row strong { font-size: 9px; }.template-row small { color: var(--muted); font-size: 8px; }.template-row input { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 7px; text-align: right; }.template-row em { color: var(--muted); font-size: 8px; font-style: normal; }.continue-card { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #cbdcd6; border-radius: 11px; background: #f2f8f5; margin-bottom: 15px; padding: 12px; cursor: pointer; }.continue-card input { margin-top: 2px; accent-color: var(--green-700); }.continue-card strong,.continue-card small { display: block; }.continue-card strong { color: var(--green-900); font-size: 10px; }.continue-card small { color: var(--muted); margin-top: 2px; font-size: 8px; }.source-note { border-radius: 9px; color: var(--green-700); background: var(--green-100); margin-top: 12px; padding: 9px 11px; font-size: 9px; }.variance-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; border: 1px solid #cbdcd6; border-radius: 11px; color: var(--green-900); background: #f2f8f5; margin-top: 9px; padding: 11px 13px; }.variance-card span { font-size: 9px; font-weight: 800; text-transform: uppercase; }.variance-card strong { font-family: Georgia,serif; font-size: 18px; font-weight: 500; }.variance-card small { grid-column: 1/-1; color: var(--muted); font-size: 8px; }.variance-card.warning { border-color: #ead7b9; color: #8a5d25; background: var(--amber-soft); }.immediate-section { border-top: 1px solid var(--line); padding-top: 19px; }.inline-help { color: var(--muted); font-size: 9px; }.immediate-grid { display: flex; max-height: 390px; flex-direction: column; gap: 6px; overflow: auto; }.immediate-row { display: grid; grid-template-columns: 1fr 25px 1fr; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; padding: 8px; }.immediate-row > span { color: var(--green-700); text-align: center; }.immediate-row > div { display: grid; grid-template-columns: 1fr 90px; align-items: center; gap: 6px; }.immediate-row small { grid-column: 1/-1; color: var(--muted); font-size: 7px; text-transform: uppercase; }.immediate-row strong { font-size: 8px; }.immediate-row input { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 6px; }.linked-order { border-radius: 12px; color: #fff; background: var(--green-900); margin-bottom: 21px; padding: 14px; }.linked-order span,.linked-order small { display: block; color: #a7bdb7; font-size: 8px; text-transform: uppercase; }.linked-order strong { display: block; margin: 2px 0; font-family: Georgia,serif; font-size: 21px; }.expected-strip { display: flex; align-items: center; justify-content: space-between; border-radius: 9px; color: var(--muted); background: #f1f0eb; margin-bottom: 9px; padding: 8px 10px; font-size: 9px; }.expected-strip strong { color: var(--ink); }.issued-summary { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }.issued-summary div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 11px; font-size: 9px; }.issued-summary div:last-child { border-bottom: 0; }.issued-summary span { color: var(--muted); }.issued-summary strong { white-space: nowrap; }

.modal-backdrop { display: grid; place-items: center; padding: 20px; }.modal-card { width: min(800px,100%); max-height: 92vh; overflow: auto; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }.compact-modal { width: min(620px,100%); }.modal-toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,254,250,.96); padding: 12px 17px; backdrop-filter: blur(8px); }.modal-actions { display: flex; gap: 8px; }.document-sheet { margin: 23px; border: 1px solid #d9d7cf; background: #fff; padding: 31px 34px; }.document-brand { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 2px solid var(--green-900); padding-bottom: 17px; }.document-brand h2 { margin: 0; color: var(--green-900); font-family: Georgia, serif; font-size: 24px; }.document-brand p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }.document-title { text-align: right; }.document-title strong { display: block; font-size: 14px; letter-spacing: .07em; }.document-title span { color: var(--muted); font-size: 10px; }.document-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 27px; margin: 21px 0; }.document-meta div { display: flex; justify-content: space-between; border-bottom: 1px solid #eceae4; padding: 7px 0; }.document-meta span { color: var(--muted); font-size: 9px; }.document-meta strong { font-size: 10px; }.document-lines { width: 100%; border-collapse: collapse; }.document-lines th { border-bottom: 1px solid #333; padding: 7px 5px; font-size: 8px; text-align: left; text-transform: uppercase; }.document-lines td { border-bottom: 1px solid #e5e3dc; padding: 8px 5px; font-size: 9px; }.document-lines .number { text-align: right; }.document-total { display: flex; justify-content: flex-end; gap: 28px; padding: 14px 5px; font-size: 12px; }.signature-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 25px; margin-top: 55px; }.signature { border-top: 1px solid #777; padding-top: 6px; color: var(--muted); font-size: 8px; text-align: center; }
.detail-panel { padding: 28px; }.detail-kicker { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }.detail-panel h2 { margin: 3px 0 8px; font-family: Georgia,serif; font-size: 28px; font-weight: 500; }.detail-panel dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 22px 0; }.detail-panel dl div { border-bottom: 1px solid var(--line); padding: 7px 0; }.detail-panel dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }.detail-panel dd { margin: 2px 0 0; font-size: 10px; font-weight: 700; }.detail-panel h3 { margin: 22px 0 7px; font-family: Georgia,serif; font-weight: 500; }.detail-line { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 9px 0; font-size: 10px; }.note-box { border-radius: 9px; color: var(--muted); background: #f3f2ed; margin-top: 15px; padding: 11px; font-size: 9px; }
.password-form { max-width: 560px; margin: 0 auto; }.password-form > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }.password-rule { margin-top: 12px; border-radius: 9px; color: var(--muted); background: #f3f2ed; padding: 10px 12px; font-size: 10px; }.password-actions { justify-content: flex-end; margin-top: 18px; }.password-form .auth-message { margin-top: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: 360px; border-radius: 11px; color: #fff; background: var(--green-950); box-shadow: 0 12px 36px rgba(12,35,29,.24); padding: 12px 16px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }.toast.show { opacity: 1; transform: translateY(0); }.toast.error { background: var(--red); }

@media (max-width: 1120px) { .metric-grid { grid-template-columns: repeat(2,1fr); }.dashboard-grid { grid-template-columns: 1fr; }.activity-card { grid-column: auto; }.upload-grid { grid-template-columns: 1fr; }.inventory-summary-four { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 820px) {
  .sidebar { inset: auto 0 0; width: 100%; height: 70px; flex-direction: row; overflow-x: auto; padding: 8px 9px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1); }.brand,.sidebar-footer,.nav-label { display: none !important; }.nav { flex-direction: row; gap: 3px; overflow: visible; padding: 0; }.nav-item { min-width: 72px; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 7px; font-size: 8px; white-space: nowrap; }.nav-item.active { box-shadow: inset 0 3px var(--amber); }.nav-icon { font-size: 14px; }.main-shell { margin-left: 0; padding-bottom: 76px; }.topbar { align-items: flex-start; padding: 18px 15px 7px; }.topbar h1 { font-size: 23px; }.topbar-actions { flex-direction: column; align-items: flex-end; }.role-switcher span,.role-pill { display: none; }.role-switcher { padding: 4px; }.role-switcher select { max-width: 190px; font-size: 9px; }.page-content { padding: 15px 14px 30px; }.feature-grid,.inventory-summary { grid-template-columns: 1fr; }.table-card { overflow-x: auto; }.data-table { min-width: 720px; }.form-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }.form-line,.form-line.simple { grid-template-columns: 1fr 92px 30px; }.form-line .carcass-field { display: none; }.immediate-row { grid-template-columns: 1fr; }.immediate-row > span { transform: rotate(90deg); }.drawer-head { padding: 18px 16px 13px; }.transaction-form { padding: 17px 16px 95px; }.form-footer { padding: 12px 16px; }.document-sheet { margin: 10px; padding: 20px 16px; }.document-meta { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }.metric-card { min-height: 112px; padding: 14px; }.metric-value { font-size: 24px; }.quick-actions { grid-template-columns: 1fr 1fr; padding: 3px 14px 14px; }.task-row { grid-template-columns: 23px 1fr; }.task-row .button { grid-column: 2; justify-self: start; }.upload-card { grid-template-columns: 38px 1fr; }.upload-card .file-button,.upload-card .validate-button { grid-column: 1/-1; grid-row: auto; }.file-status { grid-column: 1/-1; } }
/* Transaction drawers keep actions at the true end of the form so they never cover fields. */
.transaction-form { padding: 21px 25px 25px; }
.form-footer { position: static; right: auto; bottom: auto; z-index: auto; width: auto; flex-wrap: wrap; background: #faf9f4; margin: 28px -25px -25px; padding: 14px 25px; backdrop-filter: none; }
.template-lines { max-height: none; overflow: visible; padding-right: 0; }
.optional-output-block { border-top: 1px dashed var(--line); margin-top: 13px; padding-top: 4px; }
.check-field { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fbfaf7; padding: 10px 11px; }
.check-field.full { grid-column: 1/-1; }
.check-field input { width: auto; margin: 0; accent-color: var(--green-700); }
.check-field span { color: #5e6966; font-size: 9px; font-weight: 750; }
.master-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.master-tab { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); padding: 7px 11px; font-size: 9px; font-weight: 780; cursor: pointer; }
.master-tab.active { border-color: var(--green-700); color: #fff; background: var(--green-700); }
.master-count { display: inline-block; min-width: 19px; border-radius: 999px; background: rgba(0,0,0,.07); margin-left: 4px; padding: 1px 5px; text-align: center; }
.master-tab.active .master-count { background: rgba(255,255,255,.18); }
.master-actions { display: flex; justify-content: flex-end; gap: 9px; }
@media (max-width: 820px) {
  .transaction-form { padding: 17px 16px 20px; }
  .form-footer { margin: 24px -16px -20px; padding: 12px 16px; }
  .form-line { grid-template-columns: 1fr 92px 30px; }
  .form-line:not(.simple) > label:first-child { grid-column: 1/3; }
  .form-line .carcass-field:not([hidden]) { display: block; }
  .check-field.full { grid-column: auto; }
}
.section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.metric-button { width: 100%; color: inherit; text-align: left; cursor: pointer; }.metric-button.warning { border-color: #e2b8ae; background: #fff8f6; }.metric-button.warning .metric-value { color: var(--red); }
.filter-panel { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); margin-bottom: 16px; }.filter-panel summary { cursor: pointer; padding: 12px 15px; font-size: 10px; font-weight: 800; }.filter-panel summary span { display: inline-grid; min-width: 18px; place-items: center; border-radius: 99px; color: var(--green-700); background: var(--green-100); margin-left: 5px; }.filter-panel form { border-top: 1px solid var(--line); padding: 14px; }.filter-grid { grid-template-columns: repeat(4,minmax(140px,1fr)); }.filter-multi select { min-height: 92px; }.filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: var(--muted); font-size: 9px; }.pagination div { display: flex; gap: 7px; }
.sku-ledger-link { max-width: 330px; text-align: left; }.stock-state.out-of-stock { color: #737977; }.stock-state.out-of-stock:before { background: #a8aca9; }
.receipt-line { grid-template-columns: minmax(210px,1.55fr) 125px 105px minmax(135px,.85fr) 30px; }.remark-field { min-width: 0; }
.yield-matrix { display: flex; flex-direction: column; gap: 7px; overflow-x: auto; }.yield-head,.yield-row { display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) minmax(220px,1.2fr); gap: 8px; }.yield-head { color: var(--muted); padding: 0 9px; font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }.yield-row { border: 1px solid var(--line); border-radius: 11px; background: #fbfaf7; padding: 9px; }.yield-row > label,.byproduct-fields label { display: flex; flex-direction: column; gap: 4px; }.yield-row label span,.byproduct-fields span { color: var(--muted); font-size: 8px; font-weight: 750; }.yield-row input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px; }.byproduct-fields { display: grid; grid-template-columns: repeat(2,minmax(120px,1fr)); gap: 7px; }.byproduct-fields small { align-self: center; color: var(--muted); }
.aging-layers { display: flex; flex-direction: column; gap: 7px; }.aging-layer { display: grid; grid-template-columns: auto minmax(180px,1fr) 100px 80px; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; padding: 9px; }.aging-layer > input[type=checkbox] { accent-color: var(--green-700); }.aging-layer span strong,.aging-layer span small { display: block; }.aging-layer span strong { font-size: 10px; }.aging-layer span small,.aging-layer em { color: var(--muted); font-size: 8px; font-style: normal; }.aging-layer [data-layer-qty] { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 7px; }
.upload-date { grid-column: 2/3; }.preview-summary { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 7px 11px; border-radius: 10px; background: #f3f6f4; margin: 16px 0; padding: 12px; }.preview-summary strong { color: var(--green-900); font-family: Georgia,serif; font-size: 23px; }.preview-summary span { color: var(--muted); font-size: 9px; }.validation-list { border-left: 3px solid var(--amber); color: #79562e; background: var(--amber-soft); padding: 10px 12px; font-size: 9px; }.validation-list.has-errors { border-left-color: var(--red); color: var(--red); background: var(--red-soft); }.validation-list div + div { margin-top: 4px; }.valid-banner { border-radius: 9px; color: #315c52; background: #f2f8f5; padding: 11px; font-size: 9px; }.preview-table { margin-top: 15px; }
.receipt-output-grid { display: flex; flex-direction: column; gap: 6px; }.receipt-output-head,.receipt-output-row { display: grid; grid-template-columns: minmax(210px,1.5fr) 90px 120px 105px; align-items: center; gap: 8px; }.receipt-output-head { color: var(--muted); padding: 0 9px; font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }.receipt-output-row { border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; padding: 9px; font-size: 9px; }.receipt-output-row strong,.receipt-output-row small { display: block; }.receipt-output-row small { color: var(--muted); margin-top: 2px; font-size: 8px; }.receipt-output-row input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px; text-align: right; }
.document-section { margin-top: 21px; }.document-section h3 { border-bottom: 1px solid #d6d3ca; margin: 0 0 8px; padding-bottom: 5px; font-family: Georgia,serif; font-size: 14px; font-weight: 500; }.document-notes { border: 1px solid #e0ddd5; border-radius: 8px; margin-top: 15px; padding: 10px 12px; }.document-notes strong { font-size: 9px; text-transform: uppercase; }.document-notes p { margin: 4px 0 0; white-space: pre-wrap; }.inventory-ledger-summary { display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)); gap: 8px; margin: 16px 0; }.inventory-ledger-summary div { border: 1px solid var(--line); border-radius: 9px; padding: 9px; }.inventory-ledger-summary span,.inventory-ledger-summary strong { display: block; }.inventory-ledger-summary span { color: var(--muted); font-size: 8px; }.inventory-ledger-summary strong { margin-top: 2px; font-size: 11px; }.void-ledger-row { opacity: .55; text-decoration: line-through; }
@media (max-width: 980px) { .filter-grid { grid-template-columns: repeat(2,minmax(140px,1fr)); }.receipt-line { grid-template-columns: 1fr 115px 95px 30px; }.receipt-line > label:first-child,.receipt-line .remark-field { grid-column: 1/4; }.yield-head,.yield-row { min-width: 720px; } }
@media (max-width: 520px) { .section-head { align-items: flex-start; flex-direction: column; }.section-actions { width: 100%; justify-content: stretch; }.section-actions .button { flex: 1; }.filter-grid { grid-template-columns: 1fr; }.receipt-line,.form-line,.form-line.simple { grid-template-columns: 1fr 75px 30px; }.receipt-line > label:first-child,.receipt-line .remark-field,.receipt-line .source-id-field { grid-column: 1/3; }.aging-layer { grid-template-columns: auto 1fr; }.aging-layer [data-layer-qty],.aging-layer em { grid-column: 2; }.inventory-ledger-summary { grid-template-columns: 1fr 1fr; }.preview-summary { grid-template-columns: auto 1fr; } }
@media (max-width: 620px) { .receipt-output-head { display: none; }.receipt-output-row { grid-template-columns: 1fr 1fr; }.receipt-output-row > span:first-child { grid-column: 1/-1; }.receipt-output-row input { min-height: 40px; } }
@media (max-width: 620px) {
  .yield-head { display: none; }
  .yield-row { min-width: 0; grid-template-columns: 1fr; }
  .byproduct-fields { grid-template-columns: 1fr; }
  .yield-row input { min-height: 40px; }
}
@media (max-width: 820px) { .sidebar,.nav { scrollbar-width: none; }.sidebar::-webkit-scrollbar,.nav::-webkit-scrollbar { display: none; } }

/* Unified ERP interface: restrained module navigation, readable forms and dense tables. */
:root {
  --paper: #f5f6f4;
  --surface: #ffffff;
  --ink: #202725;
  --muted: #68736f;
  --line: #dfe4e1;
  --green-900: #175b4d;
  --green-700: #247565;
  --green-100: #eaf3f0;
  --radius: 9px;
  --shadow: 0 18px 55px rgba(22, 50, 43, .14);
}
body { font-size: 14px; line-height: 1.45; }
.app-header {
  position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 28px; min-height: 64px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.97); padding: 8px 28px; backdrop-filter: blur(12px);
}
.app-header .brand { display: flex; min-height: 0; color: var(--ink); padding: 0; }
.app-header .brand-name { font: 700 15px/1.2 Inter, ui-sans-serif, system-ui, sans-serif; }
.app-header .brand-subtitle { color: var(--muted); font-size: 10px; letter-spacing: 0; text-transform: none; }
.app-header .brand-mark { width: 32px; height: 32px; border-radius: 7px; background: var(--green-100); transform: none; }
.app-header .prototype-badge { border-color: #d7dfdc; color: var(--muted); background: #f5f6f4; }
.module-nav { display: flex; align-items: center; gap: 4px; }
.module-item {
  min-height: 38px; border: 0; border-radius: 6px; color: #53605c; background: transparent;
  padding: 8px 13px; font-size: 13px; font-weight: 650; cursor: pointer;
}
.module-item:hover { color: var(--ink); background: #f1f4f2; }
.module-item.active { color: #fff; background: var(--green-900); }
.app-header .user-card { min-width: 150px; border: 0; color: var(--ink); background: transparent; padding: 0; }
.app-header .user-card-copy span { color: var(--muted); font-size: 11px; }
.app-header .user-card strong { font-size: 13px; }
.section-nav {
  position: sticky; top: 64px; z-index: 35; display: flex; min-height: 43px; align-items: center;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); padding: 0 28px;
  backdrop-filter: blur(12px);
}
.section-nav-group { display: flex; align-items: center; gap: 4px; }
.section-nav-group strong { color: var(--green-900); margin-right: 10px; font-size: 13px; }
.section-nav-group button {
  min-height: 42px; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  background: transparent; padding: 8px 11px 6px; font-size: 13px; cursor: pointer;
}
.section-nav-group button:hover { color: var(--ink); }
.section-nav-group button.active { border-bottom-color: var(--green-900); color: var(--ink); font-weight: 700; }
.section-nav .reset-button { width: auto; color: #8a5953; margin: 0 0 0 auto; padding: 7px 0; font-size: 11px; }
.main-shell { min-height: calc(100vh - 64px); margin-left: 0; }
.topbar { max-width: 1540px; align-items: flex-end; margin: 0 auto; padding: 22px 28px 8px; }
.topbar h1 { font: 680 clamp(22px, 2vw, 28px)/1.2 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.02em; }
.eyebrow { color: var(--muted); margin-bottom: 5px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.page-content { max-width: 1540px; margin: 0 auto; padding: 15px 28px 48px; }
.section-head { align-items: center; margin-bottom: 14px; }
.section-head > div { margin-right: auto; }
.section-head h2, .section-head p { display: none; }
.section-subhead h3, .card-header h3, .upload-card h3 { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-weight: 680; }
.button { min-height: 40px; border-radius: 6px; padding: 9px 14px; font-size: 13px; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.text-button { min-height: 32px; padding: 5px 7px; font-size: 12px; }
.card, .metric-card, .location-card, .upload-card, .feature-card { border-radius: var(--radius); box-shadow: none; }
.data-table th { background: #f2f6f4; padding: 10px 12px; font-size: 11px; letter-spacing: .02em; text-transform: none; }
.data-table td { padding: 11px 12px; font-size: 13px; }
.data-table th.sortable-heading { padding: 0; }
.sort-control { display: inline-flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; gap: 8px; border: 0; color: #687572; background: transparent; padding: 9px 12px; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.sort-control:hover,.sort-control:focus-visible { color: var(--green-900); background: #e9f1ed; outline: 0; }
.sort-control.active { color: var(--green-900); }
.sort-indicator { min-width: 16px; color: #91a09b; font-size: 13px; text-align: center; }
.sort-control.active .sort-indicator { color: var(--green-700); }
.cell-sub { margin-top: 3px; font-size: 11px; }
.doc-link { font-size: 13px; }
.type-chip { border-radius: 5px; padding: 4px 7px; font-size: 11px; }
.status { padding: 4px 8px; font-size: 10px; letter-spacing: 0; text-transform: none; }
.stock-state { font-size: 12px; }
.filter-panel { border-radius: 8px; margin-bottom: 14px; }
.filter-panel summary { padding: 11px 13px; font-size: 13px; }
.filter-panel form { padding: 15px; }
.field { gap: 6px; }
.field > span, .field label { color: #596561; font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea {
  min-height: 42px; border-radius: 6px; background: #fff; padding: 9px 11px; font-size: 14px;
}
.field input[readonly], .form-line input[readonly] { border-color: transparent; background: #f1f4f2; color: #4b5753; cursor: default; }
input[type="search"]::-webkit-search-cancel-button { width: 20px; height: 20px; cursor: pointer; }
.check-select { position: relative; }
.check-select > summary {
  display: flex; min-height: 42px; align-items: center; justify-content: space-between; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; padding: 9px 11px; font-size: 14px; cursor: pointer; list-style: none;
}
.check-select > summary::-webkit-details-marker { display: none; }
.check-select > summary:after { color: var(--muted); content: "▾"; }
.check-select[open] > summary:after { content: "▴"; }
.check-options {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: min(420px, 90vw); max-height: 280px;
  overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); padding: 6px;
}
.check-options label { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 7px; border-radius: 5px; padding: 8px; cursor: pointer; }
.check-options label:hover { background: #f2f6f4; }
.check-options input { width: 18px; height: 18px; margin: 0; accent-color: var(--green-900); }
.check-options span { color: var(--ink); font-size: 12px; font-weight: 500; }
.filter-multi select { min-height: 42px; }
.helper-note, .form-section-title small { display: none; }

.drawer { width: min(1180px, 100vw); background: var(--paper); box-shadow: -18px 0 55px rgba(20,46,39,.16); }
.drawer-head {
  align-items: center; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97);
  padding: 15px 28px; backdrop-filter: blur(12px);
}
.drawer-head > div:first-child { min-width: 0; }
.drawer-head h2 { font: 680 23px/1.25 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: -.02em; }
.drawer-head p { display: none; }
.drawer-title-row { display: flex; align-items: center; gap: 10px; }
.drawer-head-actions { display: flex; align-items: center; gap: 8px; }
.drawer-aux-action { display: contents; }
.recovery-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #cfe1da; color: var(--green-950); background: #edf7f3; padding: 10px 28px; }
.recovery-banner.saving { background: #f5f7f5; }
.recovery-banner.conflict { border-color: #ecd0c9; color: #743e35; background: #fff4f1; }
.recovery-copy { min-width: 0; }
.recovery-copy > span,.recovery-copy > strong,.recovery-copy > small { display: block; }
.recovery-copy > span { color: var(--green-700); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.recovery-banner.conflict .recovery-copy > span { color: #9a4c3f; }
.recovery-copy > strong { margin-top: 2px; font-size: 12px; }
.recovery-copy > small { color: var(--muted); margin-top: 2px; font-size: 9px; }
.recovery-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.recovery-work-card { margin: 18px 0; border-color: #cfe1da; background: #fbfefc; }
.recovery-work-row { grid-template-columns: 34px minmax(0,1fr) auto auto; }
.recovery-device-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--green-700); background: var(--green-100); }
.recovery-work-row button:disabled { opacity: .55; cursor: not-allowed; }
.transaction-form { max-width: 1180px; margin: 0 auto; padding: 0 28px 38px; }
.form-section { border-bottom: 1px solid var(--line); margin: 0; padding: 22px 0; }
.form-section:last-of-type { border-bottom: 0; }
.form-section-title { margin-bottom: 14px; font-size: 16px; font-weight: 680; letter-spacing: 0; text-transform: none; }
.form-grid { gap: 14px; }
#production-order-form .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-line { border-radius: 7px; background: #fff; padding: 10px; }
.form-line label { font-size: 11px; letter-spacing: 0; text-transform: none; }
.form-line input, .form-line select { min-height: 40px; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.remove-line { width: 38px; height: 40px; border: 1px solid #eadbd8; border-radius: 6px; background: #fff8f7; font-size: 19px; }
.add-line { min-height: 40px; border-radius: 6px; padding: 9px 12px; font-size: 13px; text-align: left; }
.form-footer { display: none; }
.form-total { border-radius: 7px; padding: 11px 13px; }
.form-total span { font-size: 11px; letter-spacing: 0; text-transform: none; }
.form-total strong { font: 680 18px Inter, ui-sans-serif, system-ui, sans-serif; }
.source-note, .variance-card, .linked-order, .issued-summary { border-radius: 7px; font-size: 12px; }

.template-order-matrix { overflow-x: auto; }
.template-order-matrix .yield-head,
.template-order-matrix .yield-row {
  min-width: 1080px; grid-template-columns: minmax(185px,1.25fr) 92px minmax(185px,1.25fr) 92px minmax(205px,1.35fr) minmax(190px,1.2fr); gap: 10px;
}
.template-order-matrix .yield-head { padding: 0 11px; font-size: 11px; letter-spacing: 0; text-transform: none; }
.template-order-matrix .yield-row { align-items: start; border-radius: 7px; background: #fff; padding: 11px; }
.template-product strong, .template-product span { display: block; }
.template-product strong { color: var(--green-900); font-size: 12px; }
.template-product span { color: var(--ink); margin-top: 2px; font-size: 12px; line-height: 1.35; }
.template-qty { display: grid !important; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px; }
.template-qty input { min-height: 40px; text-align: right; }
.template-qty em, .quantity-with-unit em { color: var(--muted); font-size: 11px; font-style: normal; }
.mobile-field-label { display: none; }
.byproduct-fields { display: flex; flex-direction: column; gap: 8px; }
.byproduct-fields label { display: flex; flex-direction: column; gap: 4px; }
.byproduct-fields label > span:first-child { color: var(--ink); font-size: 11px; line-height: 1.3; }
.byproduct-fields small { color: var(--muted); font-size: 12px; }
.optional-byproduct { display: grid; gap: 7px; }
.optional-byproduct > input { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 8px 9px; font-size: 12px; }

.aging-layers { gap: 6px; }
.aging-layer { grid-template-columns: 26px minmax(180px,1fr) 110px 65px; border-radius: 7px; background: #fff; padding: 10px 12px; }
.aging-layer > input[type="checkbox"] { width: 18px; height: 18px; }
.aging-layer span strong { font-size: 13px; }
.aging-layer span small, .aging-layer em { font-size: 11px; }
.aging-layer [data-layer-qty] { min-height: 40px; border-radius: 6px; font-size: 13px; }
.aging-output-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(320px,.9fr); gap: 14px; }
.aging-finished-card, .aging-standard-products { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 14px; }
.aging-finished-card { display: grid; grid-template-columns: minmax(0,1fr) 170px; align-items: end; gap: 18px; }
.readonly-product span, .readonly-product strong, .readonly-product small { display: block; }
.readonly-product span { color: var(--green-900); font-size: 12px; font-weight: 750; }
.readonly-product strong { margin-top: 3px; font-size: 14px; }
.readonly-product small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.quantity-with-unit { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; }
.quantity-with-unit input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; text-align: right; }
.aging-standard-products h4 { margin: 0 0 10px; font-size: 13px; }
.aging-standard-products > label { display: grid; grid-template-columns: minmax(0,1fr) 125px; align-items: center; gap: 10px; border-top: 1px solid #edf0ee; padding: 8px 0; }
.aging-standard-products > label > span:first-child { font-size: 11px; line-height: 1.3; }
.aging-notes { margin-top: 16px; }
.inventory-ledger-summary div { border-radius: 7px; background: #fff; padding: 11px; }
.inventory-ledger-summary span { font-size: 11px; }
.inventory-ledger-summary strong { font-size: 14px; }
.inventory-ledger-summary small { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; }

.history-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-bottom: 12px; }
.history-summary > div { min-height: 76px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 12px 14px; }
.history-summary span { display: block; color: var(--muted); font-size: 11px; }
.history-summary strong { display: block; color: var(--ink); margin-top: 5px; font-size: 18px; font-weight: 680; }
.history-summary > div:last-child strong { font-size: 13px; line-height: 1.4; }
.history-view-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 12px; }
.history-view-bar > span { color: var(--muted); font-size: 11px; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 3px; }
.view-toggle button { min-height: 34px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; padding: 6px 12px; font-size: 12px; font-weight: 650; cursor: pointer; }
.view-toggle button.active { color: #fff; background: var(--green-900); }
.history-filter-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.history-table-card { max-width: 100%; overflow-x: auto; }
.history-movement-table { min-width: 1330px; }
.history-document-table { min-width: 900px; }
.history-page .pagination { margin-top: 10px; }

/* V2 workspace controls and transaction layouts */
.user-menu-wrap { position: relative; justify-self: end; }
.app-header .user-card { cursor: pointer; }
.user-chevron { color: var(--muted); font-size: 15px; line-height: 1; }
.user-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 90; width: 190px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  box-shadow: 0 14px 34px rgba(20,45,38,.16); padding: 5px;
}
.user-menu button { display: block; width: 100%; min-height: 40px; border: 0; border-radius: 5px; color: var(--ink); background: transparent; padding: 8px 10px; text-align: left; cursor: pointer; }
.user-menu button:hover { background: #f1f5f3; }
.user-menu button:last-child { color: var(--red); }
#user-switcher { max-width: 310px; min-height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 7px 9px; }
.workspace-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: -2px 0 16px; }
.workspace-tabs button { flex: 0 0 auto; min-height: 40px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 8px 13px 6px; font-weight: 650; cursor: pointer; }
.workspace-tabs button.active { border-bottom-color: var(--green-900); color: var(--ink); }
.inventory-location-totals { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 8px; margin-bottom: 14px; }
.inventory-location-totals article { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 12px 14px; }
.inventory-location-totals span,.inventory-location-totals small { display: block; color: var(--muted); font-size: 11px; }
.inventory-location-totals strong { display: block; margin: 3px 0 2px; font-size: 18px; font-variant-numeric: tabular-nums; }
.production-output-planner { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.production-output-head,.production-output-row { display: grid; grid-template-columns: minmax(260px,1fr) 115px 145px; align-items: center; gap: 12px; }
.production-output-head { color: var(--muted); background: #f6f7f5; padding: 9px 12px; font-size: 11px; font-weight: 700; }
.production-output-row { border-top: 1px solid var(--line); background: #fff; padding: 10px 12px; }
.template-product strong,.template-product small { display: block; }
.template-product strong { font-size: 13px; }
.template-product small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.on-hand-value strong,.on-hand-value small,.plan-stock span,.plan-stock strong,.plan-stock small,.prep-stock span,.prep-stock strong,.prep-stock small { display: block; }
.on-hand-value strong,.plan-stock strong,.prep-stock strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.on-hand-value small,.plan-stock span,.plan-stock small,.prep-stock span,.prep-stock small { color: var(--muted); font-size: 10px; }
.prep-output-link { display: block; min-height: 27px; color: var(--green-700); margin: 2px 0 4px; font-size: 10px; font-weight: 600; line-height: 1.3; text-transform: none; }
.template-qty { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; }
.template-qty input { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; text-align: right; }
.template-qty em { color: var(--muted); font-style: normal; }
.mobile-field-label { display: none; }
.production-plan-line,.material-prep-line { grid-template-columns: minmax(220px,1.35fr) 135px 125px 38px; align-items: end; }
.plan-stock,.prep-stock { min-height: 58px; border-left: 1px solid var(--line); padding: 5px 10px; }
.issue-review-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.status.pending-approval { color: #8a5d23; background: var(--amber-soft); }
.status.rejected { color: var(--red); background: var(--red-soft); }
.user-access-grid { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.access-grid-head,.access-assignment { display: grid; grid-template-columns: minmax(220px,1fr) 150px; align-items: center; gap: 12px; padding: 9px 11px; }
.access-grid-head { color: var(--muted); background: #f6f7f5; font-size: 11px; }
.access-assignment { border-top: 1px solid var(--line); }
.access-assignment > span:first-child { display: flex; align-items: center; gap: 9px; }
.access-assignment input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green-900); }
.access-assignment select { min-height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 7px 8px; }
.fixed-level { color: var(--muted); font-size: 12px; }
.access-profile-catalog { display: grid; grid-template-columns: repeat(3,minmax(190px,1fr)); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 12px; }
.access-profile-catalog > div { min-height: 66px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 13px; }
.access-profile-catalog > div:nth-child(3n) { border-right: 0; }
.access-profile-catalog strong,.access-profile-catalog span { display: block; }
.access-profile-catalog strong { font-size: 12px; }
.access-profile-catalog span { color: var(--muted); margin-top: 4px; font-size: 10px; }
.aging-date-picker { position: relative; }
.aging-date-picker > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 9px 12px; cursor: pointer; }
.aging-date-picker > summary span { font-weight: 650; }
.aging-date-picker > summary small { color: var(--muted); }
.aging-date-menu { position: absolute; z-index: 15; top: calc(100% + 5px); left: 0; width: min(560px,100%); max-height: 390px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 16px 36px rgba(20,45,38,.15); padding: 9px; }
.aging-date-search { position: sticky; top: -9px; z-index: 1; display: block; background: #fff; padding: 6px 2px 9px; }
.aging-date-search span { display: block; color: var(--muted); margin-bottom: 4px; font-size: 10px; }
.aging-date-search input { width: 100%; min-height: 39px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
.aging-date-options { display: grid; gap: 4px; }
.aging-date-option { display: grid; grid-template-columns: 22px minmax(150px,1fr) 150px; align-items: center; gap: 9px; border-radius: 6px; padding: 8px; }
.aging-date-option:hover { background: #f5f8f6; }
.aging-date-option > input { width: 18px; height: 18px; accent-color: var(--green-900); }
.aging-date-option strong,.aging-date-option small { display: block; }
.aging-date-option small { color: var(--muted); font-size: 10px; }
.aging-date-option .quantity-with-unit input:disabled { color: var(--muted); background: #f1f2f0; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.record-tabs { display: inline-flex; gap: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 2px 0 12px; padding: 3px; }
.record-tabs button { min-height: 38px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; padding: 7px 13px; font-weight: 650; cursor: pointer; }
.record-tabs button span { display: inline-grid; min-width: 23px; height: 23px; place-items: center; border-radius: 999px; background: #eef1ef; margin-left: 6px; font-size: 10px; }
.record-tabs button.active { color: #fff; background: var(--green-900); }
.record-tabs button.active span { color: var(--green-950); background: #fff; }
.picker-trigger { display: grid; width: 100%; min-height: 56px; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; padding: 9px 12px; text-align: left; cursor: pointer; }
.picker-trigger:hover { border-color: #9bada7; background: #fbfdfc; }
.picker-trigger:focus-visible { outline: 3px solid rgba(45,98,88,.15); border-color: var(--green-700); }
.picker-trigger strong,.picker-trigger small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-trigger strong { font-size: 13px; }
.picker-trigger small { grid-column: 1; color: var(--muted); font-size: 10px; }
.picker-trigger > span { grid-row: 1/3; grid-column: 2; color: var(--green-700); font-size: 24px; }
.picker-trigger.compact { min-height: 50px; }
body.choice-sheet-open { overflow: hidden; }
.choice-sheet[hidden] { display: none !important; }
.choice-sheet { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(12,29,26,.48); padding: 18px; }
.choice-sheet-panel { display: flex; width: min(680px,100%); max-height: min(720px,88vh); flex-direction: column; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(9,31,25,.25); }
.choice-sheet-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 16px 18px 12px; }
.choice-sheet-head h3 { margin: 0; font-size: 18px; }
.choice-sheet-head p { color: var(--muted); margin: 4px 0 0; font-size: 11px; line-height: 1.4; }
.choice-sheet-close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; font-size: 24px; cursor: pointer; }
.choice-sheet-search { flex: 0 0 auto; padding: 12px 14px 8px; }
.choice-sheet-search input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fbfaf7; padding: 9px 12px; font-size: 14px; }
.choice-sheet-search input:focus { border-color: #8ca69e; box-shadow: 0 0 0 3px rgba(45,98,88,.08); background: #fff; }
.choice-sheet-options { display: grid; min-height: 0; gap: 5px; overflow-y: auto; padding: 6px 14px 14px; overscroll-behavior: contain; }
#aging-sku-options { display: grid; gap: 5px; }
.choice-option { display: grid; min-height: 67px; grid-template-columns: minmax(110px,.55fr) minmax(180px,1.3fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; padding: 10px 12px; text-align: left; cursor: pointer; }
.choice-option:hover,.choice-option:focus-visible { border-color: #9bada7; background: #f4f8f6; outline: 0; }
.choice-option-primary strong,.choice-option-primary small,.choice-option-description,.choice-option-quantity { display: block; }
.choice-option-primary strong { color: var(--green-800); font-size: 14px; }
.choice-option-primary small,.choice-option-quantity { color: var(--muted); margin-top: 3px; font-size: 10px; }
.choice-option-description { font-size: 12px; line-height: 1.35; }
.choice-option-quantity { margin: 0; text-align: right; white-space: nowrap; }
.choice-empty { color: var(--muted); padding: 28px 14px; text-align: center; }
.choice-sheet-footer { flex: 0 0 auto; border-top: 1px solid var(--line); background: #fff; padding: 12px 14px; }
.choice-sheet-footer .button { width: 100%; min-height: 44px; }
.choice-sheet .aging-date-option { display: grid; min-height: 70px; grid-template-columns: 26px minmax(150px,1fr) 155px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 10px 12px; }
.choice-sheet .aging-date-option:hover { border-color: #9bada7; background: #f7faf8; }
.choice-sheet .aging-date-option.unavailable { border-color: #e7d4d0; background: #fff9f8; }
.choice-sheet .aging-date-option > input { width: 21px; height: 21px; accent-color: var(--green-900); }
.choice-sheet .aging-date-copy strong,.choice-sheet .aging-date-copy small { display: block; }
.choice-sheet .aging-date-copy strong { font-size: 13px; }
.choice-sheet .aging-date-copy small { color: var(--muted); margin-top: 3px; font-size: 10px; line-height: 1.35; }

@media (max-width: 900px) {
  .app-header { grid-template-columns: auto 1fr; gap: 10px; padding: 8px 14px; }
  .app-header .user-card { min-width: 0; justify-self: end; }
  .app-header .user-card-copy, .app-header .online-dot, .app-header .prototype-badge { display: none; }
  .module-nav { grid-column: 1/-1; overflow-x: auto; }
  .module-item { flex: 1 0 auto; }
  .section-nav { position: static; top: auto; overflow-x: auto; padding: 0 14px; }
  .section-nav .reset-button { display: none; }
  .topbar { align-items: flex-start; padding: 17px 15px 5px; }
  .topbar-actions { align-items: flex-end; }
  .page-content { padding: 14px 14px 34px; }
  #production-order-form .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .drawer-head { padding: 14px 16px; }
  .recovery-banner { align-items: flex-start; gap: 10px; padding: 10px 16px; }
  .recovery-copy > strong { font-size: 13px; }
  .recovery-copy > small { font-size: 10px; }
  .recovery-actions { flex-direction: column; align-items: flex-end; gap: 4px; }
  .recovery-work-row { grid-template-columns: 34px minmax(0,1fr); }
  .recovery-work-row > button { grid-column: 2; width: 100%; }
  .transaction-form { padding: 0 16px 24px; }
  .aging-output-layout { grid-template-columns: 1fr; }
  .history-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .history-filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .inventory-location-totals { grid-template-columns: repeat(2,minmax(140px,1fr)); }
}
@media (max-width: 620px) {
  .app-header .brand { display: flex !important; }
  .app-header { position: static; }
  .brand-subtitle { display: none; }
  .section-nav-group strong { margin-right: 2px; }
  .section-nav-group button { padding-inline: 8px; }
  .topbar h1 { font-size: 21px; }
  .role-switcher select { min-height: 38px; max-width: 165px; font-size: 11px; }
  .section-head { align-items: stretch; }
  .section-actions { display: grid; grid-template-columns: 1fr; }
  .section-actions .button { width: 100%; }
  .drawer-head { align-items: flex-start; }
  .drawer-head h2 { font-size: 20px; }
  .drawer-head-actions .button[form], .drawer-head-actions .button[data-save-draft] { display: none; }
  .drawer-head-actions .drawer-aux-action { display: none; }
  .drawer-head-actions .button.ghost { min-height: 38px; padding-inline: 8px; }
  .form-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #fff; margin: 24px -16px -24px; padding: 12px 16px; }
  .form-footer.has-draft-aux-actions .final-action { grid-column: 1/-1; }
  #production-order-form .form-grid { grid-template-columns: 1fr; }
  .template-order-matrix .yield-head { display: none; }
  .template-order-matrix .yield-row { min-width: 0; grid-template-columns: 1fr 88px; gap: 9px; }
  .template-order-matrix .yield-row > :nth-child(3), .template-order-matrix .yield-row > :nth-child(5), .template-order-matrix .yield-row > :nth-child(6) { grid-column: 1/-1; }
  .mobile-field-label { display: block; grid-column: 1/-1; color: var(--muted); font-size: 10px; }
  .optional-byproduct { grid-template-columns: 1fr 105px; }
  .aging-layer { grid-template-columns: 24px 1fr; }
  .aging-layer [data-layer-qty], .aging-layer em { grid-column: 2; }
  .aging-finished-card { grid-template-columns: 1fr; }
  .aging-standard-products > label { grid-template-columns: 1fr; }
  .check-options { position: fixed; right: 12px; bottom: 12px; left: 12px; width: auto; max-height: 55vh; }
  .inventory-ledger-summary { grid-template-columns: 1fr 1fr; }
  .history-view-bar { align-items: stretch; flex-direction: column; }
  .view-toggle { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .history-filter-grid { grid-template-columns: 1fr; }
  .history-summary > div { min-height: 68px; }
  .history-summary strong { font-size: 16px; }
  .app-header { grid-template-columns: 1fr auto; padding: 8px 12px; }
  .module-nav { grid-row: 2; grid-column: 1/-1; width: 100%; }
  .module-item { flex: 1 0 auto; min-height: 40px; padding-inline: 11px; }
  .user-menu { position: fixed; top: 62px; right: 10px; }
  .topbar-actions { min-width: 0; max-width: 62%; }
  #user-switcher { width: 100%; max-width: 230px; }
  .inventory-location-totals { grid-template-columns: 1fr 1fr; }
  .production-output-head { display: none; }
  .production-output-row { grid-template-columns: 1fr 95px; gap: 9px; }
  .production-output-row .template-product { grid-column: 1/-1; }
  .mobile-field-label { display: block; color: var(--muted); font-size: 10px; }
  .production-plan-line,.material-prep-line { grid-template-columns: 1fr 88px 38px; }
  .production-plan-line > label:first-child,.material-prep-line > label:first-child { grid-column: 1/3; }
  .plan-stock,.prep-stock { border-left: 0; border-top: 1px solid var(--line); padding: 8px 2px 2px; }
  .production-plan-line > label:nth-of-type(2),.material-prep-line > label:nth-of-type(2) { align-self: end; }
  .record-tabs { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .record-tabs button { min-width: 0; padding-inline: 7px; }
  .picker-trigger { min-height: 64px; }
  .picker-trigger strong { font-size: 15px; }
  .picker-trigger small { font-size: 11px; }
  .choice-sheet { align-items: end; padding: 0; }
  .choice-sheet-panel { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .choice-sheet-head { padding: 17px 16px 13px; }
  .choice-sheet-head h3 { font-size: 20px; }
  .choice-sheet-head p { font-size: 12px; }
  .choice-sheet-search { padding: 10px 12px 7px; }
  .choice-sheet-search input { min-height: 48px; font-size: 16px; }
  .choice-sheet-options { gap: 7px; padding: 6px 12px 14px; }
  .choice-option { min-height: 84px; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px; }
  .choice-option-primary { grid-column: 1; }
  .choice-option-primary strong { font-size: 16px; }
  .choice-option-primary small { font-size: 11px; }
  .choice-option-description { grid-column: 1/-1; font-size: 13px; }
  .choice-option-quantity { grid-row: 1; grid-column: 2; font-size: 11px; }
  .choice-sheet .aging-date-option { min-height: 94px; grid-template-columns: 28px 1fr; gap: 8px 10px; padding: 12px; }
  .choice-sheet .aging-date-option .quantity-with-unit { grid-column: 2; }
  .choice-sheet .aging-date-option .quantity-with-unit input { min-height: 44px; font-size: 16px; }
  .choice-sheet .aging-date-copy strong { font-size: 15px; }
  .choice-sheet .aging-date-copy small { font-size: 11px; }
  .access-grid-head { display: none; }
  .access-assignment { grid-template-columns: 1fr; }
  .access-profile-catalog { grid-template-columns: 1fr 1fr; }
  .access-profile-catalog > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .access-profile-catalog > div:nth-child(2n) { border-right: 0; }
}
@media print {
  .sidebar,.main-shell,.drawer,.drawer-backdrop,.toast { display: none !important; }
  body * { visibility: hidden !important; }
  #detail-modal,#detail-modal *,.document-sheet,.document-sheet * { visibility: visible !important; }
  #detail-modal { position: static !important; display: block !important; min-height: 0 !important; background: #fff; padding: 0; }
  .modal-card { width: 100%; max-height: none; overflow: visible; border-radius: 0; box-shadow: none; }
  .modal-toolbar { display: none !important; }
  .document-sheet { margin: 0; border: 0; padding: 0; }
  .document-section,.document-meta,.document-total,.document-notes,tr { break-inside: avoid; }
  .document-butchery { font-size: 7px; }
  .document-butchery .document-brand { padding-bottom: 5px; }
  .document-butchery .document-brand h2 { font-size: 17px; }
  .document-butchery .document-meta { grid-template-columns: repeat(3,1fr); gap: 2px 15px; margin: 7px 0; }
  .document-butchery .document-meta div { padding: 2px 0; }
  .document-butchery .document-meta span,.document-butchery .document-meta strong { font-size: 7px; }
  .document-butchery .document-section { margin-top: 7px; }
  .document-butchery .document-section h3 { margin-bottom: 2px; padding-bottom: 2px; font-size: 9px; }
  .document-butchery .document-lines th { padding: 2px 3px; font-size: 6px; }
  .document-butchery .document-lines td { max-width: 110mm; overflow: hidden; padding: 2px 3px; font-size: 7px; line-height: 1.15; text-overflow: clip; white-space: nowrap; }
  .document-butchery .document-total { padding: 5px 3px; font-size: 8px; }
  .document-butchery .document-notes { max-height: 18px; overflow: hidden; margin-top: 4px; padding: 3px 5px; }
  @page { size: A4; margin: 10mm; }
}
/* Secure live-database sign in */
.auth-screen { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: #f3f6f4; }
.auth-panel { width: min(440px, 100%); padding: 34px; border: 1px solid #dce4e0; border-radius: 18px; background: #fff; box-shadow: 0 18px 55px rgba(22, 53, 47, .12); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font-size: 18px; }
.auth-brand span { margin-top: 2px; color: #6a7572; font-size: 13px; }
.auth-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: #173a34; color: white; font-weight: 800; }
.auth-copy h1 { margin: 3px 0 8px; font-size: 30px; letter-spacing: -.035em; }
.auth-copy > p:last-child { margin: 0 0 24px; color: #66716e; }
.auth-form { display: grid; gap: 17px; }
.auth-form .button { width: 100%; min-height: 46px; margin-top: 3px; }
.auth-message { margin-top: 16px; padding: 12px 14px; border-radius: 9px; background: #fff0ee; color: #a33127; font-size: 14px; line-height: 1.45; }
.auth-secondary-action { width: 100%; margin-top: 12px; }
.data-table .select-cell { width: 42px; padding-right: 4px; text-align: center; }
.select-cell input { width: 18px; height: 18px; margin: 0; accent-color: var(--green-900); cursor: pointer; }
.select-cell input:disabled { cursor: not-allowed; opacity: .35; }
.auth-required > .app-header, .auth-required > .section-nav, .auth-required > .main-shell { visibility: hidden; }
@media (max-width: 600px) { .auth-screen { padding: 14px; } .auth-panel { padding: 26px 22px; } }
body.app-booting {
  overflow: hidden;
}

.app-booting > .app-header,
.app-booting > .section-nav,
.app-booting > .main-shell {
  visibility: hidden;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f6f5;
  color: #173a34;
}

.boot-screen[hidden] {
  display: none;
}

.boot-card {
  width: min(420px, 100%);
  text-align: center;
}

.boot-card .auth-mark {
  margin: 0 auto 22px;
}

.boot-card h1 {
  margin: 16px 0 8px;
  font-size: clamp(22px, 4vw, 28px);
}

.boot-card p {
  margin: 0 auto;
  max-width: 360px;
  color: #5f6f6b;
  font-size: 15px;
  line-height: 1.55;
}

.boot-card .button {
  margin-top: 22px;
}

.boot-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid #d8e0dd;
  border-top-color: #17795f;
  border-radius: 999px;
  animation: boot-spin 0.8s linear infinite;
}

.boot-failed .boot-spinner {
  display: none;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}
