/* ====================================================
   U-GIC Mart — "Việt Dược" v3
   Emerald + Đỏ son + Vàng nghệ trên nền kem
==================================================== */
:root {
  /* ===== Brand palette ===== */
  --emerald:        #047857;
  --emerald-dark:   #065f46;
  --emerald-deep:   #064e3b;
  --emerald-soft:   #d1fae5;
  --emerald-glow:   rgba(4,120,87,.32);

  --red:            #c8102e;
  --red-dark:       #991b1b;
  --red-soft:       #fee2e2;
  --red-glow:       rgba(200,16,46,.28);

  --gold:           #d4a017;
  --gold-light:     #fbbf24;
  --gold-soft:      #fef3c7;
  --gold-deep:      #92400e;

  --orange:         #ea580c;
  --orange-soft:    #ffedd5;

  /* Neutrals (warm cream system) */
  --cream:          #fefdf8;
  --cream-warm:     #faf8f0;
  --beige:          #f5f1e8;
  --beige-deep:     #ebe6d6;
  --line:           #e7e1cf;
  --line-strong:    #d6cfb8;
  --text:           #0a2e2a;
  --text-soft:      #475569;
  --muted:          #8b8576;

  /* Effects */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 999px;

  --sh-xs: 0 1px 2px rgba(10,46,42,.04);
  --sh-sm: 0 2px 6px rgba(10,46,42,.06), 0 1px 2px rgba(10,46,42,.04);
  --sh-md: 0 6px 18px rgba(10,46,42,.08), 0 2px 6px rgba(10,46,42,.05);
  --sh-lg: 0 18px 44px rgba(10,46,42,.12), 0 6px 14px rgba(10,46,42,.06);
  --sh-xl: 0 28px 70px rgba(10,46,42,.16), 0 10px 24px rgba(10,46,42,.08);
  --sh-emerald: 0 10px 28px var(--emerald-glow);
  --sh-red:     0 10px 28px var(--red-glow);
  --sh-gold:    0 10px 28px rgba(212,160,23,.32);

  --grad-emerald: linear-gradient(135deg,#047857 0%,#10b981 60%,#34d399 100%);
  --grad-emerald-dark: linear-gradient(135deg,#064e3b 0%,#047857 60%,#10b981 100%);
  --grad-red:     linear-gradient(135deg,#c8102e 0%,#991b1b 100%);
  --grad-gold:    linear-gradient(135deg,#fbbf24 0%,#d4a017 50%,#92400e 100%);
  --grad-orange:  linear-gradient(135deg,#fb923c 0%,#ea580c 100%);

  /* Subtle paper texture (giấy dó) — tiny SVG */
  --tex-paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .42  0 0 0 0 .25  0 0 0 .045 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; }
img, video, iframe { max-width: 100%; height: auto; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; } /* chỉ html — không set trên body để tránh cản scroll ngang bên trong */
html { scroll-behavior: smooth; }
body {
  font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px; color: var(--text);
  background:
    var(--tex-paper),
    radial-gradient(900px 500px at -10% -10%, rgba(4,120,87,.07), transparent 60%),
    radial-gradient(800px 500px at 110% 0%,  rgba(200,16,46,.05), transparent 60%),
    var(--cream);
  background-attachment: fixed;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--emerald-dark); text-decoration: none; transition: color .15s; }
a:hover { color: var(--emerald); }
img { max-width: 100%; display: block; }
h1,h2,h3,h4,h5 { color: var(--text); margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.012em; font-weight: 700; }

/* ===== Phosphor icon defaults ===== */
.ph, .ph-duotone, .ph-fill, .ph-bold, .ph-light, .ph-thin {
  font-size: 1.05em; vertical-align: -2px; line-height: 1;
}

/* ===== Layout ===== */
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ===== Top thin banner ===== */
.top-banner {
  background: linear-gradient(90deg, var(--emerald-deep) 0%, var(--emerald-dark) 50%, var(--emerald-deep) 100%);
  color: #d1fae5; font-size: 12.5px; text-align: center;
  padding: 8px 16px; letter-spacing: .02em; font-weight: 500;
}
.top-banner .ph-duotone { color: var(--gold-light); margin-right: 4px; }

/* ===== Site header ===== */
.site-header {
  position: sticky; top: 0; z-index: 400;
  background: rgba(255,253,247,.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(10,46,42,.07);
  padding: 14px 0;
}
.site-header .container { display: flex; align-items: center; gap: 24px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-img-logo {
  height: 38px; width: auto; max-width: 200px;
  object-fit: contain; display: block;
}
@media (max-width: 860px) { .brand-img-logo { height: 34px; max-width: 180px; } }
@media (max-width: 420px)  { .brand-img-logo { height: 30px; max-width: 150px; } }
.brand-logo {
  background: var(--grad-emerald); color: #fff;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
  box-shadow: var(--sh-emerald);
  position: relative; overflow: hidden;
}
.brand-logo::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 55%);
}
.brand-logo .leaf-mark {
  position: absolute; right: -3px; bottom: -3px;
  width: 16px; height: 16px;
  background: var(--gold-light); border-radius: 50% 50% 50% 0;
  transform: rotate(45deg); box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.brand-name { line-height: 1; display: flex; flex-direction: column; gap: 3px; }
.brand-name small { font-size: 10.5px; font-weight: 600; color: var(--emerald); letter-spacing: .08em; text-transform: uppercase; }

.search-box { flex: 1; position: relative; max-width: 480px; }
.search-box input {
  width: 100%; padding: 12px 18px 12px 44px;
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  font-size: 14px; background: #fff; color: var(--text);
  font-family: inherit; transition: .2s;
}
.search-box input:focus {
  outline: none; border-color: var(--emerald); background: #fff;
  box-shadow: 0 0 0 4px rgba(4,120,87,.12);
}
.search-box .ph {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--muted); pointer-events: none;
}

/* ===== Header nav — unified 40px pill buttons ===== */
.header-nav { display: flex; gap: 4px; align-items: center; }

/* "Trang chủ" link — icon + text */
.header-nav > a:not(.btn-cta):not(.btn-ghost):not(.user-chip):not(.header-icon) {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  color: var(--text-soft); font-weight: 600; font-size: 14px;
  transition: .15s;
}
.header-nav > a:not(.btn-cta):not(.btn-ghost):not(.user-chip):not(.header-icon):hover {
  background: var(--emerald-soft); color: var(--emerald-dark);
}
.header-nav > a:not(.btn-cta):not(.btn-ghost):not(.user-chip):not(.header-icon) i { font-size: 18px; }

/* CTA Đăng ký (red gradient pill) */
.header-nav .btn-cta {
  background: var(--grad-red); color: #fff; font-weight: 700;
  height: 40px; padding: 0 18px; border-radius: var(--r-pill);
  box-shadow: var(--sh-red);
  display: inline-flex; align-items: center; gap: 6px;
}
.header-nav .btn-cta:hover { color:#fff; transform: translateY(-1px); box-shadow: 0 14px 32px var(--red-glow); }

/* Đăng nhập / Đăng xuất — outline pill */
.header-nav .btn-ghost {
  background: transparent; border: 1.5px solid var(--line);
  height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  font-weight: 600; color: var(--text-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.header-nav .btn-ghost:hover { border-color: var(--emerald); color: var(--emerald-dark); background: var(--emerald-soft); }

/* Tách nhóm user (chip + logout) khỏi icon nav bằng 1 vạch dọc nhẹ */
.header-nav .user-chip { margin-left: 6px; position: relative; }
.header-nav .user-chip::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
}

/* User chip — gọn, tích hợp TV pill */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px 0 5px; border-radius: var(--r-pill);
  background: var(--cream); border: 1.5px solid var(--line);
  font-weight: 600; font-size: 13.5px; color: var(--text);
  transition: .15s;
}
.user-chip:hover {
  background: var(--emerald-soft); border-color: rgba(16,134,82,.25);
  color: var(--emerald-dark);
}
.user-chip .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad-emerald); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  box-shadow: var(--sh-emerald); flex-shrink: 0;
}
.user-chip > span { display: inline-flex; align-items: center; gap: 6px; }

/* chip sub-elements */
.chip-av-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.chip-tv-dot {
  position: absolute; bottom: -2px; right: -4px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff; font-size: 8px; font-weight: 800; letter-spacing: .04em;
  padding: 1px 4px; border-radius: 6px; border: 1.5px solid #fff; line-height: 1.4;
}
.chip-label {
  font-size: 13.5px; font-weight: 600; color: var(--text);
}
.chip-chevron { font-size: 14px; color: var(--emerald-deep); opacity: .55; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--r-md); border: none; cursor: pointer;
  font-size: 14px; font-weight: 700; text-decoration: none;
  font-family: inherit; line-height: 1;
  transition: transform .15s, box-shadow .2s, background .15s, color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad-emerald); color: #fff; box-shadow: var(--sh-emerald); }
.btn-primary:hover { color:#fff; box-shadow: 0 14px 32px var(--emerald-glow); }
.btn-success { background: var(--grad-emerald); color: #fff; box-shadow: var(--sh-emerald); }
.btn-success:hover { color:#fff; box-shadow: 0 14px 32px var(--emerald-glow); }
.btn-shop { background: var(--grad-red); color:#fff; box-shadow: var(--sh-red); }
.btn-shop:hover { color:#fff; box-shadow: 0 14px 32px var(--red-glow); }
.btn-gold { background: var(--grad-gold); color: var(--text); box-shadow: var(--sh-gold); }
.btn-gold:hover { color: var(--text); }
.btn-danger { background: var(--red); color: #fff; box-shadow: var(--sh-red); }
.btn-danger:hover { background: var(--red-dark); color:#fff; }
.btn-outline { background: #fff; border: 1.5px solid var(--line-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--emerald); color: var(--emerald-dark); background: var(--emerald-soft); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 30px; font-size: 15px; }

/* ===== Cards ===== */
.card {
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: 26px;
  border: 1px solid var(--line);
  position: relative;
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 16px; font-weight: 700; margin: 0 0 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -.01em; color: var(--text);
}
.card-title::before {
  content:""; width:5px; height:20px; border-radius:3px;
  background: var(--grad-emerald);
}

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 7px;
  font-weight: 600; font-size: 13px; color: var(--text);
}
.form-label .req { color: var(--red); margin-left: 2px; font-weight: 800; }
.form-control {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  font-size: 14px; font-family: inherit; background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-control::placeholder { color: var(--muted); }
.form-control:hover:not(:focus):not([readonly]) { border-color: var(--line-strong); }
.form-control:focus {
  outline: none; border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(4,120,87,.15);
}
.form-control[readonly] { background: var(--beige); color: var(--text-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-help { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* ===== Alerts ===== */
.alert {
  padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 16px;
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid transparent; font-weight: 500;
}
.alert .ph-duotone,
.alert [class*="ph-fill"] { font-size: 20px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.alert > div { flex: 1; min-width: 0; line-height: 1.6; }
.alert-error   { background: var(--red-soft);    color: #7f1d1d; border-color: rgba(200,16,46,.22); }
.alert-error .ph-duotone { color: var(--red); }
.alert-success { background: var(--emerald-soft);  color: #064e3b; border-color: rgba(4,120,87,.25); }
.alert-success .ph-duotone { color: var(--emerald); }
.alert-info    { background: #e0f2fe; color: #075985; border-color: rgba(2,132,199,.25); }
.alert-info .ph-duotone { color: #0284c7; }
.alert-warning { background: var(--gold-soft); color: var(--gold-deep); border-color: rgba(212,160,23,.3); }
.alert-warning .ph-duotone { color: var(--gold); }

/* ===== Auth pages ===== */
.auth-page {
  min-height: calc(100vh - 80px);
  display: flex; align-items: center; justify-content: center;
  padding: 50px 16px; position: relative; overflow: hidden;
}
.auth-page::before {
  content:""; position:absolute; inset:0; z-index:-1;
  background:
    radial-gradient(circle at 15% 20%, rgba(4,120,87,.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(200,16,46,.14), transparent 45%),
    radial-gradient(circle at 80% 20%, rgba(212,160,23,.10), transparent 45%);
}
.auth-card {
  width: 100%; max-width: 480px;
  background: rgba(255,253,247,.96);
  backdrop-filter: blur(20px);
  border-radius: var(--r-2xl);
  padding: 42px 38px;
  box-shadow: var(--sh-xl);
  border: 1px solid rgba(255,255,255,.85);
}
.auth-card h1 {
  margin: 0 0 8px; font-size: 28px; text-align: center;
  background: var(--grad-emerald); -webkit-background-clip: text;
  background-clip: text; color: transparent; font-weight: 800;
  letter-spacing: -.02em;
}
.auth-card .sub { text-align: center; color: var(--text-soft); margin-bottom: 26px; font-size: 14px; }
.auth-tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--beige);
  border-radius: var(--r-md); margin-bottom: 26px;
}
.auth-tabs a {
  flex: 1; text-align: center; padding: 11px;
  color: var(--text-soft); font-weight: 700; border-radius: var(--r-sm);
  transition: .15s;
}
.auth-tabs a.active { color: var(--emerald-dark); background: #fff; box-shadow: var(--sh-sm); }

/* ===== Wizard ===== */
.wizard-steps { display: flex; justify-content: space-between; margin-bottom: 32px; position: relative; }
.wizard-steps::before {
  content: ""; position: absolute; top: 17px; left: 12%; right: 12%;
  height: 3px; background: var(--line); z-index: 0; border-radius: 2px;
}
.wizard-steps::after {
  content: ""; position: absolute; top: 17px; left: 12%;
  height: 3px; background: var(--grad-emerald); z-index: 0; border-radius: 2px;
  transition: width .3s; width: var(--progress, 0%);
}
.wstep { flex: 1; text-align: center; position: relative; z-index: 1; }
.wstep .num {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--line); color: var(--muted);
  display: grid; place-items: center; margin: 0 auto 8px;
  font-weight: 800; font-size: 14px; transition: .25s;
}
.wstep.done .num { background: var(--emerald); color: #fff; border-color: var(--emerald); font-size: 0; }
.wstep.done .num::after { content:"✓"; font-size: 16px; font-weight: 800; }
.wstep.active .num {
  background: #fff; color: var(--emerald-dark); border-color: var(--emerald);
  box-shadow: 0 0 0 6px rgba(4,120,87,.18);
}
.wstep .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wstep.active .lbl, .wstep.done .lbl { color: var(--text); }

/* ===== Hero (home) ===== */
.hero {
  position: relative; overflow-x: clip;
  background: var(--grad-emerald-dark);
  color: #fff; padding: 90px 16px 100px; text-align: center;
  margin-bottom: 8px;
}
.hero::before {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(circle at 18% 25%, rgba(255,255,255,.14), transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(200,16,46,.4), transparent 40%),
    radial-gradient(circle at 92% 18%, rgba(212,160,23,.3), transparent 40%);
  pointer-events: none;
}
/* subtle leaf pattern */
.hero .leaves {
  position:absolute; inset:0; pointer-events:none; opacity:.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><path d='M50 8c-12 8-22 22-22 36 0 16 10 28 22 36 12-8 22-20 22-36C72 30 62 16 50 8z' fill='white'/></svg>");
  background-size: 80px 80px;
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700;
  margin-bottom: 18px; letter-spacing: .04em; text-transform: uppercase;
}
.hero .eyebrow .ph-duotone { color: var(--gold-light); font-size: 16px; }
.hero h1 {
  font-size: 46px; margin: 0 0 16px; color: #fff;
  font-weight: 800; letter-spacing: -.03em; line-height: 1.12;
}
@media (max-width: 640px) { .hero h1 { font-size: 32px; } }
.hero h1 .accent { color: var(--gold-light); }
.hero p { font-size: 17px; opacity: .94; margin: 0 auto 30px; max-width: 640px; }
.hero .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btn { padding: 14px 30px; font-weight: 700; font-size: 15px; }
.hero .btn-shop { background: var(--grad-red); }
.hero .btn-light {
  background: rgba(255,255,255,.96); color: var(--emerald-dark);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.hero .btn-light:hover { color: var(--emerald-dark); }

/* ===== Features bar ===== */
.features-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: -42px auto 30px; position: relative; z-index: 2;
  max-width: 1200px; padding: 0 20px;
}
@media (max-width: 880px) { .features-bar { grid-template-columns: repeat(2,1fr); } }
.feat {
  background: #fff; border-radius: var(--r-lg);
  padding: 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--sh-md); border: 1px solid var(--line); transition: .2s;
}
.feat:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.feat .ico {
  width: 48px; height: 48px; border-radius: var(--r-md);
  display: grid; place-items: center; font-size: 24px; flex-shrink: 0;
}
.feat .ico.g1 { background: var(--emerald-soft); color: var(--emerald-dark); }
.feat .ico.g2 { background: var(--red-soft);     color: var(--red); }
.feat .ico.g3 { background: var(--gold-soft);    color: var(--gold-deep); }
.feat .ico.g4 { background: var(--orange-soft);  color: var(--orange); }
.feat .t  { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--text); }
.feat .s  { font-size: 12px; color: var(--text-soft); margin-top: 3px; }

/* ===== Section title ===== */
.section-title {
  font-size: 24px; margin: 36px 0 20px; color: var(--text);
  font-weight: 800; letter-spacing: -.015em;
  display: flex; align-items: center; gap: 12px;
}
.section-title::before {
  content:""; display:inline-block; width:6px; height: 26px;
  background: var(--grad-emerald); border-radius: 4px;
}

/* ===== Products grid ===== */
.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.products-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) {
  .products-grid,
  .products-grid.grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .products-grid,
  .products-grid.grid-3 { grid-template-columns: 1fr; }
}

/* ===== Section sub-title ===== */
.section-sub { color: var(--text-soft); margin: -8px 0 18px; font-size: 14px; }

/* ===== Featured row: 1 thẻ TV + 1 banner ===== */
.featured-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  gap: 20px;
  margin-bottom: 12px;
}
@media (max-width: 900px) { .featured-grid { grid-template-columns: 1fr; } }
.featured-card-wrap { display: flex; }
.featured-card-wrap > .product-card { width: 100%; }

/* ===== Hero banner U-GIC MART (CSS only) ===== */
.hero-banner {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  background:
    radial-gradient(circle at 80% 20%, rgba(4,120,87,.10), transparent 55%),
    radial-gradient(circle at 15% 85%, rgba(4,120,87,.08), transparent 50%),
    linear-gradient(135deg, #f5f7f3 0%, #eaf4ec 100%);
  border: 1.5px solid var(--line);
  min-height: 320px;
  transition: transform .25s, box-shadow .25s;
}
.hero-banner:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(4,120,87,.18); }
.hero-banner::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(4,120,87,.04) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(4,120,87,.04) 0 1px, transparent 1px 24px);
  opacity: .55;
  pointer-events: none;
}
.hero-banner__inner {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 36px 24px;
  text-align: center;
}
.hero-banner__brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 22px; color: var(--emerald-deep);
  margin-bottom: 18px;
}
.hero-banner__brand i { font-size: 26px; color: var(--emerald); }
.hero-banner__brand small {
  display: block; font-size: 10.5px; font-weight: 600; color: var(--text-soft);
  letter-spacing: .5px; margin-left: 6px; line-height: 1;
}
.hero-banner__title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 900;
  line-height: 1; margin-bottom: 14px;
  letter-spacing: -1px;
}
.hero-banner__title .u    { color: #2c5fb5; }
.hero-banner__title .dash { color: var(--text); margin: 0 4px; }
.hero-banner__title .g    { color: var(--emerald); }
.hero-banner__tagline {
  font-family: 'Be Vietnam Pro', serif;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  color: var(--gold-deep);
  letter-spacing: 1px;
  font-style: italic;
}
.hero-banner__deco {
  position: absolute; left: 8%; right: 8%; bottom: 28px;
  height: 2px; background: linear-gradient(90deg, transparent, var(--emerald), transparent);
  opacity: .6;
}

.product-card {
  background: #fff; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-sm); transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--line); color: var(--text);
  display: block; position: relative;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); color: var(--text); }
.product-card .img {
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, var(--cream-warm) 0%, var(--beige) 100%);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  display: grid; place-items: center; color: var(--line-strong); font-size: 60px;
  position: relative; overflow: hidden;
}
.product-card .img::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 65%, rgba(0,0,0,.05));
}
.product-card .body { padding: 16px; }
.product-card .name {
  font-weight: 600; font-size: 14px; min-height: 42px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4;
}
.product-card .price { color: var(--red); font-weight: 800; font-size: 17px; margin-top: 8px; }
.product-card .price .vat { color: var(--muted); font-size: 11.5px; font-weight: 500; margin-left: 4px; }
.product-card .ribbon {
  position:absolute; top:12px; left:12px;
  background: var(--grad-red); color:#fff;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  box-shadow: var(--sh-sm); display: inline-flex; align-items: center; gap: 4px;
}

/* ===== Product detail ===== */
.product-detail { display: grid; grid-template-columns: minmax(0, 1fr) 1.1fr; gap: 32px; margin-top: 24px; }
@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail .img-box { background: #fff; border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-md); border: 1px solid var(--line); }
.product-detail .img-box .img { aspect-ratio: 1/1; background: linear-gradient(135deg, var(--cream-warm), var(--beige)) center/cover no-repeat; border-radius: var(--r-md); }
.product-detail .info { background: #fff; border-radius: var(--r-lg); padding: 30px; box-shadow: var(--sh-md); border: 1px solid var(--line); }
.product-detail h1 { font-size: 24px; margin: 0 0 10px; color: var(--text); font-weight: 800; }
.product-detail .price-big { color: var(--red); font-size: 34px; font-weight: 800; margin: 12px 0; letter-spacing: -.02em; }
.product-detail .vat-note { color: var(--muted); font-size: 13px; }
.product-detail .meta { padding: 16px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); margin: 18px 0; font-size: 14px; }
.product-detail .meta div { padding: 5px 0; color: var(--text-soft); }
.product-detail .meta b { color: var(--text); }
.qty-box { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.qty-box button { background: var(--beige); border: none; width: 40px; height: 42px; cursor: pointer; font-size: 16px; font-weight: 800; color: var(--text-soft); transition: .15s; }
.qty-box button:hover { background: var(--emerald-soft); color: var(--emerald-dark); }
.qty-box input { border: none; width: 60px; height: 42px; text-align: center; font-size: 14px; font-weight: 700; }
.product-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ===== Account header (emerald deep) ===== */
.account-header {
  position: relative; overflow: hidden;
  background: var(--grad-emerald-dark);
  color: #fff; padding: 40px 0 84px;
  margin-bottom: -56px;
}
.account-header::before {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.14), transparent 40%),
    radial-gradient(circle at 88% 88%, rgba(212,160,23,.22), transparent 40%),
    radial-gradient(circle at 60% 50%, rgba(200,16,46,.18), transparent 50%);
  pointer-events:none;
}
.account-header::after {
  content:""; position:absolute; inset:0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><circle cx='40' cy='40' r='1' fill='rgba(255,255,255,.16)'/></svg>");
  background-size: 26px 26px; opacity: .6; pointer-events: none;
}
.account-header .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
@media (max-width: 760px) { .account-header .container { grid-template-columns: 1fr; } }

.acc-user-info { display: flex; gap: 18px; align-items: center; }
.acc-avatar {
  position: relative;
  width: 76px; height: 76px; min-width: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: 3px solid var(--gold-light);
  display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0 3px rgba(4,120,87,.4), 0 8px 22px rgba(0,0,0,.18);
  flex-shrink: 0; aspect-ratio: 1/1;
}
.acc-avatar::after {
  content:""; position:absolute; right:2px; bottom:2px;
  width:14px; height:14px; border-radius:50%;
  background: var(--emerald); border: 2.5px solid #fff;
}
.acc-name { font-size: 22px; font-weight: 800; letter-spacing: -.015em; }
.acc-rank { font-size: 13px; opacity: .94; margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-rank-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--grad-gold); padding: 4px 12px;
  border-radius: var(--r-pill); font-weight: 700; font-size: 12px;
  color: var(--text); box-shadow: 0 4px 12px rgba(212,160,23,.4);
}
.acc-rank-badge .ph-fill { color: var(--text); }

.acc-qr {
  background: #fff; border-radius: var(--r-lg); padding: 14px;
  display: flex; gap: 14px; align-items: center; color: var(--text);
  box-shadow: var(--sh-lg); border: 2px solid var(--gold-light);
}
.acc-qr img { width: 78px; height: 78px; border-radius: 8px; }
.acc-qr-info { font-size: 12.5px; }
.acc-qr-info > div:first-child { color: var(--muted); margin-bottom: 2px; }
.acc-qr-code { font-size: 17px; font-weight: 800; color: var(--emerald-dark); letter-spacing: .02em; margin: 2px 0 6px; }
.copy-btn {
  background: var(--grad-red); color: #fff; border: none;
  padding: 6px 14px; font-size: 12px; font-weight: 700;
  border-radius: var(--r-sm); cursor: pointer; transition: .15s;
  box-shadow: var(--sh-sm); display: inline-flex; align-items: center; gap: 5px;
}
.copy-btn:hover { transform: translateY(-1px); box-shadow: var(--sh-md); }

/* ===== Account layout ===== */
.account-layout {
  display: grid; grid-template-columns: 264px 1fr; gap: 24px;
  padding: 24px 0 50px; position: relative;
}
@media (max-width: 880px) { .account-layout { grid-template-columns: 1fr; } }

.account-sidebar {
  background: #fff; border-radius: var(--r-lg); padding: 18px 14px;
  height: fit-content; box-shadow: var(--sh-md);
  border: 1px solid var(--line);
  position: sticky; top: 88px;
}
.account-sidebar h4 {
  margin: 14px 12px 8px; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
}
.account-sidebar h4:first-child { margin-top: 4px; }
.account-sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-md);
  color: var(--text-soft); font-size: 14px; font-weight: 600;
  margin: 2px 0; position: relative; transition: .15s;
}
.account-sidebar a:hover { background: var(--beige); color: var(--text); }
.account-sidebar a.active {
  background: var(--grad-emerald); color: #fff;
  box-shadow: var(--sh-emerald);
}
.account-sidebar a.active::before {
  content:""; position:absolute; left:-14px; top:8px; bottom:8px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--gold-light);
}
.account-sidebar a .ph-duotone, .account-sidebar a .ph {
  font-size: 19px; width: 22px; text-align: center;
}
.account-content { min-height: 400px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 13px 14px;
  background: var(--cream-warm); font-weight: 700;
  color: var(--text-soft); font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.table tr:hover td { background: var(--cream-warm); }
.table tr:last-child td { border-bottom: none; }

/* Table → card layout trên mobile (stacked: nhãn nhỏ trên / giá trị dưới) */
@media (max-width: 640px) {
  .table { display: block; }
  .table thead { display: none; }
  .table tbody, .table tbody tr, .table tbody td { display: block; }

  .table tbody tr {
    margin-bottom: 12px;
    border: 1px solid var(--line); border-radius: 12px;
    overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05);
    background: #fff;
  }
  .table tbody tr:hover td { background: none; }

  .table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--beige);
    font-size: 13.5px;
  }
  .table tbody td:last-child { border-bottom: none; }

  /* Nhãn nhỏ hiện phía trên giá trị — không dùng flex space-between để tránh overflow */
  .table tbody td::before {
    display: block;
    content: attr(data-label);
    font-size: 10px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 2px;
  }

  /* Ô đầu tiên (mã đơn): header card nền kem, không cần nhãn */
  .table tbody td:first-child {
    padding: 10px 14px;
    background: var(--cream-warm); font-weight: 700; font-size: 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .table tbody td:first-child::before { display: none; }
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; line-height: 1.4;
  border: 1px solid transparent;
}
.badge::before {
  content:""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .85;
}
.badge-warning   { background: var(--gold-soft);    color: var(--gold-deep); border-color: rgba(212,160,23,.3); }
.badge-info      { background: #e0f2fe;             color: #075985; border-color: rgba(2,132,199,.25); }
.badge-success   { background: var(--emerald-soft); color: var(--emerald-deep); border-color: rgba(4,120,87,.25); }
.badge-danger    { background: var(--red-soft);     color: #7f1d1d; border-color: rgba(200,16,46,.25); }
.badge-secondary { background: var(--beige);        color: var(--text-soft); border-color: var(--line); }

/* ===== Wallet ===== */
.wallet-tabs {
  display: flex; gap: 4px; background: #fff; padding: 6px;
  border-radius: var(--r-md); margin-bottom: 20px;
  box-shadow: var(--sh-sm); border: 1px solid var(--line);
}
.wallet-tabs a {
  flex: 1; text-align: center; padding: 12px;
  border-radius: var(--r-sm); color: var(--text-soft);
  font-weight: 700; transition: .15s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.wallet-tabs a:hover { color: var(--text); }
.wallet-tabs a.active { background: var(--grad-emerald); color: #fff; box-shadow: var(--sh-emerald); }
.wallet-tabs a.active.tax { background: var(--grad-orange); box-shadow: 0 8px 22px rgba(234,88,12,.3); }

.wallet-balance {
  position: relative; overflow: hidden;
  background: var(--grad-emerald); color: #fff;
  padding: 30px; border-radius: var(--r-lg); margin-bottom: 20px;
  box-shadow: var(--sh-emerald);
}
.wallet-balance::before {
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(circle at 90% 12%, rgba(255,255,255,.22), transparent 40%),
    radial-gradient(circle at 8% 90%, rgba(0,0,0,.18), transparent 40%);
}
.wallet-balance .deco {
  position:absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 92px; opacity: .12; line-height: 1;
}
.wallet-balance > * { position: relative; z-index: 1; }
.wallet-balance .label { opacity: .92; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.wallet-balance .amount { font-size: 38px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.wallet-balance.tax { background: var(--grad-orange); box-shadow: 0 12px 28px rgba(234,88,12,.32); }

/* ===== Order tabs ===== */
.order-list { display: flex; flex-direction: column; }
.order-item {
  display: block; padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: background .15s;
}
.order-item:last-child { border-bottom: none; }
.order-item:hover { background: var(--beige); margin: 0 -26px; padding: 14px 26px; }
.order-item-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.order-item-row + .order-item-row { margin-top: 6px; }
.order-item-code { font-weight: 700; color: var(--primary); font-size: 14px; }
.order-item-meta { color: var(--text-soft); font-size: 12.5px; }
.order-item-chevron { color: var(--text-3); font-size: 16px; flex-shrink: 0; }

.order-tabs {
  display: flex; gap: 0; background: #fff;
  border-radius: var(--r-md); overflow: hidden; margin-bottom: 20px;
  box-shadow: var(--sh-sm); border: 1px solid var(--line);
}
.order-tabs a {
  flex: 1; text-align: center; padding: 14px 12px;
  color: var(--text-soft); font-weight: 600; font-size: 13.5px;
  border-bottom: 3px solid transparent; transition: .15s;
}
.order-tabs a:hover { color: var(--text); background: var(--beige); }
.order-tabs a.active {
  color: var(--emerald-dark); border-bottom-color: var(--emerald);
  background: linear-gradient(180deg, transparent, rgba(4,120,87,.06));
}

/* ===== Stat cards ===== */
.network-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 760px) { .network-stats { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  position: relative; overflow: hidden;
  background: #fff; border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--sh-md); border: 1px solid var(--line); transition: .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.stat-card::before {
  content:""; position:absolute; right:-14px; top:-14px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--emerald-soft); opacity: .6;
}
.stat-card .stat-ico {
  position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--grad-emerald); color: #fff;
  display: grid; place-items: center; font-size: 22px;
  margin-bottom: 14px; box-shadow: var(--sh-emerald);
}
.stat-card .num {
  font-size: 26px; font-weight: 800; color: var(--text);
  letter-spacing: -.02em; line-height: 1.1; position: relative; z-index: 1;
}
.stat-card .lbl { font-size: 12.5px; color: var(--text-soft); margin-top: 5px; font-weight: 600; position: relative; z-index: 1; }
.stat-card .delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--emerald-dark); font-weight: 700; margin-top: 4px; }

/* Color variants */
.stat-card.red::before    { background: var(--red-soft); }
.stat-card.red .stat-ico  { background: var(--grad-red); box-shadow: var(--sh-red); }
.stat-card.gold::before   { background: var(--gold-soft); }
.stat-card.gold .stat-ico { background: var(--grad-gold); box-shadow: var(--sh-gold); color: var(--text); }
.stat-card.tax::before    { background: var(--orange-soft); }
.stat-card.tax .stat-ico  { background: var(--grad-orange); box-shadow: 0 8px 22px rgba(234,88,12,.32); }

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(180deg,#0a2e2a 0%, var(--emerald-deep) 100%);
  color: #cbd5cf; padding: 54px 0 24px; margin-top: 60px; font-size: 13.5px;
  position: relative;
}
.site-footer::before {
  content:""; position:absolute; top:0; left:0; right:0; height:4px;
  background: linear-gradient(90deg, var(--emerald) 0%, var(--gold) 50%, var(--red) 100%);
}
.site-footer .grid { display: grid; grid-template-columns: 1.6fr 1.7fr 1fr 1fr; gap: 32px; margin-bottom: 30px; }
@media (max-width: 760px) { .site-footer .grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 14px; margin: 0 0 14px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.site-footer p { margin: 7px 0; color: #94a39e; line-height: 1.7; }
/* Icon trái + text wrap thẳng hàng (hanging indent), không xuống dòng dưới icon */
.site-footer p > i.ph-duotone,
.site-footer p > i.ph-fill,
.site-footer p > i.ph {
  display: inline-block; width: 18px; margin-right: 6px;
  text-align: center; color: var(--gold-light); flex-shrink: 0;
}
.site-footer .commit p {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 8px 0; font-size: 13.5px; line-height: 1.55;
}
.site-footer .commit p > i { margin: 2px 0 0; width: 16px; }
.site-footer a { color: #cbd5cf; }
.site-footer a:hover { color: var(--gold-light); }
.site-footer .copy { text-align: center; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.08); color: #6e857e; font-size: 12.5px; }

/* ===== Misc helpers ===== */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.text-red { color: var(--red); }
.text-green, .text-emerald { color: var(--emerald-dark); }
.text-gold { color: var(--gold-deep); }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .ico {
  font-size: 56px; margin-bottom: 16px;
  display:inline-grid; place-items:center;
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--beige); color: var(--muted);
}

.divider { height:1px; background: var(--line); margin: 18px 0; }

@keyframes fadeUp { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
.account-content > *, .auth-card { animation: fadeUp .35s ease both; }

/* ===== PHASE 2 ADDITIONS ===== */

/* --- Header icons (cart/bell) + TV pill --- */
.nav-label { display: none; } /* ẩn trên desktop, hiện trong drawer (mobile CSS bật) */
/* Desktop: wrap trong suốt — không ảnh hưởng layout, badge vẫn định vị theo .header-icon */
.nav-icon-wrap { display: contents; }

.header-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--emerald-deep); transition: .18s;
  background: transparent;
}
.header-icon i { font-size: 21px; }
.header-icon:hover { background: var(--emerald-soft); color: var(--emerald-dark); }
.badge-dot {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 800; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(200,16,46,.25);
}
.badge-dot.red { background: var(--red); }

.tv-pill {
  display: inline-flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff; padding: 2px 7px; border-radius: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(212,160,23,.3);
}
.tv-pill i { font-size: 10px; }

/* --- Account header TV badge + warning --- */
.acc-tv-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(212,160,23,.35);
}

/* --- Cart badge bump + button loading (cart-ajax.js) --- */
.js-cart-count[hidden] { display: none !important; }
@keyframes cart-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.45); }
  70%  { transform: scale(.92); }
  100% { transform: scale(1); }
}
.js-cart-count.bump { animation: cart-bump .42s cubic-bezier(.22,1.4,.36,1) both; }

button.is-loading { opacity: .7; cursor: wait; position: relative; }
button.is-loading::after {
  content: ''; display: inline-block; width: 12px; height: 12px;
  margin-left: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* SweetAlert toast tinh chỉnh nhẹ */
.swal-cart-toast { font-family: inherit !important; border-left: 4px solid var(--emerald) !important; }

/* ===========================================
 * Price block — 2 cột "Giá thường | Giá TV"
 * Dùng trên product card (.price-block) và
 * trên trang chi tiết (.price-detail) — chung style.
 * =========================================== */

/* --- Single price (sp không có giá member, vd thẻ TV) --- */
.price-block.single { margin: 8px 0 4px; }
.price-block.single .amt { font-size: 22px; font-weight: 800; color: var(--red); }

/* --- Two-col layout (card) --- */
.price-block.two-col {
  margin: 8px 0 4px;
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1.5px solid rgba(0,0,0,.06);
  border-radius: 10px; overflow: hidden;
  background: #fff;
}
.price-block.two-col .col { padding: 8px 10px; }
.price-block.two-col .col-retail {
  background: #FAF7EF;
  border-right: 1px dashed rgba(0,0,0,.08);
}
.price-block.two-col .col-tv {
  background: linear-gradient(135deg, rgba(16,134,82,.07), rgba(212,160,23,.06));
}
.price-block.two-col .lbl {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .3px;
  display: flex; align-items: center; gap: 4px; margin-bottom: 4px;
}
.price-block.two-col .col-tv .lbl { color: var(--emerald-deep); }
.price-block.two-col .col-tv .lbl i { color: var(--emerald); font-size: 13px; }
.price-block.two-col .col-retail .amt { font-size: 14px; font-weight: 600; color: var(--muted); }
.price-block.two-col .col-retail .amt s { color: var(--muted); }
.price-block.two-col .amt-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price-block.two-col .col-tv .amt { font-size: 19px; font-weight: 800; color: var(--red); letter-spacing: -.3px; }
.price-block.two-col .save-badge {
  font-size: 10.5px; font-weight: 800; color: #fff; background: var(--red);
  padding: 2px 6px; border-radius: 4px; letter-spacing: .3px;
}

/* --- Two-col layout (product detail — bigger) --- */
.price-detail.two-col {
  margin: 14px 0 8px;
  display: grid; grid-template-columns: 1fr 1.2fr;
  border: 1.5px solid rgba(0,0,0,.08);
  border-radius: 14px; overflow: hidden;
  background: #fff;
}
.price-detail.two-col .col { padding: 14px 18px; }
.price-detail.two-col .col-retail {
  background: #FAF7EF;
  border-right: 1px dashed rgba(0,0,0,.1);
}
.price-detail.two-col .col-tv {
  background: linear-gradient(135deg, rgba(16,134,82,.08), rgba(212,160,23,.07));
  position: relative;
}
.price-detail.two-col .lbl {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px;
  display: flex; align-items: center; gap: 5px; margin-bottom: 6px;
}
.price-detail.two-col .col-tv .lbl { color: var(--emerald-deep); }
.price-detail.two-col .col-tv .lbl i { color: var(--emerald); font-size: 16px; }
.price-detail.two-col .col-retail .amt {
  font-size: 20px; font-weight: 600; color: var(--muted);
}
.price-detail.two-col .col-retail .amt s { color: var(--muted); }
.price-detail.two-col .amt-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-detail.two-col .col-tv .amt {
  font-size: 30px; font-weight: 800; color: var(--red); letter-spacing: -.5px;
}
.price-detail.two-col .save-badge {
  font-size: 12px; font-weight: 800; color: #fff; background: var(--red);
  padding: 3px 8px; border-radius: 5px; letter-spacing: .3px;
}
.price-detail.two-col .sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.price-detail.two-col .col-tv .sub b { color: var(--emerald-deep); font-weight: 700; }

/* Note line dưới block 2 cột ở trang chi tiết */
.price-note {
  margin: 8px 0 4px; padding: 8px 12px;
  border-radius: 10px; font-size: 13px; line-height: 1.5;
  display: flex; align-items: center; gap: 8px;
}
.price-note i { font-size: 18px; flex-shrink: 0; }
.price-note.ok { background: rgba(16,134,82,.08); color: var(--emerald-deep); border-left: 3px solid var(--emerald); }
.price-note.ok i { color: var(--emerald); }
.price-note.warn { background: var(--gold-soft); color: var(--text); border-left: 3px solid var(--gold-deep); }
.price-note.warn i { color: var(--gold-deep); }
.price-note a { color: var(--emerald-deep); font-weight: 700; }
.price-note a:hover { text-decoration: underline; }

/* Product card buttons row */
.product-card { position: relative; }
.product-card .img-link { display: block; }
.product-card-actions { display: flex; gap: 8px; margin-top: 14px; }
.product-card-actions .btn {
  padding: 12px 8px; font-size: 13px; font-weight: 700;
  min-height: 44px; line-height: 1.2; letter-spacing: .2px;
  border-radius: 10px;
}
.product-card-actions .btn i { font-size: 16px; }
.btn-buy { background: linear-gradient(135deg, var(--red), #a30c25); color: #fff; box-shadow: 0 6px 16px rgba(200,16,46,.3); }
.btn-buy:hover { color: #fff; box-shadow: 0 10px 22px rgba(200,16,46,.42); transform: translateY(-1px); }
.product-card-actions .btn:active { transform: translateY(0); }
.btn-block { display: inline-flex; align-items: center; justify-content: center; width: 100%; gap: 6px; }

@media (max-width: 480px) {
  .product-card-actions { gap: 6px; }
  .product-card-actions .btn { padding: 11px 6px; font-size: 12px; min-height: 42px; }
  .product-card-actions .btn i { font-size: 15px; }
}

/* ===========================================
 * Password input — eye toggle wrap
 * =========================================== */
.pw-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.pw-wrap .pw-input {
  width: 100%;
  padding-right: 44px !important;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0;
  transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--emerald-deep); background: rgba(16,134,82,.08); }
.pw-toggle:active { background: rgba(16,134,82,.14); }
.pw-toggle i { font-size: 20px; line-height: 1; }
.pw-toggle:focus-visible { outline: 2px solid var(--emerald); outline-offset: 1px; }

/* ===========================================
 * Rich text editor (Quill) tinh chỉnh nhẹ
 * =========================================== */
.rich-editor {
  min-height: 240px;
  background: #fff;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.ql-toolbar.ql-snow {
  border-color: #e2e2dc;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background: #fafaf6;
}
.ql-container.ql-snow { border-color: #e2e2dc; font-family: inherit; font-size: 14px; }
.ql-editor { min-height: 220px; line-height: 1.6; }
.ql-editor.ql-blank::before { font-style: normal; color: #94a3b8; }
.ql-snow .ql-picker, .ql-snow .ql-stroke { color: var(--text); }
.ql-snow .ql-stroke { stroke: var(--text); }
.ql-snow.ql-toolbar button:hover, .ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-toolbar button.ql-active {
  color: var(--emerald-deep);
}
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--emerald-deep); }

/* ===== Image uploader (admin product form) ===== */
.image-uploader {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: start;
}
.iu-preview {
  width: 180px; height: 180px;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--cream-warm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.iu-preview img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.iu-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}
.iu-empty i { font-size: 42px; color: var(--line-strong); }
.iu-controls {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.iu-pick {
  align-self: flex-start;
  cursor: pointer;
}
.iu-pick:hover { border-color: var(--emerald); color: var(--emerald-dark); background: var(--emerald-soft); }
.iu-remove {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text-soft);
  cursor: pointer; user-select: none;
}
.iu-remove input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--red);
}
.iu-remove span i { color: var(--red); }
.iu-filename {
  font-size: 12.5px; color: var(--emerald-dark);
  word-break: break-all;
}
@media (max-width: 640px) {
  .image-uploader { grid-template-columns: 1fr; }
  .iu-preview { width: 100%; max-width: 280px; height: auto; aspect-ratio: 1/1; margin: 0 auto; }
}

/* ===================================================
 * RESPONSIVE — Mobile-first refinements
 * Breakpoints:
 *   ≤ 1024px : tablet
 *   ≤  860px : mobile (hamburger frontend)
 *   ≤  640px : phone (single column nhiều khu vực)
 *   ≤  420px : phone nhỏ
 * =================================================== */

/* ---------- Hamburger button (chung 2 layout) ---------- */
.nav-toggle, .admin-nav-toggle {
  display: none;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border: 1.5px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; padding: 0;
  color: var(--emerald-deep); position: relative;
  transition: border-color .15s, background .15s;
}
.nav-toggle:hover, .admin-nav-toggle:hover { border-color: var(--emerald); background: var(--emerald-soft); }
.nav-toggle i, .admin-nav-toggle i { font-size: 22px; line-height: 1; position: absolute; transition: opacity .15s, transform .2s; }
.nav-toggle .ico-close, .admin-nav-toggle .ico-close { opacity: 0; transform: rotate(-45deg); }
body.nav-open .nav-toggle .ico-open,
body.admin-nav-open .admin-nav-toggle .ico-open { opacity: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle .ico-close,
body.admin-nav-open .admin-nav-toggle .ico-close { opacity: 1; transform: rotate(0); }

.admin-nav-toggle { color: var(--text); }

/* ---------- TABLET ≤ 1024px ---------- */
@media (max-width: 1024px) {
  .container { padding: 0 16px; }
  .site-header .container { gap: 14px; }
  .header-nav { gap: 4px; }
  .header-nav a { padding: 8px 10px; font-size: 13.5px; }
  .featured-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .product-detail .info { padding: 22px; }
  .wallet-balance { padding: 22px; }
  .wallet-balance .amount { font-size: 32px; }
}

/* ===== Header Quick Icons (cart + notif luôn hiện trên mobile) ===== */
.header-quick-icons {
  display: none; /* ẩn trên desktop — nav đã có */
  align-items: center; gap: 2px; flex-shrink: 0;
}
.hqi-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px; color: var(--text);
  transition: background .15s;
}
.hqi-btn:hover { background: var(--emerald-soft); color: var(--emerald-dark); }
.hqi-btn i { font-size: 22px; }
.hqi-badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 17px; height: 17px;
  background: var(--emerald); color: #fff;
  border-radius: 99px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  border: 1.5px solid #fff; padding: 0 3px; line-height: 1;
}
.hqi-badge.red { background: var(--red); }
.hqi-badge[hidden] { display: none; }

@media (max-width: 860px) {
  .header-quick-icons { display: flex; }
}

/* ===== Account Bottom Tab Bar (default ẩn — media query phía dưới bật) ===== */
.acct-bottom-tabs {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 62px;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0,0,0,.09);
  z-index: 190;
  align-items: stretch;
}
.abt-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; text-decoration: none;
  color: var(--text-soft);
  font-size: 10px; font-weight: 600;
  transition: color .15s;
  position: relative;
  padding: 6px 4px 4px;
}
.abt-item i { font-size: 22px; line-height: 1; }
.abt-item.active { color: var(--emerald-dark); }
.abt-item.active i { color: var(--emerald); }
.abt-item.active::after {
  content: ""; position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2.5px; border-radius: 0 0 4px 4px;
  background: var(--emerald);
}
.abt-badge {
  position: absolute; top: 5px;
  right: calc(50% - 18px);
  min-width: 16px; height: 16px;
  background: var(--red); color: #fff;
  border-radius: 99px; font-size: 10px;
  font-weight: 700; display: grid; place-items: center;
  border: 1.5px solid #fff; padding: 0 3px; line-height: 1;
}
/* reset button dùng làm tab */
button.abt-item {
  background: none; border: none; cursor: pointer;
  font-family: inherit;
}

