
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --bg: #f1f3f6;
  --card: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --green: #188038;
  --red: #d93025;
  --orange: #e8710a;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
}

#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 50;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
}
#topbar .brand { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topbar .userchip { font-size: 12px; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 99px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }

#content { padding: 64px 12px 80px; max-width: 860px; margin: 0 auto; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; height: 62px; z-index: 50;
  background: var(--card); border-top: 1px solid #e0e0e0;
  display: flex; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
}
#bottomnav button {
  flex: 1; border: 0; background: none; font-size: 19px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
}
#bottomnav button span { font-size: 10.5px; }
#bottomnav button.active { color: var(--primary); font-weight: 600; }

#kh-actionbar {
  position: fixed; bottom: 62px; left: 0; right: 0; z-index: 45;
  background: var(--card); border-top: 1px solid #e0e0e0;
  padding: 8px 12px; display: flex; gap: 8px; flex-wrap: nowrap;
  align-items: center; overflow-x: auto; scrollbar-width: none;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
#kh-actionbar::-webkit-scrollbar { display: none; }
#kh-actionbar.hidden { display: none; }
#kh-actionbar .btn { flex-shrink: 0; }
body:has(#kh-actionbar:not(.hidden)) #content { padding-bottom: 140px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.card.tappable { cursor: pointer; }
.card.tappable:active { background: #f0f4ff; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.statcard { text-align: center; padding: 16px 8px; }
.statcard .num { font-size: 21px; font-weight: 700; }
.statcard .lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }

h2.section { font-size: 15px; margin: 16px 4px 8px; color: var(--muted); font-weight: 600; }

/* Card thống kê thu gọn: slide ngang 1 dòng tiết kiệm màn hình */
.statrow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; -webkit-overflow-scrolling: touch; }
.ministat {
  flex: 0 0 auto; min-width: 104px; background: var(--card); border-radius: 10px;
  padding: 10px 12px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.ministat .num { font-size: 15px; font-weight: 700; white-space: nowrap; }
.ministat .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }

