/* ==========================================================================
   W8 Lao Live Chat — Dark Premium UI (Phoenix Edition)
   Navy + Gold gradient theme. Premium, fiery, distinct from VIP168.
   Colors: Deep navy #0a0e1a, Cards #131826, Gold #FFD700→#f59e0b, Blue #1A56DB
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand palette — Phoenix navy + gold */
  --navy: #0a0e1a;
  --navy-2: #0d1220;
  --card: #131826;
  --card-2: #181e2e;
  --border: #1e2939;
  --border-light: #2a3548;
  --gold: #FFD700;
  --gold-2: #f59e0b;
  --gold-dark: #b8860b;
  --gold-light: #FFE066;
  --gold-glow: rgba(255, 215, 0, 0.15);
  --blue: #1A56DB;
  --blue-2: #3b82f6;
  --blue-light: #1e3a5f;
  --blue-glow: rgba(59, 130, 246, 0.15);
  --white: #ffffff;
  --bg: var(--navy);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --green: #22c55e;
  --green-light: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-light: rgba(239, 68, 68, 0.12);
  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.45);
  --gold-gradient: linear-gradient(135deg, #FFD700 0%, #f59e0b 50%, #b8860b 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(245, 158, 11, 0.06) 100%);
  --navy-gradient: linear-gradient(180deg, #0a0e1a 0%, #0d1220 100%);
  --max-width: 480px;
  --admin-max-width: 1000px;
  --header-h: 60px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--navy);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 215, 0, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* --- Logo --- */
.logo {
  height: 40px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}
.logo-lg {
  height: 110px;
  width: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.4));
}
.logo-sm { height: 56px; width: auto; filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.25)); }

/* --- App Header (Customer) --- */
.app-header {
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.app-header .brand { display: flex; align-items: center; gap: .5rem; }
.app-header .brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: .5px;
}
.app-header .header-actions { display: flex; align-items: center; gap: .75rem; }
.app-header .credit-chip {
  background: var(--gold-gradient-soft);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--gold-light);
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.1);
}