/* ===== Account Bottom Sheet ===== */
.acct-sheet-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 310;
  background: rgba(0,0,0,.45);
  opacity: 0; transition: opacity .25s;
}
.acct-sheet-backdrop.is-open { display: block; opacity: 1; }

.acct-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 320;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  max-height: 82dvh; display: flex; flex-direction: column;
}
.acct-sheet.is-open { transform: translateY(0); }

.acct-sheet-bar {
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--line); margin: 12px auto 4px; flex-shrink: 0;
}
.acct-sheet-body {
  overflow-y: auto; padding: 4px 0 max(16px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px;
}
.acct-sheet-group { padding: 4px 0; }
.acct-sheet-label {
  display: block; padding: 6px 20px 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
}
.acct-sheet-group a {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 20px; color: var(--text-soft);
  font-size: 14.5px; font-weight: 600; text-decoration: none;
  transition: background .15s, color .15s;
}
.acct-sheet-group a i { font-size: 20px; color: var(--emerald-deep); flex-shrink: 0; }
.acct-sheet-group a:hover { background: var(--beige); color: var(--text); }
.acct-sheet-group a .pill {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; padding: 1px 7px; border-radius: 99px;
}
.acct-sheet-logout { color: var(--red) !important; }
.acct-sheet-logout i { color: var(--red) !important; }

/* ===== Backdrop frontend nav (luôn có, ẩn mặc định) ===== */
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(2,32,26,.52);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
  z-index: 299;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

/* ===== Drawer header (chỉ hiện trong drawer mobile) ===== */
.nav-drawer-header {
  display: none;
}

/* ---------- MOBILE ≤ 860px (hamburger frontend) ---------- */
@media (max-width: 860px) {
  .top-banner { font-size: 11.5px; padding: 6px 10px; line-height: 1.45; }

  /* Tắt backdrop-filter trên mobile — nó tạo containing block cho position:fixed children
     khiến drawer bị giam trong stacking context của header */
  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #fff !important;
  }
  .site-header { padding: 10px 0; }
  .site-header .container { flex-wrap: wrap; gap: 10px; align-items: center; }
  .nav-toggle { display: inline-flex; flex-shrink: 0; order: 97; }
  .brand { flex: 1; min-width: 0; gap: 8px; font-size: 16px; order: 0; }
  .header-quick-icons { order: 96; }
  .search-box { order: 99; }
  .brand-logo { width: 38px; height: 38px; font-size: 18px; border-radius: 10px; }
  .brand-name small { font-size: 9.5px; }
  .brand-name span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Search xuống dòng full width */
  .search-box { order: 99; flex: 0 0 100%; max-width: none; margin-top: 4px; }
  .search-box input { padding: 10px 16px 10px 40px; font-size: 14px; }

  /* ===== Clip container — giữ drawer hoàn toàn trong viewport, không gây document overflow ===== */
  .nav-drawer-clip {
    position: fixed;
    inset: 0;               /* full-viewport */
    overflow: hidden;       /* clip mọi thứ bên trong vượt viewport */
    pointer-events: none;   /* xuyên qua khi đóng */
    z-index: 300;
  }

  /* ===== Right-side drawer (position:absolute bên trong clip container) ===== */
  .header-nav {
    position: absolute;     /* relative to .nav-drawer-clip, không phải viewport */
    top: 0; right: 0; bottom: 0;
    width: 290px; max-width: 86vw;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0 10px 20px;
    transform: translateX(100%); /* đẩy ra ngoài clip container → bị clip */
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    box-shadow: -6px 0 32px rgba(0,0,0,.14);
    border-left: 1px solid var(--line);
    pointer-events: none;
  }
  body.nav-open .header-nav {
    transform: translateX(0);
    pointer-events: auto;
  }

  /* Header trong drawer */
  .nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 6px 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; background: #fff; z-index: 1;
  }
  .nav-drawer-close {
    width: 38px; height: 38px;
    border: 1.5px solid var(--line); border-radius: 10px;
    background: #fff; cursor: pointer;
    display: grid; place-items: center;
    color: var(--text); font-size: 20px;
    flex-shrink: 0;
  }
  .nav-drawer-close:hover { background: var(--emerald-soft); border-color: var(--emerald); color: var(--emerald-dark); }

  /* Links trong drawer */
  .header-nav a, .header-nav .btn-cta, .header-nav .btn-ghost, .header-nav .user-chip {
    width: 100%; justify-content: flex-start;
    border-radius: 10px; padding: 12px 14px;
    font-size: 14.5px;
  }
  .header-nav .btn-cta, .header-nav .btn-ghost { font-weight: 700; }
  /* Drawer: header-icon hiện dạng hàng ngang icon + text */
  .header-icon {
    width: 100%; height: auto; border-radius: 10px;
    padding: 12px 14px; justify-content: flex-start; gap: 14px;
    font-size: 14.5px; font-weight: 600; color: var(--text-soft);
  }
  .header-icon:hover { background: var(--beige); color: var(--text); }
  .header-icon::after { display: none; } /* tắt title-based text cũ */

  /* Icon wrap: trong drawer cần là block riêng để badge định vị */
  .nav-icon-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; width: 26px; height: 26px; flex-shrink: 0;
  }
  .nav-icon-wrap i { font-size: 22px; }
  .nav-icon-wrap .badge-dot {
    position: absolute; top: -5px; right: -7px;
    min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 3px;
  }

  /* Label hiện ra trong drawer */
  .nav-label { display: block; flex: 1; }

  .badge-dot { position: static; margin-left: auto; }
  /* User chip trong drawer */
  .user-chip {
    background: var(--emerald-soft); border-color: rgba(16,134,82,.2);
    gap: 14px; padding: 10px 14px;
  }
  .chip-label { font-size: 14.5px; flex: 1; }
  .chip-chevron { font-size: 18px; }

  /* Hero gọn lại */
  .hero { padding: 52px 16px 70px !important; }
  .hero h1 { font-size: 26px !important; line-height: 1.25; }
  .hero p { font-size: 14px !important; }

  /* Account header: ẩn QR trên mobile, dồn user info gọn */
  .account-header { padding: 24px 0 76px; }
  .account-header .container { grid-template-columns: 1fr; gap: 0; }
  .acc-qr { display: none; }
  .acc-user-info { gap: 14px; }
  .acc-avatar { width: 58px; height: 58px; min-width: 58px; font-size: 22px; }
  .acc-avatar::after { width: 12px; height: 12px; }
  .acc-name { font-size: 17px; }
  .acc-rank { font-size: 12px; gap: 6px; }

  /* Account sidebar → ẩn hoàn toàn, thay bằng bottom tab */
  .account-sidebar { display: none !important; }
  .account-layout { grid-template-columns: 1fr !important; padding-bottom: 80px; }

  /* Bottom tab bar: hiện */
  .acct-bottom-tabs { display: flex; }

  /* Đẩy content xuống để không bị bottom nav che — 62px nav + 10px đệm */
  main { padding-bottom: 72px; }

  /* Wallet & order tabs → cuộn ngang */
  /* wallet-tabs: cuộn ngang như cũ */
  .wallet-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .wallet-tabs a { flex: 0 0 auto; white-space: nowrap; padding: 10px 16px; }

  /* order-tabs: 2 hàng pill — hàng 1: 3 tab, hàng 2: 2 tab */
  .order-tabs { flex-wrap: wrap; overflow: visible; border-radius: var(--r-md); }
  .order-tabs a { flex: 1 1 30%; white-space: normal; text-align: center;
                  font-size: 12.5px; padding: 10px 4px; line-height: 1.3; }

  /* order-item hover không cần negative margin trên mobile */
  .order-item:hover { margin: 0; padding: 14px 0; background: transparent; }

  .wallet-balance { padding: 20px; }
  .wallet-balance .amount { font-size: 28px; }
  .wallet-balance .deco { font-size: 70px; right: 12px; }

  /* Cart trên mobile: ẩn cột thừa, dồn vào layout vertical */
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 12px; margin-bottom: 10px;
    position: relative;
  }
  .cart-table tr:hover td { background: transparent; }
  .cart-table td { border: 0; padding: 6px 0; text-align: left !important; }
  .cart-table td[data-label] {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
  }
  .cart-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted); font-size: 12.5px; font-weight: 600; flex-shrink: 0;
  }
  .cart-table .cell-actions {
    position: absolute; top: 8px; right: 8px; padding: 0; width: auto;
  }
  .cart-table .cell-total { font-size: 16px; }

  /* Footer */
  .site-footer { padding: 36px 0 18px; }
  .site-footer .grid { gap: 24px; }

  /* Admin */
  .admin-topbar { padding: 12px 16px; gap: 10px; }
  .admin-content { padding: 16px !important; }
}

