/* =============================================
   VN STORE — Design System
   Dark Gaming Theme | Clean Purple | No Neon
   ============================================= */

:root {
  --bg-base:       #08080f;
  --bg-card:       #0f0b1a;
  --bg-card-hover: #150f22;
  --bg-surface:    #12101e;
  --bg-input:      #1a1428;

  --primary:       #8b3cf7;
  --primary-dark:  #6d28d9;
  --primary-light: #a855f7;
  --accent:        #7c3aed;

  --glow-soft:   rgba(139, 60, 247, 0.10);
  --glow-border: rgba(139, 60, 247, 0.30);

  --border:        rgba(139, 60, 247, 0.14);
  --border-hover:  rgba(139, 60, 247, 0.38);

  --text-primary:   #f0eafa;
  --text-secondary: #9b8cbc;
  --text-muted:     #5c4f7a;

  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;
  --star:    #f59e0b;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition: 0.2s ease;

  --shadow-card:   0 2px 16px rgba(0,0,0,0.45);
  --shadow-hover:  0 4px 20px rgba(0,0,0,0.55);
  --shadow-purple: 0 4px 18px rgba(139,60,247,0.16);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

input, textarea, select {
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,60,247,0.10);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select option { background: var(--bg-input); }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- Typography --- */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 0.95rem; }

.text-gradient {
  background: linear-gradient(135deg, var(--primary-light) 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted     { color: var(--text-muted);     font-size: 0.875rem; }
.text-secondary { color: var(--text-secondary); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-primary-color { color: var(--primary-light); }

.price {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: var(--primary-light);
}
.price-original {
  font-family: 'Courier New', monospace;
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.6rem 1.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-align: center; white-space: nowrap;
  text-decoration: none; line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 10px rgba(139,60,247,0.25); }
.btn-primary:hover { background: var(--accent); box-shadow: 0 4px 14px rgba(139,60,247,0.22); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary-light); border: 1px solid var(--glow-border); }
.btn-outline:hover { background: var(--glow-soft); border-color: var(--primary); color: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card); border-color: var(--border-hover); color: var(--text-primary); }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #dc2626; transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; transform: translateY(-1px); }
.btn-sm   { padding: 0.4rem 0.85rem; font-size: 0.78rem; }
.btn-lg   { padding: 0.75rem 1.75rem; font-size: 0.95rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.45rem; border-radius: var(--radius-sm); }

/* --- Cards --- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-accent { border-color: var(--glow-border); box-shadow: var(--shadow-purple); }
.card-glow   { border-color: var(--glow-border); box-shadow: var(--shadow-purple); }

/* --- Product Card --- */
.product-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.22s ease; cursor: pointer; position: relative;
}
.product-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.product-card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-surface); }
.product-card__img-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.product-card__img-placeholder svg { width: 48px; height: 48px; }
.product-card__body { padding: 0.9rem 1rem 1rem; }
.product-card__category {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--primary-light); margin-bottom: 0.3rem;
  display: flex; align-items: center; gap: 0.3rem;
}
.product-card__category svg { width: 12px; height: 12px; }
.product-card__name {
  font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-card__rating { margin-bottom: 0.4rem; }
.product-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.55rem; }
.product-card__badge {
  position: absolute; top: 0.5rem; left: 0.5rem;
  background: var(--primary); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.18rem 0.5rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.product-card__stock { font-size: 0.72rem; color: var(--text-muted); }
.product-card__stock.low { color: var(--warning); }
.product-card__stock.out { color: var(--danger); }

/* --- Star Rating --- */
.stars-row {
  display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap;
}
.stars-row svg { display: block; flex-shrink: 0; }
.rating-count { font-size: 0.72rem; color: var(--text-muted); margin-left: 0.2rem; }

.star-picker { display: flex; gap: 0.2rem; }
.star-btn {
  background: none; border: none; cursor: pointer; padding: 0.15rem;
  transition: transform 0.1s;
}
.star-btn:hover { transform: scale(1.15); }
.star-btn svg { width: 22px; height: 22px; display: block; }
.star-btn.active svg { filter: drop-shadow(0 0 4px rgba(245,158,11,0.5)); }

/* --- Review Card --- */
.review-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 0.65rem;
}
.review-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; flex-wrap: wrap; gap: 0.4rem; }
.review-card__author { font-weight: 600; font-size: 0.875rem; }
.review-card__date   { font-size: 0.72rem; color: var(--text-muted); }
.review-card__text   { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.4rem; line-height: 1.6; }

