/* =====================================================
   BuildBy — Modern SaaS · Glassmorphism · Claude Orange
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800&family=Sora:wght@400;600;700;800&display=swap');

:root {
  --orange: #E8804F;
  --orange-deep: #D97757;
  --orange-hot: #FF9D5C;
  --amber: #F5B34F;
  --bg-0: #14100D;
  --bg-1: #1B1512;
  --bg-2: #241C17;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.09);
  --stroke: rgba(255, 255, 255, 0.10);
  --stroke-hi: rgba(232, 128, 79, 0.45);
  --text: #F4EDE7;
  --text-dim: #B9AB9F;
  --text-mute: #837567;
  --green: #4ECB8D;
  --red: #F26D6D;
  --blue: #6DA9F2;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-glow: 0 8px 40px rgba(232, 128, 79, 0.25);
  --grad-orange: linear-gradient(135deg, #E8804F 0%, #D96541 55%, #C24E2E 100%);
  --grad-text: linear-gradient(100deg, #FFC79A, #E8804F 55%, #F5B34F);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans Thai', 'Sora', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}
/* ambient glow background */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
}
body::before {
  width: 620px; height: 620px;
  top: -220px; right: -160px;
  background: radial-gradient(circle, rgba(232,128,79,.22), transparent 65%);
}
body::after {
  width: 560px; height: 560px;
  bottom: -240px; left: -180px;
  background: radial-gradient(circle, rgba(217,101,65,.14), transparent 65%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: rgba(232,128,79,.4); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: #3a2e25; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange-deep); }

.container { width: min(1240px, 92%); margin: 0 auto; }

/* ---------------- Monochrome icons ---------------- */
.ic {
  width: 1.05em; height: 1.05em; flex-shrink: 0;
  vertical-align: -.15em;
}
.ic-lg { width: 1.35em; height: 1.35em; }
.ic-muted { color: var(--text-mute); }
.ic-orange { color: var(--orange); }

/* ---------------- Navbar ---------------- */
.navbar {
  position: sticky; top: 0; z-index: 200;
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  background: rgba(20, 16, 13, 0.72);
  border-bottom: 1px solid var(--stroke);
}
.nav-inner {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Sora', 'Noto Sans Thai', sans-serif;
  font-weight: 800; font-size: 1.35rem; letter-spacing: -.5px;
}
.brand .logo-badge {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad-orange);
  display: grid; place-items: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-glow);
}
.brand .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .toey { color: var(--text-mute); font-weight: 600; font-size: .68em; letter-spacing: .8px; margin-left: 1px; transform: translateY(2px); display: inline-block; }
.brand .logo-badge .ic { width: 20px; height: 20px; color: #fff; }

.nav-links { display: flex; gap: 4px; margin-left: 10px; }
.nav-links a {
  padding: 8px 16px; border-radius: 999px;
  color: var(--text-dim); font-weight: 500; font-size: .95rem;
  transition: .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--glass-2); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  position: relative;
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--glass); border: 1px solid var(--stroke);
  display: grid; place-items: center; font-size: 1.15rem;
  color: var(--text-dim); transition: .25s;
}
.icon-btn:hover { border-color: var(--stroke-hi); color: var(--text); transform: translateY(-1px); }
.icon-btn .dot {
  position: absolute; top: -5px; right: -5px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--grad-orange);
  color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(232,128,79,.55);
}