/* --- Admin Header --- */
.admin-header {
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.admin-header .brand { display: flex; align-items: center; gap: .5rem; }
.admin-header .brand-name {
  font-size: 1rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-header .admin-info { display: flex; align-items: center; gap: 1rem; font-size: .85rem; color: var(--text-muted); }
.admin-header .admin-info b { color: var(--text); }

/* --- Admin Layout --- */
.admin-body { display: flex; min-height: calc(100dvh - var(--header-h)); }
.admin-sidebar {
  width: 200px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.2rem;
  color: var(--text-muted);
  font-size: .87rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .2s ease;
}
.admin-sidebar a:hover { background: rgba(255, 215, 0, 0.05); text-decoration: none; color: var(--text); }
.admin-sidebar a.active {
  background: var(--gold-gradient-soft);
  color: var(--gold-light);
  border-left-color: var(--gold);
  font-weight: 600;
}
.admin-sidebar a svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-main { flex: 1; padding: 1.5rem; overflow-x: auto; background: var(--navy); }
.admin-main .admin-wrap { max-width: var(--admin-max-width); margin: 0 auto; }

/* --- Layout Containers --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 1rem; }
.container-fluid { max-width: 100%; padding: 1rem; }

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.25), transparent);
}
.card-tight { padding: 1rem; }
.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .75rem;
  color: var(--text);
}

/* --- Typography --- */
h1 { font-size: 1.35rem; font-weight: 800; color: var(--white); }
h2 { font-size: 1.1rem; font-weight: 700; color: var(--white); }
h3 { font-size: 1rem; font-weight: 700; color: var(--white); }
.label { font-size: .78rem; color: var(--text-muted); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.muted { color: var(--text-muted); }
.small { font-size: .82rem; }
.tiny { font-size: .72rem; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-blue { color: var(--blue-2); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }

/* --- Values --- */
.val-lg {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.val-md { font-size: 1.6rem; font-weight: 800; }
.val-gold { color: var(--gold); }
.val-blue { color: var(--blue-2); }

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: .5rem; }

/* --- Icon Grid (Home Menu) --- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
}
.icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .7rem .4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
}
.icon-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 215, 0, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.icon-tile:hover {
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 215, 0, 0.08);
  text-decoration: none;
}
.icon-tile:hover::after { opacity: 1; }
.icon-tile svg { width: 24px; height: 24px; color: var(--gold); transition: transform .3s ease; }
.icon-tile:hover svg { transform: scale(1.15); }
.icon-tile .tile-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; }
.icon-tile .tile-sub {
  font-size: .58rem;
  color: var(--gold);
  font-weight: 600;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem 1.3rem;
  border: 1px solid var(--blue);
  background: linear-gradient(135deg, #1A56DB 0%, #1648B8 100%);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(26, 86, 219, 0.3);
  transition: all .2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:hover {
  background: linear-gradient(135deg, #2570f0 0%, #1A56DB 100%);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(26, 86, 219, 0.45);
}
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-gold {
  background: var(--gold-gradient);
  border-color: var(--gold-dark);
  color: #1a1206;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3), 0 0 24px rgba(255, 215, 0, 0.1);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #FFE45c 0%, #FFD700 50%, #f59e0b 100%);
  box-shadow: 0 6px 28px rgba(255, 215, 0, 0.45), 0 0 32px rgba(255, 215, 0, 0.15);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
  box-shadow: none;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--gold); color: var(--gold-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #dc2626;
  color: var(--white);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-color: #16a34a;
  color: var(--white);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.btn-sm { padding: .4rem .8rem; font-size: .8rem; }
.btn-block { display: flex; width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* --- Form Elements --- */
input[type="text"], input[type="password"], input[type="number"],
input[type="email"], input[type="tel"], input[type="url"], textarea, select {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-family: inherit;
  background: var(--navy-2);
  color: var(--text);
  outline: none;
  transition: all .2s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.12), 0 0 16px rgba(255, 215, 0, 0.08);
}
input::placeholder, textarea::placeholder { color: var(--text-light); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: .3rem; font-weight: 600; }

/* --- Login Page --- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--navy);
  background-image:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(255, 215, 0, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 20% 100%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(255, 215, 0, 0.06) 0%, transparent 45%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.08) 0%, transparent 70%);
  top: 10%; left: 50%;
  transform: translateX(-50%);
  animation: loginGlow 4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes loginGlow {
  0% { opacity: .5; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.3); }
}
.login-card {
  max-width: 380px;
  width: 100%;
  text-align: center;
  background: rgba(19, 24, 38, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 1;
}
.login-card h1 {
  margin: 1rem 0 .25rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.login-card .sub { color: var(--text-muted); font-size: .85rem; margin-bottom: 1.5rem; }
.login-card .form-group { margin-bottom: 1rem; text-align: left; }
.login-card .btn { margin-top: .5rem; }
.login-card .error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  margin-bottom: 1rem;
  text-align: left;
}
.login-card input {
  background: rgba(10, 14, 26, 0.6);
  border-color: rgba(255, 215, 0, 0.15);
}
.login-card input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge-pending { background: var(--amber-light); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-confirmed, .badge-approved, .badge-on { background: var(--green-light); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.25); }
.badge-rejected, .badge-off { background: var(--red-light); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-blue { background: rgba(59, 130, 246, 0.12); color: var(--blue-2); border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-gold { background: rgba(255, 215, 0, 0.12); color: var(--gold); border: 1px solid rgba(255, 215, 0, 0.25); }

/* Unread badge in chat header */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  animation: badgePulse 1.5s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* --- Tables --- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th {
  text-align: left;
  padding: .65rem .7rem;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--card-2);
}
td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 215, 0, 0.03); }