/* --- Review Form --- */
.review-form { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.review-form h4 { margin-bottom: 1rem; }

/* --- Grid Layouts --- */
.container    { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 760px; }
.container-xs { max-width: 480px; }

.grid-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }

@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .grid-products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px)  { .grid-products { grid-template-columns: 1fr; } }

/* --- Navbar --- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,15,0.94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.navbar__inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  height: 60px; padding: 0 1.25rem;
}
.navbar__logo {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 1.1rem; font-weight: 800;
  color: var(--text-primary); text-decoration: none; flex-shrink: 0;
}
.navbar__logo-img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1.5px solid var(--glow-border); }
.navbar__logo-text { color: var(--primary-light); }
.navbar__links { display: flex; align-items: center; gap: 0.15rem; flex: 1; }
.navbar__links a {
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition);
}
.navbar__links a:hover, .navbar__links a.active { background: var(--glow-soft); color: var(--primary-light); }
.navbar__actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.navbar__user {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer;
  transition: all var(--transition); font-size: 0.82rem; color: var(--text-secondary);
}
.navbar__user:hover { border-color: var(--primary); color: var(--primary-light); }
.navbar__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.navbar__hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 0.4rem; background: none; border: none; margin-right: 0.25rem;
}
.navbar__hamburger span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: all 0.25s; }
.navbar__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .navbar__hamburger { display: flex; }
  .navbar__links {
    display: none; flex-direction: column; align-items: stretch;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem; gap: 0.15rem; z-index: 99;
  }
  .navbar__links.open { display: flex; }
  .navbar__links a { padding: 0.6rem 0.75rem; display: block; }
  .navbar { position: relative; }
  .navbar__actions .btn-outline { display: none; }
}
@media (max-width: 400px) { .navbar__actions .btn-sm { padding: 0.35rem 0.65rem; font-size: 0.72rem; } }

/* --- Page Loader --- */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.loader-logo { width: 64px; height: 64px; border-radius: 14px; border: 2px solid var(--glow-border); object-fit: cover; }
.loader-title { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); letter-spacing: 0.04em; }

/* --- Hero --- */
.hero {
  min-height: 500px; display: flex; align-items: center;
  position: relative; overflow: hidden; padding: 4rem 0;
}
.hero__bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% -5%, rgba(139,60,247,0.16) 0%, transparent 65%), var(--bg-base);
}
.hero__content { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.hero__tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(139,60,247,0.08); border: 1px solid var(--glow-border);
  color: var(--primary-light); font-size: 0.75rem; font-weight: 700;
  padding: 0.28rem 0.8rem; border-radius: 999px; margin-bottom: 1.1rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.hero__tag svg { width: 13px; height: 13px; }
.hero__title { margin-bottom: 0.85rem; }
.hero__sub { color: var(--text-secondary); font-size: 1.05rem; max-width: 520px; margin-bottom: 1.75rem; }
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero__stat-val { font-size: 1.4rem; font-weight: 800; color: var(--primary-light); font-family: 'Courier New', monospace; }
.hero__stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }

/* --- Section --- */
.section    { padding: 3.5rem 0; }
.section-sm { padding: 1.75rem 0; }
.section__header { margin-bottom: 1.75rem; }
.section__title  { margin-bottom: 0.4rem; }
.section__sub    { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Tabs --- */
.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
  padding: 0.45rem 1.1rem; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(139,60,247,0.22); }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-purple { background: rgba(139,60,247,0.15); color: var(--primary-light); border: 1px solid rgba(139,60,247,0.25); }