/* ---------------- Announcement marquee ---------------- */
.announce-bar {
  position: relative; overflow: hidden;
  border-bottom: 1px solid rgba(232, 128, 79, .22);
  background:
    linear-gradient(90deg, rgba(232,128,79,.14), rgba(232,128,79,.045) 22%, rgba(232,128,79,.045) 78%, rgba(232,128,79,.14)),
    rgba(20, 16, 13, .6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.announce-bar::before, .announce-bar::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 70px; z-index: 2; pointer-events: none;
}
.announce-bar::before { left: 0; background: linear-gradient(90deg, var(--bg-0), transparent); }
.announce-bar::after { right: 0; background: linear-gradient(270deg, var(--bg-0), transparent); }
.announce-track {
  display: flex; width: max-content;
  animation: marqueeScroll var(--announce-speed, 30s) linear infinite;
  will-change: transform;
}
.announce-bar:hover .announce-track { animation-play-state: paused; }
.announce-half { display: flex; align-items: center; }
.announce-item {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 9px 34px; white-space: nowrap;
  font-size: .88rem; font-weight: 500; letter-spacing: .3px;
  color: #EFD9C6;
}
.announce-item .gem {
  color: var(--orange-hot); font-size: .72rem;
  text-shadow: 0 0 12px rgba(232, 128, 79, .8);
}
@keyframes marqueeScroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .announce-track { animation: none; } }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 26px; border-radius: 14px;
  font-weight: 600; font-size: .98rem; border: none;
  transition: .25s; white-space: nowrap;
}
.btn-primary {
  background: var(--grad-orange); color: #fff;
  box-shadow: 0 6px 24px rgba(217, 101, 65, .4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(217,101,65,.55); }
.btn-glass {
  background: var(--glass); color: var(--text);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
}
.btn-glass:hover { border-color: var(--stroke-hi); background: var(--glass-2); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: rgba(242,109,109,.14); color: var(--red); border: 1px solid rgba(242,109,109,.35); }
.btn-danger:hover { background: rgba(242,109,109,.24); }
.btn-success { background: rgba(78,203,141,.14); color: var(--green); border: 1px solid rgba(78,203,141,.35); }
.btn-success:hover { background: rgba(78,203,141,.24); }
.btn-sm { padding: 8px 16px; font-size: .88rem; border-radius: 11px; }
.btn-lg { padding: 15px 34px; font-size: 1.08rem; border-radius: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------------- Glass card ---------------- */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ---------------- Hero ---------------- */
.hero { padding: 76px 0 44px; text-align: center; position: relative; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 20px; border-radius: 999px;
  background: rgba(232,128,79,.08); border: 1px solid rgba(232,128,79,.25);
  color: var(--orange-hot); font-size: .84rem; font-weight: 600; letter-spacing: .6px;
  margin-bottom: 26px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 24px rgba(232,128,79,.1);
}
.hero h1 {
  font-family: 'Sora', 'Noto Sans Thai', sans-serif;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  font-weight: 800; letter-spacing: -1.5px; line-height: 1.18;
}
.hero h1 .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub {
  margin: 18px auto 0; max-width: 620px;
  color: var(--text-dim); font-size: 1.08rem;
}
.hero-stats {
  display: flex; justify-content: center; gap: 14px;
  margin-top: 34px; flex-wrap: wrap;
}
.hero-stat {
  padding: 18px 34px; border-radius: 18px;
  background: rgba(255,255,255,.035); border: 1px solid var(--stroke);
  backdrop-filter: blur(14px); min-width: 156px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: .3s;
}
.hero-stat:hover { border-color: var(--stroke-hi); transform: translateY(-2px); }
.hero-stat b { display: block; font-family: 'Sora','Noto Sans Thai',sans-serif; font-size: 1.65rem; font-weight: 800; letter-spacing: -.5px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.hero-stat span { color: var(--text-mute); font-size: .82rem; letter-spacing: .4px; }

/* ---------------- Search & filter ---------------- */
.search-bar {
  display: flex; gap: 10px; max-width: 640px; margin: 30px auto 0;
  padding: 8px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(16px);
}
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 1rem; padding: 8px 14px;
}
.search-bar input::placeholder { color: var(--text-mute); }

.chip-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 26px 0 8px; }
.chip {
  padding: 9px 20px; border-radius: 999px; font-size: .92rem; font-weight: 500;
  background: var(--glass); border: 1px solid var(--stroke); color: var(--text-dim);
  transition: .25s; cursor: pointer;
}
.chip:hover { border-color: var(--stroke-hi); color: var(--text); transform: translateY(-1px); }
.chip.active {
  background: var(--grad-orange); color: #fff; border-color: transparent;
  box-shadow: 0 4px 18px rgba(217,101,65,.4);
}

/* ---------------- Section headers ---------------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 26px; gap: 14px; flex-wrap: wrap; }
.section-head h2 {
  font-family: 'Sora', 'Noto Sans Thai', sans-serif;
  font-size: 1.65rem; font-weight: 800; letter-spacing: -.5px;
  display: flex; align-items: center; gap: 12px;
}
.section-head h2 .bar { width: 5px; height: 30px; border-radius: 3px; background: var(--grad-orange); box-shadow: 0 0 16px rgba(232,128,79,.6); }
.section-head p { color: var(--text-mute); font-size: .92rem; }

/* ---------------- Product grid ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 22px; }

.product-card {
  position: relative; overflow: hidden;
  background: var(--glass); border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .35s cubic-bezier(.2,.8,.25,1), border-color .3s, box-shadow .35s;
  display: flex; flex-direction: column;
}
.product-card .meta .ic { width: .95em; height: .95em; color: var(--text-mute); }
.product-card .cover .placeholder .ic { width: 56px; height: 56px; color: var(--orange); opacity: .35; stroke-width: 1.2; }
.product-card:hover {
  transform: translateY(-7px);
  border-color: var(--stroke-hi);
  box-shadow: 0 22px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(232,128,79,.2), var(--shadow-glow);
}
.product-card .cover {
  aspect-ratio: 16/10; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #2b211a, #1c1511);
}
.product-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.product-card:hover .cover img { transform: scale(1.06); }
.product-card .cover .placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 3rem; opacity: .5;
}
.product-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-card h3 { font-size: 1.06rem; font-weight: 700; line-height: 1.4; }
.product-card .desc { color: var(--text-mute); font-size: .86rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .meta { display: flex; align-items: center; gap: 14px; color: var(--text-mute); font-size: .82rem; margin-top: auto; }
.product-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.product-card .card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--stroke); }
.price-tag { font-weight: 800; font-size: 1.12rem; }
.price-tag.free { color: var(--green); }
.price-tag.paid { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 13px; border-radius: 999px;
  font-size: .73rem; font-weight: 600; letter-spacing: .5px;
}
.badge .ic { width: .95em; height: .95em; }
.badge-free { background: rgba(78,203,141,.16); color: var(--green); border: 1px solid rgba(78,203,141,.35); }
.badge-paid { background: rgba(245,179,79,.14); color: var(--amber); border: 1px solid rgba(245,179,79,.35); }
.badge-type { background: rgba(109,169,242,.13); color: var(--blue); border: 1px solid rgba(109,169,242,.3); }
.badge-orange { background: rgba(232,128,79,.14); color: var(--orange-hot); border: 1px solid rgba(232,128,79,.35); }
.badge-red { background: rgba(242,109,109,.14); color: var(--red); border: 1px solid rgba(242,109,109,.35); }
.badge-float { position: absolute; top: 12px; left: 12px; z-index: 2; backdrop-filter: blur(8px); }
.badge-float-r { position: absolute; top: 12px; right: 12px; z-index: 2; backdrop-filter: blur(8px); }

/* ---------------- Product detail ---------------- */
.detail-wrap {
  display: grid; grid-template-columns: 1.15fr .85fr;
  grid-template-areas: "cover panel" "desc panel";
  gap: 30px; padding: 40px 0 60px; align-items: start;
}
.d-cover { grid-area: cover; min-width: 0; }
.d-desc { grid-area: desc; min-width: 0; }
.d-panel { grid-area: panel; min-width: 0; align-self: stretch; }
.d-desc .desc-body:first-child { margin-top: 0; }
.detail-cover {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--stroke); box-shadow: 0 24px 60px rgba(0,0,0,.5);
  background: linear-gradient(135deg, #2b211a, #1c1511);
}
.detail-cover img { width: 100%; }
.detail-cover .placeholder { aspect-ratio: 16/10; display: grid; place-items: center; }
.detail-cover .placeholder .ic { width: 84px; height: 84px; color: var(--orange); opacity: .3; stroke-width: 1.1; }
.desc-body h2 .ic { color: var(--orange); width: 1em; height: 1em; }
.empty .ic { width: 60px; height: 60px; color: var(--orange); opacity: .4; stroke-width: 1.2; margin-bottom: 16px; }
.msg-item .ico .ic { width: 22px; height: 22px; color: #fff; }
.stat-card .s-icon .ic { width: 22px; height: 22px; color: var(--orange-hot); }
.admin-side nav a .ic { width: 18px; height: 18px; opacity: .85; }
.icon-btn .ic { width: 19px; height: 19px; }
.btn .ic { width: 1.05em; height: 1.05em; }
.donate-float .ic { width: 19px; height: 19px; color: var(--orange-hot); animation: wiggle 2.6s ease-in-out infinite; }
.search-bar .search-ic { color: var(--text-mute); width: 19px; height: 19px; align-self: center; margin-left: 14px; }
.dropdown-menu a .ic { width: 17px; height: 17px; opacity: .8; }
.alert .ic { width: 1.15em; height: 1.15em; flex-shrink: 0; margin-top: .18em; }

.detail-panel { position: sticky; top: 92px; padding: 28px; }
.detail-panel h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; line-height: 1.3; margin-bottom: 8px; }
.detail-panel .short { color: var(--text-dim); font-size: .95rem; margin-bottom: 18px; }
.spec-list { display: flex; flex-direction: column; gap: 0; margin: 18px 0; }
.spec-list .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px; border-bottom: 1px dashed rgba(255,255,255,.08);
  font-size: .93rem;
}
.spec-list .row:last-child { border-bottom: none; }
.spec-list .k { color: var(--text-mute); display: flex; gap: 8px; align-items: center; }
.spec-list .v { font-weight: 600; }