/* --- Stats (Admin Dashboard) --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: .75rem; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.stat-card .stat-val { font-size: 1.8rem; font-weight: 800; }
.stat-card .stat-label { font-size: .78rem; color: var(--text-muted); }

/* --- Chat --- */
.chat-body {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--header-h));
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--navy);
  overflow: hidden;
}
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.msg {
  max-width: 78%;
  padding: .6rem .9rem;
  border-radius: 16px;
  font-size: .9rem;
  word-break: break-word;
  position: relative;
  line-height: 1.45;
}
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1A56DB 0%, #1648B8 100%);
  color: var(--white);
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 86, 219, 0.25);
}
.msg.admin {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.msg img { max-width: 100%; border-radius: 8px; margin-top: .3rem; }
.msg .msg-time { font-size: .65rem; opacity: .55; margin-top: .2rem; }
.chat-input {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input input[type="text"] {
  flex: 1;
  padding: .6rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 22px;
  font-size: .9rem;
  outline: none;
  background: var(--navy-2);
  transition: all .2s ease;
}
.chat-input input[type="text"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1), 0 0 16px rgba(255, 215, 0, 0.08);
}
.chat-input button { white-space: nowrap; }
.chat-input label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .55rem .7rem;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
  transition: all .2s ease;
}
.chat-input label:hover { border-color: var(--gold); background: var(--gold-gradient-soft); }
.chat-input label svg { width: 22px; height: 22px; color: var(--text-muted); }
.chat-input label:hover svg { color: var(--gold); }
#img-preview { max-width: 60px; max-height: 60px; border-radius: 6px; display: none; }
#img-preview[src] { display: block; }

/* --- Admin Chat Layout --- */
.admin-chat-body {
  display: flex;
  height: calc(100dvh - var(--header-h));
}
.chat-sidebar {
  width: 240px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--card);
  flex-shrink: 0;
}
.chat-sidebar .sidebar-header { padding: .8rem 1rem; border-bottom: 1px solid var(--border); font-size: .85rem; font-weight: 700; color: var(--text-muted); }
.chat-sidebar .chat-user-item {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: .85rem;
  transition: background .15s;
}
.chat-sidebar .chat-user-item:hover { background: rgba(255, 215, 0, 0.04); }
.chat-sidebar .chat-user-item.active { background: var(--gold-gradient-soft); border-left: 3px solid var(--gold); }
.chat-sidebar .chat-user-item .cu-name { font-weight: 600; color: var(--text); }
.chat-sidebar .chat-user-item .cu-preview { font-size: .75rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sidebar .unread-dot { background: var(--red); color: #fff; border-radius: 10px; padding: 0 5px; font-size: .68rem; float: right; }
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--navy); }
.chat-area .chat-area-header { padding: .65rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; font-weight: 700; background: var(--card); color: var(--text); }

/* --- Wheel (CSS fallback — wheel.html uses inline styles + canvas) --- */
.wheel-container { position: relative; width: 240px; height: 240px; margin: 0 auto 1rem; }
.wheel-pointer {
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--gold);
  position: absolute;
  top: -8px; left: 50%; transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}