.badge-green  { background: rgba(34,197,94,0.12);  color: var(--success);       border: 1px solid rgba(34,197,94,0.25); }
.badge-yellow { background: rgba(245,158,11,0.12); color: var(--warning);       border: 1px solid rgba(245,158,11,0.25); }
.badge-red    { background: rgba(239,68,68,0.12);  color: var(--danger);        border: 1px solid rgba(239,68,68,0.25); }
.badge-blue   { background: rgba(59,130,246,0.12); color: var(--info);          border: 1px solid rgba(59,130,246,0.25); }
.badge-gray   { background: rgba(156,163,175,0.08); color: #9ca3af;             border: 1px solid rgba(156,163,175,0.18); }
.status-pending          { background: rgba(245,158,11,0.10);  color: var(--warning);       border: 1px solid rgba(245,158,11,0.25); }
.status-awaiting_payment { background: rgba(59,130,246,0.10);  color: var(--info);          border: 1px solid rgba(59,130,246,0.25); }
.status-paid             { background: rgba(139,60,247,0.12);  color: var(--primary-light); border: 1px solid rgba(139,60,247,0.25); }
.status-delivered        { background: rgba(34,197,94,0.10);   color: var(--success);       border: 1px solid rgba(34,197,94,0.25); }
.status-cancelled        { background: rgba(239,68,68,0.10);   color: var(--danger);        border: 1px solid rgba(239,68,68,0.25); }
.status-open             { background: rgba(59,130,246,0.10);  color: var(--info);          border: 1px solid rgba(59,130,246,0.25); }
.status-in_progress      { background: rgba(245,158,11,0.10);  color: var(--warning);       border: 1px solid rgba(245,158,11,0.25); }
.status-closed           { background: rgba(156,163,175,0.08); color: #9ca3af;             border: 1px solid rgba(156,163,175,0.18); }
.status-active           { background: rgba(34,197,94,0.10);   color: var(--success);       border: 1px solid rgba(34,197,94,0.25); }
.status-finished         { background: rgba(156,163,175,0.08); color: #9ca3af;             border: 1px solid rgba(156,163,175,0.18); }

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--glow-border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  max-width: 500px; width: 100%; box-shadow: var(--shadow-card);
  transform: translateY(16px); transition: transform 0.2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.35rem; }
.modal__title  { font-size: 1.05rem; font-weight: 700; }
.modal__close  { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0.2rem; display: flex; align-items: center; justify-content: center; }
.modal__close:hover { color: var(--text-primary); }

/* --- Toast --- */
#toast-container {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 999;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem 1.1rem;
  display: flex; align-items: center; gap: 0.65rem;
  min-width: 240px; max-width: 340px; box-shadow: var(--shadow-card);
  animation: toastIn 0.22s ease; font-size: 0.875rem;
}
.toast.success { border-color: rgba(34,197,94,0.35); }
.toast.error   { border-color: rgba(239,68,68,0.35); }
.toast.info    { border-color: rgba(139,60,247,0.35); }
.toast.warning { border-color: rgba(245,158,11,0.35); }
.toast-icon { flex-shrink: 0; }
.toast-icon svg { width: 16px; height: 16px; display: block; }
@keyframes toastIn  { from { opacity:0; transform: translateX(16px); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; transform: translateX(16px); } }
.toast.removing { animation: toastOut 0.22s ease forwards; }

/* --- Table --- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead tr { background: var(--bg-surface); }
th { text-align: left; padding: 0.7rem 1rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(139,60,247,0.03); }
td.bold { color: var(--text-primary); font-weight: 500; }

/* --- Form --- */
.form-group { margin-bottom: 1.15rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
.form-hint  { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.3rem; }
.input-wrap { position: relative; }
.input-wrap .input-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; display: flex; align-items: center; }
.input-wrap .input-icon svg { width: 16px; height: 16px; display: block; }
.input-wrap input { padding-left: 2.65rem; }
.input-wrap .input-action { position: absolute; right: 0.65rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; padding: 0.2rem; }
.input-wrap .input-action:hover { color: var(--primary-light); }
.search-wrap { position: relative; }
.search-wrap input { padding-left: 2.5rem; }
.search-wrap .search-icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-wrap .search-icon svg { width: 16px; height: 16px; display: block; }

/* --- Progress Bar --- */
.progress-bar { background: var(--bg-surface); border-radius: 999px; height: 6px; overflow: hidden; }
.progress-bar__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #c084fc); transition: width 0.5s ease; }

/* --- Stats --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.35rem; }
.stat-card__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; margin-bottom: 0.4rem; }
.stat-card__value { font-size: 1.6rem; font-weight: 800; font-family: 'Courier New', monospace; color: var(--primary-light); }
.stat-card__sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 3.5rem 2rem; color: var(--text-muted); }
.empty-state__icon { display: flex; justify-content: center; margin-bottom: 0.9rem; color: var(--text-muted); }
.empty-state__icon svg { width: 48px; height: 48px; }
.empty-state__title { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 0.4rem; }

/* --- Spinner --- */
.spinner {
  width: 36px; height: 36px; border: 2.5px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.65s linear infinite; display: inline-block; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 4rem; }

/* --- Raffle Card --- */
.raffle-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.22s ease; cursor: pointer; }
.raffle-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.raffle-card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-surface); }
.raffle-card__img-placeholder { width: 100%; aspect-ratio: 16/9; background: var(--bg-surface); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.raffle-card__img-placeholder svg { width: 56px; height: 56px; }
.raffle-card__body { padding: 1.1rem; }
.raffle-card__name { font-weight: 700; margin-bottom: 0.3rem; }
.raffle-card__prize { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.35rem; }
.raffle-card__prize svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--warning); }
.raffle-card__footer { display: flex; align-items: center; justify-content: space-between; }
.raffle-countdown { font-family: 'Courier New', monospace; font-size: 0.8rem; color: var(--warning); font-weight: 700; display: flex; align-items: center; gap: 0.25rem; }
.raffle-countdown svg { width: 12px; height: 12px; }

