/* Vibary UI — bang_khong_cat.css
   Chống cắt chữ câm cho bảng trong .tq (dashboard).
   Mobile ≤640 giữ nguyên dạng thẻ hiện có. */

@media (min-width: 641px) {
  /* Ô bảng: một dòng + dấu "…" */
  .tq :is(.khoi, .khoi-bang) table.bang th,
  .tq :is(.khoi, .khoi-bang) table.bang td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Cột mã: rộng theo nội dung, không gãy chữ */
  .tq :is(.khoi, .khoi-bang) table.bang th.o-ma,
  .tq :is(.khoi, .khoi-bang) table.bang td.o-ma {
    width: 1%;
    min-width: max-content; /* giữ mã không bị cắt khi table-layout fixed */
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  /* Cột dài: xuống dòng theo từ */
  .tq :is(.khoi, .khoi-bang) table.bang th.o-dai,
  .tq :is(.khoi, .khoi-bang) table.bang td.o-dai {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    text-overflow: clip;
  }

  /* Số: canh phải, chữ số đều */
  .tq :is(.khoi, .khoi-bang) table.bang th.so,
  .tq :is(.khoi, .khoi-bang) table.bang td.so {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* Tiêu đề: một dòng + "…" */
  .tq :is(.khoi, .khoi-bang) table.bang th.o-tieu-de,
  .tq :is(.khoi, .khoi-bang) table.bang td.o-tieu-de {
    display: table-cell;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 641px) and (max-width: 1279px) {
  /* Khối chứa bảng cuộn ngang, không cắt cột */
  .tq .khoi-bang,
  .tq .khoi:has(table.bang) {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--vien) transparent;
  }

  .tq .khoi-bang .khoi-than,
  .tq .khoi:has(table.bang) .khoi-than {
    overflow: visible;
  }

  /* Scrollbar mảnh 6px */
  .tq .khoi-bang::-webkit-scrollbar,
  .tq .khoi:has(table.bang)::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .tq .khoi-bang::-webkit-scrollbar-thumb,
  .tq .khoi:has(table.bang)::-webkit-scrollbar-thumb {
    background: var(--vien);
    border-radius: var(--bo-tron);
  }

  .tq .khoi-bang::-webkit-scrollbar-track,
  .tq .khoi:has(table.bang)::-webkit-scrollbar-track {
    background: transparent;
  }

  /* Ẩn cột phụ 641–1279 */
  .tq :is(.khoi, .khoi-bang) table.bang .o-phu {
    display: none;
  }
}

@media (min-width: 1280px) {
  /* Bảng cố định bề rộng, chia cột theo tỷ lệ */
  .tq :is(.khoi, .khoi-bang) table.bang {
    width: 100%;
    table-layout: fixed;
  }

  /* Hiện lại cột phụ từ 1280 */
  .tq .khoi-bang table.bang .o-phu,
  .tq .khoi:has(table.bang) table.bang .o-phu {
    display: table-cell;
  }
}
