:root{--bg:#f5f7fa;--paper:#fff;--ink:#192c40;--muted:#718095;--blue:#204963;--teal:#128077;--mint:#e5f4ef;--line:#dce4e9;--warn:#946023;--warn-bg:#fff8e9;--radius:16px;--shadow:0 3px 16px rgba(22,44,67,.042)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);font:14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;color:var(--ink)}a{color:var(--teal);text-decoration:none}a:hover{text-decoration:underline}button,input,select{font:inherit}button{cursor:pointer}.container{width:min(calc(100% - 56px),1500px);margin-inline:auto}.main{padding-top:36px;min-height:calc(100vh - 143px)}.site-header{background:#fff;border-bottom:1px solid var(--line);height:81px}.header-inner{height:100%;display:flex;align-items:center;gap:55px}.brand{display:flex;gap:12px;align-items:center;color:var(--ink);text-decoration:none;font-size:18px;letter-spacing:-.45px;line-height:1.05;white-space:nowrap}.brand:hover{text-decoration:none}.brand strong{color:var(--teal)}.brand small{display:block;margin-top:7px;font-size:10px;font-weight:600;letter-spacing:1.05px;text-transform:uppercase;color:#8494a1}.brand-symbol,.login-logo{display:grid;place-items:center;color:#fff;background:var(--teal);border-radius:13px;width:40px;height:40px;font-size:27px;font-weight:400}.nav{height:100%;display:flex;align-items:stretch;gap:35px;flex:1}.nav a{display:grid;align-items:center;color:#7c8a9a;font-size:13px;font-weight:650;border-bottom:3px solid transparent;padding-top:3px}.nav a:hover,.nav a.active{color:var(--teal);text-decoration:none}.nav a.active{border-color:var(--teal)}.account{display:flex;gap:10px;align-items:center}.account-avatar{background:#e3f0f4;color:#286781;border:1px solid #cee3e9;border-radius:100px;width:34px;height:34px;display:grid;place-items:center;font-weight:800}.account-info{display:flex;flex-direction:column;min-width:92px;line-height:1.3}.account-info strong{font-size:12px}.account-info small{font-size:11px;color:var(--muted);margin-top:3px}.button-icon{border:0;background:transparent;color:#8c9aaa;width:32px;height:32px;display:grid;place-items:center;padding:4px}.button-icon:hover{color:var(--blue)}.button-icon svg{width:19px;height:19px}.page-heading{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:25px}.eyebrow{color:var(--teal);font-size:10px;letter-spacing:2.5px;font-weight:900;margin-bottom:8px}.page-heading h1{font-size:31px;line-height:1.2;letter-spacing:-1px;margin:0 0 5px;font-weight:750}.muted,.page-heading p{color:var(--muted)}.page-heading p{margin:0}.heading-actions{display:flex;gap:13px;align-items:end}.date-field{background:white;border:1px solid var(--line);border-radius:10px;height:44px;padding:3px 12px 2px;display:flex;flex-direction:column;min-width:185px}.field-kicker{font-size:9px;letter-spacing:1px;color:var(--muted);font-weight:800;line-height:15px}.date-field input{padding:0;border:0;background:transparent;outline:0;font-size:13px;font-weight:700;color:var(--ink);min-height:22px}.btn{border:1px solid transparent;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;gap:11px;padding:11px 17px;font-size:13px;font-weight:750;min-height:44px;white-space:nowrap;text-decoration:none;transition:filter .12s,transform .12s}.btn:hover{text-decoration:none;filter:brightness(.96);transform:translateY(-1px)}.btn:disabled{opacity:.4;cursor:not-allowed;transform:none;filter:none}.btn-primary{background:var(--teal);color:white;box-shadow:0 5px 15px rgba(18,128,119,.1)}.btn-secondary{background:#e9f2f4;border-color:#d0e4e6;color:#24625e}.btn-ghost{background:#f4f9fa;color:#347c77;border-color:#cfe4e6}.btn-wide{width:100%;justify-content:space-between}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:23px}.stat{min-height:123px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:18px 23px;display:flex;flex-direction:column;box-shadow:var(--shadow)}.stat-label{font-size:11px;color:#7c8a98;font-weight:700}.stat strong{font-size:28px;letter-spacing:-.7px;color:var(--ink);line-height:1.3;margin:10px 0 5px;white-space:nowrap}.stat strong small{font-size:15px}.stat-note{font-size:11px;color:#84909c}.stat-accent{border-color:#c5e5dc;background:linear-gradient(125deg,#effaf5,#f7fffb)}.stat-accent strong{color:var(--teal)}.stat strong.stat-money{font-size:clamp(17px,1.85vw,26px);letter-spacing:-.65px;overflow-wrap:anywhere;white-space:normal}.split-section{display:grid;grid-template-columns:1.08fr 1fr;gap:20px;margin-bottom:25px}.panel{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.add-panel,.help-panel{padding:23px 27px}.panel-header{display:flex;align-items:start;justify-content:space-between;gap:14px;margin-bottom:18px}.panel h2,.section-title h2,.history-section h2{font-size:17px;letter-spacing:-.3px;line-height:1.3;margin:0 0 5px;font-weight:800}.panel-header p,.report-header p{margin:0;font-size:12px;color:var(--muted)}.round-icon{background:#eaf7f2;color:var(--teal);border-radius:50%;width:34px;height:34px;display:grid;place-items:center;font-size:23px}.add-form{display:flex;flex-direction:column;gap:12px}.field{display:flex;flex-direction:column;gap:6px;color:#516275;font-weight:650;font-size:11px}.field input,.field select,.stack-form input,.mini-table input,.price-table input{padding:10px 12px;background:#fcfdfe;border:1px solid #d9e3e9;border-radius:8px;outline:0;color:#253d51;min-height:42px;width:100%;font-size:13px;font-weight:550}.field input:focus,.field select:focus,.stack-form input:focus,.matrix input:focus,.mini-table input:focus,.price-table input:focus{border-color:#56a49b;box-shadow:0 0 0 3px rgba(29,139,129,.12)}.add-form-row{display:flex;gap:13px}.grow{flex:1}.count-field{width:128px}.steps{list-style:none;padding:2px 0 0;margin:0;display:grid;gap:22px}.steps li{display:flex;gap:12px;align-items:start}.steps li>span{background:#e9f6f1;border-radius:50%;color:var(--teal);font-weight:850;width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center}.steps strong{font-size:12.5px}.steps p{font-size:12px;color:var(--muted);margin:3px 0 0}.alert{padding:12px 16px;font-size:12px;line-height:1.5;border:1px solid;border-radius:9px;margin-bottom:15px}.alert.success{background:#ecf8f2;border-color:#c8e9d9;color:#277257}.alert.warn{background:var(--warn-bg);border-color:#f3e6ca;color:#876029}.alert.info{background:#eff6f9;border-color:#d3e6eb;color:#426a7d}.alert.danger{background:#fff2f2;border-color:#efc7c7;color:#a84747}.report-panel{margin-bottom:32px}.report-header{padding:22px 24px 19px;display:flex;justify-content:space-between;align-items:center;gap:20px}.pill{border:1px solid #dae8ed;background:#f3f7f9;border-radius:100px;font-size:11px;font-weight:750;color:#55758a;padding:5px 12px;white-space:nowrap}.report-panel>.alert{margin:0 20px 15px}.table-scroll{overflow-x:auto;overflow-y:visible;max-width:100%;scrollbar-color:#afc8d1 transparent}.matrix{border-collapse:separate;border-spacing:0;min-width:100%;width:max-content;table-layout:fixed;font-size:11.5px}.matrix th,.matrix td{border-bottom:1px solid #e2e8ec;border-right:1px solid #e5ebee;text-align:center;padding:9px 9px;vertical-align:middle;min-height:37px;background:white}.matrix th{background:#eef3f6;font-size:11px;color:#546679;font-weight:750}.matrix thead tr:first-child th{background:#eef3f6;height:90px}.matrix thead .batch-col{vertical-align:middle}.batch-id{font-size:10px;color:#9aabb8;font-weight:750;margin-bottom:7px}.batch-recipe{color:#305166;font-size:11px;line-height:1.35;max-height:52px;overflow:hidden;overflow-wrap:break-word}.matrix .ingredient-col{width:260px;min-width:260px;max-width:260px;position:sticky;left:0;text-align:left;padding-left:22px;z-index:2;background:inherit}.matrix .unit-col{width:58px;min-width:58px;position:sticky;left:260px;z-index:2;background:inherit;color:#84909c}.matrix thead .ingredient-col,.matrix thead .unit-col{z-index:4;background:#e9f0f4!important}.matrix .batch-col{width:145px;min-width:145px;max-width:145px}.matrix .total-col{width:108px;min-width:108px;max-width:108px;font-weight:800;background:#f2f8f6}.matrix tbody tr:nth-child(even) td{background:#fbfcfd}.matrix tbody tr:nth-child(even) td.total-col{background:#edf5f2}.matrix tbody tr:hover td{background:#f4f9fa}.matrix tbody tr:hover td.total-col{background:#eaf4f0}.matrix .number-row th{height:55px;background:#f6f8fa}.matrix input{border:1px solid #d7e4e6;border-radius:6px;background:white;text-align:center;width:100%;min-height:33px;min-width:0;padding:6px 5px;font-size:11px;color:#1f5462;font-weight:750}.matrix input::placeholder{color:#b8c3cd;font-weight:400}.material-name{display:block;font-weight:650}.material-lot{display:block;color:#8c9aa8;font-size:10px;margin-top:3px}.matrix .missing{background:#fff2e3!important;color:#a9682b;font-weight:900}.matrix tbody tr.highlight-row td{background:#f0f6f7;font-weight:750}.form-footer{display:flex;gap:20px;align-items:center;justify-content:space-between;padding:17px 22px;border-top:1px solid #e5ebef;background:#fff}.form-footer>span{font-size:11px;line-height:1.6;color:#8896a3;max-width:650px}.form-footer .btn{flex-shrink:0}.empty-state{text-align:center;padding:60px 15px 65px;border-top:1px solid var(--line)}.empty-icon{display:grid;place-items:center;background:#edf6f2;border-radius:18px;color:var(--teal);font-size:34px;width:70px;height:70px;margin:0 auto 13px}.empty-state h3{margin:0;font-size:16px}.empty-state p{margin:9px auto 0;color:var(--muted);max-width:450px;font-size:12px}.batch-details{margin-bottom:35px}.section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.section-title p{margin:3px 0;font-size:12px}.batch-panel{border:1px solid var(--line);background:white;border-radius:12px;margin-bottom:11px;box-shadow:var(--shadow);overflow:hidden}.batch-panel summary{display:flex;align-items:center;gap:14px;min-height:69px;padding:13px 20px;cursor:pointer;list-style:none}.batch-panel summary::-webkit-details-marker{display:none}.batch-panel summary:hover{background:#fbfdfd}.batch-index{display:grid;place-items:center;background:#eff4f7;color:#547184;border-radius:9px;width:36px;height:36px;font-weight:800;font-size:13px;flex-shrink:0}.batch-summary{flex:1}.batch-summary strong{display:block;font-size:13px}.batch-summary small{display:block;margin-top:4px;color:var(--muted);font-size:11px}.detail-state{font-size:10px;padding:5px 11px;border-radius:100px;font-weight:750;white-space:nowrap}.detail-state.pending{background:#fff5e3;color:#a66c29}.detail-state.ready{background:#e9f8ed;color:#32834a}.chevron{font-size:23px;color:#92a0ae;margin-left:14px}.batch-panel[open] .chevron{transform:rotate(180deg)}.batch-content{padding:0 20px 18px;border-top:1px solid #e9eef1}.mini-table-wrap{overflow-x:auto}.mini-table{width:100%;border-collapse:collapse;min-width:780px}.mini-table th,.mini-table td{border-bottom:1px solid #edf1f3;padding:8px 11px;text-align:left;font-size:12px}.mini-table th{background:#f8fafb;font-size:10px;text-transform:uppercase;letter-spacing:.65px;color:#82909a}.mini-table th:first-child,.mini-table td:first-child{width:33%}.mini-table th:nth-child(2){width:125px}.mini-table th:nth-child(3){width:240px}.mini-table th:last-child{width:130px}.mini-table input{min-height:35px;padding:6px 8px;font-size:12px}.mini-table small{display:block;font-size:10px;color:#91a1aa;margin-top:2px;font-weight:400}.mini-table small.source-warning{color:#ad682b}.batch-actions{display:flex;justify-content:end;padding:12px 0}.add-material-form{border-top:1px dashed #d5e3e9;padding:15px 0 3px}.form-subtitle{font-size:12px;font-weight:850;margin-bottom:12px}.add-material-grid{display:grid;grid-template-columns:1.2fr 1.2fr .7fr .65fr .9fr;gap:10px;margin-bottom:12px}.batch-delete-actions{display:flex;justify-content:flex-end;border-top:1px solid #eef1f4;margin-top:18px;padding-top:12px}.danger-link{color:#b65f5e;background:transparent;border:0;font-weight:650;font-size:11px}.danger-link:hover{text-decoration:underline}.history-section{margin-bottom:46px}.history-links{display:flex;gap:9px;flex-wrap:wrap;margin-top:15px}.history-item{background:#fff;border:1px solid var(--line);padding:12px 14px;border-radius:9px;color:#36576c;display:flex;gap:14px;font-size:11px;align-items:center}.history-item strong{color:#90a0aa;font-weight:600}.history-item:hover{text-decoration:none;border-color:#8bc8c0}.footer{padding:23px 0 30px;display:flex;justify-content:space-between;font-size:10px;color:#a6b1ba}.prices-panel{margin-top:19px}.prices-panel .panel-header{padding:22px 25px 0}.prices-search{min-width:220px}.prices-scroll{overflow:auto;max-height:66vh}.price-table{width:100%;border-collapse:collapse;table-layout:fixed}.price-table th{background:#f4f7f9;color:#788c9a;text-align:left;font-weight:800;font-size:11px;padding:13px 23px;position:sticky;top:0;z-index:1}.price-table td{border-bottom:1px solid #e9eef1;padding:10px 23px;font-size:12px}.price-table td:first-child{width:60%}.price-table td:nth-child(2){width:70px}.price-table td:nth-child(3){width:200px}.price-table input{max-width:225px;min-height:36px;padding:7px 10px}.price-table tr[hidden]{display:none}.tag{padding:4px 11px;border-radius:100px;font-size:10px;white-space:nowrap;font-weight:700}.tag-warn{background:#fff1dc;color:#ad772f}.tag-ready{background:#e9f7ec;color:#4c8b5d}.login-layout{min-height:100vh;display:grid;place-items:center}.login-card{width:min(100%,450px);background:white;border:1px solid var(--line);border-radius:20px;padding:45px 44px;box-shadow:0 15px 65px rgba(23,55,78,.085)}.login-logo{width:57px;height:57px;font-size:36px;margin:0 auto 22px}.login-card h1{text-align:center;font-size:27px;letter-spacing:-.9px;margin:0 0 3px}.login-card>.muted{text-align:center;font-size:12px;margin:0 0 30px}.stack-form{display:flex;flex-direction:column;gap:17px}.stack-form label{font-weight:750;font-size:12px;display:flex;flex-direction:column;gap:8px}.stack-form input{min-height:46px}.stack-form .btn{margin-top:6px}.login-foot{text-align:center;margin:28px 0 0;color:#9aabb7;font-size:11px}.login-foot code{font-size:10px;color:#657f8c}
@media (max-width:1200px){.container{width:min(calc(100% - 36px),1500px)}.header-inner{gap:25px}.nav{gap:18px}.stats{gap:11px}.stat{padding:17px}.add-material-grid{grid-template-columns:1fr 1fr}.split-section{grid-template-columns:1fr 1fr}}
@media (max-width:780px){.container{width:calc(100% - 28px)}.site-header{height:auto}.header-inner{min-height:73px;flex-wrap:wrap;gap:10px;padding:11px 0}.nav{order:3;width:100%;flex:auto;justify-content:space-between;min-height:35px}.nav a{font-size:12px}.account{margin-left:auto}.account-info{min-width:0}.page-heading{flex-direction:column;align-items:stretch}.page-heading h1{font-size:26px}.heading-actions{width:100%;justify-content:space-between}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.split-section{grid-template-columns:1fr}.stat{min-height:105px}.stat strong{font-size:23px}.report-header,.panel-header{align-items:start}.form-footer{align-items:stretch;flex-direction:column}.form-footer .btn{width:100%}.add-material-grid{grid-template-columns:1fr 1fr}.detail-state{display:none}.batch-panel summary{padding:12px}.footer{gap:12px;flex-direction:column}.prices-panel .panel-header{flex-direction:column}.prices-search{width:100%}}
@media (max-width:480px){.brand{font-size:16px}.brand-symbol{width:34px;height:34px}.account-info{display:none}.stats{gap:9px}.stat{padding:13px 12px;min-height:98px}.stat strong{font-size:22px}.stat strong.stat-money{font-size:18px}.add-panel,.help-panel{padding:20px 17px}.add-form-row{gap:8px}.count-field{width:95px}.batch-index{display:none}.add-material-grid{grid-template-columns:1fr}.login-card{padding:32px 23px}.heading-actions .btn{padding:10px}.date-field{min-width:160px}}
@media print{.site-header,.heading-actions,.add-panel,.help-panel,.batch-details,.history-section,.footer,.form-footer{display:none!important}.container{width:100%}.main{padding:0}.matrix .ingredient-col,.matrix .unit-col{position:static}.matrix{font-size:9px}}

/* Historical suggestions: never presented as confirmed material usage. */
.history-hint {margin: 14px 0 18px; padding: 16px; background: #f4f8fc; border: 1px solid #d4dfe9; border-radius: 8px;}
.history-hint p {font-size: .88rem; margin: 6px 0 12px;}
.history-hint-items {display: grid; gap: 7px;}
.history-hint-row {display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #dce4eb; padding-top:7px; font-size:.88rem;}
.history-hint-row .btn {white-space:nowrap; flex-shrink:0;}
.batch-display-form {display:flex; align-items:end; gap:10px; margin-bottom:18px; flex-wrap:wrap;}
.batch-display-form .field {flex:1; min-width:250px;}
@media(max-width:700px){.history-hint-row{align-items:start;flex-direction:column}}

.history-hint-buttons{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;}

/* Full editable workbook grid: original 4 fixed columns + every batch. */
.excel-scroll { max-height: 69vh; overflow: auto; border: 1px solid #cad5de; border-radius: 8px; margin: 10px 0; }
.excel-matrix { border-collapse: separate; border-spacing: 0; min-width: max-content; width: max-content; font-size: 12px; color: #23384d; }
.excel-matrix th, .excel-matrix td { box-sizing: border-box; border-right: 1px solid #d5dfe7; border-bottom: 1px solid #d5dfe7; padding: 2px; text-align: center; background: #fff; }
.excel-matrix thead th { position: sticky; top: 0; z-index: 4; background: #e6ecf0; height: 51px; }
.excel-matrix thead tr.excel-lot-row th { top: 51px; height: 36px; background: #eef3f7; }
.excel-matrix input { width: 100%; min-width: 0; padding: 6px 3px; line-height: 1.32; border: 1px solid transparent; outline-offset: -1px; text-align: center; border-radius: 3px; background: transparent; font: inherit; color: inherit; }
.excel-matrix input:focus { border: 1px solid #3084bc; outline: 1px solid #3084bc; background: #fffaf0; }
.excel-matrix input:not([readonly]):hover { border-color: #c6d7e4; }
.excel-matrix thead input { font-weight: 700; color: #2d5266; white-space: normal; }
.excel-matrix .excel-label, .excel-matrix .excel-row-name { width: 270px; min-width: 270px; max-width: 270px; }
.excel-matrix .excel-row-name { text-align: left; }
.excel-matrix .excel-row-name > input { width: 100%; text-align: left; font-weight: 600; }
.excel-matrix .sticky-name { position: sticky; left: 0; z-index: 3; background: #f3f6f8; }
.excel-matrix thead .sticky-name { z-index: 7; background: #e6ecf0; }
.excel-matrix .sticky-stock { position: sticky; background: #fafafa; z-index: 2; width: 97px; min-width: 97px; max-width: 97px; }
.excel-matrix thead .sticky-stock { z-index: 6; background: #e6ecf0; }
.excel-matrix .stock-balance { left: 270px; }
.excel-matrix .stock-incoming { left: 367px; }
.excel-matrix .stock-issued { left: 464px; box-shadow: 2px 0 3px #0001; }
.excel-matrix .excel-value, .excel-matrix .excel-batch-title { width: 113px; min-width: 113px; max-width: 113px; }
.excel-matrix .missing { background: #fff1df; }
.excel-matrix .excel-output-row td, .excel-matrix .excel-output-row th { background: #e8f2f4; font-weight: 700; }
.excel-matrix .excel-packaging-row th { background: #f2f6f7; }
.excel-matrix .excel-rework-row th { background: #eef2f6; }
.excel-row-tools { display: flex; gap: 3px; align-items: center; margin-top: 1px; color: #667d8b; font-size: 10px; }
.excel-row-tools label { display: flex; gap: 2px; align-items: center; }
.excel-row-tools select { border: 1px solid #e3eaf0; border-radius: 3px; background: white; color: #607889; font: inherit; font-size: 10px; }
.excel-row-tools button { border: 1px solid #e3eaf0; border-radius: 3px; background: #f4f7fa; color: #607889; font: inherit; cursor: pointer; padding: 0 5px; }
.excel-row-tools button:hover { background: #e2e9ee; }
.excel-help { padding: 5px 0; font-size: 12px; }
.excel-add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 12px 22px 0; }
.excel-add-row label { display: flex; flex-direction: column; font-size: 12px; gap: 3px; }
.excel-add-row input { min-width: 300px; padding: 8px; border: 1px solid #bacddc; border-radius: 6px; }
.excel-add-row select { padding: 8px; border: 1px solid #bacddc; border-radius: 6px; }
.excel-explain { margin: 16px 22px 22px; font-size: 12px; line-height: 1.6; }
@media (max-width: 780px) {
  .excel-add-row { padding: 12px 16px 0; }
  .excel-explain { margin: 14px 16px 18px; }
}
@media(max-width: 730px) {
  .excel-matrix .excel-label,.excel-matrix .excel-row-name {width:180px;min-width:180px;max-width:180px;}
  .excel-matrix .stock-balance {left:180px;}
  .excel-matrix .stock-incoming {left:277px;}
  .excel-matrix .stock-issued {left:374px;}
}
.excel-matrix textarea { display: block; width: 100%; box-sizing: border-box; border: 1px solid transparent; padding: 3px; resize: vertical; background: transparent; color: inherit; font: inherit; line-height: 1.18; white-space: pre-wrap; overflow-wrap: anywhere; }
.excel-matrix textarea:not([readonly]):hover { border-color: #b9cad8; }
.excel-matrix textarea:focus { background: #fffaf0; border-color: #3084bc; outline: 1px solid #3084bc; }
.excel-matrix thead th { height: 75px; }
.excel-matrix thead tr.excel-lot-row th { top: 75px; }
.excel-matrix thead textarea { min-height: 45px; text-align: center; font-weight: 700; }
.excel-matrix thead .sticky-name textarea { text-align: left; }
.excel-matrix .excel-row-name > textarea { text-align: left; font-weight: 600; min-height: 30px; }

/* Recipe authoring for both roles; readable even with many imported materials. */
.recipe-create-panel { margin: 16px 0 22px; }
.recipe-create-panel .panel-header, .recipe-edit-panel .panel-header { padding: 20px 24px 4px; }
.recipe-create-form { display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:12px 24px 22px; }
.recipe-create-form > .field { min-width: 130px; }
.recipe-create-form > .field.grow { flex: 1;min-width: 260px; }
.recipe-create-form > .btn { min-height: 42px; }
.recipe-main-form .recipe-name-field { margin: 12px 24px 20px;max-width: 620px; }
.recipe-edit-table { table-layout: auto;min-width: 990px; }
.recipe-edit-table th,.recipe-edit-table td { padding: 10px; }
.recipe-edit-table input { width: 100%;max-width:none; }
.recipe-edit-table select { font:inherit;min-height:36px; padding: 5px;border:1px solid #d9e3e9;border-radius:7px;background:white; }
.recipe-edit-table small { display:block;font-size:10px;margin-top:5px; }
.recipe-edit-table th:first-child,.recipe-edit-table td:first-child { width:30%; }
.recipe-edit-table th:nth-child(2),.recipe-edit-table td:nth-child(2) { width:6%; }
.recipe-edit-table th:nth-child(3),.recipe-edit-table td:nth-child(3) { width:14%; }
.recipe-edit-table th:nth-child(4),.recipe-edit-table td:nth-child(4) { width:39%; }
.recipe-edit-table th:nth-child(5),.recipe-edit-table td:nth-child(5) { width:11%; }
.recipe-edit-table .danger-link { padding:8px; }
@media(max-width:780px){.recipe-create-form {flex-direction:column;align-items:stretch}.recipe-create-form .field,.recipe-create-form .btn{width:100%}}

/* Worksheet layout: an empty report should not be an unbounded list of controls. */
.excel-empty-state { margin: 16px 20px; padding: 24px 26px; border: 1px dashed #b4ccd5; border-radius: 11px; background: #f7fbfc; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.excel-empty-state strong { display: block; margin-bottom: 8px; font-size: 17px; color: #24475a; }
.excel-empty-state p { margin: 0; color: #718b99; line-height: 1.55; max-width: 700px; }
.excel-empty-state .btn { white-space: nowrap; flex-shrink: 0; }
.excel-empty-advanced { margin: 0 20px 20px; border-top: 1px solid #dde7ed; }
.excel-empty-advanced > summary { padding: 13px 0; cursor: pointer; font-weight: 700; color: #2b6275; }
.excel-empty-advanced > p { margin: 4px 0 12px; }
.excel-matrix.excel-matrix-empty { width: 100%; min-width: 730px; table-layout: fixed; }
/* On a narrow screen, freezing all four columns would hide every batch value. */
@media (max-width: 850px) {
  .excel-matrix .excel-label, .excel-matrix .excel-row-name { width: 175px; min-width: 175px; max-width: 175px; }
  .excel-matrix tbody .sticky-stock { position: static; }
  .excel-matrix thead .sticky-stock { position: sticky; left: auto; top: 0; }
  .excel-matrix .stock-balance, .excel-matrix .stock-incoming, .excel-matrix .stock-issued { left: auto; }
  .excel-matrix .sticky-name { left: 0; }
  .excel-empty-state { margin: 12px; padding: 18px; flex-direction: column; align-items: stretch; }
  .excel-empty-state .btn { align-self: flex-start; }
  .excel-empty-advanced { margin: 0 12px 14px; }
}

/* Worksheet row-number editor and compact move controls. */
.excel-row-tools { flex-wrap: wrap; row-gap: 3px; }
.excel-row-tools .excel-order-label { gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.excel-row-tools .excel-order-position { width: 41px; max-width: 41px; min-width: 0; min-height: 20px; height: 20px; padding: 0 2px; text-align: center; font-weight: 700; font-size: 11px; border: 1px solid #c3d7df; border-radius: 4px; background: #fff; }
.excel-row-tools .excel-order-position:focus { outline: 2px solid #68b0ab; outline-offset: 1px; }
.excel-row-tools .excel-order-position::-webkit-inner-spin-button { opacity: .55; }
.excel-row-tools button[data-row-shift] { font-size: 12px; min-width: 22px; min-height: 20px; }
.excel-row-tools button:disabled { opacity: .33; cursor: default; }
.excel-order-status { font-size: 11px; margin: 0 2px 7px; color: #377a72; min-height: 0; }
.excel-order-status[data-state="error"] { color: #ae423a; font-weight: 750; }
.excel-order-status[data-state="pending"] { color: #7d7b4e; }

/* One-click access to per-batch deletion without expanding the card. */
.batch-quick-delete { flex: 0 0 auto; border: 1px solid #edd0cd; background: #fff6f5; color: #a7463e; border-radius: 7px; padding: 6px 11px; min-height: 30px; font-size: 11px; line-height: 1.3; font-weight: 750; white-space: nowrap; }
.batch-quick-delete:hover { background: #fde8e5; border-color: #d9928d; }
.batch-quick-delete:focus-visible { outline: 2px solid #c35c55; outline-offset: 2px; }
@media (max-width: 480px) { .batch-panel summary { gap: 8px; } .batch-quick-delete { padding: 6px 8px; } }

/* Confirmation dialog */
.action-confirm-dialog { width:min(460px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; border:1px solid #d5e0e6; border-radius:15px; background:white; color:var(--ink); box-shadow:0 22px 68px rgba(15,38,55,.28); }
.action-confirm-dialog::backdrop { background:rgba(14,31,44,.52); }
.action-confirm-body { padding:24px 25px; }
.action-confirm-body h2 { margin:0 0 11px; font-size:18px; line-height:1.3; }
.action-confirm-body p { margin:0 0 24px; color:#50677a; line-height:1.55; overflow-wrap:anywhere; }
.action-confirm-controls { display:flex; gap:12px; justify-content:flex-end; }
.action-confirm-controls .btn { min-width:112px; }
.btn-danger { color:white; background:#b8413c; border-color:#b8413c; }
.btn-danger:hover { background:#a53430; }
.btn-danger:disabled { opacity:.5; }
@media (max-width:420px) { .action-confirm-body { padding:19px; } .action-confirm-controls .btn { flex:1; min-width:0; } }

/* Reconciliation columns from the historical right-hand Excel block. */
.excel-summary-actions { display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:4px 8px 11px; }
.excel-summary-actions .btn { min-height:33px;padding:5px 11px;font-size:11px; }
.excel-summary-actions small {flex:1;min-width:210px;}
.excel-matrix .excel-total-column { width:116px;min-width:116px;max-width:116px; background:#f0f7f8; border-left:1px solid #bcd4d9; }
.excel-matrix thead .excel-total-column { background:#d8e9ec; }
.excel-matrix .excel-total-label { font-size:9px;line-height:1.25;color:#66818b; }
.excel-summary-cell {display:flex;align-items:center;gap:2px; }
.excel-summary-cell [data-summary-field] { font-size:11px; text-align:right;padding-right:2px;font-weight:700; }
.excel-summary-cell .excel-restore-total { flex:0 0 19px;font-weight:700;padding:0;min-height:22px;background:#eef5f6;border:1px solid #d1e3e6;border-radius:4px;color:#34817d; }
.excel-summary-cell .excel-restore-total:hover {background:#cfe8e5;}
.excel-matrix .excel-manual-total { background:#fff1de!important; }
.excel-matrix .excel-needs-attention { background:#fff9ed!important; }
.excel-warning-dot {position:absolute;display:block;color:#ab651d;right:1px;bottom:0;font-weight:900;font-size:10px;}
.excel-matrix td.excel-total-column {position:relative;}
.excel-warning-dot[hidden] {display:none!important;}

/* Keep server validation errors below Save instead of navigating to JSON. */
.excel-save-status { flex-basis:100%; display:block; padding:8px 12px; border-radius:7px; background:#edf8f5; color:#186b5d; font-size:12px; }
.excel-save-status[hidden] { display:none!important; }
.excel-save-status.is-error { color:#9e342e; background:#fff0ed; }


/* Undo button and Excel-like controls for material rows / batch numbers. */
.excel-undo-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px;
  padding: 10px 14px; margin: 0 14px 10px;
  border: 1px solid #d7e5e9; border-radius: 9px; background: #f8fcfc;
}
.excel-undo-toolbar .btn { font-size: 12px; min-height: 34px; white-space: nowrap; }
.excel-undo-toolbar .btn:disabled { opacity: .5; cursor: default; }
.excel-undo-toolbar [data-undo-hint] { flex: 1; font-size: 11px; }
.excel-undo-status { flex-basis: 100%; color: #25645d; font-size: 11px; }
.excel-undo-status:empty { display: none; }
.excel-row-tools .excel-add-below {
  min-width: 22px; height: 22px; padding: 0 4px;
  background: #e9f7f4; border: 1px solid #9dcfc6;
  color: #17786d; font-size: 15px; line-height: 18px;
  font-weight: 800; border-radius: 4px;
}
.excel-row-tools .excel-add-below:hover { background: #d5efe9; }
.excel-lot-cell .excel-lot-editor { position: relative; display: flex; width: 100%; min-width: 0; }
.excel-lot-cell .excel-lot-editor input {
  min-width: 0; width: 100%; padding-right: 24px; padding-bottom: 7px;
  font-variant-numeric: tabular-nums;
}
.excel-lot-cell .excel-fill-right {
  position: absolute; right: 2px; top: 2px;
  height: 20px; min-width: 20px; border: 0; border-radius: 4px;
  background: #e1f0ed; color: #28796f; font-size: 13px; line-height: 1;
  opacity: .58; padding: 0 3px;
}
.excel-lot-cell:hover .excel-fill-right,
.excel-lot-cell .excel-fill-right:focus-visible { opacity: 1; }
.excel-fill-handle {
  position: absolute; bottom: 0; right: 0;
  width: 11px; height: 11px; z-index: 2;
  border: 1px solid #fff; border-radius: 2px;
  background: #15857b; cursor: crosshair; touch-action: none;
}
.excel-fill-handle:hover, .excel-fill-handle:focus-visible {
  outline: 2px solid #0c6d64; outline-offset: 1px;
}
.excel-lot-cell.excel-fill-target { background: #d9f1e9!important; }
.excel-lot-cell.excel-fill-target input { outline: 1px solid #2b9d86; }
@media (max-width: 700px) {
  .excel-undo-toolbar { margin: 0 10px 10px; padding: 9px; gap: 6px; }
  .excel-undo-toolbar [data-undo-hint] { flex-basis: 100%; }
  .excel-lot-cell .excel-fill-right { opacity: 1; }
}

/* Spreadsheet range selection / paste / autofill without modifying the worksheet layout. */
.excel-range-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:9px 12px 12px; padding:9px 12px; border:1px solid #d5e8e8; border-radius:9px; background:#f6fbfa; }
.excel-range-toolbar strong { color:#305d61; font-size:11px; margin-right:4px; }
.excel-range-toolbar button { border:1px solid #b9d8d4; background:#fff; color:#287b74; min-height:29px; border-radius:6px; padding:4px 9px; font-size:11px; font-weight:750; white-space:nowrap; }
.excel-range-toolbar button:hover:not(:disabled) { background:#e4f5f1; }
.excel-range-toolbar button:disabled { opacity:.43; cursor:not-allowed; }
.excel-range-toolbar [data-grid-status] { font-size:11px; color:#587982; flex:1 1 270px; line-height:1.4; }
.excel-matrix tbody td:not(.sticky-stock) { position:relative; }
.excel-matrix tbody td.excel-grid-selected { background:#e5f7ef!important; box-shadow:inset 0 0 0 2px #289980; }
.excel-matrix tbody td.excel-grid-preview { background:#daf6ed!important; box-shadow:inset 0 0 0 2px #63beab; }
.excel-matrix tbody td.excel-grid-selected input,.excel-matrix tbody td.excel-grid-preview input { background:transparent; }
.excel-grid-fill-handle { position:absolute; right:1px; bottom:1px; height:12px; width:12px; min-height:0; padding:0; border:1px solid #fff; border-radius:2px; background:#0f8b77; z-index:3; cursor:crosshair; touch-action:none; }
.excel-grid-fill-handle:hover,.excel-grid-fill-handle:focus-visible { outline:2px solid #166f64; outline-offset:1px; }
@media(max-width:780px) { .excel-range-toolbar { margin:8px; padding:8px; gap:6px; } .excel-range-toolbar [data-grid-status] { flex-basis:100%; } }

/* Distinguish navigation mode (green selection) from text-editing mode. */
.excel-matrix tbody td.excel-grid-editing { background:#fff5d9!important; box-shadow:inset 0 0 0 2px #d19a44!important; }
.excel-matrix tbody td.excel-grid-editing input { background:transparent!important; caret-color:#243f59; }
.excel-range-toolbar .excel-grid-keyboard-hint { flex-basis:100%; color:#66828c; font-size:11px; line-height:1.45; }

/* Selection cells receive the keyboard focus; the green selection border is the focus indicator. */
.excel-matrix tbody td[tabindex="0"]:focus { outline: none; }

/* Explicit production-date scope and safe correction of wrongly dated batches. */
.day-scope-bar { display:flex; align-items:center; flex-wrap:wrap; gap:13px; justify-content:space-between; background:#eff8f6; border:1px solid #cbe4df; border-radius:10px; margin:0 0 18px; padding:12px 17px; }
.day-scope-bar>div:first-child { display:flex; flex-direction:column; gap:2px; }
.day-scope-bar strong { color:#166c63; font-size:13px; }
.day-scope-bar span { font-size:11px; color:#537b77; }
.day-scope-links { display:flex; flex-wrap:wrap; gap:6px; }
.day-scope-links a { font-size:10.5px; padding:5px 9px; background:white; color:#315b66; border:1px solid #c7dcdf; border-radius:7px; text-decoration:none; white-space:nowrap; }
.day-scope-links a.current { background:#167e73; color:white; border-color:#167e73; }
.day-scope-links a b { font-weight:750; opacity:.8; margin-left:4px; }
.day-batch-move { background:#f8fcfc; border:1px solid #d4e3e6; border-radius:12px; padding:14px 18px; margin:12px 0 16px; display:flex; flex-wrap:wrap; align-items:end; gap:13px; }
.day-batch-move-label { display:flex; flex-direction:column; gap:3px; flex:1 1 260px; }
.day-batch-move-label strong { font-size:12px; color:#244c59; }
.day-batch-move-label span, .day-batch-move-label small { font-size:11px; line-height:1.45; color:#6b8392; }
.day-batch-move-label .day-batch-move-warning { color:#9c7234; }
.day-batch-move .field input { width:170px; min-height:37px; padding:7px 9px; }
.day-batch-select-all { font-size:11px; white-space:nowrap; cursor:pointer; display:flex; align-items:center; gap:7px; padding-bottom:10px; }
.day-batch-move .btn { min-height:37px; font-size:11px; padding:8px 12px; }
.day-batch-move .btn-danger { background:#fff1ef; border-color:#eac0ba; color:#a4453b; }
.day-batch-move .btn-danger:hover { background:#ffe6e1; border-color:#d99d96; }
.day-batch-move .btn-danger:focus-visible { outline:2px solid #b45449; outline-offset:2px; }
.day-batch-move-status { font-size:11px; flex-basis:100%; color:#a4453b; }
.day-batch-move-status:empty { display:none; }
.batch-move-checkbox { width:18px; height:18px; flex:0 0 18px; accent-color:#13877a; cursor:pointer; }
.batch-panel summary .batch-move-checkbox:focus-visible { outline:2px solid #13877a; outline-offset:2px; }
@media(max-width:780px) {
  .day-scope-bar { padding:11px; }
  .day-batch-move { padding:11px; gap:9px; }
  .day-batch-move-label { flex-basis:100%; }
  .day-batch-move .field input { width:100%; }
  .day-batch-move .btn { width:100%; }
}

/* Clone a completed workshop batch instead of re-entering identical figures. */
.batch-copy-form { display:flex; gap:9px; flex-wrap:wrap; align-items:end; padding:12px; margin:12px 0; border:1px solid #cfe6e0; background:#f3fbf8; border-radius:9px; }
.batch-copy-form .field { max-width:145px; }
.batch-copy-form input[type=number] { width:95px; min-height:36px; }
.batch-copy-form small { flex:1 1 270px; font-size:11px; line-height:1.45; color:#597b78; }
.batch-copy-status { font-size:11px; color:#ac413d; flex-basis:100%; }
.batch-copy-status:empty { display:none; }
@media(max-width:700px) { .batch-copy-form .btn { width:100%; } }

/* Reversible one-day duplicate materials review */
.duplicate-review { padding:17px; margin:14px 0; }
.duplicate-list { display:grid; gap:7px; margin:11px 0; }
.duplicate-item { display:flex; align-items:flex-start; gap:9px; padding:9px; border:1px solid #d5e6e3; border-radius:7px; }
.duplicate-item input { width:17px; height:17px; flex-shrink:0; accent-color:#13877a; }
.duplicate-item span { font-size:12px; line-height:1.45; }
.duplicate-item small { display:block; font-size:11px; color:#638087; margin-top:3px; }
.duplicate-item:has(input:disabled) { background:#fff5e5; }

/* Rename printed titles without a nested worksheet form or browser-only state. */
.print-group-rename { margin:14px 0; padding:16px; }
.print-group-rename-form { display:flex; gap:10px; align-items:end; flex-wrap:wrap; }
.print-group-rename-form .field { min-width:185px; flex:1 1 220px; }
.print-group-rename-form input,.print-group-rename-form select { min-height:36px; }
.print-group-rename-form small { flex:1 1 100%; font-size:11px; }
@media (max-width:700px) {.print-group-rename-form .btn { width:100%; }}

/* Both workers and accountants can rotate their own account passwords. */
.account-password-link {font-size:11px; color:inherit; white-space:nowrap; text-decoration:underline; text-underline-offset:3px;}
.account-password-link:focus-visible {outline:2px solid #168f81; outline-offset:3px;}
.account-password-panel {padding:18px; max-width:520px; margin:24px auto;}
.account-password-panel .stack-form {max-width:460px;}
.account-password-controls {display:flex; gap:10px; flex-wrap:wrap; align-items:center;}

/* VarJour icon is served as a local static SVG in the header and login screen. */
.brand-symbol img,.login-logo img{display:block;width:40px;height:40px;border-radius:13px}