.desc-body { padding: 30px; margin-top: 26px; line-height: 1.9; color: var(--text-dim); }
.desc-body h2 { color: var(--text); font-size: 1.25rem; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.desc-body ul { padding-left: 22px; margin: 10px 0; }
.desc-body p { white-space: pre-line; }

/* ---------------- Premium CTA button ---------------- */
.btn-premium {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 16px 26px; border-radius: 16px; border: none; cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 42%),
    linear-gradient(135deg, #E8804F 0%, #D96541 55%, #BC4E2C 100%);
  color: #fff; font-family: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.32),
    inset 0 -14px 26px rgba(96, 30, 8, .28),
    0 1px 2px rgba(0,0,0,.4),
    0 12px 30px rgba(200, 90, 46, .32);
  outline: 1px solid rgba(255, 190, 150, .28); outline-offset: -1px;
  transition: transform .28s cubic-bezier(.2,.8,.25,1), box-shadow .28s;
  overflow: hidden;
}
.btn-premium::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); transition: left .7s ease;
}
.btn-premium:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.32), inset 0 -14px 26px rgba(96,30,8,.28), 0 2px 4px rgba(0,0,0,.4), 0 18px 44px rgba(200,90,46,.45); }
.btn-premium:hover::after { left: 125%; }
.btn-premium:active { transform: translateY(0); }
.btn-premium:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-premium .cta-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-premium .cta-ico svg { width: 20px; height: 20px; }
.btn-premium .cta-text { text-align: left; line-height: 1.3; }
.btn-premium .cta-label { display: block; font-size: 1.04rem; font-weight: 700; letter-spacing: .2px; }
.btn-premium .cta-sub { display: block; font-size: .78rem; font-weight: 500; opacity: .82; letter-spacing: .4px; }