/* --- Chat --- */
.chat-page-wrap { max-width: 760px; margin: 0 auto; }
.chat-outer {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  background: var(--bg-card);
}
.chat-header {
  display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.25rem;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 0.75rem;
}
.chat-header__info { flex: 1; min-width: 0; }
.chat-header__title { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header__sub   { font-size: 0.75rem; color: var(--text-muted); }
.chat-online { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--success); }
.chat-online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex-shrink: 0; animation: pulse-green 2s infinite; }
@keyframes pulse-green { 0%,100%{opacity:1} 50%{opacity:.5} }

.chat-messages {
  height: calc(100vh - 340px); min-height: 320px; max-height: 520px;
  overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: 0.6rem;
}
.chat-day-divider { text-align: center; font-size: 0.7rem; color: var(--text-muted); margin: 0.5rem 0; position: relative; }
.chat-day-divider::before, .chat-day-divider::after { content:''; position:absolute; top:50%; width:38%; height:1px; background:var(--border); }
.chat-day-divider::before { left:0; } .chat-day-divider::after { right:0; }

.chat-msg { display: flex; flex-direction: column; max-width: 76%; }
.chat-msg.mine  { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs{ align-self: flex-start; align-items: flex-start; }
.chat-msg__name { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.chat-bubble {
  padding: 0.6rem 0.9rem; border-radius: 14px;
  font-size: 0.875rem; line-height: 1.5; word-break: break-word;
}
.chat-msg.mine .chat-bubble  { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.chat-msg.theirs .chat-bubble{ background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-primary); border-bottom-left-radius: 3px; }
.chat-bubble__time { font-size: 0.65rem; opacity: 0.65; margin-top: 0.3rem; display: block; }
.chat-msg.mine .chat-bubble__time { text-align: right; }

.chat-input-row {
  display: flex; gap: 0.5rem; padding: 0.85rem 1rem;
  border-top: 1px solid var(--border); background: var(--bg-surface);
}
.chat-input-row input { flex: 1; }
.chat-input-row .btn { flex-shrink: 0; }

/* Seller rating prompt inside chat */
.chat-rate-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.04));
  border: 1px solid rgba(245,158,11,0.25); border-radius: var(--radius-sm);
  padding: 0.85rem 1rem; margin: 0.5rem 1.1rem;
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.chat-rate-banner p { font-size: 0.82rem; color: var(--text-secondary); flex: 1; }

