:root{
  --bg:#050505;
  --bg-2:#0f0d03;
  --card:#15130bcc;
  --card-2:#211b07dd;
  --line:#4b3e0d;
  --line-2:#8b7117;
  --text:#fff9df;
  --muted:#bdb28a;
  --yellow:#ffd400;
  --yellow-2:#ffb700;
  --yellow-3:#fff06a;
  --gold:#ffd747;
  --green:#00e7a2;
  --danger:#ff5c7c;
  --shadow:0 24px 80px rgba(0,0,0,.55);
  --radius:24px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,212,0,.18), transparent 28rem),
    radial-gradient(circle at 85% 20%, rgba(255,183,0,.10), transparent 24rem),
    linear-gradient(180deg,#020202 0%,#0c0a03 50%,#020202 100%);
  font-family:"Noto Sans Thai", system-ui, sans-serif;
  overflow-x:hidden;
}

button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer;border:0}
a{color:inherit;text-decoration:none}
select{width:100%;background:rgba(255,255,255,.06);border:1px solid rgba(255,212,0,.18);border-radius:14px;padding:13px 15px;outline:0;color:var(--text)}
select option{background:#111;color:#fff}

#rainCanvas{position:fixed;inset:0;width:100%;height:100%;z-index:-4;opacity:.88}
.scanline{position:fixed;inset:0;pointer-events:none;z-index:-1;background:linear-gradient(to bottom,rgba(255,212,0,.04) 1px,transparent 1px);background-size:100% 5px;mix-blend-mode:screen;opacity:.14}
.halo{position:fixed;border-radius:999px;filter:blur(70px);z-index:-3;opacity:.42;animation:float 8s ease-in-out infinite alternate}
.halo-a{width:420px;height:420px;background:rgba(255,212,0,.25);left:5%;top:8%}
.halo-b{width:480px;height:480px;background:rgba(255,183,0,.18);right:8%;bottom:8%;animation-delay:1.4s}
@keyframes float{to{transform:translate3d(30px,-40px,0) scale(1.12)}}

.glass,.glass-modal{
  background:linear-gradient(145deg,rgba(22,19,8,.84),rgba(8,8,6,.72));
  border:1px solid rgba(255,212,0,.25);
  box-shadow:var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}

.topbar{
  position:sticky;top:18px;z-index:50;
  width:min(1080px,calc(100% - 28px));
  margin:18px auto 0;
  min-height:68px;
  border-radius:999px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 14px;
}
.brand{display:flex;align-items:center;gap:10px;background:transparent;color:var(--text);font-weight:900;letter-spacing:.04em;padding:0 12px}
.brand-logo{height:38px;width:88px;object-fit:contain;filter:drop-shadow(0 0 14px rgba(255,212,0,.35))}
.brand-text{font-family:Orbitron,sans-serif;white-space:nowrap}
.navlinks{display:flex;align-items:center;gap:6px;margin-inline:auto}
.navlink{
  padding:10px 18px;border-radius:999px;background:transparent;color:var(--muted);font-weight:800;transition:.25s ease;
}
.navlink:hover,.navlink.active{
  color:#111;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));
  box-shadow:0 10px 35px rgba(255,212,0,.32)
}
.icon-btn{
  min-width:42px;height:42px;border-radius:999px;
  background:rgba(255,255,255,.07);border:1px solid rgba(255,212,0,.14);transition:.22s ease;
}
.icon-btn:hover{transform:translateY(-2px);background:rgba(255,212,0,.18)}
.cart-icon{position:relative}
.cart-icon span{position:absolute;right:-5px;top:-6px;min-width:21px;height:21px;border-radius:999px;background:var(--yellow);color:#141000;font-weight:900;font-size:12px;display:grid;place-items:center}
.primary-btn,.ghost-btn,.link-btn{
  border-radius:16px;padding:12px 18px;font-weight:900;transition:.22s ease;display:inline-flex;align-items:center;justify-content:center;gap:9px;
}
.primary-btn{
  background:linear-gradient(135deg,var(--yellow),var(--yellow-2));
  box-shadow:0 12px 30px rgba(255,212,0,.36);
  color:#161100;
}
.primary-btn:hover{transform:translateY(-2px);filter:saturate(1.2);box-shadow:0 18px 44px rgba(255,212,0,.50)}
.ghost-btn{background:rgba(255,255,255,.07);border:1px solid rgba(255,212,0,.20);color:#fff4b6}
.ghost-btn:hover{background:rgba(255,212,0,.12);transform:translateY(-2px)}
.link-btn{background:transparent;color:#ffe06b;padding-inline:0}
.big{padding:15px 22px;border-radius:18px}
.wide{width:100%}
.as-link{text-align:center}

.shell{width:min(1340px,calc(100% - 32px));margin:72px auto 110px}
.hero{display:grid;grid-template-columns:1.15fr .85fr;gap:26px;align-items:center;margin-bottom:30px}
.eyebrow{display:inline-flex;align-items:center;gap:8px;margin:0 0 12px;color:#111;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));border:1px solid rgba(255,212,0,.28);padding:6px 12px;border-radius:999px;font-weight:900}
.eyebrow.mini{font-size:13px;padding:4px 10px;margin-bottom:8px}
h1,h2,h3,p{margin:0}
h1{font-family:Orbitron,sans-serif;font-size:clamp(48px,8vw,108px);line-height:.88;letter-spacing:-.06em;font-weight:900;text-shadow:0 0 55px rgba(255,212,0,.22)}
h1 span{background:linear-gradient(90deg,#fff9d2,#ffd400,#ffb700);-webkit-background-clip:text;background-clip:text;color:transparent}
.subtext{color:var(--muted);font-size:18px;line-height:1.85;max-width:760px;margin-top:18px}
.hero-actions{display:flex;gap:12px;margin-top:28px;flex-wrap:wrap}
.role-strip{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:18px;border-radius:18px;padding:12px 14px;width:max-content;max-width:100%}
.role-strip span,.role-strip small{color:var(--muted)}
.role-strip b{background:rgba(255,212,0,.16);color:var(--yellow);border:1px solid rgba(255,212,0,.24);padding:5px 10px;border-radius:999px}
.hero-panel{min-height:380px;border-radius:var(--radius);display:grid;place-items:center;overflow:hidden;position:relative}
.hero-panel:before{content:"";position:absolute;inset:auto -15% -35% -15%;height:70%;background:radial-gradient(ellipse at center,rgba(255,212,0,.35),transparent 62%)}
.hero-logo{width:min(520px,92%);height:auto;filter:drop-shadow(0 0 40px rgba(255,212,0,.32));z-index:2}
.pulse-ring{position:absolute;width:320px;height:320px;border-radius:50%;border:1px dashed rgba(255,212,0,.55);animation:spin 12s linear infinite}
.terminal-card{position:absolute;bottom:24px;left:24px;right:24px;border:1px solid rgba(255,212,0,.18);background:rgba(0,0,0,.46);border-radius:18px;padding:15px}
.terminal-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 14px var(--green);margin-right:8px}
.terminal-card p{display:inline;color:#e9dc98;font-family:Orbitron,sans-serif;font-size:13px}
.terminal-card strong{display:block;color:var(--yellow);font-family:Orbitron,sans-serif;margin-top:8px;font-size:13px}
@keyframes spin{to{transform:rotate(360deg)}}

.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin:38px 0 42px}
.stat-card{border-radius:20px;padding:25px 26px;min-height:150px;position:relative;overflow:hidden}
.stat-card:after{content:"";position:absolute;right:-40px;top:-40px;width:120px;height:120px;background:radial-gradient(circle,rgba(255,212,0,.18),transparent 70%)}
.stat-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;border:1px solid rgba(255,212,0,.16);margin-bottom:15px}
.stat-icon.gold,.stat-icon.yellow{background:rgba(255,212,0,.12);color:var(--yellow)}
.stat-card small{position:absolute;right:25px;top:34px;color:var(--green);font-weight:900;font-size:12px}
.live-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 15px var(--green);margin-right:6px}
.stat-card b{display:block;font-size:42px;line-height:1;font-weight:900;letter-spacing:.02em;font-family:Orbitron,sans-serif}
.stat-card p{color:var(--muted);margin-top:8px}

.ticker-wrap{display:flex;align-items:center;gap:14px;border-radius:18px;padding:12px 16px;margin-bottom:28px;overflow:hidden}
.ticker-label{white-space:nowrap;font-weight:900;color:#080800;background:var(--yellow);padding:7px 13px;border-radius:999px}
.ticker{overflow:hidden;white-space:nowrap;flex:1;color:#fff4bd}
#tickerTrack{display:inline-block;animation:ticker 28s linear infinite}
#tickerTrack span{margin-right:56px;color:#fff4bd}
@keyframes ticker{from{transform:translateX(0)}to{transform:translateX(-50%)}}

.section-head{display:flex;justify-content:space-between;align-items:end;margin:0 0 18px;gap:18px}
.section-head h2{font-size:38px;letter-spacing:-.02em;font-family:Orbitron,sans-serif}
.section-head p{color:var(--muted)}
.filter-pills{display:flex;gap:8px;flex-wrap:wrap}
.pill{border-radius:999px;padding:9px 14px;background:rgba(255,255,255,.06);border:1px solid rgba(255,212,0,.15);color:#fff2a8;font-weight:900}
.pill.active,.pill:hover{background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#111}
.product-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:20px}
.product-card{border-radius:20px;overflow:hidden;background:rgba(17,15,7,.84);border:1px solid rgba(255,212,0,.20);box-shadow:0 16px 44px rgba(0,0,0,.30);transition:.28s ease;position:relative}
.product-card:hover{transform:translateY(-8px);border-color:rgba(255,212,0,.58);box-shadow:0 25px 70px rgba(255,212,0,.18)}
.product-card.out{opacity:.58}
.product-img{height:220px;position:relative;overflow:hidden;display:grid;place-items:center;background:radial-gradient(circle at center,rgba(255,212,0,.14),rgba(255,255,255,.04) 50%,rgba(0,0,0,.16))}
.product-img:before{content:attr(data-category);position:absolute;top:14px;left:16px;font-family:Orbitron,sans-serif;font-weight:900;font-size:18px;color:rgba(255,240,164,.92);letter-spacing:.06em;text-shadow:0 0 20px rgba(255,212,0,.35)}
.product-art{width:190px;height:120px;border-radius:24px;background:linear-gradient(145deg,var(--accent),#1b1603);transform:perspective(800px) rotateX(54deg) rotateZ(-15deg);box-shadow:0 25px 38px rgba(0,0,0,.55),0 0 45px color-mix(in srgb,var(--accent) 38%,transparent);position:relative}
.product-art:after{content:attr(data-label);position:absolute;left:30px;top:44px;background:rgba(5,5,5,.78);color:#fff0a3;border:1px solid rgba(255,212,0,.18);border-radius:9px;padding:6px 13px;font-size:11px;font-weight:900}
.product-art:before{content:"";position:absolute;inset:-38px 35px auto 35px;height:74px;border-radius:20px;background:linear-gradient(145deg,#1f1b0a,#4f4209);box-shadow:0 0 40px color-mix(in srgb,var(--accent) 24%,transparent)}
.tag{position:absolute;right:14px;top:14px;background:rgba(0,0,0,.58);border:1px solid rgba(255,212,0,.18);padding:7px 12px;border-radius:11px;color:#fff0a3;font-weight:900;font-size:13px}
.stock-badge{position:absolute;left:14px;bottom:14px;background:rgba(255,212,0,.14);border:1px solid rgba(255,212,0,.25);padding:7px 12px;border-radius:11px;color:var(--yellow);font-weight:900;font-size:13px}
.product-body{padding:18px}
.product-body h3{font-size:18px;font-weight:900;text-transform:uppercase;min-height:50px}
.price{font-size:29px;font-weight:900;color:var(--yellow);margin:8px 0 10px;font-family:Orbitron,sans-serif}
.badge{display:inline-flex;background:rgba(255,212,0,.13);border:1px solid rgba(255,212,0,.25);color:var(--yellow);border-radius:999px;padding:4px 10px;font-size:12px;font-weight:900;margin-bottom:14px}
.product-actions{display:grid;grid-template-columns:1fr;gap:8px}
.product-actions .ghost-btn,.product-actions .primary-btn{border-radius:13px;padding:10px 12px}

.drawer{position:fixed;right:0;top:0;bottom:0;width:min(450px,100%);background:rgba(8,7,3,.95);border-left:1px solid rgba(255,212,0,.22);box-shadow:-24px 0 70px rgba(0,0,0,.55);z-index:80;padding:24px;display:flex;flex-direction:column;transform:translateX(110%);transition:.32s cubic-bezier(.2,.8,.2,1);backdrop-filter:blur(18px)}
.drawer.open{transform:translateX(0)}
.drawer-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:20px}
.close-btn{width:42px;height:42px;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(255,212,0,.12);font-size:27px;line-height:1;color:#fff4c0}
.close-btn:hover{background:rgba(255,92,124,.22);color:#fff}
.cart-list{flex:1;overflow:auto;display:grid;gap:12px;padding-right:4px}
.cart-item{display:grid;grid-template-columns:62px 1fr auto;gap:12px;align-items:center;background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.10);border-radius:16px;padding:10px}
.cart-thumb{height:52px;border-radius:13px;background:linear-gradient(135deg,var(--accent),#111)}
.cart-item h4{margin:0;font-size:14px}
.cart-item p{margin:4px 0 0;color:var(--yellow);font-weight:900}
.qty-row{display:flex;gap:6px;align-items:center}
.qty-row button{width:28px;height:28px;border-radius:9px;background:rgba(255,255,255,.08);color:#fff3aa}
.drawer-foot{border-top:1px solid rgba(255,212,0,.11);padding-top:18px}
.total-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;color:var(--muted)}
.total-row strong{font-size:32px;color:var(--yellow);font-family:Orbitron,sans-serif}
.backdrop{position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:70;opacity:0;pointer-events:none;transition:.2s ease;backdrop-filter:blur(4px)}
.backdrop.show{opacity:1;pointer-events:auto}

.modal{width:min(760px,calc(100% - 28px));border:0;padding:0;border-radius:26px;color:var(--text);overflow:hidden;max-height:min(90vh,900px)}
.modal::backdrop{background:rgba(0,0,0,.72);backdrop-filter:blur(6px)}
.glass-modal{padding:26px;background:linear-gradient(145deg,rgba(18,15,5,.98),rgba(4,4,3,.96));overflow-y:auto;max-height:min(90vh,900px);scrollbar-width:thin;scrollbar-color:rgba(255,212,0,.35) rgba(255,255,255,.04)}
.glass-modal::-webkit-scrollbar{width:6px}
.glass-modal::-webkit-scrollbar-track{background:rgba(255,255,255,.04);border-radius:6px}
.glass-modal::-webkit-scrollbar-thumb{background:rgba(255,212,0,.35);border-radius:6px}
.glass-modal::-webkit-scrollbar-thumb:hover{background:rgba(255,212,0,.6)}
.modal-close{position:absolute;right:18px;top:18px;z-index:2}
.modal-title{padding-right:58px;margin-bottom:18px}
.modal-title h2{font-size:32px}
.modal-title p:last-child{color:var(--muted);line-height:1.7}

.login-grid{display:flex;justify-content:center}.login-grid section{width:100%;max-width:420px}
.login-box,.admin-box{background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.12);border-radius:20px;padding:18px}
.login-box .field-label{margin-top:12px}
.demo-box h3{margin-bottom:14px}
.demo-account{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center;background:rgba(0,0,0,.22);border:1px solid rgba(255,212,0,.10);border-radius:14px;padding:10px;margin-bottom:8px}
.demo-account b{color:var(--yellow);font-family:Orbitron,sans-serif}
.demo-account span{color:#fff1a5}
.demo-account em{font-style:normal;color:#111;background:var(--yellow);border-radius:999px;padding:4px 8px;font-size:12px;font-weight:900}

.product-modal-grid{display:grid;grid-template-columns:.9fr 1.1fr;gap:22px;align-items:center}
.product-modal-art{height:340px;border-radius:22px;display:grid;place-items:center;background:radial-gradient(circle at center,color-mix(in srgb,var(--accent) 20%,transparent),rgba(255,255,255,.05));border:1px solid rgba(255,212,0,.10)}
.product-modal-art .product-art{width:230px;height:145px}
.detail-list{display:grid;gap:10px;margin:18px 0;padding-left:20px}
.detail-list li{color:#f3e7ae;line-height:1.65}

.payment-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0 18px;background:rgba(255,255,255,.04);border:1px solid rgba(255,212,0,.10);padding:8px;border-radius:18px}
.pay-tab{border-radius:13px;padding:12px;background:transparent;color:#d8cb92;font-weight:900}
.pay-tab.active{background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#141000}
.pay-panel{display:none}.pay-panel.active{display:block}
.field-label{display:block;color:#f3e7ae;margin-bottom:8px;font-weight:800}
input,textarea{width:100%;background:rgba(255,255,255,.06);border:1px solid rgba(255,212,0,.16);border-radius:14px;padding:13px 15px;outline:0;color:var(--text);transition:.2s ease}
textarea{resize:vertical}
input:focus,textarea:focus,select:focus{border-color:rgba(255,212,0,.65);box-shadow:0 0 0 4px rgba(255,212,0,.13)}
.amount-row{display:grid;grid-template-columns:1fr auto;gap:10px}
.qr-card{display:grid;place-items:center;min-height:330px;background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.10);border-radius:22px;margin-top:14px;padding:18px;text-align:center}
.qr-card img{width:235px;height:235px;border-radius:18px;background:white;padding:12px;display:none}
.qr-card img.show{display:block}
.qr-card p{color:#fff0a8;margin-top:12px;font-weight:900}
.hint{display:block;color:#b7aa78;margin-top:10px;line-height:1.6}
.tmn-card{text-align:center;background:linear-gradient(145deg,rgba(255,118,0,.12),rgba(255,212,0,.06));border:1px solid rgba(255,164,0,.20);border-radius:22px;padding:28px}
.tmn-logo{width:86px;height:86px;border-radius:24px;background:linear-gradient(135deg,#ff8c20,#ff4a00);display:grid;place-items:center;margin:0 auto 14px;font-family:Orbitron,sans-serif;font-weight:900;font-size:24px}
.tmn-card p{color:var(--muted);line-height:1.7;margin:10px 0 18px}
.code-result{margin-top:14px;border:1px solid rgba(255,212,0,.12);border-radius:16px;padding:16px;background:rgba(255,255,255,.05);color:#fff0b0}
.code-result.ok{border-color:rgba(0,231,162,.4);background:rgba(0,231,162,.1);color:#a8ffe4}
.code-result.bad{border-color:rgba(255,92,124,.4);background:rgba(255,92,124,.1);color:#ffd0d8}

.admin-modal{width:min(1180px,calc(100% - 28px))}
.locked-box{text-align:center;border:1px dashed rgba(255,212,0,.25);background:rgba(255,212,0,.06);border-radius:22px;padding:34px}
.locked-box p{color:var(--muted);line-height:1.7;margin:8px 0 18px}
.admin-content{display:none}
.admin-content.show{display:block}
.admin-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
.admin-box h3{margin-bottom:12px}
.created-code{margin-top:12px;background:rgba(255,212,0,.1);border:1px dashed rgba(255,212,0,.35);border-radius:16px;padding:14px;color:var(--yellow);font-family:Orbitron,sans-serif;font-weight:900;text-align:center;letter-spacing:.08em}
.product-admin-box{margin-top:16px}
.admin-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px}
.add-product-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr auto;gap:10px;margin-bottom:16px}
.admin-table-wrap{overflow:auto;border-radius:16px;border:1px solid rgba(255,212,0,.10)}
.admin-table{width:100%;border-collapse:collapse;min-width:920px;background:rgba(0,0,0,.18)}
.admin-table th,.admin-table td{padding:11px;border-bottom:1px solid rgba(255,212,0,.10);text-align:left;vertical-align:middle}
.admin-table th{color:var(--yellow);font-size:13px;white-space:nowrap;background:rgba(255,212,0,.07)}
.admin-table input{padding:10px;border-radius:10px;min-width:88px}
.admin-table .product-name-input{min-width:190px}
.codes-list-box{margin-top:16px}
.codes-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-height:180px;overflow:auto}
.code-pill{border-radius:13px;background:rgba(0,0,0,.22);border:1px solid rgba(255,212,0,.10);padding:10px;font-size:13px;color:#f5e6a1}
.code-pill b{display:block;color:var(--yellow);font-family:Orbitron,sans-serif}
.floating-admin{position:fixed;right:22px;bottom:22px;z-index:45;width:58px;height:58px;border-radius:20px;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));box-shadow:0 18px 50px rgba(255,212,0,.35);font-size:22px;color:#111}
.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,30px);z-index:100;opacity:0;pointer-events:none;background:rgba(10,9,4,.94);border:1px solid rgba(255,212,0,.26);border-radius:999px;padding:12px 18px;box-shadow:var(--shadow);transition:.25s ease;color:#fff1ac;font-weight:800}
.toast.show{opacity:1;transform:translate(-50%,0)}

.ripple{position:fixed;border-radius:50%;pointer-events:none;z-index:200;transform:translate(-50%,-50%);background:radial-gradient(circle,rgba(255,212,0,.95),rgba(255,183,0,.28) 45%,transparent 70%);animation:ripple .7s ease-out forwards;mix-blend-mode:screen}
@keyframes ripple{from{width:8px;height:8px;opacity:1}to{width:190px;height:190px;opacity:0}}
.spark{position:fixed;z-index:201;width:8px;height:8px;border-radius:50%;background:var(--yellow);pointer-events:none;box-shadow:0 0 12px var(--yellow);animation:spark .7s ease-out forwards}
@keyframes spark{to{transform:translate(var(--dx),var(--dy));opacity:0}}

body.low-glow #rainCanvas{opacity:.32}
body.low-glow .scanline{display:none}
body.low-glow .halo{opacity:.15}

@media (max-width:1100px){
  .hero{grid-template-columns:1fr}.stats-grid,.product-grid{grid-template-columns:repeat(2,1fr)}.admin-grid{grid-template-columns:1fr}.codes-list{grid-template-columns:1fr 1fr}.product-modal-grid{grid-template-columns:1fr}.product-modal-art{height:260px}.add-product-grid{grid-template-columns:1fr 1fr}.login-grid{grid-template-columns:1fr}
}
@media (max-width:760px){
  .topbar{border-radius:24px;flex-wrap:wrap;top:8px}.brand{width:100%;justify-content:center}.navlinks{order:3;width:100%;overflow:auto;justify-content:flex-start}.navlink{white-space:nowrap}.shell{margin-top:42px}.stats-grid,.product-grid{grid-template-columns:1fr}.section-head{align-items:flex-start;gap:12px;flex-direction:column}.product-img{height:200px}.amount-row,.payment-tabs{grid-template-columns:1fr}.codes-list{grid-template-columns:1fr}h1{font-size:50px}.hero-panel{min-height:260px}.drawer{width:100%}.add-product-grid{grid-template-columns:1fr}.demo-account{grid-template-columns:1fr}.login-button{padding-inline:12px}.brand-text{font-size:13px}
}


.chat-widget{position:fixed;left:22px;bottom:22px;z-index:46;width:min(360px,calc(100vw - 28px));border-radius:24px;padding:14px;box-shadow:0 18px 50px rgba(0,0,0,.35)}
.chat-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.chat-head h3{font-size:22px}
.chat-head small{display:block;color:var(--muted);line-height:1.5;max-width:220px}
.chat-toggle{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#111;font-size:20px;box-shadow:0 10px 26px rgba(255,212,0,.25)}
.chat-body{margin-top:12px;display:grid;gap:12px;max-height:420px;overflow:hidden;transition:.25s ease}
.chat-widget.collapsed{width:auto;padding:10px 12px;border-radius:20px}
.chat-widget.collapsed .chat-head > div,.chat-widget.collapsed .chat-body{display:none}
.chat-admin-bar{display:none}
.chat-admin-bar.show{display:block}
.chat-messages{display:flex;flex-direction:column;gap:8px;max-height:240px;overflow:auto;padding:4px 4px 4px 0}
.chat-empty{display:none;border:1px dashed rgba(255,212,0,.18);background:rgba(255,255,255,.04);padding:18px;border-radius:16px;color:var(--muted);text-align:center}
.chat-empty.show{display:block}
.chat-bubble{max-width:80%;padding:10px 14px;border-radius:18px;line-height:1.55;position:relative;word-break:break-word}
.chat-bubble p{margin:0 0 4px}
.chat-bubble small{display:block;font-size:11px;opacity:.7;margin-top:3px}
/* own = ผู้ใช้ปัจจุบัน → ขวา */
.chat-bubble.own{align-self:flex-end;margin-left:auto;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#171100;border-bottom-right-radius:5px}
/* other → ซ้าย */
.chat-bubble.other{align-self:flex-start;background:rgba(255,255,255,.08);border:1px solid rgba(255,212,0,.16);color:#fff6ca;border-bottom-left-radius:5px}
.chat-bubble.system{align-self:center;background:rgba(255,255,255,.05);border:1px dashed rgba(255,212,0,.16);color:var(--muted);text-align:center;font-size:.82rem}
/* compat */
.chat-bubble.user.own,.chat-bubble.user{align-self:flex-end;margin-left:auto}
.chat-bubble.admin.other,.chat-bubble.admin{align-self:flex-start}
.chat-compose{display:grid;grid-template-columns:1fr auto;gap:10px}
.chat-compose.disabled{opacity:.7}
.chat-compose.disabled #chatInput{opacity:.7}
.chat-thread-hint{display:inline-flex;align-items:center;gap:8px;background:rgba(255,212,0,.08);border:1px solid rgba(255,212,0,.14);border-radius:999px;padding:5px 10px;font-size:12px;color:var(--yellow)}
@media (max-width:760px){.chat-widget{left:14px;right:14px;width:auto;bottom:90px}.chat-widget.collapsed{left:14px;right:auto}}


.contact-section{margin:0 0 34px}
.section-head.compact{margin-bottom:14px}
.contact-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.contact-card{border-radius:20px;padding:20px;min-height:150px}
.contact-card h3{margin:14px 0 8px}
.contact-card p{color:var(--muted);line-height:1.7}
.contact-icon{display:inline-flex;align-items:center;justify-content:center;min-width:68px;height:38px;border-radius:999px;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#111;font-weight:900;font-family:Orbitron,sans-serif;font-size:12px;padding:0 14px}
.register-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.register-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:16px}
.member-list{display:grid;gap:10px;max-height:240px;overflow:auto}
.member-card{border:1px solid rgba(255,212,0,.10);background:rgba(0,0,0,.18);border-radius:16px;padding:12px}
.member-card h4{margin:0 0 6px;color:var(--yellow);font-family:Orbitron,sans-serif;font-size:15px}
.member-card p{margin:4px 0;color:#f7e8a5;line-height:1.55}
.member-card small{display:inline-flex;background:rgba(255,212,0,.12);border:1px solid rgba(255,212,0,.2);border-radius:999px;padding:4px 8px;color:var(--yellow);font-weight:800}
@media (max-width:1100px){.contact-grid,.register-grid{grid-template-columns:1fr}}


.auth-user-btn{display:inline-flex;align-items:center;gap:10px;height:46px;padding:0 14px;border-radius:999px;background:linear-gradient(145deg,rgba(255,255,255,.08),rgba(255,212,0,.06));border:1px solid rgba(255,212,0,.18);color:#fff6ca;font-weight:900;box-shadow:0 10px 24px rgba(0,0,0,.25);transition:.22s ease}
.auth-user-btn:hover{transform:translateY(-2px);background:rgba(255,212,0,.14)}
.auth-user-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:999px;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#111;font-size:16px}
.auth-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.auth-status.ok{border-color:rgba(0,231,162,.4);background:rgba(0,231,162,.08);color:#a8ffe4}
.footer-contact{margin-top:38px;padding:24px;border-radius:26px}
.footer-contact-head{margin-bottom:14px}
.footer-contact-head h2{font-family:Orbitron,sans-serif;font-size:34px;margin:6px 0}
.footer-contact-head p:last-child{color:var(--muted);line-height:1.7}
.register-grid.single-col{grid-template-columns:1fr;max-width:560px}
.member-card .meta{color:var(--muted);font-size:13px;margin-top:6px}
@media (max-width:760px){.auth-btn-label,#authBtnLabel{display:none}.auth-user-btn{padding:0 12px;min-width:46px;justify-content:center}.auth-choice-grid{grid-template-columns:1fr}.footer-contact-head h2{font-size:28px}}


.more-menu-wrap{position:relative}
.more-menu-btn{font-size:26px;font-weight:900;line-height:1}
.more-menu{position:absolute;top:52px;right:0;display:none;min-width:270px;border-radius:18px;padding:8px;z-index:90}
.more-menu.show{display:grid;gap:6px}
.more-menu button{background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.10);padding:12px 14px;border-radius:14px;text-align:left;color:#fff4bc;font-weight:800}
.more-menu button:hover{background:rgba(255,212,0,.12);color:#111;background-image:linear-gradient(135deg,var(--yellow),var(--yellow-2))}
.order-create-box{display:flex;justify-content:space-between;align-items:center;gap:14px;border-radius:20px;padding:16px 18px;margin-bottom:16px}
.order-create-box h3{margin-bottom:6px}
.order-create-box p{color:var(--muted);line-height:1.7}
.history-modal{width:min(980px,calc(100% - 28px))}
.history-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:18px}
.history-tab{border-radius:14px;padding:12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.10);font-weight:900;color:#f0e3a6}
.history-tab.active{background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#111}
.history-panel{display:none}
.history-panel.active{display:block}
.history-list{display:grid;gap:12px;max-height:58vh;overflow:auto;padding-right:4px}
.history-card{background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.12);border-radius:20px;padding:16px}
.history-card h4{margin:0 0 8px;font-family:Orbitron,sans-serif;color:var(--yellow)}
.history-card p{margin:5px 0;color:#f6e7aa;line-height:1.6}
.history-card .muted{color:var(--muted)}
.history-meta{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.history-pill{display:inline-flex;align-items:center;gap:6px;background:rgba(255,212,0,.1);border:1px solid rgba(255,212,0,.15);border-radius:999px;padding:5px 10px;color:var(--yellow);font-size:12px;font-weight:900}
.items-box{margin-top:10px;border-top:1px dashed rgba(255,212,0,.15);padding-top:10px}
.items-box ul{margin:8px 0 0;padding-left:18px;color:#fff4bd}
.claim-badge.ok{color:#9dffd2;border-color:rgba(0,231,162,.3);background:rgba(0,231,162,.12)}
.claim-badge.bad{color:#ffd2d9;border-color:rgba(255,92,124,.3);background:rgba(255,92,124,.12)}
.claim-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.admin-modal{width:min(1280px,calc(100% - 28px));max-height:92vh;overflow:auto}
.admin-modal .modal-title{position:sticky;top:0;background:linear-gradient(145deg,rgba(18,15,5,.98),rgba(4,4,3,.96));padding-top:4px;padding-bottom:10px;z-index:2}
.admin-content{padding-bottom:6px}
.member-list{display:grid;gap:10px}
.member-card{display:grid;grid-template-columns:1.2fr .8fr auto;gap:12px;align-items:center;border:1px solid rgba(255,212,0,.10);background:rgba(0,0,0,.18);border-radius:16px;padding:12px}
.member-card h4{margin:0 0 6px;color:var(--yellow);font-family:Orbitron,sans-serif;font-size:15px}
.member-card p{margin:4px 0;color:#f7e8a5;line-height:1.55}
.member-card small{display:inline-flex;background:rgba(255,212,0,.12);border:1px solid rgba(255,212,0,.2);border-radius:999px;padding:4px 8px;color:var(--yellow);font-weight:800}
.member-role-box{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.member-role-box select{min-width:170px}
.stock-add-input{min-width:88px}
.auth-user-btn{display:inline-flex;align-items:center;gap:10px;height:46px;padding:0 14px;border-radius:999px;background:linear-gradient(145deg,rgba(255,255,255,.08),rgba(255,212,0,.06));border:1px solid rgba(255,212,0,.18);color:#fff6ca;font-weight:900;box-shadow:0 10px 24px rgba(0,0,0,.25);transition:.22s ease}
.auth-user-btn:hover{transform:translateY(-2px);background:rgba(255,212,0,.14)}
.auth-user-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:999px;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#111;font-size:16px}
.auth-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.footer-contact{margin-top:38px;padding:24px;border-radius:26px}
.footer-contact-head{margin-bottom:14px}
.footer-contact-head h2{font-family:Orbitron,sans-serif;font-size:34px;margin:6px 0}
.footer-contact-head p:last-child{color:var(--muted);line-height:1.7}
.register-grid.single-col{grid-template-columns:1fr;max-width:560px}
.order-success{border-color:rgba(0,231,162,.4);background:rgba(0,231,162,.08);color:#a8ffe4}
.order-waiting{border-color:rgba(255,212,0,.2);background:rgba(255,255,255,.05);color:#fff0b0}
@media (max-width:1100px){.member-card{grid-template-columns:1fr}.order-create-box{flex-direction:column;align-items:flex-start}}
@media (max-width:760px){#authBtnLabel{display:none}.auth-user-btn{padding:0 12px;min-width:46px;justify-content:center}.auth-choice-grid,.history-tabs{grid-template-columns:1fr}.footer-contact-head h2{font-size:28px}.more-menu{right:-32px;min-width:220px}.admin-modal{max-height:95vh}}


/* v6 responsive/admin additions */
.brand-logo{height:34px;width:120px;object-fit:contain}
.admin-nav-only{display:none}
body.is-admin .admin-nav-only{display:inline-flex}
.admin-grid{grid-template-columns:repeat(4,1fr)}
.admin-chats-modal{width:min(1180px,calc(100% - 28px));max-height:92vh;overflow:auto}
.admin-chat-layout{display:grid;grid-template-columns:320px 1fr;gap:16px}
.admin-chat-sidebar,.admin-chat-main{background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.12);border-radius:22px;padding:16px}
.admin-chat-sidebar h3{margin-bottom:12px}
.admin-chat-threads{display:grid;gap:10px;max-height:60vh;overflow:auto;padding-right:4px}
.admin-thread-card{border:1px solid rgba(255,212,0,.12);background:rgba(0,0,0,.18);border-radius:16px;padding:12px;text-align:left;color:#fff5bd}
.admin-thread-card.active,.admin-thread-card:hover{background:linear-gradient(135deg,rgba(255,212,0,.18),rgba(255,183,0,.08));border-color:rgba(255,212,0,.35)}
.admin-thread-card b{display:block;color:var(--yellow);font-family:Orbitron,sans-serif;margin-bottom:4px}
.admin-thread-card small{display:block;color:var(--muted);line-height:1.5}
.thread-status{display:inline-flex;margin-top:8px;border-radius:999px;padding:4px 8px;font-size:12px;font-weight:900;background:rgba(255,212,0,.12);border:1px solid rgba(255,212,0,.2);color:var(--yellow)}
.thread-status.progress{background:rgba(255,212,0,.18);color:#ffef98}
.thread-status.done{background:rgba(0,231,162,.12);border-color:rgba(0,231,162,.32);color:#a8ffe4}
.admin-chat-room-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}
.admin-chat-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.admin-chat-messages{min-height:340px;max-height:54vh;overflow:auto;display:flex;flex-direction:column;gap:8px;background:rgba(0,0,0,.14);border:1px solid rgba(255,212,0,.10);border-radius:18px;padding:14px}
.admin-reply-box{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:12px}
.admin-reply-box textarea{min-height:78px}
.admin-chat-bubble{max-width:80%;padding:10px 14px;border-radius:18px;line-height:1.55;word-break:break-word}
/* ในมุมมองแอดมิน: own = admin → ขวา, other = ลูกค้า → ซ้าย */
.admin-chat-bubble.own{align-self:flex-end;margin-left:auto;background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#171100;border-bottom-right-radius:5px}
.admin-chat-bubble.other{align-self:flex-start;background:rgba(255,255,255,.08);border:1px solid rgba(255,212,0,.16);color:#fff6ca;border-bottom-left-radius:5px}
.admin-chat-bubble.system{align-self:center;background:rgba(255,255,255,.04);border:1px dashed rgba(255,212,0,.16);color:var(--muted);text-align:center;font-size:.82rem}
.admin-chat-bubble small{display:block;font-size:11px;opacity:.7;margin-top:4px}
/* compat */
.admin-chat-bubble.admin.own,.admin-chat-bubble.admin{align-self:flex-end;margin-left:auto}
.admin-chat-bubble.user.other,.admin-chat-bubble.user{align-self:flex-start}
#tmnGiftResult a{color:var(--yellow);font-weight:900;text-decoration:underline}
@media (max-width:1180px){
  .topbar{width:min(1000px,calc(100% - 24px));border-radius:28px;flex-wrap:wrap}
  .navlinks{order:3;width:100%;overflow:auto;justify-content:flex-start}
  .admin-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:860px){
  .admin-chat-layout{grid-template-columns:1fr}
  .admin-chat-threads{max-height:230px}
  .admin-reply-box{grid-template-columns:1fr}
  .admin-chat-room-head{flex-direction:column}
  .admin-chat-actions{justify-content:flex-start}
  .admin-grid{grid-template-columns:1fr}
}
@media (max-width:520px){
  .brand-logo{width:92px}
  .brand-text{display:none}
  .hero-logo{width:95%}
  .stat-card b{font-size:34px}
  .history-card,.admin-box,.login-box{padding:14px}
  .modal-title h2{font-size:26px}
}


/* v7 admin fullscreen + claim choices */
.fullscreen-admin-modal{
  width:100vw !important;
  max-width:100vw !important;
  height:100vh !important;
  max-height:100vh !important;
  border-radius:0 !important;
  margin:0 !important;
  padding:28px !important;
  overflow:auto !important;
}
.fullscreen-admin-modal::backdrop{background:rgba(0,0,0,.78);backdrop-filter:blur(7px)}
.fullscreen-admin-modal .modal-close{right:26px;top:24px}
.fullscreen-admin-modal .modal-title{
  position:sticky;
  top:-28px;
  z-index:5;
  padding:18px 72px 18px 0;
  background:linear-gradient(180deg,rgba(7,6,2,.98),rgba(7,6,2,.88));
  border-bottom:1px solid rgba(255,212,0,.12);
  backdrop-filter:blur(16px);
}
.fullscreen-admin-modal .admin-content{
  width:min(1500px,calc(100vw - 56px));
  margin:0 auto;
}
.fullscreen-admin-modal .admin-grid{grid-template-columns:repeat(4,1fr)}
.fullscreen-admin-modal .admin-table{min-width:1120px}
.claim-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.history-items-preview{display:none;margin-top:10px;border-top:1px dashed rgba(255,212,0,.15);padding-top:10px}
.history-items-preview.show{display:block}
.history-items-preview ul{margin:8px 0 0;padding-left:20px;color:#fff3ad;line-height:1.7}
.view-items-btn{white-space:nowrap}
.claim-choice-modal{width:min(720px,calc(100% - 28px))}
@media (max-width:1100px){
  .fullscreen-admin-modal .admin-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:760px){
  .fullscreen-admin-modal{padding:18px !important}
  .fullscreen-admin-modal .admin-content{width:100%}
  .fullscreen-admin-modal .modal-title{top:-18px;padding-right:58px}
  .fullscreen-admin-modal .admin-grid{grid-template-columns:1fr}
  .claim-choice-grid{grid-template-columns:1fr}
}


/* v8 admin category sidebar */
.admin-backoffice-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px;align-items:start}
.admin-main-column{display:grid;gap:18px;min-width:0}
.admin-main-column>.admin-box,.admin-main-column>.product-admin-box{scroll-margin-top:120px}
.admin-side-nav{position:sticky;top:110px;padding:18px;border-radius:24px;border:1px solid rgba(255,212,0,.12);background:linear-gradient(145deg,rgba(255,255,255,.06),rgba(255,212,0,.04));box-shadow:0 18px 44px rgba(0,0,0,.22)}
.admin-side-nav h3{font-family:Orbitron,sans-serif;font-size:20px;color:var(--yellow);margin-bottom:14px}
.admin-side-links{display:grid;gap:10px}
.admin-nav-btn{width:100%;text-align:left;padding:14px 14px;border-radius:16px;background:rgba(255,255,255,.05);border:1px solid rgba(255,212,0,.10);color:#fff4bd;font-weight:900;transition:.22s ease}
.admin-nav-btn:hover,.admin-nav-btn.active{background:linear-gradient(135deg,var(--yellow),var(--yellow-2));color:#161100;transform:translateX(-3px)}
.simple-summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.summary-tile{border:1px solid rgba(255,212,0,.12);background:rgba(255,255,255,.04);border-radius:18px;padding:16px}
.summary-tile b{display:block;font-size:28px;font-family:Orbitron,sans-serif;color:var(--yellow);margin-bottom:6px}
.summary-tile span{color:#f4eab4;line-height:1.55}
.claim-request-list{display:grid;gap:12px}
.claim-request-card{border:1px solid rgba(255,212,0,.12);background:rgba(255,255,255,.04);border-radius:18px;padding:16px}
.claim-request-card h4{margin:0 0 8px;color:var(--yellow);font-family:Orbitron,sans-serif}
.claim-request-card p{margin:5px 0;color:#f6e8ad;line-height:1.6}
.claim-request-meta{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.claim-request-meta .history-pill{margin:0}
.claim-request-card .claim-actions{margin-top:12px}
.chat-widget.focus-claim{box-shadow:0 0 0 2px rgba(255,212,0,.45),0 28px 56px rgba(255,212,0,.18)}
@media (max-width:1200px){.admin-backoffice-layout{grid-template-columns:1fr}.admin-side-nav{position:static;order:-1}.simple-summary-grid{grid-template-columns:1fr 1fr}}
@media (max-width:760px){.simple-summary-grid{grid-template-columns:1fr}.admin-side-links{grid-template-columns:1fr}}


/* v9 separate admin category pages */
.admin-backoffice-layout.page-mode{grid-template-columns:minmax(0,1fr) 300px}
.admin-pages-wrap{min-height:62vh}
.admin-page-section{display:none;animation:fadeSlide .22s ease}
.admin-page-section.active{display:block}
.code-page-grid,.payment-page-grid{grid-template-columns:1fr 1fr}
@keyframes fadeSlide{from{opacity:.2;transform:translateY(8px)}to{opacity:1;transform:none}}
.admin-page-section .admin-box{margin:0}
.admin-page-section .codes-list{grid-template-columns:1fr 1fr}
@media (max-width:1200px){.code-page-grid,.payment-page-grid{grid-template-columns:1fr}}


/* v10 hide back-office buttons from non-admin users */
.admin-only{display:none !important}
body.is-admin .admin-only{display:inline-flex !important}
body.is-admin .floating-admin.admin-only{display:grid !important}
body:not(.is-admin) #openAdminBtn,
body:not(.is-admin) #floatingAdminBtn,
body:not(.is-admin) #adminChatsNavBtn{
  display:none !important;
}


/* v11 real stock delivery */
.real-stock-box{margin:14px 0 16px;padding:18px;border-radius:20px;background:rgba(255,255,255,.045);border:1px solid rgba(255,212,0,.12)}
.real-stock-box h3{margin-bottom:6px;color:var(--yellow)}
.real-stock-box p{color:var(--muted);line-height:1.65;margin-bottom:14px}
.real-stock-grid{display:grid;grid-template-columns:260px 1fr auto;gap:12px;align-items:start}
.real-stock-grid textarea{min-height:130px}
.real-stock-count{display:inline-flex;align-items:center;justify-content:center;min-width:72px;padding:9px 12px;border-radius:999px;background:rgba(255,212,0,.10);border:1px solid rgba(255,212,0,.18);color:var(--yellow);font-weight:900}
.delivered-box{margin-top:12px;border-top:1px dashed rgba(255,212,0,.18);padding-top:12px}
.delivered-box ul{margin:8px 0 0;padding-left:18px;color:#a8ffe4;line-height:1.8}
.delivered-secret{display:inline-block;background:rgba(0,231,162,.08);border:1px solid rgba(0,231,162,.2);border-radius:10px;padding:3px 8px;color:#baffea;font-family:monospace;word-break:break-all}
.stock-warning{border-color:rgba(255,92,124,.35)!important;background:rgba(255,92,124,.08)!important;color:#ffd6dd!important}
@media (max-width:980px){.real-stock-grid{grid-template-columns:1fr}}

/* v12 product management + stock management like reference */
.admin-dashboard-shell{grid-template-columns:300px minmax(0,1fr)!important}
.admin-dashboard-shell .admin-left-style{order:0;position:sticky;top:90px;align-self:start;max-height:calc(100vh - 120px);overflow:auto}
.admin-dashboard-shell .admin-main-column{order:1}
.admin-brand-mini{display:flex;align-items:center;gap:12px;padding:10px 6px 18px;border-bottom:1px solid rgba(255,212,0,.12);margin-bottom:14px}
.admin-brand-mini img{width:54px;height:42px;object-fit:contain}
.admin-brand-mini b{font-family:Orbitron,sans-serif;color:#fff7bf;letter-spacing:.04em}
.howto-bar{border-radius:16px;padding:14px 18px;margin-bottom:18px;color:#fff8c7;font-weight:900}
.product-form-panel,.stock-form-panel,.stock-list-panel{border-radius:24px}
.product-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 22px}
.form-field{display:grid;gap:7px}
.form-field.full{grid-column:1 / -1}
.form-field span{font-weight:900;color:#fff6c5}
.form-field .red{color:#ff5c7c}
.product-form-grid textarea,.stock-form-grid textarea{min-height:58px}
.add-product-wide{margin-top:16px}
.stock-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 22px}
.stock-actions-row{display:grid;grid-template-columns:1fr 200px;gap:12px;margin-top:16px}
.stock-toolbar{display:flex;gap:20px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:14px 0}
.stock-toolbar label{display:flex;align-items:center;gap:8px;color:#fff6c5;font-weight:800}
.stock-toolbar input{width:90px}
.stock-toolbar label:last-child input{width:220px}
.danger-btn{background:rgba(255,92,124,.18)!important;border-color:rgba(255,92,124,.28)!important;color:#ffd4dc!important}
.stock-list-table td:first-child{color:var(--yellow);font-family:Orbitron,sans-serif}
.stock-item-cell{font-family:monospace;word-break:break-all;color:#fff0b0}
.stock-item-cell small{display:block;color:var(--muted);font-family:"Noto Sans Thai",sans-serif;margin-top:4px}
.delivered-secret{white-space:pre-wrap}
@media (max-width:1200px){.admin-dashboard-shell{grid-template-columns:1fr!important}.admin-dashboard-shell .admin-left-style{position:static;max-height:none;order:-1}.product-form-grid,.stock-form-grid{grid-template-columns:1fr}}
@media (max-width:760px){.stock-actions-row{grid-template-columns:1fr}.stock-toolbar{align-items:flex-start;flex-direction:column}.stock-toolbar label:last-child input{width:100%}}


/* v13 stock follows entered stock automatically */
.stock-auto-note{border:1px dashed rgba(255,212,0,.22);background:rgba(255,212,0,.07);border-radius:18px;padding:16px 18px}
.stock-auto-note span{color:var(--yellow);font-family:Orbitron,sans-serif}
.stock-auto-note p{color:#fff1b2;line-height:1.7;margin:4px 0 0}
.stock-list-table .stock-item-cell{white-space:pre-wrap}


/* v14 product image/detail/delete polish */
.product-image-field{display:grid;gap:8px;min-width:220px}
.product-image-preview{width:82px;height:52px;border-radius:14px;border:1px solid rgba(255,212,0,.18);background:rgba(255,255,255,.04);object-fit:cover;display:block}
.product-image-preview.empty{display:grid;place-items:center;color:var(--yellow);font-size:11px;font-weight:900;text-align:center;padding:4px}
.product-detail-field{min-width:260px;min-height:54px;resize:vertical}
.product-img.custom-image{background-size:cover;background-position:center;background-repeat:no-repeat}
.product-img.custom-image .product-art{display:none}
.product-modal-image{width:100%;min-height:260px;border-radius:24px;background-size:cover;background-position:center;border:1px solid rgba(255,212,0,.14);box-shadow:inset 0 0 60px rgba(0,0,0,.35)}
.delete-product-btn{background:rgba(255,92,124,.18)!important;border-color:rgba(255,92,124,.35)!important;color:#ffd8df!important}
.product-list-table th,.product-list-table td{vertical-align:middle}
.product-list-table .product-name-input{min-width:190px}
@media (max-width:1200px){.product-detail-field{min-width:220px}.product-image-field{min-width:190px}}


/* v15 detail + note display */
.product-note-field{min-width:220px;min-height:54px;resize:vertical}
.product-note-box{margin:12px 0;padding:12px 14px;border-radius:16px;background:rgba(255,212,0,.08);border:1px solid rgba(255,212,0,.18);color:#fff2ad;line-height:1.7}
.product-note-box b{display:block;color:var(--yellow);margin-bottom:4px}
.product-detail-text{white-space:pre-wrap}


/* v16: reduce font sizes globally for cleaner premium layout */
:root{
  --font-scale: .86;
}

html{
  font-size: 13px;
}

/* Navigation / buttons */
.topbar,
.navlinks,
.navlink,
.auth-user-btn,
.primary-btn,
.ghost-btn,
.icon-btn,
.pill,
.badge,
.field-label,
.demo-account,
.more-menu button{
  font-size: .92rem;
}

/* Hero section */
.hero-copy h1{
  font-size: clamp(4.2rem, 8vw, 7.2rem) !important;
  line-height: .86;
  letter-spacing: -.06em;
}

.hero-copy .subtext{
  font-size: 1.02rem;
  line-height: 1.75;
  max-width: 720px;
}

.eyebrow{
  font-size: .86rem;
}

.eyebrow.mini,
.mini{
  font-size: .78rem;
}

/* Cards / stats */
.stat-card b{
  font-size: clamp(2.5rem, 4.2vw, 4.3rem) !important;
}

.stat-card p,
.stat-card small{
  font-size: .9rem;
}

.section-head h2,
.footer-contact-head h2{
  font-size: clamp(2rem, 3vw, 3rem) !important;
}

.section-head p,
.footer-contact-head p{
  font-size: .98rem;
}

/* Product cards */
.product-body h3,
.product-card h3{
  font-size: 1.05rem !important;
  line-height: 1.35;
}

.product-body .price,
.product-card .price,
.price{
  font-size: clamp(1.65rem, 2.25vw, 2.55rem) !important;
}

.product-actions button{
  font-size: .9rem;
}

.tag,
.stock-badge{
  font-size: .78rem;
}

/* Modals */
.modal-title h2,
.glass-modal h2{
  font-size: clamp(1.8rem, 3vw, 3rem) !important;
}

.modal-title p,
.glass-modal p,
.detail-list,
.product-detail-text,
.product-note-box{
  font-size: .98rem;
}

.product-modal-grid h2{
  font-size: clamp(1.8rem, 2.8vw, 2.6rem) !important;
}

/* Admin */
.admin-box h3,
.admin-side-nav h3,
.admin-section-head h3{
  font-size: 1.25rem !important;
}

.admin-table th{
  font-size: .84rem;
}

.admin-table td,
.admin-table input,
.admin-table select,
.admin-table textarea,
.product-form-grid input,
.product-form-grid select,
.product-form-grid textarea,
.stock-form-grid input,
.stock-form-grid select,
.stock-form-grid textarea{
  font-size: .92rem;
}

.created-code{
  font-size: 1.1rem;
}

.summary-tile b{
  font-size: 2rem !important;
}

/* Chat / history */
.chat-head h3,
.history-card h4{
  font-size: 1.1rem;
}

.chat-bubble,
.admin-chat-bubble,
.history-card,
.history-pill{
  font-size: .9rem;
}

/* Mobile tune */
@media (max-width: 760px){
  html{
    font-size: 12px;
  }

  .hero-copy h1{
    font-size: clamp(3.5rem, 17vw, 5rem) !important;
  }

  .stat-card b{
    font-size: 2.6rem !important;
  }

  .product-body .price,
  .product-card .price,
  .price{
    font-size: 1.8rem !important;
  }
}


/* v17 service top-up sections */
.special-services-section{
  margin:42px 0 36px;
  padding:26px;
  border-radius:30px;
  border:1px solid rgba(255,212,0,.15);
}
.special-services-section .section-head{
  margin-bottom:18px;
}
.service-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}
.service-card{
  border:1px solid rgba(255,212,0,.14);
  background:linear-gradient(145deg,rgba(255,255,255,.06),rgba(255,212,0,.035));
  border-radius:26px;
  padding:20px;
  box-shadow:0 20px 50px rgba(0,0,0,.24);
}
.service-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:16px;
}
.service-head h3{
  color:#fff8c7;
  font-family:Orbitron,"Noto Sans Thai",sans-serif;
  font-size:1.35rem;
  line-height:1.35;
}
.service-chip{
  border:1px solid rgba(255,212,0,.25);
  background:rgba(255,212,0,.12);
  color:var(--yellow);
  border-radius:999px;
  padding:7px 10px;
  font-weight:900;
  white-space:nowrap;
  font-size:.82rem;
}
.service-table-wrap{
  display:grid;
  gap:14px;
}
.service-table-wrap.two-cols{
  grid-template-columns:1fr 1fr;
  align-items:start;
}
.service-table-wrap h4{
  color:var(--yellow);
  margin:4px 0 8px;
  font-size:1rem;
}
.service-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid rgba(255,212,0,.12);
  border-radius:16px;
}
.service-table th,
.service-table td{
  padding:10px 12px;
  border-bottom:1px solid rgba(255,212,0,.08);
  text-align:left;
}
.service-table th{
  color:var(--yellow);
  background:rgba(255,212,0,.08);
  font-weight:900;
}
.service-table td{
  color:#fff0b5;
  background:rgba(0,0,0,.16);
}
.service-table tr:last-child td{
  border-bottom:0;
}
.service-actions{
  display:grid;
  grid-template-columns:1fr 1fr 1.3fr;
  gap:10px;
  margin-top:18px;
}
.service-detail-modal{
  width:min(820px,calc(100% - 28px));
}
.service-detail-content h2{
  color:#fff8c7;
  font-family:Orbitron,"Noto Sans Thai",sans-serif;
  margin-bottom:10px;
}
.service-detail-content p,
.service-detail-content li{
  color:#fff0b5;
  line-height:1.8;
}
.service-detail-content ul{
  margin:12px 0 0;
  padding-left:20px;
}
.service-order-result{
  margin-top:14px;
}
@media (max-width:1180px){
  .service-grid{grid-template-columns:1fr}
}
@media (max-width:760px){
  .special-services-section{padding:18px}
  .service-table-wrap.two-cols{grid-template-columns:1fr}
  .service-actions{grid-template-columns:1fr}
  .service-head{flex-direction:column}
}


/* v18: package tabs for service price tables */
.package-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0 16px;
}
.package-tab{
  border:1px solid rgba(255,212,0,.18);
  background:rgba(255,255,255,.045);
  color:#fff2ad;
  border-radius:999px;
  padding:9px 13px;
  font-weight:900;
  transition:.2s ease;
}
.package-tab:hover,
.package-tab.active{
  background:linear-gradient(135deg,var(--yellow),var(--yellow-2));
  color:#161100;
  box-shadow:0 12px 28px rgba(255,212,0,.2);
}
.package-panel{
  display:none;
  animation:serviceFade .18s ease;
}
.package-panel.active{
  display:block;
}
.package-panel h4{
  color:var(--yellow);
  margin:4px 0 10px;
  font-size:1.05rem;
}
@keyframes serviceFade{
  from{opacity:.2;transform:translateY(6px)}
  to{opacity:1;transform:none}
}
.service-card{
  align-self:start;
}
.service-table{
  margin-bottom:0;
}


/* v19 chat image upload */
.chat-compose{
  grid-template-columns:auto 1fr auto;
}
.chat-image-btn{
  min-width:46px;
  padding-inline:12px;
}
.admin-reply-box{
  grid-template-columns:1fr;
}
.admin-reply-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.chat-upload-image{
  max-width:220px;
  max-height:220px;
  border-radius:14px;
  border:1px solid rgba(255,212,0,.22);
  display:block;
  cursor:pointer;
  object-fit:cover;
  box-shadow:0 10px 24px rgba(0,0,0,.28);
}
.chat-upload-image:hover{
  transform:scale(1.02);
}
.chat-image-caption{
  margin-top:7px;
  color:#fff0b5;
  word-break:break-word;
}
.chat-image-modal{
  width:min(920px,calc(100% - 28px));
  padding:18px;
}
.chat-image-modal img{
  width:100%;
  max-height:82vh;
  object-fit:contain;
  border-radius:18px;
  border:1px solid rgba(255,212,0,.16);
}
.chat-bubble.image,
.admin-chat-bubble.image{
  padding:10px;
}
@media (max-width:560px){
  .chat-compose{
    grid-template-columns:auto 1fr;
  }
  .chat-compose #sendChatBtn{
    grid-column:1 / -1;
  }
  .chat-upload-image{
    max-width:180px;
  }
}


/* ============================================================
   DUCK DUCK STORE — v20 UX/UI Polish
   ============================================================ */

/* ---------- Loading skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,212,0,.06) 25%,
    rgba(255,212,0,.14) 50%,
    rgba(255,212,0,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 12px;
}
@keyframes shimmer { to { background-position: -200% 0 } }

.skeleton-card {
  height: 360px;
  border-radius: 20px;
  border: 1px solid rgba(255,212,0,.10);
}

/* ---------- Scroll progress bar ---------- */
#scrollBar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--yellow), var(--yellow-3));
  z-index: 999;
  width: 0%;
  transition: width .1s linear;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(255,212,0,.55);
}

/* ---------- Improved product cards ---------- */
.product-card {
  transition: transform .28s cubic-bezier(.2,.8,.2,1),
              box-shadow .28s ease,
              border-color .28s ease;
}
.product-card:hover {
  transform: translateY(-10px) scale(1.015);
}
.product-card .product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.product-card .add-btn {
  position: relative;
  overflow: hidden;
}
.product-card .add-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.18);
  transform: translateX(-100%);
  transition: transform .3s ease;
}
.product-card .add-btn:hover::after {
  transform: translateX(100%);
}

/* Out-of-stock overlay */
.product-card.out::after {
  content: 'หมดสต็อก';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.56);
  color: rgba(255,255,255,.75);
  font-weight: 900;
  font-family: Orbitron, sans-serif;
  font-size: .95rem;
  letter-spacing: .12em;
  backdrop-filter: blur(2px);
  border-radius: 20px;
  pointer-events: none;
}

/* ---------- Better price display ---------- */
.price-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 10px;
}
.price-old {
  font-size: .9rem;
  color: var(--muted);
  text-decoration: line-through;
}
.price-discount-badge {
  background: rgba(255,92,124,.18);
  border: 1px solid rgba(255,92,124,.28);
  color: #ffd4dc;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 900;
}

/* ---------- Cart drawer improvements ---------- */
.cart-item {
  transition: background .18s ease;
}
.cart-item:hover {
  background: rgba(255,212,0,.06);
}
.cart-item h4 {
  font-size: .88rem;
  line-height: 1.4;
}
.qty-row button {
  transition: background .18s ease, transform .14s ease;
}
.qty-row button:hover {
  background: rgba(255,212,0,.22);
  transform: scale(1.15);
}
.cart-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.cart-empty-state .cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  display: block;
  opacity: .6;
}

/* ---------- Topbar improvements ---------- */
.topbar {
  transition: box-shadow .25s ease, background .25s ease;
}
.topbar.scrolled {
  box-shadow: 0 8px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(255,212,0,.12);
}

/* Notification dot on cart */
.cart-icon.has-items span {
  animation: bounce-badge .5s ease;
}
@keyframes bounce-badge {
  0%,100% { transform: scale(1) }
  50% { transform: scale(1.35) }
}

/* ---------- Auth button / role badge ---------- */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: .78rem;
}
.role-badge.admin    { background: rgba(255,92,124,.18); border: 1px solid rgba(255,92,124,.3); color: #ffd6dc; }
.role-badge.dealer   { background: rgba(0,231,162,.12); border: 1px solid rgba(0,231,162,.28); color: #a8ffe4; }
.role-badge.vip      { background: rgba(255,212,0,.18); border: 1px solid rgba(255,212,0,.32); color: var(--yellow); }
.role-badge.customer { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #e0d8b8; }

/* ---------- Modal improvements ---------- */
.modal {
  animation: modal-in .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* Close button hover */
.close-btn {
  transition: background .18s ease, transform .18s ease;
}
.close-btn:hover {
  background: rgba(255,92,124,.28);
  transform: rotate(90deg) scale(1.1);
}

/* Input focus glow improved */
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255,212,0,.72);
  box-shadow: 0 0 0 3px rgba(255,212,0,.12), 0 2px 12px rgba(255,212,0,.08);
}

/* ---------- Checkout / payment modal ---------- */
.payment-modal {
  width: min(820px, calc(100% - 28px));
}
.payment-modal .modal-title {
  position: sticky;
  top: 0;
  background: linear-gradient(145deg,rgba(18,15,5,.99),rgba(4,4,3,.98));
  padding-top: 4px;
  padding-bottom: 10px;
  z-index: 2;
}
.pay-tab {
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
.pay-tab:hover:not(.active) {
  background: rgba(255,212,0,.10);
  transform: translateY(-1px);
}

/* Order placed success animation */
.order-placed-success {
  animation: pop-in .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop-in {
  from { transform: scale(.88); opacity: 0 }
  to   { transform: scale(1);   opacity: 1 }
}

.delivered-item {
  background: rgba(0,231,162,.08);
  border: 1px solid rgba(0,231,162,.22);
  border-radius: 10px;
  padding: 8px 12px;
  color: #a8ffe4;
  font-family: monospace;
  margin: 6px 0;
  word-break: break-all;
  line-height: 1.6;
}

/* ---------- Admin panel polish ---------- */
.admin-nav-btn {
  position: relative;
  overflow: hidden;
}
.admin-nav-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--yellow);
  transform: scaleY(0);
  transition: transform .2s ease;
  border-radius: 0 3px 3px 0;
}
.admin-nav-btn.active::before,
.admin-nav-btn:hover::before {
  transform: scaleY(1);
}

/* Admin table row hover */
.admin-table tbody tr {
  transition: background .18s ease;
}
.admin-table tbody tr:hover {
  background: rgba(255,212,0,.04);
}

/* Save / delete button sizes in admin table */
.save-product-btn {
  padding: 8px 12px !important;
  font-size: .82rem !important;
  white-space: nowrap;
}
.delete-product-btn {
  padding: 8px 12px !important;
  font-size: .82rem !important;
  white-space: nowrap;
}

/* Code pill improved */
.code-pill {
  transition: transform .2s ease, border-color .2s ease;
  cursor: default;
}
.code-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255,212,0,.28);
}
.code-pill.used {
  opacity: .5;
  filter: grayscale(.6);
}

/* ---------- Chat widget improvements ---------- */
.chat-widget {
  transition: box-shadow .25s ease;
}
.chat-widget:not(.collapsed):hover {
  box-shadow: 0 24px 60px rgba(255,212,0,.12), 0 0 0 1px rgba(255,212,0,.18);
}
.chat-bubble {
  animation: bubble-in .18s ease;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px) }
  to   { opacity: 1; transform: none }
}

/* Unread badge */
.chat-toggle-wrap {
  position: relative;
  display: inline-block;
}
.chat-unread-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: none;
  place-items: center;
  border: 2px solid var(--bg);
}
.chat-unread-badge.show {
  display: grid;
}

/* ---------- History modal ---------- */
.history-card {
  transition: transform .2s ease, border-color .2s ease;
}
.history-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,212,0,.25);
}

/* ====== PENDING ORDER — LOCKED STATE ====== */
.order-pending-lock {
  border-color: rgba(255,212,0,.35) !important;
  pointer-events: none;       /* ล็อกการกด */
  user-select: none;
  position: relative;
}
/* อนุญาตให้ copy-btn ยังคลิกได้เมื่อ delivered (ไม่ถูก lock) */
.order-pending-lock * { pointer-events: none; }
.order-pending-lock:hover { transform: none; }

/* Banner "รอแอดมินยืนยัน" */
.pending-wait-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  background: rgba(255,212,0,.07);
  border: 1px solid rgba(255,212,0,.28);
  border-radius: 14px;
  color: #fff0a3;
}
.pending-wait-banner b { font-size: .88rem; display: block; margin-bottom: 3px; }
.pending-wait-banner p { margin: 0; font-size: .78rem; color: var(--muted); line-height: 1.5; }

/* Spinner ใน pending banner */
.pending-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255,212,0,.18);
  border-top-color: var(--yellow);
  animation: order-spin .9s linear infinite;
  flex-shrink: 0;
}
@keyframes order-spin { to { transform: rotate(360deg); } }

/* ====== DELIVERED — แสดงสต็อก ====== */
.delivered-items-section {
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(0,231,162,.05);
  border: 1px solid rgba(0,231,162,.22);
  border-radius: 14px;
}
.delivered-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 900;
  font-size: .88rem;
  margin-bottom: 10px;
}
.delivered-items-section .history-delivered-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 5px 0;
}
.delivered-value {
  font-family: monospace;
  font-size: .84rem;
  color: #a8ffe4;
  word-break: break-all;
  flex: 1;
}

/* Delivered items in history */
.history-delivered-item {
  display: block;
  font-family: monospace;
  font-size: .85rem;
  padding: 5px 10px;
  background: rgba(0,231,162,.07);
  border: 1px solid rgba(0,231,162,.18);
  border-radius: 8px;
  color: #a8ffe4;
  margin: 4px 0;
  word-break: break-all;
}

/* Status badge colors */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 900;
}
.status-badge.pending  { background: rgba(255,212,0,.12); border: 1px solid rgba(255,212,0,.22); color: #fff0a3; }
.status-badge.paid     { background: rgba(0,150,255,.12); border: 1px solid rgba(0,150,255,.22); color: #a0cfff; }
.status-badge.delivered{ background: rgba(0,231,162,.12); border: 1px solid rgba(0,231,162,.22); color: #a8ffe4; }
.status-badge.cancelled{ background: rgba(255,92,124,.12); border: 1px solid rgba(255,92,124,.22); color: #ffd6dc; }

/* ---------- Service cards improvement ---------- */
.service-table tbody tr {
  transition: background .15s ease;
}
.service-table tbody tr:hover td {
  background: rgba(255,212,0,.07);
}

/* ---------- Ticker improvement ---------- */
.ticker-wrap {
  position: relative;
  overflow: hidden;
}
.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}
.ticker-wrap::before {
  left: 0;
  background: linear-gradient(to right, rgba(8,8,6,.95), transparent);
}
.ticker-wrap::after {
  right: 0;
  background: linear-gradient(to left, rgba(8,8,6,.95), transparent);
}

/* ---------- Section entrance animation ---------- */
.animate-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .52s ease, transform .52s ease;
}
.animate-in.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Empty state improvements ---------- */
.empty-state {
  text-align: center;
  padding: 48px 28px;
  border: 1px dashed rgba(255,212,0,.18);
  border-radius: 22px;
  background: rgba(255,212,0,.04);
}
.empty-state-icon {
  font-size: 3.2rem;
  margin-bottom: 16px;
  display: block;
  opacity: .7;
}
.empty-state h3 {
  color: #fff4bd;
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 320px;
  margin: 0 auto;
}

/* ---------- Floating admin button improved ---------- */
.floating-admin {
  transition: transform .2s ease, box-shadow .2s ease;
}
.floating-admin:hover {
  transform: rotate(18deg) scale(1.1);
  box-shadow: 0 22px 55px rgba(255,212,0,.48);
}

/* ---------- QR image show animation ---------- */
.qr-card img.show {
  animation: qr-appear .3s ease;
}
@keyframes qr-appear {
  from { opacity: 0; transform: scale(.88) }
  to   { opacity: 1; transform: scale(1) }
}

/* ---------- Stock item row hover ---------- */
.stock-list-table tbody tr {
  transition: background .15s ease;
}
.stock-list-table tbody tr:hover {
  background: rgba(255,212,0,.04);
}
.delete-stock-item-btn {
  padding: 6px 12px !important;
  font-size: .8rem !important;
}

/* ---------- Button loading state ---------- */
.btn-loading {
  pointer-events: none;
  opacity: .7;
  position: relative;
}
.btn-loading::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,.25);
  border-top-color: rgba(0,0,0,.75);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

/* ---------- Admin chat thread card improved ---------- */
.admin-thread-card {
  transition: transform .18s ease, border-color .18s ease;
  cursor: pointer;
}
.admin-thread-card:hover {
  transform: translateX(-3px);
}
.admin-chat-messages {
  scroll-behavior: smooth;
}

/* ---------- Member card role select highlight ---------- */
.member-card select:focus {
  border-color: rgba(255,212,0,.6);
}

/* ---------- Notice textarea ---------- */
#noticeInput {
  min-height: 110px;
  font-family: 'Noto Sans Thai', monospace;
  line-height: 1.75;
}

/* ---------- Responsive nav pill scroll ---------- */
@media (max-width: 760px) {
  .navlinks {
    scrollbar-width: none;
  }
  .navlinks::-webkit-scrollbar { display: none; }
  .product-card .product-actions {
    grid-template-columns: 1fr;
  }
  .payment-modal {
    width: calc(100% - 24px);
    max-height: 92dvh;
  }
}

/* ---------- Focus visible (accessibility) ---------- */
:focus-visible {
  outline: 2px solid rgba(255,212,0,.72);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
  outline-radius: 8px;
}

/* ---------- Smooth section divider ---------- */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,212,0,.22) 30%,
    rgba(255,212,0,.22) 70%,
    transparent);
  margin: 44px 0;
}

/* ---------- Product count badge on filter pills ---------- */
.pill .pill-count {
  background: rgba(255,212,0,.22);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: .72rem;
  font-weight: 900;
}

/* ---------- Checkout order info mini cart ---------- */
.cart-item-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,212,0,.10);
  border-radius: 12px;
  margin-bottom: 6px;
  font-size: .9rem;
}
.cart-item-mini:last-child {
  margin-top: 10px;
  background: rgba(255,212,0,.07);
  border-color: rgba(255,212,0,.18);
  border-radius: 14px;
  padding: 10px 14px;
}
.cart-item-mini strong {
  color: var(--yellow);
  font-family: Orbitron, sans-serif;
  font-size: 1.1rem;
}

/* ---------- Admin page section fade ---------- */
.admin-page-section.active {
  animation: fadeSlide .2s ease;
}

/* ---------- Topbar shrink on scroll ---------- */
.topbar.compact {
  min-height: 56px;
  padding: 5px 14px;
}

/* ---------- Copy button for delivered items ---------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255,212,0,.1);
  border: 1px solid rgba(255,212,0,.2);
  color: var(--yellow);
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
  transition: background .18s ease;
  margin-left: 6px;
}
.copy-btn:hover {
  background: rgba(255,212,0,.22);
}
.copy-btn.copied {
  background: rgba(0,231,162,.14);
  border-color: rgba(0,231,162,.28);
  color: #a8ffe4;
}

/* ---------- Demo account quick login click ---------- */
.demo-account {
  cursor: pointer;
  transition: background .18s ease;
}
.demo-account:hover {
  background: rgba(255,212,0,.10);
  border-color: rgba(255,212,0,.24);
}

/* ---------- Custom scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,212,0,.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,212,0,.40);
}

/* ---------- Admin page header sticky ---------- */
.admin-page-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg,rgba(7,6,2,.98),transparent);
  padding-bottom: 10px;
  margin-bottom: 4px;
}

/* ---------- Stock warning glow ---------- */
.stock-badge.low {
  background: rgba(255,92,124,.14);
  border-color: rgba(255,92,124,.28);
  color: #ffd6dc;
  animation: pulse-warn 2s ease-in-out infinite;
}
@keyframes pulse-warn {
  0%,100% { box-shadow: none }
  50% { box-shadow: 0 0 10px rgba(255,92,124,.28) }
}

/* ---------- Success state green glow ---------- */
.code-result.ok {
  animation: glow-green .4s ease;
}
@keyframes glow-green {
  from { box-shadow: 0 0 0 0 rgba(0,231,162,.35) }
  to   { box-shadow: 0 0 18px 0 rgba(0,231,162,.12) }
}

/* ---------- Backdrop close hint ---------- */
.backdrop::after {
  content: 'แตะนอกกรอบเพื่อปิด';
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.28);
  font-size: .8rem;
  white-space: nowrap;
  pointer-events: none;
}

/* ===== Chat thread card ===== */
.admin-thread-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,212,0,.10);
  text-align: left;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  width: 100%;
}
.admin-thread-card:hover { background: rgba(255,212,0,.08); border-color: rgba(255,212,0,.25); }
.admin-thread-card.active { background: rgba(255,212,0,.14); border-color: rgba(255,212,0,.45); }
.admin-thread-card.thread-status-done { opacity: .55; }
.thread-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-card-row b { font-size: .88rem; color: #fff4bd; }
.admin-thread-card small { font-size: .76rem; color: var(--muted); }

/* ===== Chat status badges ===== */
.thread-status-badge {
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.thread-status-badge.status-open     { background: rgba(255,212,0,.15); color: #ffd400; }
.thread-status-badge.status-progress { background: rgba(0,160,255,.15); color: #60c8ff; }
.thread-status-badge.status-done     { background: rgba(0,231,162,.15); color: #00e7a2; }

/* ===== Chat status badge in room header ===== */
.chat-status-badge { font-weight: 700; letter-spacing: .04em; }
.chat-status-badge.status-open     { color: #ffd400; }
.chat-status-badge.status-progress { color: #60c8ff; }
.chat-status-badge.status-done     { color: #00e7a2; }