/* ---------------- Spec list (professional / monochrome) ---------------- */
.spec-list .k svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: var(--orange); opacity: .8;
}
.spec-list .k {
  font-size: .86rem; letter-spacing: .2px;
}
.spec-list .v { font-variant-numeric: tabular-nums; }

/* ---------------- Download progress ---------------- */
.dl-progress-wrap { display: none; margin-top: 16px; }
.dl-progress-wrap.active { display: block; animation: fadeUp .4s; }
.dl-bar-track {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.07); border: 1px solid var(--stroke);
  position: relative;
}
.dl-bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--grad-orange);
  box-shadow: 0 0 18px rgba(232,128,79,.7);
  transition: width .2s ease;
  position: relative; overflow: hidden;
}
.dl-bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }
.dl-status { display: flex; justify-content: space-between; margin-top: 10px; font-size: .88rem; color: var(--text-dim); }
.dl-status .pct { font-weight: 800; font-size: 1.05rem; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .9rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.form-control {
  width: 100%; padding: 13px 16px; border-radius: 13px;
  background: rgba(255,255,255,.05); border: 1px solid var(--stroke);
  color: var(--text); font-size: .97rem; outline: none; transition: .25s;
}
.form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(232,128,79,.15); background: rgba(255,255,255,.07); }
.form-control::placeholder { color: var(--text-mute); }
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control option { background: var(--bg-2); color: var(--text); }
.form-hint { font-size: .8rem; color: var(--text-mute); margin-top: 6px; }