/* Biểu đồ cột so sánh các kỳ (thuần CSS, không thư viện) */
.barchart { display: flex; align-items: flex-end; gap: 6px; height: 150px; overflow-x: auto; padding-top: 4px; }
.barcol {
  flex: 1 0 36px; max-width: 70px; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.barcol .bar { width: 68%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 3px; }
.barcol .barval { font-size: 10px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; }
.barcol .barlbl { font-size: 10px; color: var(--muted); margin-top: 3px; white-space: nowrap; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row .title { font-weight: 600; }
.sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.right { text-align: right; }

.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.badge.green { background: #e6f4ea; color: var(--green); }
.badge.red { background: #fce8e6; color: var(--red); }
.badge.orange { background: #fef0e3; color: var(--orange); }
.badge.blue { background: #e8f0fe; color: var(--primary); }
.badge.gray { background: #eee; color: var(--muted); }

/* Số thứ tự ngoài card ở các trang danh sách (Khách, Đơn, Team...) */
.stt {
  display: inline-block; min-width: 22px; height: 20px; line-height: 20px;
  text-align: center; background: #e8f0fe; color: var(--primary);
  border-radius: 6px; font-size: 11px; font-weight: 700;
  margin-right: 7px; padding: 0 4px; vertical-align: 1px;
}

/* Tóm tắt slot trên cùng hồ sơ khách: mỗi mail 1 dòng với gói hiện tại */
.slotbox {
  background: #f8f9fa; border: 1px solid #f1f3f4; border-radius: 8px;
  padding: 8px 10px; margin: 8px 0 6px;
}
.slotline { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 13px; flex-wrap: wrap; }
.slotline .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.slotline .dot.green { background: var(--green); }
.slotline .dot.blue { background: var(--primary); }
.slotline .dot.orange { background: var(--orange); }
.slotline .dot.red { background: var(--red); }

/* Vùng nguy hiểm cuối trang chi tiết: nút xóa kiểu chìm, tách khỏi nội dung chính */
.dangerzone {
  margin-top: 28px; padding-top: 14px; border-top: 1px dashed #dadce0; text-align: center;
}
.btn.ghost {
  background: transparent; color: var(--muted); border: 1px solid #dadce0;
  font-weight: 500; font-size: 13px; padding: 8px 14px;
}
.btn.ghost:active { background: #fce8e6; color: var(--red); border-color: var(--red); }
/* Nút ẩn theo class (nút xóa 2 bước, nút import chờ đọc file...) */
button.hidden { display: none; }
/* Nút bị khóa (chưa xác nhận xóa...): mờ + không bấm được */
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Dòng team gọn: thông tin dàn NGANG bằng icon, tự xuống dòng khi chật */
.teamrow .trow { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.tinfo {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.tinfo b { color: var(--text); }
.tinfo .tl { font-size: 11.5px; }

/* Hồ sơ khách: khối email xổ xuống (accordion) chứa các gói của riêng mail đó */
details.mailbox {
  background: var(--card); border-radius: var(--radius); margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
details.mailbox summary {
  list-style: none; cursor: pointer; padding: 12px 14px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
details.mailbox summary::-webkit-details-marker { display: none; }
details.mailbox summary .caret { margin-left: auto; color: var(--muted); transition: transform .15s; }
details.mailbox[open] summary .caret { transform: rotate(180deg); }
details.mailbox .mailbody { padding: 0 14px 12px; border-top: 1px solid #f1f3f4; padding-top: 10px; }
/* Select trạng thái gia hạn thu gọn trong khối sub */
.ghsel {
  padding: 7px 9px; border: 1px solid #dadce0; border-radius: 8px;
  font-size: 12.5px; background: #fff; max-width: 100%;
}
/* Dòng chọn đơn trong modal thanh toán gộp CTV */
.payrow {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid #f1f3f4; font-size: 13.5px; cursor: pointer;
}
.payrow input { width: auto; }

.money { font-weight: 700; }
.money.in { color: var(--green); }
.money.out { color: var(--red); }

.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff;
}
.btn:active { background: var(--primary-dark); }
.btn.secondary { background: #e8f0fe; color: var(--primary); }
.btn.danger { background: #fce8e6; color: var(--red); }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn.block { display: block; width: 100%; text-align: center; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.fab {
  position: fixed; right: 16px; bottom: 78px; z-index: 40;
  width: 54px; height: 54px; border-radius: 50%; border: 0;
  background: var(--primary); color: #fff; font-size: 26px;
  box-shadow: 0 3px 10px rgba(26,115,232,.45); cursor: pointer;
}

.searchbar {
  width: 100%; padding: 11px 14px; border: 1px solid #dadce0; border-radius: 10px;
  font-size: 15px; margin-bottom: 10px; background: var(--card);
}
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.chip {
  flex-shrink: 0; border: 1px solid #dadce0; background: var(--card); border-radius: 99px;
  padding: 6px 13px; font-size: 13px; cursor: pointer; color: var(--text);
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Modal */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
#modal-backdrop.hidden { display: none; }
#modal {
  background: var(--card); width: 100%; max-width: 640px; max-height: 88vh;
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column;
}
@media (min-width: 700px) {
  #modal-backdrop { align-items: center; }
  #modal { border-radius: 16px; }
}
#modal-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid #eee; font-weight: 700; font-size: 16px;
}
#modal-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nút hành động chính nhân bản lên tiêu đề modal */
#modal-headbtn { flex-shrink: 0; white-space: nowrap; }
#modal-headbtn.hidden { display: none; }
#modal-close { border: 0; background: #f1f3f6; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; }
#modal-body { padding: 16px; overflow-y: auto; }

/* Forms */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #dadce0; border-radius: 8px;
  font-size: 15px; background: #fff; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Ô liên hệ nhiều giá trị (1 hồ sơ nhiều email/sđt/zalo/fb...) */
.field.multi .mf-inp { margin-bottom: 6px; }
.field.multi .mf-inp:last-child { margin-bottom: 0; }
.mf-add {
  border: 1px solid #dadce0; background: #fff; color: var(--primary);
  border-radius: 6px; width: 22px; height: 22px; line-height: 1; font-size: 14px;
  cursor: pointer; vertical-align: middle; margin-left: 4px;
}
.hint { background: #e8f0fe; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--primary-dark); margin-bottom: 12px; }

/* Tables */
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--card); border-radius: var(--radius); }
table.data th { text-align: left; padding: 9px 10px; background: #f8f9fa; color: var(--muted); font-size: 12px; white-space: nowrap; }
table.data td { padding: 9px 10px; border-top: 1px solid #f1f3f4; white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; }

/* ===== Chống tràn chữ làm vỡ layout (email dài, log JSON, lệnh code, lỗi sync...) ===== */
.card, .hint, .sub, #modal-body, #toast { overflow-wrap: anywhere; }
code { word-break: break-all; white-space: pre-wrap; }
/* Flex con phải được phép co lại thì chữ mới gói được (mặc định min-width:auto gây tràn) */
.row > div { min-width: 0; }
.row .title { overflow-wrap: anywhere; }
.slotline b { word-break: break-all; }
details.mailbox summary .title { word-break: break-all; min-width: 0; }
.tinfo { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.payrow span { min-width: 0; overflow-wrap: anywhere; }
/* Log dài (nhật ký trạng thái, log nhắn): gói chữ + THU GỌN 3 dòng, bấm để xem đầy đủ */
.logline { word-break: break-word; overflow-wrap: anywhere; }
.logclamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; cursor: pointer;
}
.logclamp.open { display: block; -webkit-line-clamp: unset; }

/* ===== Subscription timeline (heatmap kiểu GitHub) ===== */
.sub-timeline { background:#f8f9fa; border:1px solid #e8eaed; border-radius:10px; padding:10px 12px; margin:10px 0 4px; overflow-x:auto; }
.sub-timeline .tl-header { display:flex; gap:0; margin-bottom:3px; padding-left:30px; }
.sub-timeline .tl-header span { width:22px; text-align:center; font-size:9px; color:#888; flex-shrink:0; }
.sub-timeline .tl-row { display:flex; align-items:center; gap:0; margin-bottom:2px; }
.sub-timeline .tl-year { width:30px; font-size:10px; color:#888; flex-shrink:0; }
.sub-timeline .tl-cell {
  width:20px; height:17px; border-radius:3px; margin:0 1px; flex-shrink:0;
  background:#f1f3f4; border:1px solid #e0e0e0; cursor:default; position:relative;
}
.sub-timeline .tl-cell.active { background:#34a853; border-color:#2d8a47; }
.sub-timeline .tl-cell.inactive { background:#fbbc04; border-color:#d4a000; }
.sub-timeline .tl-cell.paused { background:#ff9800; border-color:#e68900; }
.sub-timeline .tl-cell.future { background:#b7dfbe; border-color:#88c492; }
.sub-timeline .tl-cell.today { box-shadow:0 0 0 2px #1a73e8; z-index:1; }
.sub-timeline .tl-cell.start-dot { font-weight:700; }
.sub-timeline .tl-legend { display:flex; gap:10px; margin-top:6px; flex-wrap:wrap; }
.sub-timeline .tl-legend span { display:flex; align-items:center; gap:4px; font-size:10px; color:#666; }
.sub-timeline .tl-legend .dot { width:10px; height:10px; border-radius:2px; flex-shrink:0; }

/* Ghi chú hồ sơ: chế độ xem / sửa */
.note-view {
  background:#fffde7; border:1px solid #ffe082; border-radius:8px;
  padding:10px 12px; white-space:pre-wrap; font-size:13px; line-height:1.6;
  min-height:36px; color:#333; cursor:default; position:relative;
}
.note-view.empty { color:#999; font-style:italic; }
.note-edit-btn {
  position:absolute; top:6px; right:8px; background:transparent; border:none;
  cursor:pointer; color:#888; padding:2px; line-height:1; display:flex; align-items:center;
}
.note-edit-btn:hover { color:#1a73e8; }
.note-edit-area { display:none; }
.note-edit-area.active { display:block; }

/* Team nổi bật trong hồ sơ khách */
.team-highlight {
  background:linear-gradient(135deg,#e8f0fe 0%,#f0f8ff 100%);
  border:1px solid #c5d8ff; border-radius:10px; padding:10px 14px; margin:8px 0 4px;
  display:flex; align-items:flex-start; gap:8px; flex-wrap:wrap;
}
.team-highlight .th-name { font-weight:700; color:#1a56db; font-size:14px; }
.team-highlight .th-renew { font-weight:600; color:#e65100; font-size:12px; }

/* Nút nhắn gia hạn nhanh trong hồ sơ: hàng dọc icon + text */
.nhac-row { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0 4px; }
.nhac-row .nhac-btn { display:flex; align-items:center; gap:4px; }

/* ===== Responsive ===== */
/* Màn hình rất hẹp: form 1 cột, chữ nhỏ hơn chút */
@media (max-width: 380px) {
  .fieldrow { grid-template-columns: 1fr; }
  body { font-size: 14px; }
  .btn { padding: 10px 12px; }
}
/* Tablet/desktop: nội dung rộng hơn, dashboard 4 cột, modal nổi giữa */
@media (min-width: 900px) {
  #content { max-width: 1100px; }
  .grid2 { grid-template-columns: repeat(4, 1fr); }
  #bottomnav { max-width: 1100px; left: 50%; transform: translateX(-50%); border-radius: 14px 14px 0 0; }
}
/* Vuốt mượt cho bảng + vùng chip trên mobile */
.tablewrap, .chips { -webkit-overflow-scrolling: touch; }
/* Vùng bấm tối thiểu 40px cho ngón tay */
.chip { min-height: 36px; }
.btn.small { min-height: 34px; }
input, select, textarea, button { touch-action: manipulation; }

#toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #323232; color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 14px; max-width: 90%; text-align: center; transition: opacity .25s;
}
#toast.hidden { opacity: 0; pointer-events: none; }
.menu-list .card { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.menu-list .card .ico { font-size: 22px; }
.empty { text-align: center; color: var(--muted); padding: 28px 0; font-size: 14px; }
a { color: var(--primary); }


/* ===== Public landing page (tech glassmorphism) ===== */
#public-home {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  /* subtle grid overlay */
  background-image:
    linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.03) 39px, rgba(255,255,255,0.03) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.03) 39px, rgba(255,255,255,0.03) 40px);
  overflow-y: auto;
}
#public-home.hidden { display: none; }

.pub-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  color: #fff;
}

.pub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.pub-brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #5b6cf8 0%, #8b5cf6 100%);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.pub-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.pub-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.3;
}
.pub-subtitle {
  font-size: 13.5px;
  color: rgba(255,255,255,0.65);
  margin: 0 0 22px;
  line-height: 1.5;
}

.pub-field { margin-bottom: 14px; }
.pub-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pub-field input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 10px;
  font-size: 15px;
  color: #fff;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.pub-field input::placeholder { color: rgba(255,255,255,0.35); }
.pub-field input:focus {
  outline: none;
  border-color: rgba(91,108,248,0.8);
  background: rgba(255,255,255,0.14);
}

.pub-err {
  font-size: 13px;
  color: #ff7b7b;
  min-height: 18px;
  margin-bottom: 8px;
}

.pub-btn {
  display: block; width: 100%; border: 0;
  padding: 13px 16px;
  background: #5b6cf8;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.1s;
}
.pub-btn:active { background: #4757e0; transform: scale(0.99); }
.pub-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.pub-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.10);
  text-align: center;
}
.pub-lang-switcher {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 12px;
}
.pub-lang-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 99px;
  color: rgba(255,255,255,0.55);
  font-size: 11.5px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pub-lang-btn:hover {
  background: rgba(255,255,255,0.13);
  color: rgba(255,255,255,0.85);
}
.pub-lang-btn.active {
  background: rgba(91,108,248,0.35);
  border-color: rgba(91,108,248,0.7);
  color: #fff;
  font-weight: 600;
}
.pub-admin-link {
  font-size: 12.5px;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.15s;
}
.pub-admin-link:hover { color: rgba(255,255,255,0.65); }

@media (max-width: 480px) {
  .pub-card { padding: 28px 20px 22px; }
  .pub-title { font-size: 19px; }
}

/* ===== Màn hình đăng nhập (Cloudflare) ===== */
#login {
  position: fixed; inset: 0; background: var(--bg); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#login.hidden, #app-ui.hidden { display: none; }
.login-box {
  background: var(--card); border-radius: 16px; padding: 28px; width: 100%;
  max-width: 400px; box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
.login-box h2 { margin: 0 0 4px; }
.login-box .sub { margin-bottom: 16px; }
.lg-err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* Nav ngang full menu: kéo qua lại, ẩn scrollbar */
#bottomnav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
#bottomnav::-webkit-scrollbar { display: none; }
#bottomnav button { flex: 0 0 auto; min-width: 62px; padding: 0 10px; }

/* Số thứ tự danh sách: chip nhỏ trước tên, đánh theo thứ tự đang lọc/sort */
.stt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 5px; margin-right: 7px;
  background: #eef3fe; color: var(--primary); border-radius: 6px;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}