/* ---------- ADMIN drawer ----------
 * Backdrop + nav-toggle PHẢI có default style luôn (để không vỡ desktop grid).
 * - Default: backdrop fixed full-screen nhưng invisible & không bắt sự kiện
 * - Default: nav-toggle ẩn (chỉ hiện ở mobile)
 * Mobile (≤900px): biến sidebar thành drawer slide-in từ trái + bật backdrop khi mở
 */
.admin-backdrop {
  position: fixed; inset: 0;
  background: rgba(2,32,26,.55);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 150;
}
.admin-nav-toggle { display: none; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav-toggle { display: inline-flex; flex-shrink: 0; }

  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 280px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200; height: 100vh;
    box-shadow: 8px 0 30px rgba(0,0,0,.25);
  }
  body.admin-nav-open .admin-sidebar { transform: translateX(0); }
  body.admin-nav-open .admin-backdrop { opacity: 1; pointer-events: auto; }

  .admin-topbar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-user { gap: 8px; }
  .admin-user > div { display: none; }  /* ẩn tên + role, chỉ giữ avatar */
}

/* ---------- PHONE ≤ 640px ---------- */
@media (max-width: 640px) {
  .container { padding: 0 12px; }
  body { font-size: 14px; }

  .top-banner span,
  .top-banner .ph-duotone:nth-of-type(2) { display: none; }   /* ẩn dấu · và icon hotline trên màn nhỏ */

  .card { padding: 18px; border-radius: 14px; }
  .card-title { font-size: 15px; padding-bottom: 10px; margin-bottom: 14px; }

  /* Featured 1 cột (large card riêng cho membership), product grid vẫn 2 cột để không quá lớn */
  .featured-grid { grid-template-columns: 1fr !important; gap: 14px; }

  /* Product card font + padding gọn */
  .product-card .body { padding: 12px; }
  .product-card .name { font-size: 14px; }
  .price-block.two-col .col { padding: 7px 8px; }
  .price-block.two-col .col-tv .amt { font-size: 17px; }
  .price-block.two-col .col-retail .amt { font-size: 13px; }
  .price-block.two-col .lbl { font-size: 10px; }

  /* Product detail */
  .product-detail .info { padding: 18px; }
  .product-detail h1 { font-size: 19px; }
  .price-detail.two-col { grid-template-columns: 1fr; }
  .price-detail.two-col .col-retail { border-right: 0; border-bottom: 1px dashed rgba(0,0,0,.1); }
  .price-detail.two-col .col { padding: 12px 16px; }
  .price-detail.two-col .col-tv .amt { font-size: 26px; }
  .price-detail.two-col .col-retail .amt { font-size: 17px; }

  /* Buttons defaults nhỏ lại 1 chút */
  .btn { padding: 11px 18px; font-size: 13.5px; }
  .btn-lg { padding: 13px 22px; font-size: 14.5px; }
  .btn-sm { padding: 7px 12px; font-size: 12.5px; }

  /* Auth card */
  .auth-page { padding: 28px 12px; min-height: calc(100vh - 60px); }
  .auth-card { padding: 24px 18px !important; border-radius: 16px !important; }

  /* Network stats: 2 cột nhỏ hơn */
  .network-stats { gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card .num { font-size: 21px; }
  .stat-card .lbl { font-size: 11.5px; }
  .stat-card .stat-ico { width: 38px; height: 38px; font-size: 18px; margin-bottom: 10px; }

  /* Tables: ép wrap có overflow cho mọi .table */
  .table th, .table td { padding: 10px 12px; font-size: 13px; }

  /* Footer */
  .site-footer .grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- TINY PHONE ≤ 420px ---------- */
@media (max-width: 420px) {
  .top-banner { font-size: 11px; }
  .brand-name small { display: none; }
  .brand { font-size: 15px; }
  .product-card-actions { gap: 5px; }
  .product-card-actions .btn { font-size: 11.5px; min-height: 40px; padding: 9px 4px; gap: 4px; }
  .product-card-actions .btn i { font-size: 14px; }
  .acc-qr-info { font-size: 11.5px; }
  .acc-qr img { width: 56px; height: 56px; }
  .wallet-balance .amount { font-size: 24px; }
}

/* ---------- Touch-friendly mặc định ---------- */
@media (hover: none) and (pointer: coarse) {
  .btn, .btn-sm, .form-control, .qty-box button, .qty-box input { min-height: 42px; }
  .product-card:hover { transform: none; }
  .stat-card:hover { transform: none; }
  .btn:hover { transform: none; }
}

/* Product detail: member CTA */
.member-cta {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--gold-soft); border: 1.5px dashed var(--gold);
  display: flex; gap: 12px; align-items: flex-start; color: var(--text);
}
.member-cta > i:first-child { font-size: 24px; color: var(--gold-deep); flex-shrink: 0; margin-top: 2px; }
.member-cta a { color: var(--emerald-deep); font-weight: 600; }

/* --- Cart page --- */
.cart-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 18px;
}
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-table th, .cart-table td { vertical-align: middle; }
.cart-table .th-r { text-align: right; }
.cart-table .cell-price { text-align: right; font-weight: 700; }
.cart-table .cell-total { text-align: right; font-weight: 800; color: var(--red); }
.cart-item { display: flex; gap: 12px; align-items: center; }
.cart-thumb {
  width: 64px; height: 64px; border-radius: 8px;
  background: var(--beige) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--line-strong); font-size: 28px; flex-shrink: 0;
}
.cart-thumb.sm { width: 44px; height: 44px; font-size: 20px; }