/* --- Dashboard Layout --- */
.dashboard-layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 1.25rem 0; position: sticky; top: 60px;
  height: calc(100vh - 60px); overflow-y: auto;
}
.sidebar__section { margin-bottom: 0.35rem; padding: 0 0.75rem; }
.sidebar__label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; padding: 0.45rem 0.65rem; margin-bottom: 0.15rem; }
.sidebar__link {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem 0.65rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.845rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.sidebar__link:hover { background: var(--glow-soft); color: var(--primary-light); }
.sidebar__link.active { background: rgba(139,60,247,0.11); color: var(--primary-light); border: 1px solid rgba(139,60,247,0.18); }
.sidebar__icon { width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sidebar__icon svg { width: 100%; height: 100%; }
.sidebar__badge {
  margin-left: auto; background: var(--primary); color: #fff;
  font-size: 0.6rem; font-weight: 700; border-radius: 999px;
  padding: 0.1rem 0.4rem; min-width: 16px; text-align: center;
}
.dashboard-content { flex: 1; padding: 2rem 1.75rem; overflow-x: hidden; }
.dash-section { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

@media (max-width: 860px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 0.2rem; padding: 0.65rem 0.75rem; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar__section { margin: 0; }
  .sidebar__label { display: none; }
  .sidebar__link { font-size: 0.78rem; padding: 0.38rem 0.55rem; }
  .sidebar__badge { display: none; }
  .dashboard-content { padding: 1.25rem; }
}

/* --- Page Header --- */
.page-header { padding: 2.25rem 0 1.75rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb-sep { color: var(--border-hover); }

/* --- Footer --- */
.footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 2.5rem 0 1.25rem; margin-top: 3.5rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer__brand p { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.65rem; line-height: 1.65; }
.footer__col h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.85rem; }
.footer__col a { display: block; color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 0.45rem; }
.footer__col a:hover { color: var(--primary-light); }
.footer__bottom { border-top: 1px solid var(--border); padding-top: 1.1rem; display: flex; align-items: center; justify-content: space-between; font-size: 0.77rem; color: var(--text-muted); }
@media (max-width: 768px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } .footer__bottom { flex-direction: column; gap: 0.4rem; text-align: center; } }

/* --- Categories --- */
.categories-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media(max-width: 600px){ .categories-grid { grid-template-columns: repeat(2,1fr); } }
.cat-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem 1rem; text-align: center; cursor: pointer;
  transition: all 0.22s; text-decoration: none; color: var(--text-secondary);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.cat-item:hover { border-color: var(--border-hover); box-shadow: var(--shadow-purple); transform: translateY(-2px); color: var(--primary-light); }
.cat-item svg { width: 28px; height: 28px; }
.cat-item__label { font-size: 0.82rem; font-weight: 600; }

/* --- Promo Banner --- */
.promo-banner {
  background: linear-gradient(135deg, rgba(139,60,247,0.07), rgba(192,38,211,0.04));
  border: 1px solid var(--glow-border); border-radius: var(--radius-lg);
  padding: 1.75rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
}
@media (max-width: 580px) { .promo-banner { flex-direction: column; text-align: center; } }

/* --- Auth --- */
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, rgba(109,40,217,0.22) 0%, var(--bg-base) 60%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 2.5rem; text-align: center;
}
.auth-brand::before {
  content:''; position:absolute; width:400px; height:400px; border-radius:50%;
  background: radial-gradient(circle, rgba(139,60,247,0.12) 0%, transparent 70%);
  top:-80px; right:-80px; pointer-events:none;
}
.auth-brand__logo { width: 88px; height: 88px; border-radius: 20px; border: 2px solid var(--glow-border); object-fit: cover; margin-bottom: 1.75rem; box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.auth-brand__title { font-size: 2rem; font-weight: 800; margin-bottom: 0.6rem; }
.auth-brand__sub   { color: var(--text-secondary); max-width: 260px; line-height: 1.7; margin-bottom: 2.5rem; font-size: 0.925rem; }
.auth-feature { display: flex; align-items: center; gap: 0.75rem; text-align: left; margin-bottom: 1rem; color: var(--text-secondary); font-size: 0.875rem; }
.auth-feature svg { color: var(--primary-light); flex-shrink: 0; }
.auth-social { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; }
.auth-social strong { color: var(--primary-light); font-size: 1.1rem; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg-base); overflow-y: auto; }
.auth-box { width: 100%; max-width: 400px; background: var(--bg-card); border: 1px solid var(--glow-border); border-radius: var(--radius-xl); padding: 2.25rem; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.75rem; }
.auth-logo img { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--glow-border); margin-bottom: 0.65rem; }
.auth-logo h2 { font-size: 1.3rem; font-weight: 800; }
.auth-logo p { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; }
.auth-tabs { display: flex; background: var(--bg-surface); border-radius: var(--radius-sm); padding: 0.22rem; margin-bottom: 1.75rem; }
.auth-tab { flex: 1; text-align: center; padding: 0.5rem; border-radius: 5px; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all 0.2s; }
.auth-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(139,60,247,0.25); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.divider { text-align: center; color: var(--text-muted); font-size: 0.75rem; margin: 0.9rem 0; position: relative; }
.divider::before, .divider::after { content:''; position:absolute; top:50%; width:40%; height:1px; background: var(--border); }
.divider::before { left:0; } .divider::after { right:0; }
.back-link { display: block; text-align: center; margin-top: 1.25rem; color: var(--text-muted); font-size: 0.8rem; }
.back-link:hover { color: var(--primary-light); }
@media (max-width: 768px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-side { min-height: 100vh; padding: 1.5rem; align-items: flex-start; padding-top: 2.5rem; }
}

