@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Barlow+Condensed:wght@600;700;800&display=swap");

:root {
  --navy: #0d2f5e;
  --navy-dark: #081d3d;
  --gold: #e8a33d;
  --gold-light: #fbe3b8;
  --bg: #f2f4f8;
  --paper: #ffffff;
  --ink: #182338;
  --ink-soft: #5b6779;
  --line: #dfe4ec;
  --ok: #1f8a52;
  --warn: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

h1, h2, h3 { font-family: "Be Vietnam Pro", sans-serif; margin: 0; }

.numeric { font-family: "Barlow Condensed", sans-serif; font-weight: 800; letter-spacing: 1px; }

/* ---------- Thanh trên cùng dùng chung ---------- */
.topbar {
  background: linear-gradient(120deg, var(--navy-dark), var(--navy));
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.topbar .title { font-weight: 800; font-size: 1.25rem; letter-spacing: .5px; }
.topbar .title small { display:block; font-weight:500; font-size:.7rem; opacity:.75; letter-spacing:2px; }
.topbar .actions { display: flex; gap: 10px; align-items: center; }
.topbar .who { font-size:.85rem; opacity:.85; }

/* ---------- Trang chủ (dạng thẻ, lưới tự dàn) ---------- */
.home-wrap {
  min-height: 100vh; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at top, var(--navy), var(--navy-dark));
  padding: 32px 16px;
}
.home-card {
  width: 100%; max-width: 620px;
  background: var(--paper); border-radius: 22px;
  padding: 40px 32px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  border-top: 4px solid var(--gold);
}
.home-card .brand { text-align:center; margin-bottom: 30px; }
.home-card .brand .badge {
  width: 64px; height:64px; border-radius: 50%;
  background: var(--navy); border: 3px solid var(--gold);
  display:flex; align-items:center; justify-content:center; margin: 0 auto 14px;
  font-size:1.8rem;
}
.home-card .brand .org-name {
  font-weight:700; letter-spacing: 1.5px; font-size:.8rem; color: var(--gold);
  margin-bottom: 8px; text-transform: uppercase;
}
.home-card .brand h1 { font-size: 1.55rem; line-height:1.3; color: var(--navy-dark); }
.home-card .home-subtitle {
  margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: .95rem; font-weight: 600;
}

/* Lưới tự dàn: tự động xếp thêm cột khi rộng chỗ, thêm thẻ mới sau này không vỡ bố cục */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.home-tile {
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px;
  background: #f7f2e7; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 16px; text-decoration:none; cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-tile:hover, .home-tile:active { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(13,47,94,.15); }
.home-tile-icon { font-size: 2rem; line-height:1; }
.home-tile-title { font-weight:800; color: var(--navy-dark); font-size: 1.05rem; }
.home-tile-desc { color: var(--ink-soft); font-size: .85rem; line-height:1.4; }

.home-tile-full { grid-column: 1 / -1; }
.home-tile-primary {
  flex-direction:row; text-align:left; justify-content:flex-start;
  background: linear-gradient(120deg, var(--navy-dark), var(--navy));
  border: none; padding: 22px 24px;
}
.home-tile-primary .home-tile-icon {
  flex-shrink:0; width:52px; height:52px; border-radius:14px;
  background: rgba(255,255,255,.12); display:flex; align-items:center; justify-content:center;
}
.home-tile-primary .home-tile-title { color:#fff; }
.home-tile-primary .home-tile-desc { color: rgba(255,255,255,.75); }
.home-tile-primary:hover, .home-tile-primary:active { box-shadow: 0 10px 24px rgba(0,0,0,.35); }

@media (max-width: 480px) {
  .home-tile-primary { flex-direction:column; text-align:center; }
}

/* ---------- Nút bấm ---------- */
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--gold); color: var(--navy-dark); }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(232,163,61,.5); }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-danger { background: var(--warn); color: #fff; }
.btn-ghost { background: var(--line); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 18px 26px; font-size: 1.1rem; border-radius: 14px; }
.btn-block { width: 100%; }

/* ---------- Form / thẻ ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(20,30,50,.05);
}
.field { margin-bottom: 16px; }
.field label { display:block; font-weight:600; font-size:.85rem; margin-bottom:6px; color: var(--ink-soft); }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 1rem;
  font-family: inherit;
  background: #fbfcfe;
}
.field input:focus, .field select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, var(--navy), var(--navy-dark));
  padding: 20px;
}
.login-card { width: 100%; max-width: 380px; }
.login-card .brand { text-align:center; color:#fff; margin-bottom: 22px; }
.login-card .brand .badge {
  width: 56px; height:56px; border-radius: 50%; background: var(--gold);
  display:flex; align-items:center; justify-content:center; margin: 0 auto 12px;
  font-weight:800; color: var(--navy-dark); font-size:1.7rem;
}
.login-card .brand .org-name {
  font-family: "Times New Roman", Times, serif;
  font-weight:700; letter-spacing: .5px; font-size:1.1rem; color: #d32f2f;
  margin-bottom: 8px; text-transform: uppercase; line-height:1.3;
}
.login-card .brand h1 { font-size: 1.05rem; line-height:1.4; }

/* ---------- Toast ---------- */
.htxh-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: var(--navy-dark); color:#fff; padding: 12px 22px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 999;
  font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.htxh-toast.show { opacity: 1; transform: translate(-50%, 0); }
.htxh-toast.error { background: var(--warn); }

/* ---------- Trang hiển thị (TV) ---------- */
html, body { height: 100%; }
.hienthi-wrap { height: 100vh; height: 100dvh; display:flex; flex-direction:column; background: var(--navy-dark); overflow:hidden; }
.hienthi-header {
  text-align:center; padding: 2vh 10px 1.5vh; color:#fff; flex-shrink:0;
  background: linear-gradient(180deg, var(--navy), var(--navy-dark));
  border-bottom: 3px solid var(--gold);
}
.hienthi-header h1 {
  font-size: clamp(1.2rem, 3.6vw, 3.2rem);
  letter-spacing: 1px;
  white-space: nowrap;      /* luôn 1 dòng, không tự xuống dòng */
  overflow: hidden;         /* phòng khi JS co chữ chưa kịp chạy */
  display: inline-block;
  max-width: 100%;
}
.hienthi-grid {
  flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 1.6vh 1.4vw; padding: 1.8vh 1.4vw; min-height: 0;
}
.counter-box {
  background: var(--paper); border-radius: 18px; padding: 1.6vh 1vw;
  display:flex; flex-direction:column; align-items:center; justify-content:space-between;
  text-align:center;
  border: 2px solid var(--line); position: relative; overflow:hidden;
  /* Biến ô quầy thành 1 "container" để chữ bên trong co giãn theo đúng
     kích thước THẬT SỰ của ô này (container query units: cqh/cqi), thay vì
     chỉ theo bề rộng toàn màn hình (vw) như trước. Cách cũ khiến màn nhỏ/dọc
     (điện thoại: lưới co thành 1 cột x 6 hàng, mỗi ô rất thấp) bị tràn/cắt
     chữ vì cỡ chữ không biết ô đang thấp đi. */
  container-type: size;
  container-name: counterbox;
}
.counter-box.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%,100% { box-shadow:none; } 30% { box-shadow: 0 0 0 8px var(--gold-light); } }
.counter-box .cb-name {
  font-weight: 800; color: var(--navy); text-transform: uppercase;
  letter-spacing: .5px; max-width: 100%;
  overflow-wrap: break-word;
  /* clamp(...vw...) giữ lại làm phương án dự phòng cho trình duyệt rất cũ
     không hiểu container query units. */
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}
.counter-box .cb-field {
  color: var(--ink-soft); font-weight:600;
  line-height:1.3; margin-top: .6vh; max-width: 100%;
  overflow-wrap: break-word;
  font-size: clamp(1rem, 1.9vw, 1.45rem);
}
.counter-box .cb-number {
  color: var(--navy-dark); text-align:center; line-height:1;
  margin-top: auto;
  font-size: clamp(4.2rem, 9vw, 7.5rem);
}
.counter-box .cb-transfer {
  color: #fff; font-weight:800; text-align:center;
  background: var(--warn, #C0392B); border-radius: 20px;
  padding: 2px 12px; margin-top: .4vh;
  min-height: 1.2em; letter-spacing: .2px; max-width: 96%;
  overflow-wrap: break-word;
  font-size: clamp(.8rem, 1.6vw, 1.05rem);
}
.counter-box .cb-transfer:empty { padding: 0; min-height: 0; background: transparent; }
.counter-box .cb-phone {
  color: var(--ink-soft); font-weight:700; text-align:center;
  min-height: 1.4em; letter-spacing: .3px;
  font-size: clamp(.85rem, 1.7vw, 1.15rem);
}
.counter-box .cb-closed {
  color: var(--warn); font-weight:800; text-align:center;
  line-height:1.3; margin-top: auto; max-width: 100%;
  overflow-wrap: break-word;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
}

/* ---------- Cỡ chữ theo kích thước THẬT của ô quầy (container query) ----------
   Ghi đè lên các clamp(...vw...) ở trên, chỉ áp dụng khi trình duyệt hỗ trợ
   container query (Chrome 105+, Edge 105+, Safari 16+, Firefox 110+ — mọi
   trình duyệt dùng cho máy hiển thị/điện thoại hiện nay đều đáp ứng). Dùng
   min(cqh, cqi) để chữ vừa không tràn theo CHIỀU CAO (ô thấp, ví dụ màn điện
   thoại dọc lưới co thành 1 cột x 6 hàng) vừa không tràn theo CHIỀU RỘNG (tên
   quầy dài trên ô hẹp). Nếu trình duyệt không hỗ trợ container query, cả khối
   @container này bị bỏ qua và các clamp(...vw...) phía trên vẫn còn nguyên. */
@container counterbox (min-width: 1px) {
  .counter-box .cb-name {
    font-size: clamp(0.85rem, min(11cqh, 11cqi), 2.6rem);
  }
  .counter-box .cb-field {
    font-size: clamp(0.65rem, min(6.5cqh, 6.5cqi), 1.45rem);
  }
  .counter-box .cb-number {
    font-size: clamp(1.6rem, min(30cqh, 26cqi), 7.5rem);
  }
  .counter-box .cb-transfer {
    font-size: clamp(0.55rem, min(4.2cqh, 4.2cqi), 1.05rem);
  }
  .counter-box .cb-phone {
    font-size: clamp(0.55rem, min(4.6cqh, 4.6cqi), 1.15rem);
  }
  .counter-box .cb-closed {
    font-size: clamp(0.8rem, min(9cqh, 9cqi), 2rem);
  }
}
/* ---------- Trang Kiosk (tự co giãn lấp đầy màn hình, tối ưu cho màn hình dọc) ---------- */
html, body { height: 100%; }
.kiosk-wrap {
  height: 100vh; height: 100dvh;
  background: linear-gradient(180deg, var(--navy), var(--navy-dark));
  display:flex; flex-direction:column;
  padding: 2.5vh 2.5vw 12vh; /* chừa khoảng trống dưới cùng cho banner hướng dẫn cố định */
  box-sizing: border-box;
  overflow: hidden;
}
.kiosk-title { color:#fff; text-align:center; font-size: clamp(1.1rem, 3.4vh, 2.1rem); line-height:1.25; flex-shrink:0; }
.kiosk-sub { color: var(--gold-light); text-align:center; margin-top: .6vh; font-size: clamp(.85rem, 1.9vh, 1.15rem); flex-shrink:0; }

/* Mặc định (màn hình dọc / hẹp): xếp thành danh sách dọc, mỗi quầy chia đều chiều cao còn lại */
.kiosk-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
  margin-top: 2vh;
  min-height: 0;
}
.kiosk-btn {
  flex: 1;
  min-height: 0;
  background: var(--paper); border-radius: 16px; border: none;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; cursor:pointer; box-shadow: 0 6px 18px rgba(0,0,0,.2);
  transition: transform .12s;
  padding: 1vh 3vw;
}
.kiosk-btn:active { transform: scale(.97); }
.kiosk-btn .kb-name {
  font-weight:800; color: var(--navy-dark);
  font-size: clamp(1.1rem, 3.4vh, 2rem);
  text-transform: uppercase; letter-spacing: .5px;
}
.kiosk-btn .kb-field {
  color: var(--ink-soft); font-weight:600;
  font-size: clamp(.9rem, 2.1vh, 1.3rem);
  margin-top: .8vh; line-height:1.3;
}
.kiosk-btn.kiosk-btn-full {
  background: #E7E7E7;
  cursor: not-allowed;
  box-shadow: none;
  opacity: .75;
}
.kiosk-btn.kiosk-btn-full .kb-name,
.kiosk-btn.kiosk-btn-full .kb-field { color: var(--ink-soft); }
.kiosk-btn .kb-full {
  margin-top: .8vh;
  font-weight: 800;
  color: var(--warn);
  font-size: clamp(.85rem, 1.9vh, 1.1rem);
}

/* Màn hình ngang / rộng (ví dụ máy tính bàn): chuyển sang lưới 2 cột cho gọn */
@media (min-aspect-ratio: 1/1) and (min-width: 720px) {
  .kiosk-wrap { align-items:center; }
  .kiosk-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    width:100%; max-width: 900px;
    margin: 2vh auto 0;
  }
}
/* ---------- Banner hướng dẫn chạm quầy (Kiosk) ---------- */
.kiosk-instruction {
  position: fixed; left: 50%; bottom: 2vh; transform: translateX(-50%);
  width: min(94vw, 680px);
  min-height: 7vh;
  background: rgba(13, 47, 94, .95);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 1.2vh 4vw;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 50;
}
.kiosk-instruction .ki-icon {
  font-size: clamp(1.6rem, 2.8vh, 2.1rem); flex-shrink: 0;
}
.kiosk-instruction .ki-text {
  color: #fff; font-size: clamp(.95rem, 1.8vh, 1.25rem); font-weight: 700; line-height: 1.35;
  text-align: center;
}

