/* CAMP STUDIO — ออเดอร์ทุกร้าน · ธีมพาสเทลพีช (อบอุ่น มุมโค้งใหญ่ เงานุ่ม — ตามแบบที่ user เลือก) */
:root{
  --bg:#F6EDE4; --card:#FFFFFF; --ink:#4A3E36; --muted:#A28E80; --line:#F0E0D2;
  --teal:#E8926B; --teal-dk:#D97C53; --teal-soft:#FBE7DA;   /* ชื่อตัวแปรเดิม — ค่าเป็นพีชแล้ว */
  --cream:#FDF6EF; --pink:#E27A9E; --pink-soft:#F9E2EB; --yellow:#EFC257; --yellow-soft:#FBF0D3;
  --amber:#D97706; --green:#0E9F6E; --blue:#4E93C8; --red:#E02424; --gray:#BCA99C;
  --r:18px; --sh:0 8px 22px rgba(214,158,116,.16), 0 2px 5px rgba(214,158,116,.08);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font-family:'Noto Sans Thai',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  font-size:15px; line-height:1.55; -webkit-font-smoothing:antialiased;
}
[hidden]{display:none !important}
.muted{color:var(--muted)}
.mono{font-family:'JetBrains Mono',ui-monospace,monospace}

/* ── ปุ่ม ── */
.btn{
  font:inherit; font-weight:600; border-radius:14px; border:1px solid transparent;
  padding:9px 14px; cursor:pointer; transition:transform .06s ease, box-shadow .12s ease;
}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.5; cursor:default}
.btn-main{background:var(--teal); color:#fff; box-shadow:0 2px 0 var(--teal-dk)}
.btn-main:hover:not(:disabled){background:var(--teal-dk)}
.btn-ghost{background:#fff; color:var(--ink); border-color:var(--line)}
.btn-ghost:hover:not(:disabled){border-color:var(--teal); color:var(--teal-dk)}
.btn-danger{background:#fff; color:var(--red); border-color:#F2C7C7}
.btn-sm{padding:6px 11px; font-size:13.5px}

/* ── หน้าเข้าสู่ระบบ ── */
.gate{position:fixed; inset:0; display:grid; place-items:center; padding:24px; background:var(--bg); z-index:50}
.gate-card{
  background:var(--card); border:1px solid var(--line); border-radius:26px; box-shadow:var(--sh);
  padding:32px 30px; width:min(400px,100%); display:flex; flex-direction:column; gap:10px;
}
.gate-card h1{margin:0; font-size:24px}
.gate-card p{margin:0 0 8px}
.gate-card label{font-weight:600; font-size:14px}
.gate-card input{
  font:inherit; padding:12px 14px; border:1.5px solid var(--line); border-radius:14px; background:var(--cream);
}
.gate-card input:focus{outline:2px solid var(--teal-soft); border-color:var(--teal)}
.err{color:var(--red); font-size:14px; margin:4px 0 0}

/* ── โครงหน้า ── */
.topbar{
  position:sticky; top:0; z-index:20; background:rgba(246,237,228,.92); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line); padding:12px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
.brandmark{display:flex; align-items:center; gap:11px}
.brandmark .dot{width:13px; height:13px; border-radius:50%; background:var(--teal); box-shadow:0 0 0 4px var(--teal-soft)}
.brandmark b{display:block; font-size:17px; line-height:1.2}
.brandmark span{font-size:12.5px}
.topbar-actions{display:flex; gap:8px}
.wrap{max-width:1180px; margin:0 auto; padding:18px 20px 60px}

/* ── สรุป ── */
.stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:16px}
.stat{background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:13px 15px; box-shadow:var(--sh)}
.stat b{display:block; font-size:24px; line-height:1.25}
.stat span{font-size:13px; color:var(--muted)}
.stat.hot{background:var(--teal-soft); border-color:#F4D4BF}
.stat.go{background:var(--yellow-soft); border-color:#F1E0B0}
.stat.hot b{color:var(--teal-dk)}
.stat.go b{color:#B08A1F}

/* ── ตัวกรอง ── */
.filters{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  padding:12px 15px; box-shadow:var(--sh); display:flex; flex-direction:column; gap:9px; margin-bottom:16px;
}
.frow{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.flabel{font-size:13px; color:var(--muted); min-width:38px}
.chips{display:flex; gap:7px; flex-wrap:wrap}
.chip{
  font:inherit; font-size:13.5px; padding:5px 12px; border-radius:999px;
  border:1px solid var(--line); background:var(--cream); cursor:pointer; color:var(--ink);
}
.chip:hover{border-color:var(--teal)}
.chip.on{background:var(--teal); border-color:var(--teal); color:#fff; font-weight:600}
.chip .cdot{display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle}
.frow input[type=search]{
  flex:1; min-width:220px; font:inherit; padding:8px 12px; border:1px solid var(--line);
  border-radius:10px; background:var(--cream);
}
.frow input[type=search]:focus{outline:2px solid var(--teal-soft); border-color:var(--teal)}

/* ── รายการออเดอร์ ── */
.list{display:flex; flex-direction:column; gap:9px}
.row{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--sh);
  padding:12px 15px; display:grid; gap:4px 14px; cursor:pointer;
  grid-template-columns:auto 1fr auto; align-items:center;
}
.row:hover{border-color:var(--teal)}
.row .tag{
  font-size:11.5px; font-weight:700; letter-spacing:.03em; padding:5px 11px; border-radius:999px;
  color:#fff; white-space:nowrap;
}
.row .mid{min-width:0}
.row .no{font-weight:700; font-size:15px}
.row .sub{font-size:13px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.row .right{text-align:right; white-space:nowrap}
.row .amt{font-weight:700}
.pill{
  display:inline-block; font-size:12.5px; font-weight:600; padding:3px 10px; border-radius:999px;
  background:#F1EFE8; color:var(--muted);
}
.pill.await{background:#FDF1DF; color:var(--amber)}
.pill.paid{background:#E4F6EE; color:var(--green)}
.pill.ship{background:#E1F0FA; color:var(--blue)}
.pill.cancel{background:#F1EFE8; color:var(--gray)}
.pill.fail{background:#FBE7E7; color:var(--red)}
.empty{
  background:var(--card); border:1px dashed var(--line); border-radius:var(--r);
  padding:34px; text-align:center; color:var(--muted);
}
.alert{
  background:#FDF1DF; border:1px solid #F0DCB6; color:#8A5A08; border-radius:var(--r);
  padding:11px 15px; margin-bottom:14px; font-size:14px;
}

/* ── แผงรายละเอียด ── */
.sheet{position:fixed; inset:0; z-index:40; display:flex; justify-content:flex-end}
.sheet-bg{position:absolute; inset:0; background:rgba(74,62,54,.32)}
.sheet-body{
  position:relative; background:var(--bg); width:min(560px,100%); height:100%; overflow-y:auto;
  padding:20px 22px 60px; box-shadow:-14px 0 40px rgba(120,84,58,.18);
}
.sheet h2{margin:0 0 2px; font-size:21px}
.sheet h3{margin:22px 0 8px; font-size:15px; color:var(--muted); font-weight:600}
.sheet-top{display:flex; align-items:flex-start; justify-content:space-between; gap:12px}
.box{background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:13px 15px; box-shadow:var(--sh)}
.kv{display:grid; grid-template-columns:112px 1fr; gap:5px 12px; font-size:14px}
.kv dt{color:var(--muted)}
.kv dd{margin:0}
.item{display:flex; gap:11px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item img{width:42px; height:42px; object-fit:contain; background:var(--cream); border-radius:8px; border:1px solid var(--line)}
.item .nm{flex:1; min-width:0; font-size:14px}
.item .nm small{display:block; color:var(--muted); font-size:12.5px}
.item .pr{font-weight:600; white-space:nowrap}
.tot{display:flex; justify-content:space-between; padding-top:10px; font-weight:700}
.log{display:flex; flex-direction:column; gap:6px; font-size:13.5px}
.log-row{display:grid; grid-template-columns:1fr auto; gap:4px 10px; padding-bottom:6px; border-bottom:1px solid var(--line)}
.log-row:last-child{border-bottom:0}
.log-row .t{font-weight:600}
.log-row .d{color:var(--muted); font-size:12.5px; white-space:nowrap}
.acts{display:flex; flex-direction:column; gap:9px}
.act-row{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.act-row input{
  flex:1; min-width:180px; font:inherit; padding:9px 12px; border:1px solid var(--line);
  border-radius:10px; background:var(--cream);
}
.hint{font-size:13px; color:var(--muted); margin:2px 0 0}

/* ── toast ── */
.toast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%); z-index:60;
  background:#5A4A3E; color:#fff; padding:11px 18px; border-radius:999px; font-size:14px;
  box-shadow:0 8px 22px rgba(35,40,46,.28); max-width:88vw; text-align:center;
}

@media (max-width:640px){
  .wrap{padding:14px 13px 50px}
  .row{grid-template-columns:auto 1fr; }
  .row .right{grid-column:1 / -1; text-align:left; padding-top:4px}
  .kv{grid-template-columns:96px 1fr}
  .sheet-body{padding:16px 15px 50px}
}

/* ─── ตั้งค่าผู้ใช้ ─── */
#whoami { align-self: center; margin-right: 2px; font-size: 12.5px; }
.urow { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--line, #e3e8e6); }
.urow:last-child { border-bottom: none; }
.urow.off .umain { opacity: .45; }
.umain b { font-family: 'JetBrains Mono', monospace; font-size: 13.5px; }
.umain small { display: block; color: var(--muted, #6b7f7a); margin-top: 2px; }
.uacts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.uform label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
.uform input[type="text"], .uform input:not([type]) { width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--line, #d8e0dd); border-radius: 10px; font: inherit; }
.ulabel { display: block; font-weight: 700; font-size: 13px; margin: 14px 0 4px; }
.ucheck { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important;
  margin: 4px 0 !important; font-size: 13.5px; }
.ucheck input { width: auto !important; }
.ubrands { margin-left: 26px; }

/* ── ลูกเล่นธีมพีช: วงกลมพาสเทลลอยหลังหน้า login (ตามภาพอ้างอิง) ── */
.gate::before, .gate::after{
  content:""; position:absolute; border-radius:50%; z-index:-1; opacity:.6;
}
.gate::before{ width:190px; height:190px; background:#F3D9C6; left:-60px; bottom:-50px; }
.gate::after{ width:90px; height:90px; background:#F6E3D3; left:130px; bottom:70px; }
.gate{ overflow:hidden; }
.gate-card h1{ color:#4A3E36; }
