:root{--ink:#182019;--muted:#687168;--cream:#f5f7f2;--card:#fff;--green:#386c4b;--line:#dfe5dc;--shadow:0 15px 40px rgba(30,50,33,.08)}*{box-sizing:border-box}body{margin:0;background:var(--cream);color:var(--ink);font-family:'DM Sans',sans-serif}.locked{overflow:hidden}.topbar{height:78px;display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,calc((100% - 1180px)/2));background:rgba(245,247,242,.9);border-bottom:1px solid var(--line);backdrop-filter:blur(14px);position:sticky;top:0;z-index:20}.brand{display:flex;gap:11px;align-items:center;color:var(--ink);font:800 20px Manrope;text-decoration:none}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:var(--green);color:white}.status{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:7px}.status span{width:8px;height:8px;background:#55a56d;border-radius:50%;box-shadow:0 0 0 4px #dcecdf}.shell{max-width:1180px;margin:auto;padding:54px 24px 80px}.hero{min-height:310px;padding:55px 60px;border-radius:28px;background:#dce8d8;display:flex;align-items:center;justify-content:space-between;overflow:hidden;position:relative}.hero:after{content:'S';position:absolute;right:180px;top:-95px;font:800 400px Manrope;color:rgba(255,255,255,.28);transform:rotate(8deg)}.eyebrow{font-size:11px;letter-spacing:.18em;font-weight:700;color:var(--green)}h1,h2,h3{font-family:Manrope;margin:0}.hero h1{font-size:54px;line-height:1.04;margin:13px 0}.hero h1 em{color:var(--green);font-style:normal}.hero p,.section-head p,.location-hero p{color:var(--muted);margin:0}.hero-stat{position:relative;z-index:2;width:150px;height:150px;border-radius:50%;background:rgba(255,255,255,.72);display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:var(--shadow)}.hero-stat strong{font:800 40px Manrope}.hero-stat span{color:var(--muted);font-size:13px}.section-head{display:flex;justify-content:space-between;margin:52px 0 20px}.section-head h2{font-size:25px;margin-bottom:5px}.location-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.location-card{position:relative;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;padding:22px;background:var(--card);border:1px solid var(--line);border-radius:20px;color:var(--ink);text-decoration:none;transition:.2s}.location-card:hover{transform:translateY(-3px);box-shadow:var(--shadow);border-color:#bdcaba}.location-icon{width:62px;height:62px;display:grid;place-items:center;border-radius:17px;font-size:29px}.sage{background:#dce9dc}.blue{background:#dce8ef}.ice{background:#e6eff4}.sand{background:#efe6d6}.location-type,.product-info span{font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--muted);font-weight:700}.location-copy h3{font-size:18px;margin:3px 0}.location-copy p{font-size:13px;color:var(--muted);margin:0}.location-count{text-align:right;padding-right:24px}.location-count strong{display:block;font:800 24px Manrope}.location-count span{font-size:11px;color:var(--muted)}.arrow{position:absolute;right:14px;color:#95a097}.back{display:inline-block;color:var(--muted);text-decoration:none;font-size:14px;margin-bottom:28px}.location-hero{display:flex;align-items:center;gap:24px;padding-bottom:35px;border-bottom:1px solid var(--line)}.location-icon.large{width:88px;height:88px;font-size:40px;border-radius:24px}.location-hero h1{font-size:38px;margin:5px 0}.primary{border:0;border-radius:12px;padding:13px 19px;color:white;background:var(--green);font:600 14px DM Sans;cursor:pointer}.location-hero .primary{margin-left:auto}.toolbar{margin:25px 0}.search{display:flex;align-items:center;gap:10px;max-width:480px;background:white;border:1px solid var(--line);border-radius:13px;padding:0 14px}.search input{width:100%;padding:13px 0;border:0;outline:0;font:14px DM Sans;background:none}.inventory-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.product-card{display:grid;grid-template-columns:74px 1fr;gap:15px;background:white;border:1px solid var(--line);border-radius:18px;padding:16px}.product-card img,.catalog-item img{width:74px;height:74px;object-fit:cover;border-radius:13px;background:#eef1ec}.product-info h3{font-size:16px;margin:4px 0}.product-info p{margin:0;color:var(--muted);font-size:13px}.counter{grid-column:1/-1;display:grid;grid-template-columns:38px 1fr 38px;align-items:center;background:#f1f4ef;border-radius:10px;text-align:center}.counter button{border:0;background:none;height:36px;font-size:20px;color:var(--green);cursor:pointer}.counter strong{font-family:Manrope}.empty{grid-column:1/-1;text-align:center;padding:70px;background:white;border:1px dashed #bdc8bb;border-radius:20px}.empty p{color:var(--muted)}.modal[hidden]{display:none}.modal{position:fixed;inset:0;z-index:50}.modal-backdrop{position:absolute;inset:0;background:rgba(15,22,16,.5);backdrop-filter:blur(4px)}.modal-panel{position:absolute;right:0;top:0;height:100%;width:min(520px,100%);background:var(--cream);padding:32px;box-shadow:-20px 0 60px rgba(0,0,0,.15);overflow:auto}.modal-head{display:flex;justify-content:space-between;align-items:start;margin-bottom:22px}.modal-head h2{margin-top:5px}.close{border:0;background:#e5e9e2;width:38px;height:38px;border-radius:50%;font-size:23px;cursor:pointer}.modal-panel .search{max-width:none}.catalog{display:grid;gap:10px;margin-top:18px}.catalog-item{display:grid;grid-template-columns:58px 1fr auto;align-items:center;gap:13px;background:#fff;border:1px solid var(--line);padding:10px;border-radius:14px}.catalog-item img{width:58px;height:58px}.catalog-item div{display:flex;flex-direction:column}.catalog-item span{font-size:12px;color:var(--muted);margin-top:3px}.catalog-item button{border:0;border-radius:9px;padding:9px 12px;background:#e3eee1;color:var(--green);font-weight:700;cursor:pointer}footer{text-align:center;color:#8a938a;font-size:12px;padding:25px;border-top:1px solid var(--line)}[hidden]{display:none!important}@media(max-width:780px){.shell{padding:28px 16px 60px}.topbar{height:66px;padding:0 17px}.hero{padding:35px 25px;min-height:280px}.hero h1{font-size:39px}.hero-stat{width:100px;height:100px}.hero:after{display:none}.location-grid,.inventory-grid{grid-template-columns:1fr}.location-hero{align-items:flex-start;flex-wrap:wrap}.location-hero .primary{width:100%;margin:0}.location-hero h1{font-size:30px}}@media(max-width:500px){.hero{display:block}.hero-stat{position:absolute;right:20px;bottom:20px}.location-card{grid-template-columns:auto 1fr}.location-count{display:none}.status{display:none}}


/* iPad/iPhone Safari touch ergonomics */
html{-webkit-text-size-adjust:100%}
button,a,input,select,textarea{-webkit-tap-highlight-color:rgba(56,108,75,.12)}
button,.primary,.secondary,.counter button,.catalog-item button,.close{touch-action:manipulation}
@media (hover:none) and (pointer:coarse){
  button,.primary,.secondary,.catalog-item button,.remove-item button{min-height:44px}
  .counter button{min-width:44px;min-height:44px}
  input,select,textarea{font-size:16px}
  .location-actions{display:flex;gap:10px;flex-wrap:wrap}
}
@media (min-width:781px) and (max-width:1180px){
  .shell{padding-left:24px;padding-right:24px}
  .location-actions{display:flex;gap:10px;flex-wrap:wrap;margin-left:auto}
  .location-actions .primary,.location-actions .secondary{min-height:44px}
  .inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* Tablet / iPad layout */
.topbar{-webkit-backdrop-filter:blur(14px)}
.modal-backdrop{-webkit-backdrop-filter:blur(4px)}
button,.primary,.secondary{-webkit-appearance:none}
.modal-panel{-webkit-overflow-scrolling:touch}

@media (min-width:700px) and (max-width:1100px){
  .topbar{height:72px;padding-left:20px;padding-right:20px}
  .brand{font-size:18px;gap:9px;white-space:nowrap}
  .brand-mark{width:34px;height:34px;border-radius:10px}
  .header-actions{gap:8px;min-width:0}
  .header-actions .status{display:none}
  .logout-link{padding:9px 11px;white-space:nowrap}
  .shell{padding:36px 22px 70px}
  .location-hero{display:grid;grid-template-columns:74px minmax(0,1fr);align-items:center;gap:16px 20px;padding-bottom:28px}
  .location-icon.large{width:74px;height:74px;border-radius:20px;font-size:34px}
  .location-hero h1{font-size:32px}
  .location-actions{grid-column:1/-1;width:100%;display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0}
  .location-actions .primary,.location-actions .secondary{width:100%;min-height:48px;margin:0;font-size:14px}
  .toolbar{margin:22px 0}.toolbar .search{max-width:100%}
  .inventory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .modal-panel{width:620px;max-width:100%;height:100vh;padding:28px}
  .catalog-item button{min-height:44px;min-width:78px}
  .empty{padding:55px 30px}
}

@media (max-width:699px){
  .header-actions{gap:7px}
  .sync-toggle,.notification-toggle{width:37px;height:37px}
  .logout-link{padding:8px 9px}
}

/* Applied by compat.js on real iPads, including older Safari */
html.is-ipad .topbar{position:-webkit-sticky;position:sticky}
html.is-ipad button,html.is-ipad a{touch-action:manipulation}
html.is-ipad .modal-panel{height:100vh;-webkit-overflow-scrolling:touch}


/* Cabinet links shown in the add-product catalog */
.catalog-item .catalog-copy{min-width:0}
.catalog-item .catalog-details{display:flex;flex-direction:row;flex-wrap:wrap;align-items:baseline;margin-top:3px;font-size:12px;line-height:1.35;color:var(--muted);letter-spacing:0;text-transform:none}
.catalog-item .catalog-details>.catalog-meta,.catalog-item .catalog-details>.catalog-locations{display:inline;margin-top:0;font-size:12px;line-height:1.35;letter-spacing:0;text-transform:none}
.catalog-item .catalog-locations{margin-left:18px;font-weight:700}
.catalog-item .catalog-locations.is-linked{color:#386c4b;-webkit-text-fill-color:#386c4b}
.catalog-item .catalog-locations.is-unlinked{color:#8a938a;-webkit-text-fill-color:#8a938a;font-weight:500}