.auth-wrap { max-width: 440px; margin: 60px auto; padding: 38px 34px; }
.auth-wrap h1 { font-size: 1.7rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-wrap .sub { text-align: center; color: var(--text-mute); font-size: .92rem; margin-bottom: 28px; }

/* ---------------- Alerts ---------------- */
.alert { padding: 14px 18px; border-radius: 14px; font-size: .93rem; margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-start; }
.alert-error { background: rgba(242,109,109,.12); border: 1px solid rgba(242,109,109,.35); color: #ffb3b3; }
.alert-success { background: rgba(78,203,141,.12); border: 1px solid rgba(78,203,141,.35); color: #a9eecb; }
.alert-info { background: rgba(109,169,242,.12); border: 1px solid rgba(109,169,242,.3); color: #bcd8fb; }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10, 7, 5, .7);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; animation: fadeIn .25s; }
.modal {
  width: min(480px, 100%); max-height: 90vh; overflow-y: auto;
  background: linear-gradient(160deg, rgba(43,33,26,.95), rgba(27,21,18,.97));
  border: 1px solid var(--stroke-hi);
  border-radius: 24px; padding: 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), var(--shadow-glow);
  animation: popUp .3s cubic-bezier(.2,.9,.3,1.2);
}
.modal h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.modal .modal-sub { color: var(--text-dim); font-size: .9rem; margin-bottom: 20px; }
.modal-close {
  float: right; width: 34px; height: 34px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--stroke); color: var(--text-dim);
  font-size: 1rem; transition: .2s;
}
.modal-close:hover { color: var(--text); border-color: var(--stroke-hi); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popUp { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.qr-box {
  background: #fff; border-radius: 18px; padding: 18px;
  display: grid; place-items: center; margin: 16px auto; max-width: 260px;
}
.qr-box img { width: 100%; border-radius: 8px; }

/* ---------------- Donation float ---------------- */
.donate-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 300;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(43,33,26,.92), rgba(27,21,18,.95));
  border: 1px solid var(--stroke-hi);
  backdrop-filter: blur(16px);
  font-weight: 600; font-size: .92rem; color: var(--text);
  box-shadow: 0 10px 34px rgba(0,0,0,.5), 0 0 22px rgba(232,128,79,.25);
  transition: .3s; cursor: pointer;
  animation: floatPulse 3.2s ease-in-out infinite;
}
.donate-float:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 44px rgba(0,0,0,.55), var(--shadow-glow); }
.donate-float .cup { font-size: 1.25rem; animation: wiggle 2.6s ease-in-out infinite; }
@keyframes floatPulse { 0%,100% { box-shadow: 0 10px 34px rgba(0,0,0,.5), 0 0 14px rgba(232,128,79,.18);} 50% { box-shadow: 0 10px 34px rgba(0,0,0,.5), 0 0 30px rgba(232,128,79,.4);} }
@keyframes wiggle { 0%,88%,100% { transform: rotate(0);} 92% { transform: rotate(-12deg);} 96% { transform: rotate(10deg);} }

/* ---------------- Toast ---------------- */
.toast-zone { position: fixed; top: 84px; right: 18px; z-index: 600; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 14px 20px; border-radius: 14px; font-size: .92rem; font-weight: 500;
  background: linear-gradient(160deg, rgba(43,33,26,.95), rgba(27,21,18,.97));
  border: 1px solid var(--stroke-hi); backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
  animation: toastIn .35s cubic-bezier(.2,.9,.3,1.15);
  max-width: 340px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--stroke); background: var(--glass); backdrop-filter: blur(16px); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
.tbl th {
  text-align: left; padding: 14px 18px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; color: var(--text-mute);
  border-bottom: 1px solid var(--stroke); white-space: nowrap;
}
.tbl td { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .2s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.03); }

/* ---------------- Inbox ---------------- */
.msg-item {
  display: flex; gap: 16px; padding: 20px 22px;
  border-radius: var(--radius); margin-bottom: 14px;
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(14px); transition: .25s;
}
.msg-item.unread { border-color: var(--stroke-hi); background: rgba(232,128,79,.06); }
.msg-item:hover { transform: translateX(4px); }
.msg-item .ico {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  background: var(--grad-orange); display: grid; place-items: center; font-size: 1.3rem;
  box-shadow: 0 4px 16px rgba(217,101,65,.35);
}
.msg-item h4 { font-size: 1rem; font-weight: 700; }
.msg-item .body-text { color: var(--text-dim); font-size: .89rem; margin: 4px 0 8px; white-space: pre-line; }
.msg-item .time { color: var(--text-mute); font-size: .78rem; }

