/* 5ACE Homes — Bảng hàng · Giao diện chủ đạo vàng — xanh đêm */
:root {
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --ink: #201A12;
  --muted: #8A8175;
  --line: #E8E2D6;
  --navy: #0C1425;
  --navy-2: #182544;
  --gold: #F0B429;
  --gold-2: #D99A06;
  --gold-deep: #A16207;
  --gold-soft: #FDF0D2;
  --green: #15803D;
  --green-soft: #DCFCE7;
  --red: #B91C1C;
  --red-soft: #FEE2E2;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(32, 26, 18, .05), 0 6px 18px rgba(32, 26, 18, .06);
  --tabbar-h: 60px;
  --sab: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, select { font-family: inherit; font-size: 16px; }
svg { display: block; }

#app { max-width: 680px; margin: 0 auto; min-height: 100dvh; position: relative; }

/* ---------- Thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(var(--sat) + 10px) 16px 10px;
  background: linear-gradient(160deg, var(--navy-2), var(--navy) 62%);
  color: #fff;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 2px 14px rgba(12, 20, 37, .28);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(150deg, #FFDE8A, #F0B429 55%, #C8860A);
  color: #241703;
  font-weight: 900; font-size: 12.5px; letter-spacing: .2px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35), 0 2px 8px rgba(240, 180, 41, .4);
}
.titles { min-width: 0; }
.titles h1 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: rgba(255, 255, 255, .72); margin-top: 1px; }
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; flex: 0 0 auto; }
.sync .dot.syncing { background: var(--gold); animation: pulse 1s infinite; }
.sync .dot.error { background: #F87171; }
@keyframes pulse { 50% { opacity: .35; } }
.icon-btn {
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 12px; color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .1);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.spin svg { animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Khung nội dung ---------- */
.view { padding: 14px 14px calc(var(--tabbar-h) + var(--sab) + 22px); }

/* ---------- Thẻ chung ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 10px; font-size: 15.5px; font-weight: 800; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 2px 9px; }
.section-title h2 { margin: 0; font-size: 15.5px; font-weight: 800; }
.section-title .sub { font-size: 12px; color: var(--muted); }

/* ---------- Tổng quan ---------- */
.quote {
  border: 0; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #1B2A4E, #0C1425 70%);
}
.quote p { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.quote .who { font-size: 11.5px; color: var(--gold); font-weight: 600; letter-spacing: .3px; }
.quote .mark {
  position: absolute; right: 10px; top: 2px; font-size: 54px; line-height: 1;
  color: rgba(240, 180, 41, .25); font-family: Georgia, serif;
}
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 12px 14px; }
.stat .num { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.stat .num.gold { color: var(--gold-deep); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 1px; }
.stat.hl { background: linear-gradient(140deg, #FFF8E7, #FFF); border-color: #F3E3B7; }

.mini {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.mini:last-child { border-bottom: 0; padding-bottom: 2px; }
.mini:active { background: #FBF9F4; }
.mini .l { min-width: 0; }
.mini .ma { font-weight: 700; font-size: 14.5px; }
.mini .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .r { text-align: right; flex: 0 0 auto; }
.mini .price { font-weight: 800; color: var(--gold-deep); font-size: 14.5px; }
.mini .delta-down { color: var(--green); font-size: 12px; font-weight: 700; }
.mini .delta-up { color: var(--red); font-size: 12px; font-weight: 700; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; }

/* ---------- Bảng hàng ---------- */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: 10px 13px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.search-box svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.search-box input { border: 0; outline: 0; background: none; width: 100%; font-size: 16px; color: var(--ink); }
.filter-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px;
}
.filter-head .title { font-size: 12px; font-weight: 800; letter-spacing: .8px; color: var(--muted); }
.btn-clear {
  font-size: 12.5px; font-weight: 700; color: var(--red);
  background: var(--red-soft); border-radius: 9px; padding: 5px 11px;
}
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.f-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 11px; font-size: 13px; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow);
}
.f-chip .val { font-weight: 500; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-chip.active { background: var(--gold-soft); border-color: #EBCF8B; }
.f-chip.active .val { color: var(--gold-deep); font-weight: 700; }
.f-chip.on-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 7px;
  background: var(--gold); color: #241703; font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.list-meta { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 10px; }
.list-meta .count { font-size: 13px; color: var(--muted); }
.list-meta .count b { color: var(--ink); font-size: 15px; }
.sort-sel {
  display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700;
  color: var(--gold-deep); background: var(--gold-soft); padding: 6px 10px; border-radius: 10px;
}
.sort-sel svg { width: 14px; height: 14px; }

.unit-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 13px 14px; margin-bottom: 11px;
}
.unit-card:active { border-color: #EBCF8B; }
.uc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.uc-ma { font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; }
.badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 8px; flex: 0 0 auto; }
.badge.selling { background: var(--green-soft); color: var(--green); }
.uc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip {
  font-size: 11.5px; font-weight: 700; color: #4B463C;
  background: #F4F0E6; border-radius: 8px; padding: 3px 8px;
}
.uc-price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 9px; }
.uc-price .gia { font-size: 19px; font-weight: 800; color: var(--gold-deep); letter-spacing: -.3px; }
.uc-price .gia small { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.uc-price .dg { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.uc-note { font-size: 13px; color: #57534E; margin-top: 6px; line-height: 1.45; }
.uc-src { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.uc-src .src-date { background: #FDF0D2; color: var(--gold-deep); font-weight: 700; border-radius: 7px; padding: 2px 7px; }
.uc-actions { display: flex; gap: 8px; margin-top: 11px; }
.uc-actions .btn { flex: 1; }
.more-btn {
  width: 100%; padding: 12px; border-radius: 13px; font-size: 14px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); color: var(--gold-deep); box-shadow: var(--shadow);
}
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }
.empty .big { font-size: 34px; margin-bottom: 8px; }

/* ---------- Nút ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 800;
  background: linear-gradient(150deg, #FFD25E, #F0B429 60%, #DE9E08);
  color: #241703; box-shadow: 0 2px 8px rgba(240, 180, 41, .35);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.btn.navy { background: linear-gradient(150deg, #1B2A4E, #0C1425); color: #fff; box-shadow: 0 2px 8px rgba(12, 20, 37, .3); }
.btn.danger { background: var(--red-soft); color: var(--red); box-shadow: none; }
.btn.wide { width: 100%; padding: 13px; font-size: 14.5px; }

/* ---------- Thanh dưới ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 680px; margin: 0 auto;
  display: flex; background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--sab);
  height: calc(var(--tabbar-h) + var(--sab));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #9A9284; font-size: 10.5px; font-weight: 700; position: relative; padding-top: 2px;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--gold-deep); }
.tab.active::before {
  content: ""; position: absolute; top: 0; width: 34px; height: 3px;
  border-radius: 0 0 4px 4px; background: linear-gradient(90deg, #FFD25E, #D99A06);
}

/* ---------- Đăng nhập / phân quyền ---------- */
.auth-overlay { display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--navy-2), var(--navy) 70%); }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border-radius: 22px;
  padding: 28px 22px 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, .4); text-align: center;
}
.auth-card .logo { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; font-size: 16px; }
.auth-card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.auth-card .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.auth-card .text-input { margin-bottom: 10px; text-align: left; }
.auth-err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 18px; margin-bottom: 6px; }
.auth-card .btn.wide { margin-top: 2px; }
.role-chip {
  display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 8px;
}
.role-chip.admin { background: var(--gold-soft); color: var(--gold-deep); }
.role-chip.nv { background: #E0F2FE; color: #0369A1; }
.role-chip.off { background: var(--red-soft); color: var(--red); }
/* 3 hộp tài khoản: Đổi tên / Đổi mật khẩu / Đăng xuất */
.acc { display: flex; flex-direction: column; gap: 8px; margin-top: 13px; }
.acc-head {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 800; color: var(--ink);
  text-align: center; box-shadow: var(--shadow); transition: .15s;
}
.acc-head:active { transform: scale(.98); }
.acc-head.open { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); }
.acc-head.danger { background: var(--red-soft); color: var(--red); box-shadow: none; margin-top: 2px; }
.acc-body { margin-top: 8px; animation: up2 .16s ease-out; }
@keyframes up2 { from { opacity: 0; transform: translateY(-4px); } }
.u-row {
  display: flex; align-items: center; gap: 9px; padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.u-row:last-child { border-bottom: 0; }
.u-row .l { flex: 1; min-width: 0; }
.u-row .n { font-weight: 700; font-size: 14.5px; }
.u-row .d { font-size: 11.5px; color: var(--muted); }
.u-row .btn { padding: 7px 10px; font-size: 12px; flex: 0 0 auto; }
.log-row { display: flex; gap: 8px; align-items: baseline; padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-row:last-child { border-bottom: 0; }
.log-row .t { color: var(--muted); font-size: 11.5px; flex: 0 0 auto; }
.log-row .who { font-weight: 700; }
.log-row .ma { color: var(--gold-deep); font-weight: 700; }
.reveal-btn {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px;
  font-size: 11.5px; font-weight: 800; color: var(--gold-deep);
  background: var(--gold-soft); border-radius: 8px; padding: 3px 9px;
  vertical-align: middle; white-space: nowrap;
}
.reveal-btn svg { width: 12px; height: 12px; }
.masked { letter-spacing: 1px; }

/* ---------- Overlay chi tiết ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.detail-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--sat) + 10px) 14px 10px;
  background: linear-gradient(160deg, var(--navy-2), var(--navy) 62%);
  color: #fff; border-radius: 0 0 20px 20px;
}
.detail-top .close {
  width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .12);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.detail-top .close svg { width: 17px; height: 17px; }
.detail-top .t { min-width: 0; }
.detail-top .t .ma { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-top .t .sub { font-size: 11.5px; color: rgba(255, 255, 255, .7); }
.detail-body { padding: 14px 14px calc(var(--sab) + 30px); max-width: 680px; margin: 0 auto; }
.hero-price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hero-price .gia { font-size: 26px; font-weight: 900; color: var(--gold-deep); letter-spacing: -.5px; }
.hero-price .gia small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.hero-price .dg { font-size: 14.5px; font-weight: 800; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.kv .item { background: #FAF7F0; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.kv .item.wide { grid-column: 1 / -1; }
.kv .k { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .4px; }
.kv .v { font-size: 14.5px; font-weight: 700; margin-top: 1px; word-break: break-word; }
.kv .v.small { font-weight: 500; font-size: 13px; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.detail-actions .wide { grid-column: 1 / -1; }
.post-preview {
  background: #FBF9F4; border: 1px dashed #DECFA4; border-radius: 13px;
  padding: 12px 14px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.tpl-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.tpl-row .btn { padding: 8px 12px; font-size: 12.5px; }
.tpl-name { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ---------- Bottom sheet ---------- */
.sheet-overlay { background: rgba(12, 20, 37, .5); display: flex; align-items: flex-end; overflow: hidden; }
.sheet-backdrop { position: absolute; inset: 0; }
.sheet {
  position: relative; width: 100%; max-width: 680px; margin: 0 auto;
  background: var(--bg); border-radius: 22px 22px 0 0;
  max-height: 80%; display: flex; flex-direction: column;
  animation: up .22s ease-out;
  padding-bottom: var(--sab);
}
@keyframes up { from { transform: translateY(40%); opacity: .6; } }
.sheet-head {
  padding: 14px 18px 10px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.sheet-head .title { font-size: 15.5px; font-weight: 800; }
.sheet-head .close { width: 30px; height: 30px; border-radius: 9px; background: #EDE8DD; display: flex; align-items: center; justify-content: center; }
.sheet-head .close svg { width: 14px; height: 14px; color: var(--muted); }
.sheet-body { overflow-y: auto; padding: 12px 18px 18px; -webkit-overflow-scrolling: touch; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border-radius: 12px; margin-bottom: 6px;
  background: var(--surface); border: 1.5px solid var(--line); font-size: 14px; font-weight: 600;
}
.opt .n { color: var(--muted); font-size: 12px; font-weight: 600; }
.opt.selected { border-color: var(--gold); background: var(--gold-soft); }
.opt .tick { width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid #CFC7B8; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.opt.selected .tick { background: var(--gold); border-color: var(--gold); color: #241703; }
.opt .tick svg { width: 12px; height: 12px; }
.sheet-foot { display: flex; gap: 9px; padding: 10px 18px 16px; border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }
.range-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.range-presets .opt { margin: 0; justify-content: center; }
.range-inputs { display: flex; align-items: center; gap: 8px; }
.range-inputs input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 12px;
  background: var(--surface); outline: 0; font-size: 16px;
}
.range-inputs input:focus { border-color: var(--gold); }
.range-inputs .sep { color: var(--muted); font-weight: 700; }
.field-lbl { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .6px; margin: 0 2px 8px; }

/* ---------- Sheet Phân khu: cây khu → nhóm → tòa ---------- */
.pk-tools { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; }
.pk-tool-btn {
  font-size: 12.5px; font-weight: 800; color: var(--gold-deep);
  background: var(--gold-soft); border-radius: 10px; padding: 7px 13px;
}
.pk-tool-btn:active { transform: scale(.96); }
.pk-sel { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--gold-deep); }
.pk-zone {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 13px; margin-bottom: 8px; overflow: hidden;
}
.pk-zone.selected { border-color: var(--gold); }
.pk-row {
  display: flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 8px 12px;
}
.pk-row:active { background: #FBF7EC; }
.pk-zone-row { font-size: 14.5px; font-weight: 800; }
.pk-zone.selected > .pk-zone-row { background: var(--gold-soft); }
.pk-group { border-top: 1px dashed var(--line); background: #FBF9F4; font-size: 13.5px; font-weight: 800; }
.pk-group.selected { background: var(--gold-soft); }
.pk-tower { border-top: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.pk-tower.lv1 { padding-left: 43px; }
.pk-tower.lv2 { padding-left: 66px; }
.pk-tower.selected { background: var(--gold-soft); }
.pk-arrow {
  width: 24px; height: 24px; margin-left: -5px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.pk-arrow svg { width: 15px; height: 15px; transition: transform .16s; }
.pk-zone.pk-open > .pk-row .pk-arrow svg { transform: rotate(90deg); }
.pk-arrow-slot { width: 14px; flex: 0 0 auto; }
.pk-check {
  width: 21px; height: 21px; border-radius: 7px; flex: 0 0 auto;
  border: 1.5px solid #CFC7B8; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.pk-check .ck, .pk-check .mi { display: none; line-height: 0; }
.pk-check svg { width: 13px; height: 13px; }
.pk-check.on { background: var(--gold); border-color: var(--gold); color: #241703; }
.pk-check.on .ck { display: block; }
.pk-check.half { border-color: var(--gold); color: var(--gold-deep); }
.pk-check.half .mi { display: block; }
.pk-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-zone-row .pk-name { white-space: normal; line-height: 1.3; } /* tên khu dài thì xuống dòng, không cắt */
.pk-n { font-size: 11.5px; font-weight: 700; color: var(--muted); flex: 0 0 auto; }
.pk-allbtn {
  font-size: 11px; font-weight: 800; color: var(--gold-deep); flex: 0 0 auto;
  background: var(--gold-soft); border-radius: 8px; padding: 5px 9px; white-space: nowrap;
}
.pk-allbtn:active { transform: scale(.95); }

/* ---------- Quản trị ---------- */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.set-row .l { min-width: 0; }
.set-row .l .t { font-size: 14.5px; font-weight: 700; }
.set-row .l .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.switch { position: relative; width: 48px; height: 29px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; z-index: 2; }
.switch .track { position: absolute; inset: 0; background: #D8D2C4; border-radius: 20px; transition: .18s; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: .18s;
}
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(19px); }
.text-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px;
  background: var(--surface); outline: 0; font-size: 16px; color: var(--ink);
}
.text-input:focus { border-color: var(--gold); }
.sel-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px;
  background: var(--surface); font-size: 14px; color: var(--ink); outline: 0; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8175' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.steps { counter-reset: st; margin: 4px 0 0; padding: 0; list-style: none; }
.steps li { counter-increment: st; display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; color: #44403C; }
.steps li::before {
  content: counter(st); flex: 0 0 auto; width: 22px; height: 22px; border-radius: 8px;
  background: var(--gold-soft); color: var(--gold-deep); font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.link { color: var(--gold-deep); font-weight: 700; text-decoration: none; }
.ver { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--sab) + 18px);
  z-index: 90; background: #26201A; color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 13px; box-shadow: 0 6px 22px rgba(0, 0, 0, .3);
  max-width: 86%; text-align: center; animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateX(-50%) scale(.9); opacity: 0; } }

.skeleton { text-align: center; color: var(--muted); padding: 50px 20px; font-size: 14px; }
.skeleton .logo-big {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  background: linear-gradient(150deg, #FFDE8A, #F0B429 55%, #C8860A);
  display: flex; align-items: center; justify-content: center;
  color: #241703; font-weight: 900; font-size: 16px;
  animation: pulse 1.2s infinite;
}

@media (min-width: 480px) {
  .filters { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