.cart-summary-card .sum-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.cart-summary-card .sum-row.total { font-size: 17px; font-weight: 800; color: var(--red); border-top: 1.5px solid var(--line); padding-top: 12px; margin-top: 6px; }
.sticky-summary { position: sticky; top: 16px; }

.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; transition: .15s; }
.icon-btn:hover { color: var(--red); background: var(--red-soft); }
.icon-btn i { font-size: 20px; }

.qty-form { display: inline-block; }

/* --- Checkout --- */
.checkout-grid {
  display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start;
}
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }

.address-list { display: flex; flex-direction: column; gap: 10px; }
.address-card {
  display: flex; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: .18s; background: #fff;
}
.address-card:hover { border-color: var(--emerald); }
.address-card input[type=radio] { margin-top: 4px; accent-color: var(--emerald); }
.address-card.default { border-color: var(--emerald); background: var(--emerald-soft); }

.payment-option {
  display: flex; gap: 12px; padding: 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; margin-bottom: 10px; transition: .18s; background: #fff;
}
.payment-option:hover { border-color: var(--emerald); }
.payment-option input[type=radio] { margin-top: 4px; accent-color: var(--emerald); }
.payment-option > div { display: flex; gap: 12px; align-items: center; flex: 1; }

.checkout-items { max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.checkout-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }

/* --- Order detail timeline --- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 14px; padding: 10px 0; position: relative; }
.timeline li::before {
  content: ''; position: absolute; left: 6px; top: 22px; bottom: -12px;
  width: 2px; background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--emerald); border: 3px solid var(--emerald-soft);
  flex-shrink: 0; margin-top: 4px; z-index: 1;
}

/* --- Badges --- */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-success   { background: var(--emerald-soft); color: var(--emerald-deep); }
.badge-warning   { background: var(--gold-soft); color: var(--gold-deep); }
.badge-danger    { background: var(--red-soft); color: #7f1d1d; }
.badge-info      { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #f3f4f6; color: #4b5563; }

/* --- Pill (notification count in nav) --- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--red); color: #fff;
  border-radius: 10px; font-size: 11px; font-weight: 800;
  margin-left: 6px;
}

/* --- ADMIN --- */
.admin-body { background: #f5f1e8; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  /* Phải khai lại ở đây vì base .admin-sidebar (position:sticky) nằm sau media query trên */
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 280px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200; height: 100vh; overflow-y: auto;
  }
  body.admin-nav-open .admin-sidebar { transform: translateX(0); }
}

.admin-sidebar {
  background: linear-gradient(180deg, #013e2c, #02201a);
  color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
/* Override sticky → fixed PHẢI ở đây (sau base) để cascade đúng */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 280px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200; height: 100vh;
  }
  body.admin-nav-open .admin-sidebar { transform: translateX(0); }
}
.admin-brand {
  display: flex; gap: 10px; align-items: center; color: #fff;
  padding: 6px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 12px;
}
.admin-brand:hover { color: #fff; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.85); padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; transition: .15s;
}
.admin-nav a i { font-size: 18px; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: var(--emerald); color: #fff; box-shadow: 0 4px 14px rgba(4,120,87,.4); }
.admin-nav .pill { background: var(--gold); color: var(--text); margin-left: auto; }

.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  background: #fff; padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.admin-topbar h1 { margin: 0; font-size: 20px; color: var(--emerald-deep); }
.admin-user { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.admin-user .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-emerald); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.admin-content { padding: 24px; flex: 1; }

/* ===== Admin Bottom Nav (mobile ≤900px) ===== */
.admin-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 62px; z-index: 199;
  background: #013e2c;
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  align-items: stretch;
}
.admin-bottom-nav a,
.admin-bottom-nav .abn-menu-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: rgba(255,255,255,.55); font-size: 10px; font-weight: 600;
  text-decoration: none; background: none; border: none;
  cursor: pointer; padding: 8px 4px; position: relative;
  letter-spacing: .01em; transition: color .15s, background .15s;
}
.admin-bottom-nav a i,
.admin-bottom-nav .abn-menu-btn i { font-size: 22px; }
.admin-bottom-nav a:hover,
.admin-bottom-nav .abn-menu-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.admin-bottom-nav a.active { color: #6ee7b7; }
.abn-badge {
  position: absolute; top: 6px; right: calc(50% - 18px);
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 800;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #013e2c;
}
@media (max-width: 900px) {
  .admin-bottom-nav { display: flex; }
  .admin-content { padding-bottom: 78px !important; }
}

/* admin stats cards extra colors */
.network-stats .stat-card.gold {
  background: linear-gradient(135deg, var(--gold-soft) 0%, #fff 100%);
  border: 1.5px solid var(--gold);
}
.network-stats .stat-card.gold .num { color: var(--gold-deep); }
.network-stats .stat-card.gold .stat-ico { background: linear-gradient(135deg, var(--gold), var(--gold-deep)); }
.network-stats .stat-card.tax {
  background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
  border: 1.5px solid #fb923c;
}
.network-stats .stat-card.tax .num { color: #c2410c; }
.network-stats .stat-card.tax .stat-ico { background: linear-gradient(135deg, #fb923c, #c2410c); }
.network-stats .stat-card.red {
  background: linear-gradient(135deg, var(--red-soft) 0%, #fff 100%);
  border: 1.5px solid var(--red);
}
.network-stats .stat-card.red .num { color: var(--red); }
.network-stats .stat-card.red .stat-ico { background: linear-gradient(135deg, var(--red), #a30c25); }

/* admin small button helpers */
.btn.btn-sm { padding: 6px 10px; font-size: 12.5px; gap: 4px; }
.btn.btn-sm i { font-size: 14px; }

/* Dividers */
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* Form helper for admin input width */
.form-control-lg { font-size: 18px; padding: 12px 14px; }


/* ========================================
   RANK / LỘ TRÌNH THĂNG TIẾN
   ======================================== */

/* Timeline ngang 7 cấp */
.rank-timeline {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; padding: 18px 6px 8px; position: relative;
}
.rank-timeline::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 44px;
  height: 3px; background: var(--line); border-radius: 2px; z-index: 0;
}
.rt-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; z-index: 1; text-align: center;
}
.rt-dot {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: 3px solid var(--line);
  color: var(--muted); font-size: 24px;
  transition: .25s;
}
.rt-step.rt-done .rt-dot {
  background: var(--rk, var(--emerald)); border-color: var(--rk, var(--emerald));
  color: #fff; opacity: .55;
}
.rt-step.rt-current .rt-dot {
  background: var(--rk, var(--emerald)); border-color: #fff;
  color: #fff;
  box-shadow: 0 0 0 4px var(--rk, var(--emerald)), 0 8px 22px rgba(0,0,0,.18);
  transform: scale(1.12);
}
.rt-step.rt-locked .rt-dot { opacity: .55; }
.rt-name {
  font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.2;
  margin-top: 2px;
}
.rt-step.rt-locked .rt-name { color: var(--muted); font-weight: 600; }
.rt-pct { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.rt-step.rt-current .rt-pct { color: var(--rk); font-weight: 700; }
.rt-pin {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 8px;
  white-space: nowrap; box-shadow: 0 3px 8px rgba(200,16,46,.3);
  letter-spacing: .03em;
}
.rt-pin::after {
  content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--red);
}

/* Card cấp hiện tại */
.rank-current-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--rk) 8%, #fff), #fff);
  border-left: 4px solid var(--rk);
}
.rcc-head { display: flex; align-items: center; gap: 18px; }
.rcc-icon {
  width: 72px; height: 72px; border-radius: 18px;
  background: var(--rk); color: #fff;
  display: grid; place-items: center; font-size: 38px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--rk) 35%, transparent);
  flex-shrink: 0;
}
.rcc-meta { flex: 1; min-width: 0; }
.rcc-label { font-size: 12px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; }
.rcc-name { font-size: 24px; font-weight: 800; color: var(--text); margin-top: 2px; }
.rcc-desc { color: var(--text-soft); font-size: 13.5px; margin-top: 4px; }
.rcc-pct { text-align: center; flex-shrink: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.rcc-pct-num { font-size: 32px; font-weight: 800; color: var(--rk); line-height: 1; }
.rcc-pct-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* Card cấp tiếp theo (trang ranks.php) */
.rank-next-card { border-left: 4px solid var(--rk); }
.rnc-head { display: flex; align-items: center; gap: 14px; }
.rnc-arrow {
  width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in srgb, var(--rk) 12%, #fff);
  color: var(--rk); display: grid; place-items: center; font-size: 22px;
  flex-shrink: 0;
}
.rnc-label { font-size: 12px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; }
.rnc-name { font-size: 19px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rnc-name > i { color: var(--rk); font-size: 22px; }
.rnc-pct { font-size: 13px; color: var(--rk); background: color-mix(in srgb, var(--rk) 10%, #fff);
  padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.rnc-req {
  margin-top: 16px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap;
}
.rnc-req-text { font-size: 14px; color: var(--text-soft); }
.rnc-req-num { font-size: 16px; }
.rnc-req-num b { color: var(--rk); font-size: 20px; }
.rnc-status { margin-top: 12px; }

/* Progress bar */
.rank-progress {
  height: 10px; background: var(--beige); border-radius: 999px;
  overflow: hidden; margin-top: 6px;
}
.rank-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--rk, var(--emerald)),
    color-mix(in srgb, var(--rk, var(--emerald)) 70%, #fff));
  border-radius: 999px; transition: width .5s ease;
  box-shadow: 0 0 8px color-mix(in srgb, var(--rk, var(--emerald)) 40%, transparent);
}
.rank-progress-bar.met {
  background: linear-gradient(90deg, var(--emerald), var(--emerald-dark));
}

/* Bảng chi tiết 7 cấp */
.rank-detail-table tr.rdt-current {
  background: var(--emerald-soft);
}
.rank-detail-table tr.rdt-current td { border-color: rgba(16,134,82,.2); }
.rdt-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--text);
}
.rdt-name > i { color: var(--rk, var(--emerald)); font-size: 18px; }
.rdt-name .muted { font-weight: 500; font-size: 12px; }

/* ===== Rank detail compact cards ===== */
.rdc-list { display: flex; flex-direction: column; }
.rdc-item {
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.rdc-item:last-child { border-bottom: none; }
.rdc-item.rdc-current { background: var(--emerald-soft);
  margin: 0 -26px; padding: 12px 26px;
  border-left: 3px solid var(--emerald); }
.rdc-row1 {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}
.rdc-name {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 700; font-size: 14px; color: var(--text);
  flex: 1; min-width: 0;
}
.rdc-name > i { color: var(--rk, var(--emerald)); font-size: 17px; flex-shrink: 0; }
.rdc-name .muted { font-weight: 500; font-size: 12px; }
.rdc-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.rdc-pct { color: var(--rk, var(--emerald)); font-size: 15px; }
.rdc-row2 {
  font-size: 12.5px; color: var(--text-soft); margin-top: 4px;
  line-height: 1.4;
}

/* Card "Cấp tiếp theo" trên dashboard (compact) */
.next-rank-card {
  border-left: 4px solid var(--rk);
  background: linear-gradient(135deg, color-mix(in srgb, var(--rk) 6%, #fff), #fff);
  margin-bottom: 16px;
}
.nrc-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nrc-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--rk); color: #fff;
  display: grid; place-items: center; font-size: 28px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--rk) 30%, transparent);
  flex-shrink: 0;
}
.nrc-body { flex: 1; min-width: 220px; }
.nrc-label { font-size: 11.5px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; }
.nrc-name { font-size: 18px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.nrc-pct {
  font-size: 12.5px; color: var(--rk);
  background: color-mix(in srgb, var(--rk) 10%, #fff);
  padding: 2px 9px; border-radius: 999px; font-weight: 700;
}
.nrc-meta { font-size: 13.5px; color: var(--text-soft); margin-top: 6px; }
.nrc-cta { flex-shrink: 0; }

@media (max-width: 768px) {
  /* rank timeline: 2 hàng — hàng 1: 4 circle, hàng 2: 3 circle */
  .rank-timeline {
    grid-template-columns: repeat(4, 1fr);
    overflow-x: visible; padding-bottom: 8px;
  }
  .rank-timeline::before { display: none; } /* ẩn đường ngang vì 2 hàng */
  .rt-dot { width: 44px; height: 44px; font-size: 20px; }
  .rt-name { font-size: 11px; }
  .rt-pct { font-size: 10.5px; }
  .rt-pin { font-size: 9px; padding: 1px 6px; top: -12px; }
  /* rdc-current: bỏ negative margin trên mobile vì card padding nhỏ hơn */
  .rdc-item.rdc-current { margin: 0 -18px; padding: 12px 18px; }
  .rcc-head { flex-wrap: wrap; }
  .rcc-pct { padding-left: 0; border-left: none; border-top: 1px solid var(--line);
    padding-top: 12px; width: 100%; text-align: left; display: flex;
    align-items: baseline; gap: 8px; }
  .rcc-pct-num { font-size: 24px; }
  .rdt-name { font-size: 13px; }
}

/* ========================================
   SETTINGS PAGE — admin/settings.php
   ======================================== */
.settings-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px;
}
.settings-tabs a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 13.5px; color: var(--text-soft);
  background: #fff; border: 1.5px solid var(--line);
  transition: .15s;
}
.settings-tabs a:hover { border-color: var(--emerald); color: var(--emerald-dark); background: var(--emerald-soft); }
.settings-tabs a.active { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.settings-tabs a i { font-size: 17px; }

.settings-fields { display: flex; flex-direction: column; gap: 18px; }
.field-row { display: grid; grid-template-columns: 260px 1fr; gap: 12px 20px; align-items: start; }
.field-row label { font-weight: 600; font-size: 14px; color: var(--text); padding-top: 11px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; grid-column: 2; }

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; gap: 6px; }
  .field-row label { padding-top: 0; }
  .field-hint { grid-column: 1; }
}

/* ========================================
   VIETQR PAYMENT BLOCK — account/order-detail.php
   ======================================== */
.vqr-block {
  display: flex; gap: 24px; align-items: flex-start;
  background: linear-gradient(135deg, #f0fdf9, #fdf9f0);
  border: 1.5px solid rgba(16,134,82,.2);
  border-radius: var(--r-lg); padding: 20px 22px;
  flex-wrap: wrap;
}
.vqr-left { flex: 1; min-width: 240px; }
.vqr-title {
  font-size: 16px; font-weight: 800; color: var(--emerald-dark);
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.vqr-title i { font-size: 20px; }

.vqr-info { display: flex; flex-direction: column; gap: 8px; }
.vqr-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.vqr-lbl {
  min-width: 90px; color: var(--muted); font-size: 12.5px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.vqr-stk {
  font-family: 'Courier New', monospace; font-size: 15px;
  background: rgba(16,134,82,.08); padding: 2px 8px; border-radius: 6px;
  letter-spacing: .05em;
}
.vqr-copy {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; padding: 2px 4px;
  border-radius: 6px; transition: .15s; line-height: 1;
}
.vqr-copy:hover { background: var(--emerald-soft); color: var(--emerald-dark); }

.vqr-note {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--r-md);
  background: rgba(16,134,82,.07); font-size: 13px; color: var(--text-soft);
  display: flex; gap: 8px; align-items: flex-start;
  border: 1px dashed rgba(16,134,82,.2);
}
.vqr-note i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.vqr-right {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.vqr-img {
  width: 180px; height: 180px; border-radius: 12px;
  border: 2px solid rgba(16,134,82,.25);
  background: #fff; padding: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.vqr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--grad-emerald); color: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  box-shadow: var(--sh-emerald);
}
.vqr-badge i { font-size: 13px; }

@media (max-width: 500px) {
  .vqr-block { flex-direction: column-reverse; align-items: center; }
  .vqr-img { width: 160px; height: 160px; }
  .vqr-lbl { min-width: 70px; }
}

/* ========================================
   USER DETAIL — admin/user-detail.php
   ======================================== */

/* Header card */
.ud-header {
  display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap;
  padding: 20px 22px; margin-bottom: 12px;
}
.ud-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: var(--emerald); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
}
.ud-info { flex: 1; min-width: 200px; }
.ud-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 8px; font-size: 13px; color: var(--muted-text);
}
.ud-meta i { margin-right: 3px; }
.ud-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }

/* Stat strip */
.ud-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.ud-stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px; text-align: center;
}
.ud-stat .n { font-size: 18px; font-weight: 800; color: var(--text); }
.ud-stat .l { font-size: 11.5px; color: var(--muted-text); margin-top: 2px; }