/* --- Sort Select --- */
.sort-select { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary); padding: 0.45rem 0.7rem; border-radius: var(--radius-sm); font-size: 0.82rem; cursor: pointer; }

/* --- Glow pulse --- */
@keyframes glowPulse { 0%,100%{ box-shadow: 0 2px 10px rgba(139,60,247,0.25); } 50%{ box-shadow: 0 4px 22px rgba(139,60,247,0.5); } }
.glow-pulse { animation: glowPulse 2.5s ease infinite; }

/* --- Utilities --- */
.flex    { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* =============================================
   VN STORE — Dashboard & Chat Extras
   ============================================= */

/* ── Ticket modal chat area ── */
.td-messages-box {
  height: 300px; overflow-y: auto;
  background: var(--bg-surface); border-radius: var(--radius-sm);
  padding: 1rem; margin-bottom: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
  scrollbar-width: thin;
}
.td-input-row {
  display: flex; gap: .5rem;
}
.td-input-row input { flex: 1; }
.td-input-row .btn  { flex-shrink: 0; }

/* ── Message bubbles (reused in dashboard ticket detail) ── */
.message-bubble {
  max-width: 80%; padding: .55rem .85rem;
  border-radius: 14px; font-size: .875rem;
  line-height: 1.5; word-break: break-word;
  position: relative;
}
.message-bubble.mine {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}
.message-bubble.theirs {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.message-bubble__meta {
  font-size: .62rem; opacity: .6; margin-top: .25rem;
  text-align: right;
}

/* ── Dashboard welcome banner ── */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(139,60,247,.08), rgba(139,60,247,.03));
  border: 1px solid var(--glow-border); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin-bottom: 1.75rem;
  flex-wrap: wrap; gap: .75rem;
}
.dash-welcome__left  { display: flex; align-items: center; gap: 1rem; }
.dash-welcome__avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; color: #fff;
  border: 2px solid var(--glow-border);
}
.dash-welcome__name { font-size: 1.05rem; font-weight: 700; }
.dash-welcome__sub  { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }

/* ── Order row card ── */
.order-row-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; transition: border-color var(--transition);
}
.order-row-card:hover { border-color: var(--border-hover); }
.order-row-card__id   { font-weight: 700; font-size: .85rem; min-width: 90px; }
.order-row-card__meta { flex: 1; min-width: 120px; }
.order-row-card__date { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }
.order-row-card__actions { display: flex; gap: .5rem; margin-left: auto; }

/* ── Raffle ticket card ── */
.raffle-ticket-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  transition: border-color var(--transition);
}
.raffle-ticket-card:hover { border-color: var(--border-hover); }
.raffle-ticket-card__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem; margin-bottom: .65rem;
}
.raffle-ticket-card__name  { font-weight: 700; font-size: .9rem; }
.raffle-ticket-card__prize { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
.tickets-row { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; }

/* ── Support ticket card ── */
.ticket-support-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; transition: border-color var(--transition);
}
.ticket-support-card:hover { border-color: var(--border-hover); }
.ticket-support-card__info    { flex: 1; min-width: 120px; }
.ticket-support-card__subject { font-weight: 600; font-size: .875rem; }
.ticket-support-card__meta    { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Profile avatar large ── */
.profile-avatar-lg {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: #fff;
  border: 2px solid var(--glow-border);
}
.profile-card-wrap { max-width: 500px; }

/* ── Section card list ── */
.section-cards-list { display: flex; flex-direction: column; gap: .65rem; }