.wheel {
  width: 240px; height: 240px; border-radius: 50%;
  border: 8px solid var(--gold);
  background: conic-gradient(var(--blue) 0 25%, var(--gold) 0 50%, var(--green) 0 75%, #9333EA 0 100%);
  transition: transform 4s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}
.wheel-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* --- Box (CSS fallback — box.html uses inline styles) --- */
.box-icon {
  width: 140px; height: 140px; margin: 0 auto 1rem;
  font-size: 4rem; display: flex; align-items: center; justify-content: center;
  background: var(--gold-gradient-soft);
  border-radius: 20px; border: 2px solid var(--gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

/* --- Game Cards --- */
.game-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  margin-bottom: .6rem;
  transition: all .25s ease;
  box-shadow: var(--shadow);
}
.game-card:hover {
  border-color: rgba(255, 215, 0, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 215, 0, 0.08);
  text-decoration: none;
}
.game-card .gc-icon { font-size: 1.6rem; }
.game-card .gc-title { flex: 1; font-weight: 600; font-size: .95rem; }
.game-card .gc-arrow { color: var(--text-light); }

/* --- Result Box --- */
.result-box {
  margin-top: 1rem;
  padding: .9rem;
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 2.5rem;
  font-size: .9rem;
  color: var(--text-muted);
}

/* --- History List --- */
.hist-list { text-align: left; margin-top: 1rem; max-height: 200px; overflow-y: auto; }
.hist-list .hist-item { padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .8rem; color: var(--text-muted); }
.hist-list .hist-item:last-child { border-bottom: none; }

/* --- Slip Items --- */
.slip-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem;
  margin-bottom: .5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  background: var(--navy-2);
}
.slip-item img { max-width: 100px; max-height: 100px; border-radius: 6px; }

/* --- Tabs --- */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tabs button {
  padding: .45rem .9rem;
  border: 1px solid var(--border-light);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s ease;
}
.tabs button:hover { border-color: var(--gold); color: var(--text); }
.tabs button.active {
  background: var(--gold-gradient);
  color: #1a1206;
  border-color: var(--gold-dark);
}

/* --- Alert --- */
.alert {
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin-bottom: .5rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-light); color: var(--green); border-color: rgba(34, 197, 94, 0.25); }
.alert-error { background: var(--red-light); color: var(--red); border-color: rgba(239, 68, 68, 0.25); }
.alert-info { background: rgba(59, 130, 246, 0.12); color: var(--blue-2); border-color: rgba(59, 130, 246, 0.25); }

/* --- QR Code --- */
.qr-box { background: var(--white); padding: 12px; border-radius: var(--radius); display: inline-block; border: 1px solid var(--border); }

/* --- Install Steps --- */
.steps { text-align: left; }
.steps .step { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .5rem; }
.steps .step .step-num {
  background: var(--gold-gradient);
  color: #1a1206;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}
.steps .step .step-text { font-size: .85rem; color: var(--text-muted); padding-top: .15rem; }

/* --- Misc --- */
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 1rem 0; }
.empty-state { text-align: center; color: var(--text-light); padding: 2rem 1rem; font-size: .9rem; }
.footer-text { text-align: center; color: var(--text-light); font-size: .72rem; padding: 1rem; letter-spacing: .5px; }

/* --- Favicon inline --- */
.favicon-link { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .admin-sidebar { width: 60px; }
  .admin-sidebar a { justify-content: center; padding: .65rem 0; }
  .admin-sidebar a .sidebar-label { display: none; }
  .admin-sidebar a svg { width: 22px; height: 22px; }
}

@media (max-width: 600px) {
  .admin-sidebar { display: none; }
  .admin-body { flex-direction: column; }
  .admin-main { padding: 1rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .icon-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chat-sidebar { width: 160px; }
  .app-header .credit-chip { font-size: .76rem; padding: .22rem .55rem; }
  .container { padding: .75rem; }
}

@media (max-width: 400px) {
  .icon-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   W8 Lao — Mobile Bottom Navigation (Dark Premium)
   ========================================================================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 1000; height: 56px; overflow: visible;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--text-light);
  padding: 4px 8px; font-size: .58rem; font-weight: 600;
  gap: 2px; transition: all .25s ease; min-width: 48px; border-radius: 10px;
  position: relative;
}
.bottom-nav a .bn-icon { display: flex; align-items: center; justify-content: center; transition: transform .25s ease; }
.bottom-nav a .bn-icon svg { width: 24px; height: 24px; display: block; }
.bottom-nav a .bn-label { font-size: .58rem; }
.bottom-nav a:hover { color: var(--gold-light); text-decoration: none; }
.bottom-nav a:hover .bn-icon { transform: translateY(-2px); }
.bottom-nav a.active {
  color: var(--gold);
  font-weight: 700;
}
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--gold-gradient);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.bottom-nav a.active .bn-icon {
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
  transform: scale(1.1);
}

