:root {
  --bg: #0b0708;
  --bg2: #120b0d;
  --card: #170e10;
  --card2: #1e1215;
  --line: rgba(255, 60, 70, .22);
  --line2: rgba(255, 255, 255, .08);
  --red: #ff2d3d;
  --red2: #d4121f;
  --glow: rgba(255, 30, 50, .35);
  --text: #f6eeee;
  --muted: #a99a9c;
  --green: #22c55e;
  --greenbg: rgba(22, 120, 60, .35);
  --radius: 14px;
}
:root[data-theme="blue"] {
  --line: rgba(56, 189, 248, .24);
  --red: #38bdf8;
  --red2: #0369a1;
  --glow: rgba(56, 189, 248, .35);
}
:root[data-theme="purple"] {
  --line: rgba(192, 132, 252, .24);
  --red: #c084fc;
  --red2: #7e22ce;
  --glow: rgba(192, 132, 252, .35);
}
:root[data-theme="green"] {
  --line: rgba(74, 222, 128, .24);
  --red: #4ade80;
  --red2: #15803d;
  --glow: rgba(74, 222, 128, .3);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  background-image:
    radial-gradient(900px 500px at 85% -5%, rgba(255, 30, 50, .16), transparent 60%),
    radial-gradient(700px 500px at -10% 40%, rgba(180, 10, 30, .12), transparent 60%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

.logo { font-weight: 800; font-size: 26px; letter-spacing: -.5px; }
.logo b { color: var(--red); font-weight: 800; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  background: linear-gradient(180deg, #ff3d4c, var(--red2));
  box-shadow: 0 6px 20px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: grayscale(.5); }
.btn.ghost { background: rgba(255,255,255,.05); border: 1px solid var(--line2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--line); background: rgba(255,45,61,.08); }
.btn.line { background: #06c755; box-shadow: 0 6px 20px rgba(6,199,85,.25); }
.btn.tg { background: #229ed9; box-shadow: 0 6px 20px rgba(34,158,217,.25); }
.btn.danger { background: rgba(255,45,61,.12); border: 1px solid var(--line); box-shadow: none; color: #ff7a85; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* inputs */
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 10px; outline: none;
  background: rgba(255,255,255,.04); border: 1px solid var(--line2);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,45,61,.15); }
select.input option { background: #1a1012; }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.6; }
label.field { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
label.field > span { display: block; margin-bottom: 6px; }
label.field small { display: block; margin-top: 4px; font-size: 12px; opacity: .8; }
.store-image-editor { display: flex; align-items: flex-start; gap: 16px; }
.store-image-editor > div:last-child { display: grid; gap: 10px; }
.store-image-preview { width: min(100%, 360px); min-height: 120px; aspect-ratio: 16 / 7; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--muted); }
.store-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.store-gallery-editor { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.store-gallery-thumb { width: 150px; display: grid; gap: 6px; }
.store-gallery-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line2); border-radius: 10px; }
@media (max-width: 600px) {
  .store-image-editor { flex-direction: column; }
}

/* badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge.new { background: var(--red2); }
.badge.ok { background: var(--greenbg); color: #4ade80; border: 1px solid rgba(34,197,94,.35); }
.badge.out { background: rgba(255,45,61,.2); color: #ff6b77; border: 1px solid var(--line); }

/* modal */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s;
}
.modal {
  width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; position: relative;
  background: linear-gradient(180deg, #1a0f12, #110a0c); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 80px rgba(255,30,50,.18); padding: 22px;
}
.modal .x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; color: var(--muted); }
.modal .x:hover { background: rgba(255,255,255,.08); color: #fff; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 300;
  background: #241418; border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); font-size: 14px; animation: fade .2s;
}
.toast.err { border-color: var(--red); color: #ff8a93; }
.toast.ok { border-color: rgba(34,197,94,.5); }