/* ---------------- Status pills ---------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pill-pending { background: rgba(245,179,79,.14); color: var(--amber); border: 1px solid rgba(245,179,79,.35); }
.pill-approved { background: rgba(78,203,141,.14); color: var(--green); border: 1px solid rgba(78,203,141,.35); }
.pill-rejected { background: rgba(242,109,109,.14); color: var(--red); border: 1px solid rgba(242,109,109,.35); }

/* ---------------- Footer ---------------- */
.footer {
  margin-top: 60px; padding: 40px 0 90px;
  border-top: 1px solid var(--stroke);
  background: rgba(255,255,255,.02);
  color: var(--text-mute); font-size: .88rem;
}
.footer .cols { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; }

/* ---------------- Empty state ---------------- */
.empty {
  text-align: center; padding: 70px 20px; color: var(--text-mute);
}
.empty .big { font-size: 3.4rem; margin-bottom: 14px; opacity: .6; }

/* ---------------- Buy options ---------------- */
.buy-option {
  display: block; padding: 18px 20px; border-radius: 16px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 2px solid var(--stroke);
  transition: .25s; margin-bottom: 12px;
}
.buy-option:hover { border-color: rgba(232,128,79,.4); }
.buy-option.selected { border-color: var(--orange); background: rgba(232,128,79,.09); box-shadow: 0 0 0 4px rgba(232,128,79,.12); }
.buy-option .opt-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.buy-option .opt-desc { font-size: .84rem; color: var(--text-mute); margin-top: 5px; }
.buy-option input { display: none; }

.file-drop {
  border: 2px dashed rgba(232,128,79,.4); border-radius: 16px;
  padding: 26px; text-align: center; cursor: pointer; transition: .25s;
  background: rgba(232,128,79,.05);
}
.file-drop:hover, .file-drop.drag { background: rgba(232,128,79,.12); border-color: var(--orange); }
.file-drop .fd-icon { font-size: 2rem; margin-bottom: 8px; }
.file-drop p { color: var(--text-dim); font-size: .9rem; }
.file-drop .fname { color: var(--orange-hot); font-weight: 600; margin-top: 6px; word-break: break-all; }

/* ---------------- Steps ---------------- */
.steps { display: flex; gap: 0; margin-bottom: 28px; }
.step { flex: 1; text-align: center; position: relative; color: var(--text-mute); font-size: .82rem; font-weight: 600; }
.step .n {
  width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--stroke);
  display: grid; place-items: center; font-weight: 800;
}
.step.on { color: var(--orange-hot); }
.step.on .n { background: var(--grad-orange); color: #fff; border: none; box-shadow: 0 4px 16px rgba(217,101,65,.45); }
.step::after {
  content: ''; position: absolute; top: 17px; left: calc(50% + 24px); right: calc(-50% + 24px);
  height: 2px; background: var(--stroke);
}
.step:last-child::after { display: none; }

/* ---------------- Dropdown (user menu) ---------------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px;
  background: linear-gradient(160deg, rgba(43,33,26,.97), rgba(27,21,18,.98));
  border: 1px solid var(--stroke); border-radius: 16px; padding: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  display: none; z-index: 400;
}
.dropdown-menu.open { display: block; animation: popUp .22s cubic-bezier(.2,.9,.3,1.15); }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 11px; font-size: .92rem; color: var(--text-dim);
  transition: .2s;
}
.dropdown-menu a:hover { background: var(--glass-2); color: var(--text); }
.dropdown-menu .sep { height: 1px; background: var(--stroke); margin: 6px 8px; }

.avatar {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--grad-orange); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(217,101,65,.4); cursor: pointer;
  border: none;
}

/* ---------------- Mobile nav ---------------- */
.hamburger { display: none; }
.mobile-nav {
  display: none; flex-direction: column; gap: 4px; padding: 10px 0 16px;
}
.mobile-nav a { padding: 12px 16px; border-radius: 12px; color: var(--text-dim); font-weight: 500; }
.mobile-nav a:hover { background: var(--glass-2); color: var(--text); }
.mobile-nav.open { display: flex; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: grid; }
  /* มือถือ: ปก → การ์ดดาวน์โหลด → รายละเอียด (เน้นให้กดโหลดก่อนอ่าน) */
  .detail-wrap { grid-template-columns: 1fr; grid-template-areas: "cover" "panel" "desc"; gap: 22px; }
  .detail-panel { position: static; }
  .d-desc .desc-body:first-child { margin-top: 0; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 13px; }
  .product-card .body { padding: 13px 14px 15px; }
  .product-card h3 { font-size: .92rem; }
  .product-card .desc { display: none; }
  .hero { padding: 50px 0 30px; }
  .donate-float { right: 12px; bottom: 12px; padding: 10px 16px; font-size: .82rem; }
  .donate-float .label-long { display: none; }
  .donate-float .label-short { display: inline !important; }
  .modal { padding: 22px; }
  .auth-wrap { padding: 28px 22px; margin: 30px auto; }
}
@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr; }
}

