.table-wrap { overflow: auto; border: 1px solid rgba(148,163,184,.14); border-radius: 16px; max-height: calc(100vh - 315px); min-height: 390px; background: rgba(7,11,22,.72); box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.table-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: #334155; border-radius: 999px; border: 2px solid #0b1020; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; table-layout: auto; font-size: 12px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid rgba(36,48,68,.8); vertical-align: middle; line-height: 1.25; }
th { position: sticky; top: 0; background: rgba(17,24,39,.98); color: #aab6c8; font-weight: 750; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); text-transform: uppercase; letter-spacing: .035em; font-size: 10.5px; }
.th-content { display: grid; gap: 5px; min-width: 96px; }
.th-sort { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; padding: 0; background: transparent; border: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.th-sort:hover { transform: none; background: transparent; }
.column-filter { width: 100%; min-width: 84px; padding: 4px 6px; border-radius: 8px; text-transform: none; letter-spacing: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(96,165,250,.08); }
tbody tr.selected td { background: rgba(59,130,246,.16); }
.table-wrap tbody td {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.select-col { width: 34px; text-align: center; position: sticky; left: 0; z-index: 3; background: rgba(12,19,36,.98); }
.empty-cell { text-align: center; color: var(--muted); padding: 28px 12px; }
.ban-reason { font-size: 11px; color: var(--muted); white-space: normal; max-width: 220px; margin-top: 3px; line-height: 1.35; }
.inv-details { font-size: 11px; color: var(--muted); white-space: normal; min-width: 220px; max-width: 360px; line-height: 1.45; }
.inv-details b { color: var(--txt); font-weight: 600; }
.account-cell, .item-cell { display: flex; align-items: center; gap: 9px; }
.item-cell img { flex: 0 0 auto; border-radius: 8px; background: rgba(255,255,255,.04); }
.item-cell span { white-space: normal; min-width: 220px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.b-live, .b-online, .b-ok { background: rgba(34,197,94,.16); color: var(--ok); }
.b-die, .b-error, .b-vac, .b-tradeban { background: rgba(239,68,68,.16); color: var(--err); }
.b-unknown, .b-offline, .b-limited { background: rgba(148,163,184,.14); color: var(--muted); }
.b-probation, .b-notrade, .b-expired, .b-missing { background: rgba(245,158,11,.16); color: var(--warn); }
.badge + .badge { margin-left: 4px; }
.cell-actions { display: flex; gap: 6px; align-items: center; }
.cell-actions button { padding: 5px 8px; font-size: 11px; border-radius: 8px; }
.mono { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 11px; color: #a8b3c7; }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); box-shadow: 0 0 0 2px rgba(255,255,255,.04); }
.value-pill { display: inline-flex; align-items: center; border: 1px solid #4a5456; background: #2d3637; color: var(--txt); border-radius: 2px; padding: 3px 8px; font-weight: 700; }
.editable-cell { cursor: text; border-bottom: 1px dashed #5f7378; }

.table-wrap { border-color: #4b5557; border-radius: 2px; min-height: 430px; max-height: calc(100vh - 250px); background: #202627; }
.table-wrap.compact { min-height: 150px; max-height: 260px; }
table { font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; min-width: 100%; }
th, td { padding: 3px 10px; height: 26px; border-right: 1px solid #3f4a4c; border-bottom: 1px solid #4a5557; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
th:last-child, td:last-child { border-right: 0; }
thead th { background: #1c1f20; color: #aeb8bd; font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: 0; z-index: 10; }
thead .grid-title-row th { top: 0; height: 31px; background: #1b1d1e; border-bottom-color: #30383a; z-index: 11; }
thead .grid-filter-row th { top: 31px; height: 25px; padding-top: 2px; padding-bottom: 2px; background: #1b1f20; z-index: 12; }
thead th.filter-open { overflow: visible; z-index: 80; }
.th-sort { height: 100%; justify-content: space-between; color: #aeb8bd; }
.th-label { overflow: hidden; text-overflow: ellipsis; }
.sort-mark { color: #7f8d92; font-size: 10px; }
.col-resizer { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 2; }
.col-resizer:hover { background: rgba(143,157,161,.28); }
body.resizing-col { cursor: col-resize; user-select: none; }
.th-content { display: block; min-width: 84px; }
.filter-cell { display: grid; grid-template-columns: minmax(42px, 1fr) 17px; align-items: center; gap: 5px; }
.column-filter { min-width: 42px; height: 20px; width: 100%; padding: 2px 4px; border-radius: 1px; background: #252b2c; border: 1px solid #4f5a5d; color: #e6edf0; }
.filter-icon { position: relative; display: inline-block; width: 14px; height: 14px; color: #8fa1a7; font-size: 0; line-height: 1; }
.filter-icon-empty { visibility: hidden; }
.filter-icon::before { content: ''; position: absolute; inset: 2px; background: currentColor; clip-path: polygon(8% 16%, 92% 16%, 58% 54%, 58% 84%, 42% 84%, 42% 54%); }
.select-filter-cell { position: relative; }
.select-filter-cell.open { z-index: 90; }
.select-filter-btn { text-align: left; color: #cbd5e1; }
.select-filter-menu { display: none; position: absolute; left: 0; top: 24px; z-index: 90; min-width: 190px; max-height: 280px; overflow: auto; padding: 6px; background: #202728; border: 1px solid #596568; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.select-filter-cell.open .select-filter-menu { display: grid; gap: 4px; }
.select-filter-menu label { display: flex; align-items: center; gap: 6px; padding: 2px 3px; color: #d7e0e4; font-size: 11px; text-transform: none; }
.select-filter-search { width: 100%; height: 22px; margin-bottom: 3px; }
tfoot td.grid-pager { position: sticky; bottom: 0; z-index: 6; height: 30px; background: #1b2021; color: #bfc9cd; border-top: 1px solid #4b5557; }
.grid-pager { text-align: right; }
.grid-pager span { margin: 0 8px; }
.grid-pager button { padding: 2px 8px; min-width: 28px; }
.grid-pager select { padding: 2px 4px; height: 22px; }
tbody tr { height: 26px; }
tbody tr.virtual-spacer { height: auto; pointer-events: none; }
tbody tr.virtual-spacer td { padding: 0 !important; border: 0 !important; background: transparent !important; vertical-align: top; }
tbody td { height: 26px; max-height: 26px; background: #243031; color: #e6edf0; overflow: hidden; text-overflow: ellipsis; }
tbody tr:nth-child(even) td { background: #222b2c; }
tbody tr:hover td { background: #344044; }
tbody tr.selected td { background: #676767; color: #fff; }
td { cursor: default; }
td.cell-selected { outline: 1px solid #8f9da1; outline-offset: -1px; }
td.cell-copied { animation: copyFlash 1s ease-out; }
@keyframes copyFlash { 0% { background: rgba(95,115,120,.28); } 100% { background: transparent; } }

.select-col { min-width: 38px; width: 38px; padding: 0 6px; background: #1b1d1e; z-index: 5; }
thead .select-col { z-index: 20; background: #1b1d1e; }
thead .grid-filter-row .select-col { background: #1b1f20; }
tbody .select-col { background: inherit; z-index: 3; }
input[type=checkbox] { width: 14px; height: 14px; accent-color: #5f7378; vertical-align: middle; }
.badge { padding: 1px 5px; border-radius: 2px; font-size: 10px; }
.cell-actions { gap: 4px; }
.cell-actions button { padding: 3px 6px; border-radius: 2px; }
.mono { color: #c5ced1; font-size: 12px; }
.color-dot { width: 38px; height: 15px; border-radius: 0; border-color: transparent; box-shadow: none; vertical-align: middle; }
.value-pill { border: 1px solid #4a5456; background: #2d3637; color: var(--txt); border-radius: 2px; padding: 1px 5px; }
.item-cell { gap: 6px; min-width: 0; }
.item-cell img { width: 32px; height: 32px; border-radius: 2px; }
.item-cell span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input.price-input { background: none; border: none; border-radius: 0; box-shadow: none; outline: none; padding: 0; width: 100%; color: var(--txt); font-size: inherit; }
.sticker-row { display: flex; flex-wrap: nowrap; gap: 2px; align-items: center; }
.sticker-row img { flex: 0 0 auto; }
.cell-truncate { display: block; font-size: 10px; max-width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Rộng cột do colgroup/resize quyết định; truncate theo ô, không cap cứng. Double-click ô để xem đầy đủ. */
th.col-reason, td.col-reason,
th.col-narrow, td.col-narrow,
th.col-items, td.col-items,
th.col-asset-id, td.col-asset-id { min-width: 0; }
.col-reason .cell-truncate { max-width: 100%; cursor: pointer; }
.col-items .cell-truncate { max-width: 100%; cursor: pointer; font-size: inherit; }
.col-asset-id .mono { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.col-narrow .cell-truncate, .col-narrow .mono { max-width: 100%; vertical-align: middle; }
.col-narrow .cell-actions { flex-wrap: nowrap; }
.token-exp-cell { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; vertical-align: middle; }
.token-remain { font-size: 10px; color: #a7b2b6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.col-token-exp { max-width: 84px; }