/* Info grid */
.ud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.table-info td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table-info tr:last-child td { border-bottom: none; }

/* Mini balance boxes */
.ud-mini-bal {
  flex: 1; background: var(--bg-soft); border-radius: var(--r-md);
  padding: 10px 14px; text-align: center;
}
.ud-mini-bal .lbl { font-size: 11px; color: var(--muted-text); margin-bottom: 2px; }
.ud-mini-bal .val { font-size: 16px; font-weight: 800; }
.ud-mini-bal .val.cash { color: var(--emerald); }
.ud-mini-bal .val.tax  { color: var(--red); }

@media (max-width: 600px) {
  .ud-header { flex-direction: column; }
  .ud-actions { width: 100%; }
  .ud-grid { grid-template-columns: 1fr; }
}

/* ========================================
   POOL — admin/pool.php
   ======================================== */
.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.pool-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow .15s;
}
.pool-card.pool-active {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16,134,82,.07);
}

.pool-header { display: flex; align-items: center; gap: 12px; }
.pool-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--emerald-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--emerald); flex-shrink: 0;
}
.pool-name  { font-size: 15px; font-weight: 700; }
.pool-rank  { font-size: 12.5px; color: var(--muted-text); margin-top: 2px; }

.pool-amount { text-align: center; padding: 12px 0; }
.amt-label { font-size: 12px; color: var(--muted-text); margin-bottom: 4px; }
.amt-val {
  font-size: 28px; font-weight: 800; color: var(--muted-text);
  letter-spacing: -.5px;
}
.amt-val.has-money { color: var(--emerald); }
.amt-meta { font-size: 12px; color: var(--muted-text); margin-top: 4px; }

