:root {
  --bg: #f3f5fb;
  --bg-soft: #ffffff;
  --card-bg: #ffffff;
  --text: #1c2033;
  --text-muted: #6b7280;
  --border: #e7e9f2;
  --primary: #6c5ce7;
  --primary-dark: #5947d8;
  --accent: #00c2a8;
  --success: #16c784;
  --danger: #ff5a5f;
  --warning: #ffb020;
  --sidebar-bg: #171528;
  --sidebar-text: #cfcbe8;
  --sidebar-active: #6c5ce7;
  --shadow: 0 4px 20px rgba(30, 20, 60, 0.06);
  --radius: 16px;
}

[data-theme="dark"] {
  --bg: #0f1120;
  --bg-soft: #171a2e;
  --card-bg: #181b30;
  --text: #eef0fb;
  --text-muted: #9497b8;
  --border: #2a2d47;
  --primary: #8b7bff;
  --primary-dark: #7566f0;
  --accent: #2fe6c9;
  --sidebar-bg: #0c0e1c;
  --sidebar-text: #a8abcf;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  transition: background .25s ease, color .25s ease;
  min-height: 100vh;
}

a { text-decoration: none; }

/* ===== Layout ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 6px 10px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 16px;
}
.sidebar .brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }

.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: .93rem;
  display: flex;
  align-items: center;
  gap: 11px;
}
.sidebar .nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--primary), #8b7bff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(108,92,231,.35);
}
.sidebar .nav-section {
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .08em;
  color: #6f7296;
  margin: 18px 10px 8px;
  font-weight: 700;
}

.main-content { flex: 1; min-width: 0; }

.topbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-wrap { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* ===== Cards ===== */
.card-soft {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #fff;
  margin-bottom: 14px;
}
.stat-card .stat-value { font-size: 1.55rem; font-weight: 800; }
.stat-card .stat-label { color: var(--text-muted); font-size: .85rem; }