/* ---------- Ngoài khung giờ lấy số (Kiosk) ---------- */
.kiosk-closed {
  flex: 1;
  display: none; /* JS chuyển sang "flex" khi ngoài giờ */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vh;
  margin-top: 2vh;
  min-height: 0;
  text-align: center;
}
.kiosk-closed .kc-icon { font-size: clamp(3rem, 9vh, 5.5rem); }
.kiosk-closed .kc-text {
  color: #fff; font-weight: 700;
  font-size: clamp(1.1rem, 3vh, 1.8rem); line-height: 1.4;
  background: rgba(13,47,94,.6);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 2.4vh 4vw;
  max-width: 640px;
}

/* Phiếu in 80mm (máy in nhiệt cuộn giấy K80) */
#printArea { display:none; }
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: fixed; top:0; left:0; display:block; }
  @page { size: 80mm auto; margin: 3mm; }
}
.ticket-slip { width: 72mm; font-family: "Be Vietnam Pro", sans-serif; text-align:center; }
.ticket-slip h3 { font-size: 13px; line-height:1.3; }
.ticket-slip .big { font-size: 40px; font-weight: 800; margin: 6px 0; }
.ticket-slip .row { font-size: 13px; margin: 2px 0; }
.ticket-slip hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }

/* ---------- Trang quầy cán bộ ---------- */
.quay-wrap { max-width: 640px; margin: 24px auto; padding: 0 16px 60px; }
.quay-current { text-align:center; padding: 30px 16px; }
.quay-current .label { color: var(--ink-soft); font-weight:600; }
.quay-current .number { font-size: 5rem; color: var(--navy); line-height:1; margin: 10px 0; }
.quay-actions { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.quay-info { margin-top: 10px; font-size:.95rem; color: var(--ink-soft); }
.quay-transfer { text-align:left; }
.quay-transfer-row { display:flex; gap:10px; margin-top:8px; }
.quay-transfer-row select {
  flex:1; padding:10px 12px; border-radius:8px; border:1px solid var(--line);
  font-size:.95rem; background:#fff;
}
.quay-transfer-row .btn { flex:0 0 auto; white-space:nowrap; }
/* .btn-outline mặc định được thiết kế để đặt trên nền tối (topbar màu navy -
   viền/chữ trắng, xem nút "Đăng xuất"). Nút "Chuyển quầy" lại nằm trong
   .quay-current, một .card nền sáng (var(--paper)), nên viền/chữ trắng gần
   như vô hình trên nền sáng (dẫn tới hiện tượng: bấm vẫn chạy nhưng không
   thấy nút). Ghi đè riêng cho ngữ cảnh nền sáng này để chữ/viền hiện rõ mà
   không ảnh hưởng tới .btn-outline dùng ở topbar. */
.quay-transfer-row .btn-outline {
  background: transparent;
  border: 1px solid var(--navy-dark, #0b2545);
  color: var(--navy-dark, #0b2545);
}
.quay-transfer-row .btn-outline:hover { background: rgba(11,37,69,.08); }
.waiting-list { margin-top: 22px; }
.waiting-item { display:flex; justify-content:space-between; padding: 10px 14px; border-bottom:1px solid var(--line); }
.pill { display:inline-block; padding: 2px 10px; border-radius: 20px; font-size:.75rem; font-weight:700; }
.pill-kiosk { background:#e6f0ff; color:#1d4fa3; }
.pill-mobile { background:#eaf7ee; color: var(--ok); }
.pill-transfer { background:#fdeaea; color: var(--warn); }

/* ---------- Trang admin ---------- */
.admin-wrap { max-width: 1080px; margin: 24px auto; padding: 0 16px 60px; }
.tabs { display:flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn { background: var(--paper); border:1px solid var(--line); border-radius: 10px; padding: 10px 16px; cursor:pointer; font-weight:700; color: var(--ink-soft); }
.tab-btn.active { background: var(--navy); color:#fff; border-color: var(--navy); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
table { width:100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align:left; padding: 10px 12px; border-bottom:1px solid var(--line); font-size:.92rem; }
th { color: var(--ink-soft); font-size:.78rem; text-transform: uppercase; letter-spacing:.5px; }
.stat-row { display:flex; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.stat-card { flex:1; min-width: 140px; background: var(--paper); border:1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat-card .num { font-size: 1.8rem; font-weight:800; color: var(--navy); }
.stat-card .lbl { font-size:.8rem; color: var(--ink-soft); font-weight:600; }
/* Thẻ thống kê có thể bấm để xem danh sách chi tiết (Số TT, SĐT...) */
.stat-card.clickable { cursor: pointer; transition: box-shadow .15s, transform .1s, border-color .15s; }
.stat-card.clickable:hover { box-shadow: 0 4px 14px rgba(13,47,94,.18); border-color: var(--navy); transform: translateY(-1px); }
.stat-card.clickable.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-light) inset; }
.stat-card .hint { font-size:.68rem; color: #9a6a10; font-weight:600; margin-top:2px; }
.report-toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:10px; }
.detail-panel { margin-top: 18px; border-top: 2px dashed var(--line); padding-top: 14px; }
.detail-panel .detail-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.detail-panel .detail-title { font-weight:800; color: var(--navy); }
.detail-panel table { font-size:.86rem; }
.list-row { display:flex; align-items:center; justify-content:space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.small-note { font-size: .8rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Trang mobile (dân) ---------- */
.mobile-wrap { min-height: 100vh; background: var(--bg); display:flex; align-items:flex-start; justify-content:center; padding: 30px 16px 70px; }
.mobile-card { width:100%; max-width: 420px; }
.mobile-result { text-align:center; }
.mobile-result .number { font-size: 4rem; color: var(--navy); margin: 10px 0; }

/* Ngoài khung giờ lấy số */
.mobile-closed { display: none; text-align: center; padding: 10px 4px 6px; }
.mobile-closed .mc-icon { font-size: 2.4rem; margin-bottom: 10px; }
.mobile-closed .mc-text { font-weight: 700; color: var(--warn); font-size: 1.05rem; line-height: 1.5; }

@media (max-width: 720px) {
  /* Bản gốc ép 6 quầy vào ĐÚNG 1 màn hình (1 cột x 6 hàng, grid-template-rows:
     repeat(6,1fr) bên trong .hienthi-wrap có height:100vh/100dvh + overflow:
     hidden). Trên nhiều điện thoại, chiều cao khả dụng thực tế (sau khi trừ
     thanh địa chỉ trình duyệt, hoặc trình duyệt trong app Zalo/Facebook không
     hỗ trợ 100dvh) NHỎ HƠN 6 hàng cần có để chữ số không bị vỡ/cắt — kết quả
     là các ô quầy bị co quá thấp, số "đang xử lý" hiển thị không đầy đủ (bị
     .counter-box { overflow:hidden } cắt bớt) mà không cách nào cuộn xem tiếp
     vì toàn bộ .hienthi-wrap đang overflow:hidden.
     Sửa: đặt chiều cao TỐI THIỂU an toàn cho mỗi ô (đủ để số + tên quầy không
     vỡ chữ) bằng grid-auto-rows, và cho phép .hienthi-grid tự cuộn dọc riêng
     khi 6 ô cộng lại cao hơn màn hình — nhờ vậy số đang xử lý luôn hiển thị
     đầy đủ, chỉ cần cuộn thêm thay vì bị cắt mất. */
  .hienthi-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: minmax(150px, 1fr);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .quay-actions { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
