/* PlatePerfect  CI ของ Another Pound Café  น้ำเงิน #123C8C  เหลือง #FFD000  ขาว */
:root{--blue:#123C8C;--yellow:#FFD000;--white:#fff;--ok:#1F8A4C;--bad:#C0392B;--line:#d7dce8;--soft:#f3f5fa}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:"Noto Sans Thai","Montserrat","Leelawadee UI",system-ui,sans-serif;color:var(--blue);background:#fff;line-height:1.45;font-size:16px}
.en{font-family:"Montserrat","Noto Sans Thai",sans-serif}
button{font:inherit;cursor:pointer}
button:disabled{opacity:.5;cursor:default}
.hidden{display:none !important}
.mock{background:var(--yellow);color:var(--blue);font-size:12px;font-weight:700;padding:2px 8px;white-space:nowrap}
.mode-practice{background:#fff;color:var(--blue);border:2px dashed var(--yellow)}

/* buttons */
.btn{border:0;font-weight:700;font-size:20px;padding:16px 12px;width:100%;display:flex;align-items:center;justify-content:center;gap:12px}
.b-main{background:var(--yellow);color:var(--blue)}
.b-alt{background:#fff;color:var(--blue);border:2px solid var(--blue)}
.b-line{background:transparent;color:#fff;border:2px solid #fff;font-size:16px;padding:12px}
.ring{width:28px;height:28px;border-radius:50%;border:4px solid var(--blue);flex:none}

/* top bars */
.bar{background:var(--blue);color:#fff;display:flex;align-items:center;gap:14px;padding:10px 20px}
.bar img{height:34px}
.bar .t{font-size:13px;line-height:1.3}
.bar .t b{display:block;font-size:18px}
.bar .r{margin-left:auto;display:flex;gap:16px;align-items:center;font-size:14px}
.bar a{color:#fff}

/* lights */
.light{padding:14px 16px;margin-bottom:10px}
.light .big{font-size:26px;font-weight:700;display:flex;align-items:center;gap:10px;line-height:1.2}
.light .sub{font-size:15px;margin-top:4px;font-weight:700}
.light .nums{display:flex;gap:14px;font-size:13px;margin-top:6px;opacity:.9}
.l-yellow{background:var(--yellow);color:var(--blue)}
.l-green{background:var(--ok);color:#fff}
.l-red{background:var(--bad);color:#fff}
.l-grey{background:#fff;color:var(--blue)}
.ico{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-family:Montserrat,sans-serif;font-size:20px;font-weight:700;flex:none;background:#fff}
.l-yellow .ico{background:var(--blue);color:var(--yellow)} .l-green .ico{color:var(--ok)} .l-red .ico{color:var(--bad)} .l-grey .ico{background:var(--blue);color:#fff}
.dot{width:14px;height:14px;border-radius:50%;flex:none;display:inline-block}
.dot.green{background:var(--ok)} .dot.yellow{background:var(--yellow);box-shadow:0 0 0 2px var(--blue)} .dot.red{background:var(--bad)} .dot.grey{background:#aab}

/* kitchen */
.k-wrap{display:flex;height:100vh;min-height:560px}
.cam{flex:1;position:relative;background:#14171c;overflow:hidden;cursor:pointer}
.cam img.live{width:100%;height:100%;object-fit:contain;background:#14171c}
.cam .empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;gap:14px;font-size:22px;font-weight:700}
.cam .empty .bigring{width:96px;height:96px;border-radius:50%;border:8px solid var(--yellow)}
.cam .ref{position:absolute;left:16px;top:16px;width:150px;background:#fff;padding:6px 6px 4px;cursor:zoom-in}
.cam .ref img{display:block;width:100%;height:110px;object-fit:cover}
.cam .ref span{display:block;font-size:13px;font-weight:700;padding-top:4px}
.cam .ref.big{width:min(520px,70%)}
.cam .ref.big img{height:auto;max-height:60vh;object-fit:contain}
.cam .tag{position:absolute;left:16px;bottom:16px;background:var(--blue);color:#fff;font-size:15px;padding:8px 14px}
.cam .busy{position:absolute;inset:0;background:rgba(18,60,140,.82);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;font-size:24px;font-weight:700}
.spin{width:64px;height:64px;border-radius:50%;border:8px solid rgba(255,255,255,.3);border-top-color:var(--yellow);animation:sp 1s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.toast{position:fixed;left:50%;top:20px;transform:translateX(-50%);background:var(--ok);color:#fff;font-weight:700;font-size:19px;padding:12px 22px;z-index:50;box-shadow:0 6px 20px rgba(0,0,0,.25)}
.toast.err{background:var(--bad)}
.side{width:410px;background:var(--blue);color:#fff;padding:20px 24px;display:flex;flex-direction:column;overflow-y:auto}
.brand{display:flex;align-items:center;gap:14px;margin-bottom:16px}
.brand img{height:42px}
.brand .t{font-size:13px;line-height:1.3}
.brand .t b{display:block;font-size:17px}
.lab{display:flex;gap:10px;align-items:baseline;font-size:15px;margin:0 0 8px}
.lab .n{font-family:Montserrat,sans-serif;font-weight:700;color:var(--yellow)}
.dishes{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.dish{display:flex;align-items:center;gap:12px;padding:6px;border:2px solid #fff;background:transparent;color:#fff;text-align:left}
.dish img{width:64px;height:48px;object-fit:cover}
.dish b{font-size:17px}
.dish.on{background:var(--yellow);color:var(--blue);border-color:var(--yellow)}
.tables{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:14px}
.tables button{border:2px solid #fff;background:transparent;color:#fff;text-align:center;padding:9px 0;font-family:Montserrat,sans-serif;font-weight:700;font-size:18px}
.tables button.on{background:var(--yellow);color:var(--blue);border-color:var(--yellow)}
.samples{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.samples button{border:2px dashed #fff;background:transparent;color:#fff;padding:4px 10px;font-size:14px}
.grow{flex:1}
.today{display:flex;gap:16px;font-size:13px;margin-top:10px}
.today b{font-family:Montserrat,sans-serif;font-size:18px;margin-right:4px}
.sec{font-size:13px;font-weight:700;color:var(--yellow);margin:8px 0 0;display:flex;justify-content:space-between}
.items{list-style:none;margin:0;padding:0;font-size:15px}
.items li{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid rgba(255,255,255,.35)}
.items li small{display:block;font-size:12px;opacity:.85}
.st{font-weight:700;font-size:13px;padding:2px 10px;white-space:nowrap}
.st.ok{background:#fff;color:var(--blue)} .st.qty{background:var(--yellow);color:var(--blue)} .st.no{background:var(--bad);color:#fff} .st.unk{background:transparent;color:#fff;border:1px dashed #fff}
.tofix{font-size:13px;font-weight:700;color:var(--yellow);white-space:nowrap}
.tofix:before{content:"→ "}
.acts{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.acts.two{flex-direction:row}
.acts.two .btn{flex:1}
.meta{font-size:13px;margin-top:8px}
.locked{background:var(--yellow);color:var(--blue);padding:12px 14px;font-weight:700;font-size:17px;margin-bottom:14px}
.locked small{display:block;font-weight:400;font-size:14px}
.reasons{display:flex;flex-direction:column;gap:8px}
.reasons button{border:2px solid #fff;background:transparent;color:#fff;padding:12px 14px;font-size:17px;text-align:left}
.reasons button.on{background:var(--yellow);color:var(--blue);border-color:var(--yellow);font-weight:700}
.note{border:2px solid #fff;padding:10px;font-size:14px;margin-top:10px}
.why{font-size:15px;margin:4px 0}
.why li{margin:2px 0}
#shoot,.side .acts{position:sticky;bottom:0;z-index:2}
.side .acts{background:var(--blue);padding-top:8px}
@media (max-width:820px),(max-height:620px){.k-wrap{flex-direction:column;height:auto}.cam{height:34vh;flex:none}.side{width:auto;overflow:visible}
  #shoot{position:fixed;left:12px;right:12px;bottom:12px;width:auto;box-shadow:0 4px 18px rgba(0,0,0,.35)}.side{padding-bottom:96px}}

/* phone (guest) */
.ph{max-width:480px;margin:0 auto;min-height:100vh;display:flex;flex-direction:column}
.ph-body{flex:1;padding:18px;display:flex;flex-direction:column;gap:12px}
.ph-body h3{margin:0;font-size:22px}
.q{font-size:15px}
.pcard{display:flex;gap:12px;align-items:center;border:2px solid var(--blue);padding:8px;background:#fff;color:var(--blue);text-align:left;width:100%}
.pcard img{width:84px;height:64px;object-fit:cover}
.pcard b{font-size:18px;display:block}
.pcard small{font-size:13px}
.pcard.first{border-width:3px;background:#fffbe0}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips button{border:2px solid var(--blue);background:#fff;color:var(--blue);padding:7px 12px;font-size:15px}
.chips button.on{background:var(--blue);color:#fff}
.shot{border:2px dashed var(--blue);min-height:180px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;font-weight:700;cursor:pointer;position:relative;background:var(--soft)}
.shot img{width:100%;max-height:260px;object-fit:cover;display:block}
.shot .again{position:absolute;right:8px;bottom:8px;background:#fff;font-size:13px;padding:3px 8px}
textarea{width:100%;border:2px solid var(--line);padding:10px;font:inherit;font-size:15px;color:var(--blue);min-height:64px}
.ph-foot{padding:14px 18px 22px;position:sticky;bottom:0;background:#fff}
.bigno{font-family:Montserrat,sans-serif;font-size:44px;font-weight:700}
.status{display:flex;flex-direction:column}
.status div{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);font-size:16px}
.status i{width:22px;height:22px;border-radius:50%;border:3px solid var(--blue);flex:none}
.status i.done{background:var(--blue)}
.status i.now{border-color:var(--yellow);background:var(--yellow)}
.verdict{background:var(--yellow);padding:18px;font-size:16px}
.verdict b{display:block;font-size:26px}
.err{color:var(--bad);font-weight:700;font-size:15px}
.practice{border:2px dashed var(--yellow);padding:8px 10px;font-size:13px;background:#fffbe0}
.practice .samples button{border-color:var(--blue);color:var(--blue)}

/* owner and admin */
.page{display:flex;flex-direction:column;min-height:100vh}
.cols{flex:1;display:flex;min-height:0}
.col{padding:18px 22px;overflow-y:auto}
.col h3{font-size:15px;margin:0 0 10px;display:flex;gap:8px;align-items:baseline}
.col h3 .n{font-family:Montserrat,sans-serif}
.feed div.row{display:flex;gap:10px;align-items:center;border-bottom:1px solid var(--line);padding:9px 0;font-size:15px}
.feed .t{margin-left:auto;font-size:13px;font-family:Montserrat,sans-serif;white-space:nowrap}
.feed div.flag{background:#fdeceb;padding-left:8px}
.ccard{border:3px solid var(--bad);padding:14px;display:flex;gap:14px;align-items:center;background:#fff;color:var(--blue);width:100%;text-align:left;margin-bottom:10px}
.ccard img{width:110px;height:84px;object-fit:cover}
.ccard b{font-size:19px;display:block}
.ccard.done{border-color:var(--ok)}
.cd{background:#fff;color:var(--blue);border:2px solid var(--blue);font-weight:700;padding:3px 11px;font-family:"Montserrat","Noto Sans Thai",sans-serif;white-space:nowrap}
.cd.warn{background:var(--yellow);border-color:var(--yellow)}
.cd.late{background:var(--bad);border-color:var(--bad);color:#fff}
.cd.done{background:#e6e8ee;border-color:#e6e8ee;color:#4a5f8f}
.thumb{width:48px;height:36px;object-fit:cover;cursor:zoom-in;flex:none}
.trio{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.trio figure{margin:0}
.trio img{width:100%;height:240px;object-fit:cover;display:block;background:var(--soft);cursor:zoom-in}
.trio .none{height:240px;background:var(--soft);display:flex;align-items:center;justify-content:center;font-size:15px;text-align:center;padding:10px}
.trio figcaption{font-size:14px;font-weight:700;margin-top:4px}
.trio figcaption small{display:block;font-weight:400}
.ai{background:var(--soft);padding:12px 14px;font-size:15px;margin-top:14px;border-left:5px solid var(--blue);white-space:pre-wrap;overflow-wrap:anywhere}
.ai em{font-style:normal;font-weight:700;display:block;font-size:13px}
.opts{display:flex;flex-direction:column;gap:8px}
.opts button{border:2px solid var(--blue);background:#fff;color:var(--blue);padding:12px 14px;font-size:17px;display:flex;gap:10px;align-items:center;text-align:left}
.opts button i{width:20px;height:20px;border-radius:50%;border:3px solid var(--blue);flex:none}
.opts button.on{background:var(--yellow);border-color:var(--yellow);font-weight:700}
.opts button.on i{background:var(--blue)}
.lbtn{border:0;font-weight:700;font-size:19px;padding:15px 20px;background:var(--yellow);color:var(--blue);width:100%}
.link{background:none;border:0;color:var(--blue);text-decoration:underline;padding:0;font-size:15px}
.kv{font-size:14px;margin-top:8px}
.ltoast{background:var(--ok);color:#fff;font-weight:700;font-size:16px;padding:9px 16px;margin-bottom:14px;display:inline-block}
.mlist{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:18px}
.mcard{border:2px solid var(--blue);background:#fff;color:var(--blue);padding:0;text-align:left}
.mcard img{width:100%;height:160px;object-fit:cover;display:block}
.mcard div{padding:10px 12px;font-size:14px}
.mcard b{font-size:19px;display:block}
.mcard.add{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;border-style:dashed;min-height:240px;font-weight:700;font-size:20px}
.mcard.add .plus{font-family:Montserrat,sans-serif;font-size:56px;line-height:1}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;font-size:15px}
.field input[type=text],.field input[type=number],input.in{border:2px solid var(--blue);padding:10px;font:inherit;font-size:17px;color:var(--blue)}
table.ck{width:100%;border-collapse:collapse;font-size:15px}
table.ck th{text-align:left;font-size:13px;border-bottom:3px solid var(--blue);padding:6px}
table.ck td{border-bottom:1px solid var(--line);padding:4px 6px}
table.ck input[type=text]{width:100%;border:1px solid var(--line);padding:6px;font:inherit;color:var(--blue)}
table.ck input[type=number]{width:70px;border:2px solid var(--blue);padding:5px;font:inherit;font-weight:700;color:var(--blue);font-family:Montserrat,sans-serif}
table.ck input[type=checkbox]{width:22px;height:22px;accent-color:var(--blue)}
.sum{display:flex;gap:18px;align-items:center;margin:8px 0 14px;font-size:15px;flex-wrap:wrap}
.okb{background:var(--ok);color:#fff;font-weight:700;padding:4px 12px}
.badb{background:var(--bad);color:#fff;font-weight:700;padding:4px 12px}
.aibar{background:var(--yellow);padding:10px 14px;font-weight:700;margin-bottom:10px;font-size:15px}
.disc{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px;align-items:center}
.disc span{border:2px solid var(--blue);padding:4px 12px;font-weight:700}
.overlay{position:fixed;inset:0;background:rgba(10,20,50,.85);display:flex;align-items:center;justify-content:center;z-index:60;cursor:zoom-out}
.overlay img{max-width:92vw;max-height:92vh}
@media (max-width:900px){.cols{flex-direction:column}.trio img,.trio .none{height:160px}}