/* balance card */
.balance-card {
  background: linear-gradient(135deg, var(--primary) 0%, #8b7bff 60%, var(--accent) 130%);
  border-radius: var(--radius);
  color: #fff;
  padding: 26px;
  box-shadow: 0 12px 30px rgba(108,92,231,.35);
  position: relative;
  overflow: hidden;
}
.balance-card::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-soft {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-soft:hover { background: var(--border); color: var(--text); }

.amount-btn {
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 6px;
  font-weight: 700;
  font-size: .92rem;
  transition: all .15s ease;
}
.amount-btn:hover { border-color: var(--primary); color: var(--primary); }
.amount-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== Tables ===== */
.table-modern { --bs-table-bg: transparent; }
.table-modern thead th {
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
}
.table-modern td, .table-modern th { border-color: var(--border); color: var(--text); vertical-align: middle; }

/* ===== Badges ===== */
.badge-status { padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .76rem; }
.badge-pending { background: rgba(255,176,32,.15); color: var(--warning); }
.badge-approved { background: rgba(22,199,132,.15); color: var(--success); }
.badge-rejected { background: rgba(255,90,95,.15); color: var(--danger); }

/* ===== Service card ===== */
.service-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease;
}
.service-card:hover { transform: translateY(-4px); }
.service-card .thumb {
  height: 150px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.4rem;
}
.service-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.service-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.service-card .cat-tag {
  display: inline-block; font-size: .72rem; font-weight: 700;
  color: var(--primary); background: rgba(108,92,231,.1);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; width: fit-content;
}

/* ===== QR box ===== */
.qr-box {
  background: var(--bg-soft);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.qr-box img { max-width: 220px; width: 100%; border-radius: 12px; border: 1px solid var(--border); }

.copy-field {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.copy-field .label { font-size: .74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.copy-field .value { font-weight: 700; font-size: 1rem; }

/* ===== theme toggle ===== */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 1.1rem;
}

/* form controls dark aware */
.form-control, .form-select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(108,92,231,.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { font-weight: 600; font-size: .88rem; }

.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at top left, #7566f0 0, transparent 45%),
              radial-gradient(circle at bottom right, #2fe6c9 0, transparent 45%),
              var(--bg);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

@media (max-width: 992px) {
  .sidebar { position: fixed; z-index: 1050; transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1040; }
  .sidebar-backdrop.show { display: block; }
}


/* =========================================================
   TMXSHOP PREMIUM UI — Presentation only
   Không thay đổi xử lý PHP / database / giao dịch.
   ========================================================= */
:root{
  --tmx-purple:#6d28d9;
  --tmx-indigo:#4f46e5;
  --tmx-blue:#2563eb;
  --tmx-dark:#11132d;
  --tmx-line:#e9eaf4;
}
.user-header{position:sticky;top:0;z-index:1030;background:rgba(255,255,255,.94);backdrop-filter:blur(16px);border-bottom:1px solid var(--border)}
.user-nav{min-height:76px;display:flex;align-items:center;gap:22px;padding:10px 24px}
.user-brand{display:flex;align-items:center;gap:10px;color:var(--text);min-width:205px}
.user-brand strong{display:block;font-size:1.08rem;font-weight:800;background:linear-gradient(90deg,#6d28d9,#2563eb);-webkit-background-clip:text;background-clip:text;color:transparent}
.user-brand small{display:block;color:var(--text-muted);font-size:.64rem;font-weight:700;white-space:nowrap}
.brand-mark{width:39px;height:39px;border-radius:12px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#6d28d9,#2563eb);box-shadow:0 8px 20px rgba(79,70,229,.25)}
.user-brand img{width:39px;height:39px;border-radius:12px;object-fit:cover}
.user-main-nav{display:flex;align-items:center;gap:3px;flex:1;justify-content:center}
.user-main-nav a{display:flex;align-items:center;gap:6px;padding:10px 11px;border-radius:10px;color:var(--text-muted);font-size:.82rem;font-weight:700;white-space:nowrap}
.user-main-nav a:hover,.user-main-nav a.active{color:var(--tmx-indigo);background:rgba(79,70,229,.08)}
.user-main-nav a.active{box-shadow:inset 0 -2px 0 var(--tmx-indigo)}
.user-actions{display:flex;align-items:center;gap:8px}
.balance-pill{display:flex;align-items:center;gap:6px;border:1px solid #ddd9fb;background:#f7f5ff;color:#5b21b6;border-radius:999px;padding:9px 13px;font-size:.8rem;font-weight:800}
.user-profile{display:flex;align-items:center;gap:7px;border:1px solid var(--border);background:var(--bg-soft);color:var(--text);border-radius:12px;padding:7px 10px;font-weight:700}
.user-profile:after{margin-left:3px}
.avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#7c3aed,#2563eb);color:#fff;flex:none}
.user-main{min-height:calc(100vh - 76px);background:linear-gradient(180deg,#f8f9ff 0%,var(--bg) 38%)}
.user-container{max-width:1500px;padding:24px 28px 40px}
.page-heading{display:flex;align-items:end;justify-content:space-between;margin-bottom:18px}
.page-heading h1{font-size:1.45rem;margin:3px 0 0;font-weight:800}
.eyebrow{font-size:.67rem;letter-spacing:.12em;color:#7668c7;font-weight:800;text-transform:uppercase}
.mobile-user-menu{display:none}
.tmx-footer{border-top:1px solid var(--border);padding:18px 28px;background:var(--card-bg);font-size:.78rem;color:var(--text-muted)}
.tmx-footer strong{color:var(--tmx-indigo)}

.user-hero{position:relative;overflow:hidden;border-radius:22px;padding:34px 38px;color:#fff;background:radial-gradient(circle at 85% 15%,rgba(255,255,255,.18),transparent 26%),linear-gradient(120deg,#171242 0%,#25145d 43%,#4532bb 100%);box-shadow:0 18px 45px rgba(51,33,126,.22)}
.user-hero:after{content:"";position:absolute;width:260px;height:260px;border-radius:50%;right:-100px;bottom:-140px;background:rgba(255,255,255,.08)}
.user-hero h2{font-size:2rem;font-weight:800;margin-bottom:8px}
.user-hero p{max-width:560px;color:rgba(255,255,255,.72);margin-bottom:20px}
.hero-kicker{font-size:.72rem;letter-spacing:.14em;font-weight:800;color:#c4b5fd}
.hero-buttons{display:flex;gap:10px;flex-wrap:wrap}
.hero-btn-primary{background:#fff;color:#4c1d95;border:0;border-radius:10px;padding:10px 17px;font-weight:800}
.hero-btn-ghost{background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.25);border-radius:10px;padding:10px 17px;font-weight:800}
.hero-art{position:absolute;right:5%;top:50%;transform:translateY(-50%);width:270px;height:190px;opacity:.95}
.hero-art .cube{position:absolute;inset:32px 65px;background:linear-gradient(145deg,#8b5cf6,#312e81);border:1px solid rgba(255,255,255,.3);border-radius:28px;transform:rotate(-8deg);box-shadow:0 25px 50px rgba(0,0,0,.3)}
.hero-art i{position:absolute;font-size:7rem;right:74px;top:35px;filter:drop-shadow(0 20px 20px rgba(0,0,0,.3))}
.feature-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--border);border:1px solid var(--border);border-radius:16px;overflow:hidden;margin:18px 0}
.feature-item{background:var(--card-bg);padding:15px 16px;display:flex;align-items:center;gap:12px}
.feature-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;color:#5b21b6;background:#f0ebff;font-size:1.1rem}
.feature-item strong{display:block;font-size:.83rem}.feature-item small{color:var(--text-muted);font-size:.68rem}
.section-head{display:flex;align-items:center;justify-content:space-between;margin:24px 0 12px}
.section-head h3{font-size:1.02rem;font-weight:800;margin:0}
.section-head a{font-size:.76rem;font-weight:700;color:var(--tmx-indigo)}
.service-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.tmx-service-card{background:var(--card-bg);border:1px solid var(--border);border-radius:16px;overflow:hidden;box-shadow:var(--shadow);height:100%;transition:.18s}
.tmx-service-card:hover{transform:translateY(-4px);box-shadow:0 14px 30px rgba(44,37,100,.1)}
.tmx-service-thumb{height:145px;background:linear-gradient(135deg,#24164d,#5b21b6);position:relative;display:grid;place-items:center;overflow:hidden}
.tmx-service-thumb:before{content:"";position:absolute;width:110px;height:110px;border:1px solid rgba(255,255,255,.14);border-radius:28px;transform:rotate(25deg)}
.tmx-service-thumb i{font-size:3.2rem;color:#fff;z-index:1}
.tmx-service-thumb img{width:100%;height:100%;object-fit:cover;position:relative;z-index:2}
.tmx-service-body{padding:14px}
.tmx-service-body h4{font-size:.86rem;font-weight:800;line-height:1.35;margin:8px 0 6px}
.tmx-service-body p{font-size:.7rem;color:var(--text-muted);min-height:32px}
.tmx-price{font-size:.92rem;font-weight:900;color:#5b21b6}
.tmx-cat{font-size:.64rem;font-weight:800;color:#6d28d9;background:#f1edff;border-radius:999px;padding:5px 8px}
.dashboard-panel{background:var(--card-bg);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);padding:18px}
.panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.panel-title h3{font-size:.9rem;font-weight:800;margin:0}.panel-title a{font-size:.72rem;font-weight:700}
.user-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:18px 0}
.user-stat{background:var(--card-bg);border:1px solid var(--border);border-radius:15px;padding:16px;box-shadow:var(--shadow)}
.user-stat .icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#7c3aed,#2563eb);margin-bottom:10px}
.user-stat strong{font-size:1.05rem;display:block}.user-stat small{color:var(--text-muted);font-size:.7rem}
.admin-shell .sidebar{width:255px;background:linear-gradient(180deg,#11122b,#171632 60%,#101128);border-right:1px solid rgba(255,255,255,.05);padding:18px 14px}
.admin-brand{display:flex;align-items:center;gap:10px;color:#fff;padding:4px 8px 18px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:13px}
.admin-brand strong{display:block;font-size:.98rem}.admin-brand small{display:block;font-size:.57rem;color:#8f91b5;letter-spacing:.12em;font-weight:800}
.admin-brand-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:linear-gradient(135deg,#7c3aed,#2563eb)}
.admin-brand img{width:38px;height:38px;border-radius:11px;object-fit:cover}
.admin-user-card{display:flex;gap:9px;align-items:center;padding:10px;border-radius:12px;background:rgba(255,255,255,.045);margin-bottom:15px}.admin-user-card small{display:block;color:#8183a5;font-size:.6rem}.admin-user-card strong{display:block;color:#fff;font-size:.76rem}
.admin-shell .sidebar .nav-link{font-size:.78rem;padding:10px 11px;border-radius:10px}
.admin-shell .sidebar .nav-link.active{background:linear-gradient(135deg,#6d28d9,#4f46e5);box-shadow:0 8px 20px rgba(79,70,229,.25)}
.admin-shell .nav-section{font-size:.6rem;margin:15px 9px 6px;color:#696b91}
.nav-badge{margin-left:auto;background:#ef4444;color:#fff;font-size:.6rem;border-radius:999px;padding:3px 7px}
.admin-shell .logout-link{color:#fca5a5!important;margin-top:8px}
.admin-topbar{box-shadow:0 2px 14px rgba(40,34,90,.04)}
.admin-page-wrap{max-width:1500px;padding:24px 28px}
.pending-pill{display:flex;align-items:center;gap:6px;border:1px solid #fde68a;background:#fffbeb;color:#a16207;border-radius:999px;padding:8px 11px;font-size:.72rem;font-weight:800}
.admin-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:18px}
.admin-stat{position:relative;overflow:hidden;background:var(--card-bg);border:1px solid var(--border);border-radius:16px;padding:17px;box-shadow:var(--shadow)}
.admin-stat .top{display:flex;align-items:center;justify-content:space-between}.admin-stat .icon{width:39px;height:39px;border-radius:11px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#7c3aed,#4f46e5)}
.admin-stat .value{font-size:1.35rem;font-weight:900;margin-top:13px}.admin-stat small{font-size:.7rem;color:var(--text-muted)}
.admin-chart-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,1fr);gap:15px;margin-bottom:18px}
.admin-panel{background:var(--card-bg);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);padding:18px}
.admin-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.admin-panel-head h3{font-size:.9rem;font-weight:800;margin:0}.admin-panel-head small{font-size:.68rem;color:var(--text-muted)}
.admin-progress{height:8px;background:var(--bg);border-radius:99px;overflow:hidden}.admin-progress span{display:block;height:100%;background:linear-gradient(90deg,#7c3aed,#2563eb);border-radius:99px}
.quick-action{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid var(--border);border-radius:11px;color:var(--text);font-size:.75rem;font-weight:700;margin-bottom:8px}.quick-action:hover{border-color:#c4b5fd;background:#faf8ff}
@media(max-width:1200px){.user-main-nav a{padding:9px 7px;font-size:.74rem}.user-brand{min-width:170px}.service-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:992px){
  .user-main-nav{display:none}.user-nav{padding:10px 15px}.user-actions{margin-left:auto}.mobile-user-menu{display:block}
  .user-container{padding:18px 15px 30px}.page-heading{align-items:center}.feature-strip{grid-template-columns:repeat(2,1fr)}
  .service-grid{grid-template-columns:repeat(2,1fr)}.user-stat-grid{grid-template-columns:1fr 1fr}
  .hero-art{opacity:.35;right:-20px}.admin-chart-grid{grid-template-columns:1fr}.admin-stat-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:576px){
  .user-brand small{display:none}.balance-pill span{display:none}.balance-pill{padding:9px 11px}.user-profile{padding:7px}.user-hero{padding:25px 22px}.user-hero h2{font-size:1.45rem}.hero-art{display:none}
  .feature-strip{grid-template-columns:1fr}.feature-item{padding:12px}.service-grid{grid-template-columns:1fr 1fr;gap:10px}.tmx-service-thumb{height:105px}.tmx-service-body{padding:10px}.tmx-service-body h4{font-size:.76rem}.tmx-price{font-size:.78rem}
  .user-stat-grid{grid-template-columns:1fr}.admin-page-wrap{padding:18px 13px}.admin-stat-grid{grid-template-columns:1fr 1fr}.admin-stat .value{font-size:1rem}.admin-shell .topbar{padding:11px 13px}
}