.pool-info-row {
  display: flex; gap: 0;
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden;
}
.pi {
  flex: 1; padding: 10px 8px; text-align: center;
  border-right: 1px solid var(--border);
}
.pi:last-child { border-right: none; }
.pi-n { font-size: 15px; font-weight: 700; color: var(--text); }
.pi-l { font-size: 10.5px; color: var(--muted-text); margin-top: 2px; line-height: 1.3; }

.pool-last { font-size: 12px; color: var(--muted-text); text-align: center; }

.disabled-look { opacity: .55; cursor: not-allowed; }

@media (max-width: 600px) {
  .pool-grid { grid-template-columns: 1fr; }
}

/* ========================================
   REFERRAL LINK CARD — account/my-network.php
   ======================================== */
.ref-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--emerald-soft) 0%, #fff 100%);
  border: 1.5px solid var(--emerald);
  padding: 18px 20px; flex-wrap: wrap;
}
.ref-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--emerald); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.ref-body { flex: 1; min-width: 200px; }
.ref-label { font-size: 11.5px; font-weight: 600; color: var(--emerald-dark); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ref-url {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  word-break: break-all; background: rgba(0,0,0,.04);
  padding: 5px 10px; border-radius: 6px; margin-bottom: 6px;
  font-family: monospace;
}
.ref-hint { font-size: 12px; color: var(--muted-text); }
.ref-copy-btn { flex-shrink: 0; white-space: nowrap; }

/* ========================================
   TREE TABLE — F1–F4 mạng lưới
   ======================================== */
.depth-badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.depth-badge.d1 { background: #e0f2fe; color: #0369a1; }
.depth-badge.d2 { background: #dcfce7; color: #166534; }
.depth-badge.d3 { background: #fef9c3; color: #854d0e; }
.depth-badge.d4 { background: #fce7f3; color: #9d174d; }

.depth-row.d1 td:first-child { border-left: 3px solid #0369a1; }
.depth-row.d2 td:first-child { border-left: 3px solid #16a34a; }
.depth-row.d3 td:first-child { border-left: 3px solid #ca8a04; }
.depth-row.d4 td:first-child { border-left: 3px solid #db2777; }

.depth-sep td { height: 6px; background: var(--bg-soft); }

.tree-indent-icon { color: var(--muted-text); margin-right: 3px; font-size: 12px; }

/* ===== Net list — compact member cards ===== */
.net-list { display: flex; flex-direction: column; }
.net-depth-sep {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 4px;
  font-size: 12px; color: var(--text-soft); font-weight: 600;
}
.net-depth-sep:first-child { border-top: none; margin-top: 0; }
.net-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent; padding-left: 8px;
}
.net-item:last-child { border-bottom: none; }
.net-item.d1 { border-left-color: #0369a1; }
.net-item.d2 { border-left-color: #16a34a; }
.net-item.d3 { border-left-color: #ca8a04; }
.net-item.d4 { border-left-color: #db2777; }
.net-row1 {
  display: flex; align-items: center; gap: 6px;
}
.net-fbadge { font-size: 11px; padding: 1px 7px; }
.net-name {
  flex: 1; min-width: 0; font-weight: 700; font-size: 14px;
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.net-status { flex-shrink: 0; font-size: 11px; }
.net-row2 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  font-size: 12px; color: var(--text-soft); padding-left: 2px;
}
.net-rank { font-weight: 700; color: var(--emerald-dark); }
.net-sep { color: var(--line-dark, #ccc); }

@media (max-width: 600px) {
  .ref-card { flex-direction: column; align-items: flex-start; }
  .ref-copy-btn { width: 100%; }
}

/* ========================================
   NOTIFICATIONS PAGE — account/notifications.php
   ======================================== */
.notif-list {
  display: flex; flex-direction: column; gap: 0;
  max-height: 560px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.notif-list::-webkit-scrollbar { width: 5px; }
.notif-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
@media (max-width: 860px) {
  .notif-list { max-height: 65dvh; }
}

.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--emerald-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--emerald);
}
.notif-title  { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.notif-msg    { font-size: 13px; color: var(--muted-text); margin-bottom: 4px; }
.notif-time   { font-size: 11.5px; color: var(--muted-text); }

/* ========================================
   PAGINATION — dùng chung
   ======================================== */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-md);
  border: 1px solid var(--border); font-size: 13.5px;
  color: var(--text); text-decoration: none;
  transition: all .15s;
}
.pagination a:hover   { border-color: var(--emerald); color: var(--emerald); }
.pagination a.active  { background: var(--emerald); border-color: var(--emerald); color: #fff; font-weight: 700; }

.pg-ellipsis {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; font-size: 13px; color: var(--muted-text);
}

/* ========================================
   ADMIN COMPACT LIST CARDS
   Dùng cho orders / users / withdrawals
   ======================================== */
.admin-list { display: flex; flex-direction: column; gap: 14px; }

.admin-item {
  background: #fff;
  border: 1.5px solid #c9d4ce;
  border-left: 4px solid var(--emerald);
  border-radius: var(--r-lg); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 7px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Dòng 1: mã lệnh / tên + badge trạng thái */
.ai-row1 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ai-code {
  font-size: 13px; font-weight: 700; color: var(--emerald);
  text-decoration: none; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-code:hover { text-decoration: underline; }

/* Dòng 2: info chính */
.ai-row2 {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ai-sub {
  font-size: 12px; color: var(--muted-text); font-weight: 400;
}

/* Dòng 3: meta gọn */
.ai-row3 {
  font-size: 12.5px; color: var(--muted-text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ai-row3 b { color: var(--red); font-size: 14px; font-weight: 700; }
.ai-dot { color: var(--border); font-size: 14px; line-height: 1; }

/* Dòng 4: ngày + actions */
.ai-row4 {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; margin-top: 2px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.ai-date { font-size: 11.5px; color: var(--muted-text); }
.ai-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Tên thành viên đậm có link */
.ai-name-link {
  font-size: 14px; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.ai-name-link:hover { color: var(--emerald); }

/* Tag nhỏ inline */
.ai-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; padding: 1px 7px; border-radius: 20px;
  font-weight: 600; background: var(--emerald-soft); color: var(--emerald);
}
.ai-tag.red   { background: #fef2f2; color: var(--red); }
.ai-tag.amber { background: #fffbeb; color: #b45309; }
.ai-tag.muted { background: var(--border); color: var(--muted-text); }

/* ---- Product card layout ---- */
.prod-item.prod-hidden { opacity: .5; }

.prod-top {
  display: flex; gap: 12px; align-items: flex-start;
}
.prod-thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: var(--cream); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-text); font-size: 22px;
}
.prod-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.prod-info { flex: 1; min-width: 0; }
.prod-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.3;
}
.prod-code {
  font-size: 11.5px; color: var(--muted-text); margin-top: 1px;
}
.prod-desc {
  font-size: 12px; color: var(--muted-text); margin-top: 4px;
  line-height: 1.4;
}

/* ---- Report top lists ---- */
.rpt-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 700px) {
  .rpt-top-grid { grid-template-columns: 1fr; }
}

.rpt-list { display: flex; flex-direction: column; }
.rpt-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.rpt-item:last-child { border-bottom: none; }

.rpt-rank {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--emerald-soft); color: var(--emerald);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rpt-item:nth-child(1) .rpt-rank { background: #FEF3C7; color: #B45309; }
.rpt-item:nth-child(2) .rpt-rank { background: #F1F5F9; color: #475569; }
.rpt-item:nth-child(3) .rpt-rank { background: #FEE2E2; color: #B91C1C; }

.rpt-info { flex: 1; min-width: 0; }
.rpt-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.rpt-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted-text); margin-top: 2px;
}
