/* ============================================================
   DS PROJECT SHOP — DS THEME (สไตล์ P.Shop)
   แถบข้างม่วงทรงคางหมู + เงาม่วงฟุ้ง + การ์ดขาวเงานุ่ม + ปุ่มม่วงไล่เฉด
   โหลดต่อจาก base.css : ทับโทเคนสี/หน้าตาเท่านั้น ไม่มี logic
   ============================================================ */
:root{
  --ds-rail:#5b45e6;
  --mt-ink:#14121f; --mt-ink-2:#3b3752; --mt-mute:#5f5b78; --mt-dim:#8e8aa8;
  --mt-deep:#6a45f2; --mt-deep-2:#5b45e6; --mt-mint:#e4ddff; --mt-mint-2:#f1eeff;
  --mt-peach:#ffe3f3; --mt-sky:#dfe9ff; --mt-lime:#dcf7ea; --mt-sand:#fff0e0;
  --mt-line:#e6e3f5; --mt-line-2:#d6d0f0;
  --mt-bad:#b4233a; --mt-warn:#b45f0a; --mt-ok:#12805c;
  --mt-card:#fff; --mt-surface:#fff; --mt-surface-2:#f7f6fd;
  --th-radius:20px;
  --mt-shadow:0 1px 2px rgba(60,40,140,.06),0 14px 34px -12px rgba(70,50,170,.18);
  --mt-shadow-h:0 2px 4px rgba(60,40,140,.08),0 26px 50px -14px rgba(70,50,170,.3);
  --cl-grad:linear-gradient(135deg,#8a63ff,#6a45f2);
  --cl-side:var(--ds-rail); --cl-accent:var(--ds-rail);
  --ds-glow:0 12px 24px -8px rgba(106,69,242,.55);
}
body{
  background:radial-gradient(900px 500px at 12% -8%,#d9d2ff66,transparent 70%),radial-gradient(700px 500px at 100% 100%,#f1d9f655,transparent 70%),#eceaf8 !important;
  background-attachment:fixed !important;
}
::selection{background:#e4ddff;color:#14121f}
::-webkit-scrollbar-thumb{background:rgba(106,69,242,.3)}
::-webkit-scrollbar-thumb:hover{background:var(--mt-deep)}
.custom-scrollbar::-webkit-scrollbar-thumb{background:rgba(106,69,242,.3)}

/* ---------- primitives ---------- */
.mt-card,.mt-panel,.mt-glass{background:#fff;border:1px solid var(--mt-line);box-shadow:var(--mt-shadow);backdrop-filter:none;-webkit-backdrop-filter:none}
.mt-card{border-radius:20px}
.mt-card-hover:hover{transform:translateY(-5px);box-shadow:var(--mt-shadow-h)}
.mt-text{background:linear-gradient(100deg,#8a63ff,#5b45e6 70%,#c026d3);-webkit-background-clip:text;background-clip:text;color:transparent!important}
.mt-tag{background:var(--cl-grad);box-shadow:var(--ds-glow)}
.mt-tag.mint{background:var(--mt-mint-2);color:#5b45e6!important;box-shadow:none}
.mt-btn{background:var(--cl-grad);border-radius:14px;box-shadow:var(--ds-glow)}
.mt-btn:hover{background:var(--cl-grad);filter:brightness(1.06);box-shadow:0 16px 28px -8px rgba(106,69,242,.65)}
.mt-btn-ghost{background:#fff;border-radius:14px;box-shadow:0 0 0 1px var(--mt-line),var(--mt-shadow)}
.mt-btn-ghost:hover{background:var(--mt-mint-2);color:#5b45e6!important}
.mt-icon-btn{background:var(--mt-surface-2);border-radius:14px}
.mt-icon-btn:hover{background:var(--mt-mint)}
.mt-icon-btn.accent{background:var(--mt-mint-2);color:#5b45e6!important}
.mt-icon-btn.accent:hover{background:var(--cl-grad);color:#fff!important}
.mt-seg{border-radius:14px}
.mt-seg:hover{background:#fff}
.mt-seg.on{background:var(--cl-grad);box-shadow:var(--ds-glow)}
.mt-input{border-radius:14px}
.mt-input:focus,body input:focus,body select:focus,body textarea:focus{border-color:var(--mt-deep)!important;box-shadow:0 0 0 4px rgba(138,99,255,.3)!important}
.mt-bg-mint{background:linear-gradient(145deg,#dcf7ea,#9fe3c8)}
.mt-bg-peach{background:linear-gradient(145deg,#ffe3f3,#ffa8d6)}
.mt-bg-sky{background:linear-gradient(145deg,#e0ebff,#b7ceff)}
.mt-bg-lime{background:linear-gradient(145deg,#fff0e0,#ffc98a)}
.mt-bg-sand{background:linear-gradient(145deg,#f4efff,#ddd2fa)}
.mt-bg-lilac{background:linear-gradient(145deg,#e6dcff,#b9a4ff)}
@keyframes mtPulse{0%{box-shadow:0 0 0 0 rgba(106,69,242,.55)}70%{box-shadow:0 0 0 8px rgba(106,69,242,0)}100%{box-shadow:0 0 0 0 rgba(106,69,242,0)}}

/* ---------- legacy Tailwind map -> โทนม่วง P.Shop ---------- */
html[data-mode=light] body .bg-zinc-800,html[data-mode=light] body .bg-zinc-700{background:#f1eeff!important}
html[data-mode=light] body .bg-black,html[data-mode=light] body [class*="bg-black/"]:not([class*="inset-0"]),html[data-mode=light] body [class*="bg-zinc-900/"],html[data-mode=light] body [class*="bg-zinc-950/"],html[data-mode=light] body [class*="bg-zinc-800/"]{background:rgba(106,69,242,.06)!important}
html[data-mode=light] body thead.bg-black,html[data-mode=light] body thead .bg-black,html[data-mode=light] body tfoot.bg-zinc-950{background:rgba(106,69,242,.08)!important}
html[data-mode=light] body .bg-white\/5,html[data-mode=light] body .bg-white\/10,html[data-mode=light] body .bg-white\/20{background:rgba(106,69,242,.08)!important}
html[data-mode=light] body .hover\:bg-white\/10:hover,html[data-mode=light] body .hover\:bg-white\/20:hover,html[data-mode=light] body .hover\:bg-white\/5:hover,html[data-mode=light] body .hover\:bg-zinc-800:hover,html[data-mode=light] body .hover\:bg-zinc-700:hover,html[data-mode=light] body .hover\:bg-zinc-800\/30:hover,html[data-mode=light] body .hover\:bg-zinc-800\/50:hover{background:rgba(106,69,242,.1)!important}
html[data-mode=light] body tr.hover\:bg-zinc-800\/30:hover,html[data-mode=light] body tr.hover\:bg-zinc-800\/50:hover{background:rgba(138,99,255,.14)!important}
html[data-mode=light] body .bg-red-600,html[data-mode=light] body .bg-red-700,html[data-mode=light] body .bg-red-800,html[data-mode=light] body .bg-gradient-to-r.from-red-600{background:var(--cl-grad)!important;color:#fff!important;box-shadow:var(--ds-glow)}
html[data-mode=light] body .hover\:bg-red-700:hover,html[data-mode=light] body .hover\:bg-red-600:hover,html[data-mode=light] body .hover\:bg-red-500:hover,html[data-mode=light] body .hover\:bg-white:hover{background:var(--cl-grad)!important;filter:brightness(1.06)}
html[data-mode=light] body .hover\:text-pink-300:hover{color:#6a45f2!important}
html[data-mode=light] body .text-blue-500,html[data-mode=light] body .text-blue-400,html[data-mode=light] body .text-cyan-300{color:#5b45e6!important}
html[data-mode=light] body .rounded-xl{border-radius:18px}html[data-mode=light] body .rounded-2xl{border-radius:22px}html[data-mode=light] body .rounded-3xl{border-radius:26px}html[data-mode=light] body .rounded-lg{border-radius:14px}
html[data-mode=light] body input:focus,html[data-mode=light] body select:focus,html[data-mode=light] body textarea:focus{border-color:var(--mt-deep)!important;box-shadow:0 0 0 4px rgba(138,99,255,.3)!important}
html[data-mode=light] body input::placeholder,html[data-mode=light] body textarea::placeholder{color:#a9a5c4}
html[data-mode=light] body tr.hover\:bg-zinc-800\/30:hover{background:rgba(138,99,255,.14)!important}
body [style*="background:var(--mt-deep)"],body [style*="background:var(--mt-deep)"] *{color:#fff!important}
body [style*="background:var(--mt-deep)"]{background:var(--cl-grad)!important}
html[data-mode=light] body .plan-card:hover{border-color:#6a45f2!important;box-shadow:0 14px 34px rgba(106,69,242,.22)!important}
html[data-mode=light] body .modal-overlay,html[data-mode=light] body #setting-image-modal,html[data-mode=light] body [class*="bg-black/80"],html[data-mode=light] body [class*="bg-black/90"]{background:rgba(20,18,31,.45)!important}
div:where(.swal2-container) div:where(.swal2-popup){border-radius:24px!important;box-shadow:0 30px 80px -20px rgba(60,30,160,.35)!important}
div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{background:var(--cl-grad)!important;border-radius:14px!important;box-shadow:var(--ds-glow)!important}
div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{background:#f1eeff!important;color:var(--mt-ink)!important;border-radius:14px!important}
div:where(.swal2-container) div:where(.swal2-timer-progress-bar){background:#6a45f2!important}

/* ---------- แถบข้าง : คางหมูขอบโค้ง + เงาม่วงฟุ้ง ---------- */
.cl-side{top:90px;left:0;bottom:auto;width:88px;height:auto;padding:66px 0 72px;gap:0;align-items:center;border-radius:0;overflow:visible;color:#fff;
  background:linear-gradient(var(--ds-rail),var(--ds-rail)) 0 70px/100% calc(100% - 140px) no-repeat;box-shadow:none;
  filter:drop-shadow(16px 22px 26px rgba(91,69,230,.38)) drop-shadow(0 0 38px rgba(91,69,230,.22))}
.cl-side::before,.cl-side::after{content:"";position:absolute;left:0;width:88px;height:72px;z-index:-1;background:var(--ds-rail);
  clip-path:path('M0 0C26 22 60 24 78 36Q88 42 88 56L88 72L0 72Z')}
.cl-side::before{top:0}
.cl-side::after{bottom:0;transform:scaleY(-1)}
.cl-nav{width:52px;height:52px;margin:-3px 0;padding:0;justify-content:center;border-radius:18px;position:relative;color:#fff!important}
.cl-nav svg{width:20px;height:20px;stroke-width:1.6}
.cl-nav:hover{background:rgba(255,255,255,.14);transform:none}
.cl-nav.on{background:#fff;color:var(--ds-rail)!important;margin:3px 0;box-shadow:0 12px 22px -8px rgba(20,10,90,.55)}
.cl-nav span{position:absolute;left:calc(100% + 24px);top:50%;flex:none;transform:translate(-6px,-50%);background:#0e0c1a;color:#fff!important;font-size:12px;font-weight:700;padding:6px 12px;border-radius:10px;white-space:nowrap;opacity:0;pointer-events:none;transition:all .2s;box-shadow:0 10px 20px -6px rgba(14,12,26,.5);z-index:5}
.cl-nav:hover span,.cl-nav:focus-visible span{opacity:1;transform:translate(0,-50%)}
.cl-nav em{position:absolute;top:6px;right:6px;background:#fb923c;color:#fff!important;font-size:10px;padding:1px 6px;line-height:1.4}
.cl-me{order:90;padding:0;margin-top:0;gap:0}
.cl-me::before{content:"";display:block;width:26px;height:1px;background:rgba(255,255,255,.4);margin:12px 0}
.cl-ava{width:46px;height:46px;padding:2px;background:linear-gradient(135deg,#d946ef,#7c3aed);box-shadow:0 0 0 2px rgba(255,255,255,.85),0 8px 16px -6px rgba(20,10,90,.5)}
.cl-ava i{width:10px;height:10px;right:0;bottom:2px;box-shadow:0 0 0 2px var(--ds-rail)}
.cl-me b,.cl-me small{display:none}
.cl-bal{order:91;margin-top:10px;padding:0;background:transparent;box-shadow:none;display:flex;flex-direction:column;align-items:center;gap:8px;width:100%}
.cl-bal small{display:none}
.cl-bal b{font-size:10px;font-weight:700;margin:0;color:rgba(255,255,255,.9)!important}
.cl-bal .mt-icon-btn{width:40px;height:40px;background:rgba(255,255,255,.16);color:#fff!important}
.cl-bal .mt-icon-btn:hover{background:rgba(255,255,255,.28)}
.cl-side .cl-out{font-size:0;width:40px;height:40px;margin:0;padding:0;border-radius:14px;background:rgba(255,255,255,.16)!important;color:#fff!important;box-shadow:none!important;gap:0}
.cl-side .cl-out:hover{background:rgba(255,255,255,.28)!important;filter:none}

/* ---------- เมนูล่าง/แถบบน (มือถือ) ---------- */
.cl-top{background:#fff;border:1px solid var(--mt-line);box-shadow:var(--mt-shadow);backdrop-filter:none;-webkit-backdrop-filter:none}
.cl-dock{background:var(--ds-rail);box-shadow:0 18px 36px -10px rgba(91,69,230,.65);border-radius:24px}
.cl-dock a{border-radius:16px;color:#fff!important}
.cl-dock a.on{background:#fff!important;color:var(--ds-rail)!important;box-shadow:0 10px 18px -8px rgba(20,10,90,.5)!important}
.cl-dock em{background:#fb923c}
@media (max-width:1023px){body{background-attachment:scroll!important}.cl-dock{box-shadow:0 10px 22px -8px rgba(91,69,230,.6)}}
@media (min-width:1024px){
  .th-side .th-pop{left:calc(100% + 22px);bottom:0;top:auto;right:auto}
  .cl-side{transform:translateZ(0)}
  .cl-dock{display:none}
  body{padding-bottom:24px!important}
  body.cl-side-on>main{margin-left:124px!important;margin-right:28px!important}
}
@media (min-width:1024px) and (max-height:620px){.cl-me,.cl-bal b{display:none}}

/* ============================================================
   ADMIN — หน้า admin.php ในสไตล์ Ds Theme (ผูกกับ body.is-admin)
   ============================================================ */
html[data-mode=light] body.is-admin h2.text-3xl,html[data-mode=light] body.is-admin h2.md\:text-4xl{letter-spacing:-.03em}
/* การ์ดสถิติ 4 ใบ : ไอคอนเป็นชิปสีแบบ P.Shop + แถบสีใต้ตัวเลข */
body.is-admin .lg\:grid-cols-4>.mt-card{--cc:#6a45f2;--cb:#f1eeff;transition:transform .25s,box-shadow .25s}
body.is-admin .lg\:grid-cols-4>.mt-card:nth-child(2){--cc:#fb923c;--cb:#fff0e0}
body.is-admin .lg\:grid-cols-4>.mt-card:nth-child(3){--cc:#16a36f;--cb:#dcf7ea}
body.is-admin .lg\:grid-cols-4>.mt-card:nth-child(4){--cc:#d946ef;--cb:#ffe3f3}
body.is-admin .lg\:grid-cols-4>.mt-card:hover{transform:translateY(-5px);box-shadow:var(--mt-shadow-h)}
body.is-admin .lg\:grid-cols-4>.mt-card>.absolute{top:18px;right:18px;padding:0;width:46px;height:46px;border-radius:14px;display:grid;place-items:center;opacity:1!important;background:var(--cb);color:var(--cc)}
html[data-mode=light] body.is-admin .lg\:grid-cols-4>.mt-card>.absolute svg{width:22px;height:22px;color:var(--cc)!important}
body.is-admin .lg\:grid-cols-4>.mt-card .h-1.w-12{background:var(--cc)!important;opacity:.85;box-shadow:0 6px 12px -4px var(--cc)}
/* กราฟรายได้ : ชมพู -> ม่วง */
body.is-admin #gradientFill stop:first-child{stop-color:#8a63ff;stop-opacity:.34}
body.is-admin #gradientFill stop:last-child{stop-color:#8a63ff;stop-opacity:0}
body.is-admin svg.overflow-visible polyline{stroke:#6a45f2}
body.is-admin svg.overflow-visible circle{fill:#6a45f2}
html[data-mode=light] body.is-admin .relative.h-64 .border-b{border-bottom-style:dashed;border-color:rgba(106,69,242,.2)!important}
html[data-mode=light] body.is-admin foreignObject .text-red-500{color:#6a45f2!important}
html[data-mode=light] body.is-admin foreignObject>div{box-shadow:0 10px 24px -8px rgba(70,50,170,.35)}
/* สีเน้นที่เดิมเป็นแดง -> ม่วง (ส่วนที่เป็นสถานะผิดพลาด/ลบ ยังคงแดง) */
html[data-mode=light] body.is-admin svg.text-red-600,html[data-mode=light] body.is-admin span.text-red-500.px-2,html[data-mode=light] body.is-admin p.text-red-500.font-bold.text-lg{color:#6a45f2!important}
html[data-mode=light] body.is-admin #prevBadge{color:#5b45e6!important;background:#f1eeff!important}
/* ปุ่มลบ (DEL) ต้องยังเป็นแดงตอน hover ไม่ใช่ม่วง */
html[data-mode=light] body.is-admin button.bg-red-900\/30{background:rgba(180,35,58,.08)!important;color:#b4233a!important;border-color:rgba(180,35,58,.25)!important;box-shadow:none}
html[data-mode=light] body.is-admin button.bg-red-900\/30:hover{background:#b4233a!important;color:#fff!important;border-color:transparent!important;filter:none}
/* ตาราง */
body.is-admin table{border-collapse:separate;border-spacing:0}
body.is-admin thead th{font-size:11px;letter-spacing:.08em}
body.is-admin tbody tr{transition:background .15s}
body.is-admin .mt-card.overflow-hidden{border-radius:22px}
body.is-admin .overflow-x-auto::-webkit-scrollbar{height:8px}