/* All bottom-nav items are now equal (SVG icons) — FAB treatment removed */
.bottom-nav-spacer { height: 60px; }

/* Make sure body has padding for bottom nav */
body { padding-bottom: 60px; }

/* Customer chat page: no bottom nav, no extra padding, no page scroll */
body.chat-page { padding-bottom: 0; overflow: hidden; }

/* Chat message bubbles (used by chat.js) */
.chat-msg {
  max-width: 80%;
  padding: .55rem .85rem;
  border-radius: 16px;
  font-size: .88rem;
  line-height: 1.4;
  word-break: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1A56DB 0%, #1648B8 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 86, 219, 0.25);
}
.chat-msg.admin {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg img { max-width: 200px; border-radius: 8px; margin-top: 4px; cursor: pointer; }
.chat-msg .time { font-size: .6rem; opacity: .55; margin-top: 2px; }

/* Slip notice banner */
.slip-notice {
  background: var(--gold-gradient-soft);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius);
  padding: .55rem .85rem;
  font-size: .78rem;
  color: var(--gold-light);
  font-weight: 600;
  text-align: center;
  margin-bottom: .5rem;
}

/* ==========================================================================
   W8 — Premium extras
   ========================================================================== */

/* Gold gradient border card (home highlight) */
.card-gold {
  background: var(--card);
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--card), var(--card)),
    var(--gold-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: var(--shadow), 0 0 24px rgba(255, 215, 0, 0.06);
}

/* Animated counter number style */
.counter {
  font-variant-numeric: tabular-nums;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* Selection */
::selection { background: rgba(255, 215, 0, 0.25); color: var(--white); }

/* Fade-in animation utility */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .5s ease-out both; }

/* ==========================================================================
   W8 — Compact Home Hero (unified welcome + credit + stat badges)
   Replaces the old 3 separate cards (.home-welcome / .home-credit / .home-stat)
   ========================================================================== */
.home-hero {
  position: relative;
  background: var(--card);
  border: 1px solid transparent;
  background-image:
    linear-gradient(var(--card), var(--card)),
    var(--gold-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: var(--radius);
  padding: 1rem 1.1rem .85rem;
  margin-bottom: .9rem;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 32px rgba(255,215,0,0.06);
}
.home-hero::before {
  content: '';
  position: absolute;
  top: -45%; right: -15%;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.hero-top {
  display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap;
  margin-bottom: .35rem;
  position: relative; z-index: 1;
}
.hero-label { font-size: .66rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.hero-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.hero-credit { text-align: center; margin: .15rem 0 .6rem; position: relative; z-index: 1; }
.hero-credit-label { font-size: .66rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; margin-bottom: .1rem; }
.hero-credit .val-lg { font-size: 2.1rem; line-height: 1.1; }
.hero-credit-unit { font-size: .7rem; color: var(--text-muted); font-weight: 600; }
.hero-badges { display: flex; gap: .5rem; justify-content: center; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--gold-gradient-soft);
  border: 1px solid rgba(255,215,0,0.25);
  color: var(--gold-light);
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .8rem; font-weight: 700;
}
.hero-badge svg { width: 14px; height: 14px; color: var(--gold); flex-shrink: 0; }
.hero-badge-label { font-size: .66rem; font-weight: 600; color: var(--text-muted); }

/* Compact one-line home notice (SVG icon, no emoji) */
.home-notice {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--gold-gradient-soft);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius-sm);
  padding: .45rem .8rem;
  font-size: .76rem;
  color: var(--gold-light);
  font-weight: 600;
  text-align: center;
  margin-bottom: .6rem;
}
.home-notice svg { width: 15px; height: 15px; color: var(--gold); flex-shrink: 0; }
