:root{
--ink:#19352e;
--muted:#63736c;
--paper:#f5f6f1;
--white:#fff;
--line:#dfe5dc;
--green:#28694d;
--accent:#e6eeaa;
--yellow:#956510;
--red:#b64633;
--wine:#802b45;
font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
color:var(--ink);
background:var(--paper);
font-size:16px;
line-height:1.5;
font-synthesis:none}
*{
box-sizing:border-box}
body{
margin:0}
a{
color:var(--green);
text-underline-offset:3px}
button,input,select,textarea{
font:inherit}
button,a,input,select,textarea{
touch-action:manipulation}
button,.button{
cursor:pointer;
min-height:44px;
border-radius:10px;
padding:10px 17px;
border:1px solid transparent;
display:inline-flex;
align-items:center;
justify-content:center;
gap:8px;
font-weight:650;
text-decoration:none}
button:disabled{
opacity:.6;
cursor:wait}
.primary{
background:var(--ink);
color:white}
.secondary{
background:white;
border-color:var(--line);
color:var(--ink)}
.danger{
background:var(--wine);
color:white}
.text-button{
background:none;
padding:4px 8px;
color:var(--green);
font-weight:500}
button:hover,.button:hover{
filter:brightness(.96)}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{
outline:3px solid #5281ad;
outline-offset:3px}
.top{
display:flex;
align-items:center;
gap:24px;
padding:18px 4vw;
background:white;
border-bottom:1px solid var(--line)}
.brand{
text-decoration:none;
color:var(--ink);
font-size:34px;
letter-spacing:-1.8px;
font-weight:800;
line-height:1}
.brand span{
display:block;
font-size:10px;
font-weight:500;
letter-spacing:1.2px;
text-transform:uppercase;
margin-top:8px}
.test{
font-size:12px;
font-weight:700;
color:#9a2e38;
background:#fff0f1;
border-radius:6px;
padding:5px 9px}
.account{
margin-left:auto;
display:flex;
gap:20px;
align-items:center;
font-size:14px}
.nav{
display:flex;
gap:24px;
border-bottom:1px solid var(--line);
padding:0 4vw;
background:#fff}
.nav a{
padding:16px 4px;
color:var(--muted);
text-decoration:none;
border-bottom:3px solid transparent;
font-size:14px;
font-weight:650}
.nav a[aria-current]{
color:var(--ink);
border-color:var(--green)}
main{
max-width:1450px;
padding:36px 4vw 60px;
margin:auto}
footer{
padding:22px 4vw;
color:var(--muted);
font-size:12px;
border-top:1px solid var(--line)}
h1,h2,h3,p{
margin-top:0}
h1{
font-size:clamp(26px,3vw,38px);
letter-spacing:-1.1px;
line-height:1.2;
margin-bottom:12px;
max-width:1000px}
h2{
font-size:21px;
letter-spacing:-.4px}
h3{
font-size:17px}
p{
margin-bottom:14px}
.eyebrow{
text-transform:uppercase;
font-size:11px;
letter-spacing:1.7px;
font-weight:750;
color:var(--muted);
margin-bottom:12px}
.muted,.help{
color:var(--muted)}
.help{
font-size:13px;
margin:10px 0}
.lead{
font-size:19px;
max-width:650px}
.page-head{
display:flex;
align-items:center;
justify-content:space-between;
gap:20px;
margin-bottom:24px}
.page-head p:last-child{
margin-bottom:0}
.stats{
display:grid;
grid-template-columns:repeat(4,1fr);
background:white;
border:1px solid var(--line);
border-radius:14px;
overflow:hidden;
margin-bottom:22px}
.stats>div{
padding:19px 24px;
border-right:1px solid var(--line)}
.stats>div:last-child{
border:0}
.stats strong{
display:block;
font-size:31px;
line-height:1.2;
letter-spacing:-.8px}
.stats span{
display:block;
color:var(--muted);
font-size:13px;
margin-top:5px}
.stats .warn-stat strong{
color:var(--yellow)}
.stats small{
font-size:20px;
color:var(--muted)}
.notice{
background:#fff6df;
border:1px solid #eedcb0;
padding:15px 19px;
border-radius:10px;
font-size:14px;
color:#72521d;
margin-bottom:24px}
.notice.success{
background:#edf7ed;
border-color:#c8e3cd;
color:#245b3d}
.panel-toolbar{
display:flex;
justify-content:space-between;
align-items:end;
gap:20px;
margin:30px 0 20px}
.panel-toolbar h2{
margin:0}
.search{
margin:0!important;
min-width:270px;
font-size:12px}
.search input{
margin-top:4px}
.machine{
background:#e9eee6;
border:1px solid #dbe2d6;
border-radius:18px;
padding:14px}
.machine-row{
padding:5px 0 15px}
.machine-row:last-child{
padding-bottom:0}
.row-label{
font-size:11px;
letter-spacing:1.2px;
text-transform:uppercase;
font-weight:700;
color:var(--muted);
padding:1px 6px 8px}
.spirals{
display:grid;
grid-auto-columns:145px;
grid-auto-flow:column;
gap:10px;
overflow-x:auto;
padding-bottom:6px;
scrollbar-width:thin;
scroll-snap-type:x proximity}
.cell{
min-width:0;
scroll-snap-align:start;
background:white;
display:flex;
flex-direction:column;
border-radius:11px;
padding:12px 12px 10px;
text-decoration:none;
color:var(--ink);
border:1px solid #dde4d8;
position:relative;
transition:box-shadow .15s,transform .15s;
--status:#91a197}
.cell:hover{
transform:translateY(-2px);
box-shadow:0 6px 20px #173f3612}
.cell.full{
--status:#48835c}
.cell.medium{
--status:#c59a32}
.cell.low{
--status:#ca6654}
.cell.empty{
--status:#8b3752}
.cell-top{
display:flex;
align-items:center;
justify-content:space-between}
.slot-number{
font-size:15px;
font-weight:750;
letter-spacing:.5px}
.status-dot{
width:7px;
height:7px;
border-radius:50%;
background:var(--status)}
.cell-photo{
height:110px;
display:flex;
align-items:center;
justify-content:center;
margin:5px 0 8px}
.cell-photo img{
width:100%;
height:100%;
object-fit:contain;
mix-blend-mode:multiply}
.no-photo{
color:var(--muted);
font-size:12px;
text-align:center;
padding:14px}
.cell-name{
font-size:12px;
line-height:1.4;
min-height:34px;
margin-bottom:auto;
overflow-wrap:anywhere}
.cell-quantity{
display:flex;
align-items:baseline;
gap:6px;
margin:12px 0 5px;
flex-wrap:wrap}
.cell-quantity strong{
font-size:24px;
line-height:1}
.cell-quantity span{
font-size:11px;
color:var(--muted)}
progress{
width:100%;
height:5px;
border:0;
border-radius:3px;
overflow:hidden;
appearance:none;
background:#edf0e9;
margin:4px 0 7px}
progress::-webkit-progress-bar{
background:#edf0e9}
progress::-webkit-progress-value{
background:var(--status)}
progress::-moz-progress-bar{
background:var(--status)}
.cell-status{
font-size:10px;
color:var(--muted);
margin:0}
.cell.free{
background:#f4f7f0;
border-style:dashed;
justify-content:space-between}
.back{
display:inline-block;
margin-bottom:25px;
font-size:14px;
text-decoration:none}
.badge{
display:inline-block;
border-radius:7px;
background:#e8ede4;
color:#54624e;
padding:6px 11px;
font-size:12px;
white-space:nowrap;
font-weight:600}
.badge.full{
background:#e4f0e5;
color:#28643d}
.badge.unknown{
background:#fff2d6;
color:#8b6421}
.badge.low,.badge.empty{
background:#fae4e3;
color:#a33a45}
.cell-detail{
display:grid;
grid-template-columns:minmax(260px,.8fr) 1.2fr;
gap:46px;
align-items:center;
padding:28px;
background:white;
border:1px solid var(--line);
border-radius:16px;
margin-bottom:35px}
.photo-wrap{
display:flex;
align-items:center;
justify-content:center;
min-height:100px;
background:#fff;
border-radius:12px;
overflow:hidden}
.photo-button{
display:block;
padding:0;
background:transparent;
width:100%;
height:100%;
border:none}
.photo-wrap img{
display:block;
width:100%;
height:160px;
object-fit:contain}
.hero-photo{
height:330px;
padding:10px}
.hero-photo img{
height:100%;
max-height:310px}
.hero-photo .photo-button{
height:100%}
.compact{
grid-template-columns:1fr 1fr;
max-width:500px;
margin-top:24px}
.compact>div{
padding:15px 18px}
.section{
margin-top:32px}
.operations{
margin:30px 0}
.operation-grid{
display:grid;
align-items:start;
grid-template-columns:1fr 1fr;
gap:12px}
details{
background:white;
border:1px solid var(--line);
border-radius:12px;
padding:17px 20px}
summary{
cursor:pointer;
font-weight:650;
min-height:30px;
list-style-position:inside}
summary span{
display:block;
font-size:12px;
color:var(--muted);
font-weight:400;
padding-left:20px;
margin-top:5px}
details[open]>summary{
padding-bottom:18px;
border-bottom:1px solid var(--line);
margin-bottom:20px}
label{
display:block;
font-size:13px;
font-weight:600;
margin:15px 0}
input,textarea,select{
display:block;
width:100%;
border:1px solid #c9d3c5;
border-radius:8px;
background:white;
padding:10px 12px;
color:var(--ink);
min-height:44px;
margin-top:7px;
max-width:100%}
textarea{
min-height:85px;
resize:vertical}
label .help{
display:block;
font-weight:400;
margin-bottom:0}
fieldset{
border:1px solid var(--line);
border-radius:10px;
margin:15px 0;
padding:15px}
legend{
font-size:14px;
font-weight:600;
padding:0 7px}
.form-grid{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:0 20px}
.assortment-form{
background:white;
border:1px solid var(--line);
border-radius:14px;
padding:24px}
.command-form>label,.draft-edit>label{
max-width:700px}
.form-message:empty{
display:none}
.form-message{
padding:12px;
border-radius:8px;
background:#eef3e8;
color:#385e34;
font-size:14px}
.form-message.error{
background:#fcedeb;
color:#963b35}
.actions{
display:flex;
align-items:center;
gap:12px;
flex-wrap:wrap}
.history-row{
display:flex;
align-items:center;
justify-content:space-between;
gap:20px;
padding:17px 0;
border-bottom:1px solid var(--line);
text-decoration:none;
color:var(--ink);
font-size:14px}
.history-row div span{
display:block;
color:var(--muted);
font-size:12px;
margin-top:4px}
.history-row time{
font-size:12px;
white-space:nowrap;
color:var(--muted)}
.catalog{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
gap:16px}
.product-card{
background:white;
border:1px solid var(--line);
border-radius:14px;
padding:20px;
display:flex;
flex-direction:column;
gap:10px}
.product-card h2{
font-size:15px;
margin-bottom:0}
.product-card>a{
text-decoration:none}
.product-card .badge{
align-self:start}
.product-card p{
margin-bottom:0;
font-size:12px}
.product-card .photo-wrap{
height:175px;
margin-bottom:10px}
.product-card>a:last-child{
margin-top:auto;
padding-top:10px;
font-size:13px}
.product-list{
display:grid;
grid-template-columns:1fr 1fr;
gap:16px}
.warehouse-item{
display:grid;
grid-template-columns:100px 1fr;
gap:20px;
background:white;
border:1px solid var(--line);
padding:20px;
border-radius:14px}
.warehouse-item .photo-wrap{
align-self:start}
.warehouse-item img{
height:120px}
.warehouse-item h2{
font-size:16px;
margin-bottom:7px}
.warehouse-item a{
text-decoration:none}
.warehouse-item p{
font-size:12px}
.warehouse-item details{
margin-top:14px;
background:var(--paper);
padding:12px}
.big-quantity{
font-size:26px}
.withdraw-line{
display:grid;
grid-template-columns:1fr 1fr 1fr;
align-items:center;
gap:15px;
border-bottom:1px solid var(--line);
padding:8px 0}
.draft-line{
padding:20px;
background:white;
border:1px solid var(--line);
border-radius:12px;
margin-bottom:12px}
.draft-line>strong{
display:block;
margin-bottom:8px}
.draft-line p{
font-size:14px;
margin-bottom:6px}
.selected-product{
display:flex;
align-items:center;
gap:20px;
max-width:700px;
background:var(--paper);
padding:15px;
border-radius:10px}
.selected-product .photo-wrap{
width:140px;
flex-shrink:0}
.selected-product p{
font-weight:650;
font-size:16px}
.empty-state{
max-width:700px;
padding:70px 0}
.login{
padding:65px 0 80px;
max-width:800px}
.login h1{
font-size:clamp(38px,6vw,70px);
letter-spacing:-2px}
.login .lead{
margin:25px 0}
.login .button{
margin:12px 0}
dialog{
width:95vw;
height:94dvh;
max-width:1300px;
max-height:96dvh;
border:0;
border-radius:16px;
padding:20px;
color:var(--ink)}
dialog::backdrop{
background:#142c25c9}
.photo-toolbar{
display:flex;
justify-content:space-between;
align-items:center;
gap:15px}
.photo-toolbar p{
font-weight:650;
margin:0}
.photo-toolbar button{
flex-shrink:0}
.zoom-area{
overflow:auto;
height:calc(100% - 120px);
display:block;
touch-action:pan-x pan-y pinch-zoom}
#large-photo{
display:block;
object-fit:contain;
max-width:none;
height:100%;
width:100%}
.zoom-area.zoom-15 #large-photo{
width:150%;
height:150%}
.zoom-area.zoom-20 #large-photo{
width:200%;
height:200%}
.zoom-area.zoom-25 #large-photo{
width:250%;
height:250%}
.zoom-area.zoom-30 #large-photo{
width:300%;
height:300%}
.photo-hint{
font-size:12px;
color:var(--muted);
text-align:center;
margin-top:10px}
.photo-hint button{
padding:2px 14px}
.skip{
position:absolute;
top:-100px;
padding:12px;
background:white;
z-index:100}
.skip:focus{
top:0}
[hidden]{
display:none!important}

@media(max-width:900px){
.account>span{
display:none}
.cell-detail{
gap:25px;
grid-template-columns:1fr 1fr}
.hero-photo{
height:280px}
.form-grid{
grid-template-columns:1fr 1fr}
.product-list{
grid-template-columns:1fr}
.spirals{
grid-auto-columns:145px}
.stats>div{
padding:15px}
.top{
gap:15px}
.warehouse-item .photo-wrap{
height:140px}
}

@media(max-width:600px){
main{
padding:25px 16px 45px}
.top{
padding:15px 16px;
gap:12px}
.brand{
font-size:29px}
.brand span{
display:none}
.test{
font-size:10px;
padding:4px 7px}
.account{
gap:0}
.text-button{
font-size:12px;
padding:4px}
.nav{
padding:0 12px;
gap:14px;
justify-content:space-between}
.nav a{
font-size:12px;
padding:13px 0}
.page-head{
align-items:start;
flex-direction:column;
gap:12px}
.page-head>.button{
font-size:12px;
padding:8px 12px;
min-height:40px}
.page-head h1{
font-size:28px}
.stats{
grid-template-columns:1fr 1fr}
.stats>div{
border-bottom:1px solid var(--line);
padding:14px 16px}
.stats>div:nth-child(2){
border-right:0}
.stats>div:nth-child(3){
border-bottom:0}
.stats strong{
font-size:27px}
.stats span{
font-size:11px}
.compact{
grid-template-columns:1fr 1fr;
margin-bottom:14px}
.compact>div{
border-bottom:0}
.notice{
font-size:12px;
padding:12px 14px}
.panel-toolbar{
align-items:stretch;
flex-direction:column;
gap:12px}
.search{
min-width:0}
.machine{
margin:0 -7px;
padding:9px;
border-radius:12px}
.spirals{
grid-auto-columns:140px;
gap:8px}
.cell-detail{
grid-template-columns:1fr;
padding:19px;
gap:20px}
.hero-photo{
height:290px}
.cell-summary h2{
font-size:20px}
.operation-grid,.form-grid{
grid-template-columns:1fr}
.assortment-form{
padding:17px}
.history-row{
align-items:start;
flex-direction:column;
gap:7px}
.history-row time{
white-space:normal}
.catalog{
grid-template-columns:1fr 1fr;
gap:10px}
.product-card{
padding:13px;
gap:8px}
.product-card .photo-wrap{
height:130px}
.product-card img{
height:120px}
.product-card h2{
font-size:13px}
.product-card .badge{
font-size:10px;
padding:5px 6px;
white-space:normal}
.warehouse-item{
grid-template-columns:65px 1fr;
padding:15px;
gap:14px}
.warehouse-item .photo-wrap{
height:100px}
.warehouse-item img{
height:90px}
.withdraw-line{
grid-template-columns:1fr}
.withdraw-line label{
margin:3px 0 8px}
.selected-product{
gap:12px}
.selected-product .photo-wrap{
width:100px}
.selected-product p{
font-size:14px}
.login{
padding-top:35px}
.login h1{
font-size:46px}
.login .lead{
font-size:17px}
.photo-toolbar{
font-size:13px;
align-items:start}
.photo-toolbar button{
font-size:12px}
dialog{
padding:12px;
width:98vw;
height:96dvh}
.photo-hint{
font-size:10px}
footer{
padding:20px 16px}
.draft-controls .actions{
align-items:stretch;
flex-direction:column}
.draft-controls button{
width:100%}
}

@media print{
.top,.nav,footer,.back,.actions,.draft-controls,dialog{
display:none}
body{
background:white}
main{
padding:0;
max-width:none}
.notice{
border-color:#aaa;
background:white;
color:black}
.history-row{
break-inside:avoid}
}

/* Access decisions remain readable on phones and wide workspaces. */
.access-card{background:var(--white);border:1px solid var(--line);border-radius:16px;padding:24px;margin:18px 0;overflow-wrap:anywhere}
.access-card h3{margin-top:0}
.access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.access-grid .access-card{margin:0}
.access-form select{margin-bottom:16px}
.nav{overflow-x:auto}
.nav a{flex-shrink:0;white-space:nowrap}
@media(max-width:700px){.access-grid{grid-template-columns:1fr}.access-card{padding:18px}}

/* Catalog forms retain the same touch targets and document rhythm. */
.catalog-form fieldset{border:0;padding:0;margin:0;min-width:0}
.catalog-form,.photo-form,.revision-card{background:#fff;padding:24px;border:1px solid var(--line);border-radius:14px;margin-top:20px}
.check{display:flex;align-items:center;gap:10px}
.check input{width:20px;min-height:20px;flex-shrink:0;margin:0}
.catalog-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px}
.catalog-facts dt{font-size:13px;color:var(--muted)}
.catalog-facts dd{margin:5px 0 0;overflow-wrap:anywhere}
.revision-card .photo-wrap{max-width:220px}
@media(max-width:650px){.catalog-form,.photo-form,.revision-card{padding:16px}.catalog-facts{grid-template-columns:1fr}}
/* Purchase documents remain usable as stacked cards on a phone. */
.purchase-product{display:grid;grid-template-columns:110px minmax(0,1fr);gap:1rem;align-items:start}
.purchase-product .photo-wrap{width:110px;height:130px;overflow:hidden}
.purchase-product img{max-width:100%;max-height:100%;object-fit:contain}
.purchase-line,.purchase-receipt,.purchase-accepted{min-width:0;margin:1rem 0;padding:1rem;border:1px solid var(--line,#d9e2dc);border-radius:12px}
.purchase-form select,.purchase-form input,.purchase-form textarea{max-width:100%}
.purchase-form .check{display:flex;align-items:center;gap:.6rem}
.purchase-form .check input{width:auto}
.purchase-form .form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:1rem}
.attachment-upload{padding:1rem;background:#f1f5f1;border-radius:12px}
@media(max-width:600px){.purchase-product{grid-template-columns:70px minmax(0,1fr)}.purchase-product .photo-wrap{width:70px;height:100px}.purchase-line,.purchase-receipt,.purchase-accepted{padding:.65rem}}
.cost-form label{display:block;margin:1rem 0}
.cost-form input:not([type=checkbox]),.cost-form select,.cost-form textarea{width:100%;max-width:100%;min-width:0}
.cost-form,.cost-comparison,.revision-card{overflow-wrap:anywhere}
.cost-form [hidden]{display:none!important}
.cost-form .form-grid{grid-template-columns:repeat(auto-fit,minmax(min(250px,100%),1fr))}

.cost-form input[type=checkbox]{display:inline-block;width:1.2rem;height:1.2rem;min-height:1.2rem;padding:0;vertical-align:middle;margin-right:.5rem}
.valuation-save-form{margin:1.2rem 0}
.valuation-review-form input[type=checkbox]{display:inline-block;width:1.2rem;height:1.2rem;min-height:1.2rem;padding:0;vertical-align:middle;margin-right:.5rem}

.integration-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}.integration-grid .draft-line{margin:0}.integration-grid p{margin-bottom:0}@media(max-width:700px){.integration-grid{grid-template-columns:1fr}}

/* Collaborative stocktake */
.stocktake-scope {max-height:28rem;overflow:auto;border:1px solid var(--line,#d5dfda);border-radius:12px;padding:.7rem}
.stocktake-choice {display:flex;align-items:center;gap:.7rem;padding:.6rem;margin:0}
.stocktake-choice input {width:1.1rem;height:1.1rem;flex:none}
.stocktake-choice[hidden] {display:none}
.stocktake-rows {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.stocktake-row {min-width:0;margin:0}
.stocktake-row-head {display:flex;align-items:center;gap:1rem}
.stocktake-row-head h3 {overflow-wrap:anywhere}
.stocktake-photo {width:76px;height:92px;flex:none;padding:.3rem;background:white;border:1px solid #d5dfda}
.stocktake-photo img {width:100%;height:100%;object-fit:contain}
.stocktake-no-photo {font-size:.8rem;min-width:60px;color:#66736d}
.stocktake-times {display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.stocktake-times input {min-width:0;width:100%}
.stocktake-comparison {display:grid;grid-template-columns:1fr 1fr;gap:.6rem;background:#edf4ef;padding:.8rem;border-radius:10px;margin:1rem 0}
.stocktake-comparison strong {display:block;font-size:1.2rem}
.stocktake-controls form {margin:1rem 0}
.stocktake-row p {overflow-wrap:anywhere}
@media(max-width:800px){.stocktake-rows{grid-template-columns:1fr}.stocktake-times{grid-template-columns:1fr}}
@media print{.stocktake-controls,[data-stocktake-form],.stocktake-photo,.back{display:none!important}.stocktake-rows{display:block}.stocktake-row{break-inside:avoid}.stocktake-review{break-inside:avoid}}