/* =====================================================
   ADMIN PANEL
   ===================================================== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-side {
  width: 258px; flex-shrink: 0;
  background: rgba(255,255,255,.03);
  border-right: 1px solid var(--stroke);
  backdrop-filter: blur(20px);
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.admin-side .brand { padding: 4px 10px 20px; }
.admin-side nav { display: flex; flex-direction: column; gap: 4px; }
.admin-side nav .nav-label { font-size: .72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-mute); padding: 16px 12px 6px; }
.admin-side nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--text-dim); font-size: .93rem; font-weight: 500; transition: .2s;
}
.admin-side nav a:hover { background: var(--glass-2); color: var(--text); }
.admin-side nav a.active {
  background: var(--grad-orange); color: #fff;
  box-shadow: 0 6px 20px rgba(217,101,65,.35);
}
.admin-side nav a .cnt {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: rgba(242,109,109,.9); color: #fff; font-size: .72rem; font-weight: 700;
  display: grid; place-items: center;
}
.admin-main { flex: 1; padding: 30px 34px 60px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 14px; flex-wrap: wrap; }
.admin-head h1 { font-family: 'Sora','Noto Sans Thai',sans-serif; font-size: 1.55rem; font-weight: 800; letter-spacing: -.5px; }
.admin-head p { color: var(--text-mute); font-size: .88rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
  padding: 22px 24px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--stroke);
  backdrop-filter: blur(16px); position: relative; overflow: hidden;
  transition: .3s;
}
.stat-card:hover { border-color: var(--stroke-hi); transform: translateY(-3px); }
.stat-card .s-icon {
  width: 46px; height: 46px; border-radius: 14px; font-size: 1.3rem;
  display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(232,128,79,.14); border: 1px solid rgba(232,128,79,.3);
}
.stat-card b { font-size: 1.75rem; font-weight: 800; display: block; letter-spacing: -.5px; }
.stat-card span { color: var(--text-mute); font-size: .85rem; }
.stat-card .trend { font-size: .78rem; font-weight: 700; margin-top: 6px; display: inline-block; }
.trend.up { color: var(--green); }
.trend.flat { color: var(--text-mute); }

.chart-card { padding: 24px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--stroke); backdrop-filter: blur(16px); }
.chart-card h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.chart-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 28px; }

.thumb-sm { width: 58px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--stroke); }
.slip-thumb { width: 90px; border-radius: 10px; border: 1px solid var(--stroke); cursor: zoom-in; transition: .25s; }
.slip-thumb:hover { transform: scale(1.05); border-color: var(--orange); }
.slip-full { max-width: 100%; border-radius: 14px; }

@media (max-width: 980px) {
  .admin-side { position: fixed; z-index: 450; left: -280px; transition: left .3s; }
  .admin-side.open { left: 0; box-shadow: 30px 0 60px rgba(0,0,0,.5); }
  .admin-main { padding: 20px 16px 50px; }
  .chart-row { grid-template-columns: 1fr; }
  .admin-menu-btn { display: grid !important; }
}
.admin-menu-btn { display: none; }

/* print slip nicely */
@media print { .admin-side, .navbar, .donate-float { display: none !important; } }
