/* Khu quản trị: khung cố định đúng 1 màn hình — thanh trên + menu trái đứng yên,
   trang danh sách thì tiêu đề + bộ lọc cũng đứng yên, chỉ vùng dữ liệu cuộn. */
.adm-body { background: #f4f6fa; overflow: hidden; }
.adm { --top-h: 52px; --side-w: 228px; display: grid; height: 100vh;
  grid-template: var(--top-h) minmax(0, 1fr) / var(--side-w) minmax(0, 1fr); grid-template-areas: "top top" "side main"; }
.adm-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  background: #fff; border-bottom: 1px solid var(--tblr-border-color); }
.adm-brand { font-weight: 700; font-size: 15px; color: var(--tblr-body-color); display: flex; align-items: center; }
.adm-brand:hover, .adm-user:hover { text-decoration: none; }
.adm-top-right { display: flex; align-items: center; gap: 14px; }
.adm-user { display: flex; align-items: center; gap: 8px; color: var(--tblr-body-color); font-weight: 500; }
.adm-side { grid-area: side; background: #fff; border-right: 1px solid var(--tblr-border-color); overflow-y: auto; padding: 4px 10px 16px; }
.side-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8a94a6; padding: 14px 10px 4px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: #3d4756; font-weight: 500; }
.side-link .ico { color: #8a94a6; flex: none; }
.side-link:hover { background: #f1f4f8; text-decoration: none; color: var(--tblr-body-color); }
.side-link.active { background: #e8f0fb; color: var(--tblr-primary); }
.side-link.active .ico { color: var(--tblr-primary); }
.adm-main { grid-area: main; overflow-y: auto; padding: 16px 24px 24px; min-width: 0; }
.adm-main.fill { overflow: hidden; display: flex; flex-direction: column; }
.adm-main.fill > * { flex: none; }
.ico { vertical-align: -3px; flex: none; }

/* Tiêu đề trang */
.ph { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; min-height: 40px; }
.ph-back { display: inline-block; font-size: 13px; color: var(--tblr-secondary); }
.ph-title { font-size: 19px; font-weight: 700; margin: 0; line-height: 1.3; }
.ph-sub { color: var(--tblr-secondary); margin-top: 1px; font-size: 13px; max-width: 900px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn .ico { margin-right: 5px; }
.btn-icon .ico { margin: 0; }

/* Khối dữ liệu = thanh lọc + bảng cuộn trong khung + chân bảng */
.dv { display: flex; flex-direction: column; min-height: 0; background: #fff; border: 1px solid var(--tblr-border-color); border-radius: 8px; }
.adm-main.fill > .dv, .adm-main.fill > .grow { flex: 1 1 auto; min-height: 0; }
.dv-bar { flex: none; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--tblr-border-color); }
.dv-bar .ts-wrapper, .dv-bar > .form-select { width: 240px; }
.dv-bar .ts-wrapper.w-sm, .dv-bar > .form-select.w-sm { width: 170px; }
.dv-bar .bar-label { font-size: 12.5px; color: var(--tblr-secondary); }
.dv-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 16px; border-bottom: 1px solid var(--tblr-border-color); }
.dv-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.dv-head .muted { color: var(--tblr-secondary); font-size: 13px; }
.dv-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.dv-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* Thanh thao tác hàng loạt: chỉ hiện khi đã tick ít nhất 1 dòng */
.dv-selbar { flex: none; display: flex; align-items: center; gap: 12px; margin: 0; padding: 7px 12px 7px 16px; background: #f6f8fb;
  border-bottom: 1px solid var(--tblr-border-color); font-size: 13px; }
.dv-selbar[hidden] { display: none; }
.dv-selbar .sel-count { color: #5b6574; }
.dv-selbar .sel-count b { color: var(--tblr-primary); font-weight: 600; }
/* nút trong nhóm: cùng kiểu với .seg-btn của bộ lọc */
.seg-act { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 5px 12px; border: 0; border-radius: 5px;
  background: transparent; font-size: 13px; font-weight: 500; color: #4a5462; cursor: pointer; white-space: nowrap; }
.seg-act:hover { color: var(--tblr-body-color); background: rgba(255,255,255,.65); }
.seg-act.is-main { background: #fff; color: var(--tblr-primary); box-shadow: 0 1px 2px rgba(16,24,40,.14); }
.seg-act.is-main:hover { background: #fff; color: #1a5aa6; }
.seg-act:focus-visible { outline: 2px solid rgba(32,107,196,.45); }
.dv-selbar .sel-clear { margin-left: auto; padding: 4px 8px; border: 0; border-radius: 5px; background: none; font-size: 13px;
  color: var(--tblr-secondary); cursor: pointer; }
.dv-selbar .sel-clear:hover { color: var(--tblr-body-color); background: #eef1f5; }
.dv-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.dv-scroll.h-sm { max-height: 300px; } .dv-scroll.h-md { max-height: 440px; }
.dv-foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 7px 16px; border-top: 1px solid var(--tblr-border-color);
  font-size: 12.5px; color: var(--tblr-secondary); background: #fbfcfd; border-radius: 0 0 8px 8px; }
.dv-foot b { color: var(--tblr-body-color); font-weight: 600; }
.dv-empty { padding: 48px 16px !important; text-align: center; color: var(--tblr-secondary); }
.dv-more td { text-align: center; color: var(--tblr-secondary); padding: 14px !important; }
.dv-main.htmx-request { opacity: .5; transition: opacity .15s; }
.dv-search { position: relative; flex: 0 1 320px; min-width: 220px; margin: 0; }
.dv-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #8a94a6; pointer-events: none; }
.dv-search .form-control { padding-left: 32px; }

/* Bảng */
.table-admin { margin: 0; font-size: 13.5px; }
.table-admin > :not(caption) > * > * { padding: 7px 12px; }
.table-admin thead th { position: sticky; top: 0; z-index: 2; background: #f6f8fb; color: #5b6574; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--tblr-border-color); }
.table-admin td { vertical-align: middle; border-color: #eef1f5; }
.table-admin tbody tr:hover > td { background: #f8fafd; }
.table-admin tr[data-href] { cursor: pointer; }
.table-admin .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-admin .act { text-align: right; white-space: nowrap; width: 1%; }
.table-admin .chk { width: 40px; }
.table-admin .sub { display: block; font-size: 12px; color: var(--tblr-secondary); }
.table-admin td:first-child, .table-admin th:first-child { padding-left: 16px; }
.table-admin td:last-child, .table-admin th:last-child { padding-right: 16px; }
.table-admin tr.is-checked > td { background: #eef5fe; }
.table-admin tr.row-muted td { color: var(--tblr-secondary); }
/* Dòng tiêu đề nhóm (gom bài theo phân hệ SAP) */
.table-admin tr.dv-grp > td, .table-admin tr.dv-grp:hover > td { background: #f1f4f9; font-weight: 600; font-size: 12.5px; color: #3b4452;
  padding-top: 6px; padding-bottom: 6px; border-top: 1px solid #e3e8ef; }
.table-admin tr.dv-grp .grp-code { display: inline-block; min-width: 46px; margin-right: 8px; font-family: var(--tblr-font-monospace); color: var(--tblr-primary); }
.table-admin tr.dv-grp .grp-n { margin-left: 10px; font-weight: 400; color: var(--tblr-secondary); }
.row-link { color: inherit; font-weight: 500; }
.row-link:hover { color: var(--tblr-primary); }
.act-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; color: #6b7685;
  border: 0; background: transparent; padding: 0; }
.act-btn:hover { background: #e9edf3; color: var(--tblr-body-color); text-decoration: none; }
.act-btn.danger:hover { background: #fdecec; color: var(--bad); }
.truncate { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Nút chọn nhanh – thay dropdown 2–5 lựa chọn */
.seg { display: inline-flex; background: #eef1f5; border-radius: 7px; padding: 3px; gap: 2px; flex-wrap: nowrap; vertical-align: middle; max-width: 100%; }
.seg-opt { margin: 0; display: inline-flex; position: relative; }
.seg-in { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.seg-btn { margin: 0; padding: 5px 12px; border-radius: 5px; font-size: 13px; font-weight: 500; color: #4a5462; cursor: pointer;
  white-space: nowrap; user-select: none; line-height: 1.45; }
.seg-btn:hover { color: var(--tblr-body-color); background: rgba(255,255,255,.65); }
.seg-in:checked + .seg-btn { background: #fff; color: var(--tblr-primary); box-shadow: 0 1px 2px rgba(16,24,40,.14); }
.seg-in:focus-visible + .seg-btn { outline: 2px solid rgba(32,107,196,.45); }
.seg-in:disabled + .seg-btn { opacity: .45; cursor: default; }
.seg-sm .seg-btn { padding: 3px 9px; font-size: 12.5px; }
.seg.block { display: flex; } .seg.block .seg-opt { flex: 1; } .seg.block .seg-btn { flex: 1; text-align: center; }
.seg .seg-in[value="FATAL"]:checked + .seg-btn { color: var(--bad); }
.seg .seg-in[value="INFO"]:checked + .seg-btn { color: #6b7685; }

/* Ô chọn (Tom Select): khung + mũi tên lấy đúng kiểu .form-select của Tabler để giống mọi ô nhập khác */
.ts-wrapper.form-select { min-height: 36px; padding: 0 !important; }
.ts-wrapper.form-select .ts-control { padding: 6px 34px 6px 12px; min-height: 34px; background: transparent !important; font-size: 14px;
  flex-wrap: nowrap; box-shadow: none; }
.ts-wrapper.single .ts-control .item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.ts-wrapper.form-select.focus { border-color: #90b5e2; box-shadow: 0 0 0 .2rem rgba(32,107,196,.16); }
.ts-wrapper.form-select.disabled { background-color: #f6f8fb; color: var(--tblr-secondary); }
.ts-wrapper.form-select.disabled .ts-control { opacity: 1; }
.ts-dropdown { border-radius: 8px; border: 1px solid var(--tblr-border-color); box-shadow: 0 12px 28px rgba(15,23,42,.14); margin-top: 4px;
  z-index: 1080; font-size: 13.5px; }
.ts-dropdown.wide { width: max-content !important; min-width: var(--ts-w, 200px); max-width: min(560px, 92vw); }
.ts-dropdown .ts-dropdown-content { max-height: 340px; padding: 4px; }
.ts-dropdown .option, .ts-dropdown .create { border-radius: 5px; padding: 6px 10px; white-space: normal; }
.ts-dropdown .active { background: #eef5fe; color: var(--tblr-body-color); }
.ts-dropdown .selected { color: var(--tblr-primary); font-weight: 500; }
.ts-dropdown .dropdown-input-wrap { padding: 6px 6px 2px; }
.ts-dropdown .dropdown-input { border: 1px solid var(--tblr-border-color) !important; border-radius: 6px; padding: 6px 10px; width: 100%; font-size: 13.5px; }
.ts-dropdown .dropdown-input:focus { outline: none; border-color: #90b5e2 !important; box-shadow: none !important; }
.ts-dropdown .no-results { padding: 8px 10px; color: var(--tblr-secondary); }
.table-admin .ts-wrapper.form-select, .rules-table .ts-wrapper.form-select { min-height: 32px; }
.table-admin .ts-wrapper .ts-control, .rules-table .ts-wrapper .ts-control { min-height: 30px; padding-top: 4px; padding-bottom: 4px; font-size: 13px; }

/* Thông báo nổi góc phải – tự tắt khi thành công */
.toasts { position: fixed; top: 62px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; width: 420px; max-width: calc(100vw - 40px); }
.toast-msg { display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid var(--tblr-border-color);
  border-left: 4px solid var(--info); border-radius: 8px; padding: 10px 10px 10px 14px; box-shadow: 0 10px 24px rgba(15,23,42,.12); animation: toast-in .2s ease-out; }
.toast-msg.t-success { border-left-color: var(--ok); } .toast-msg.t-danger { border-left-color: var(--bad); } .toast-msg.t-warning { border-left-color: var(--warn); }
.toast-text { flex: 1; font-size: 13.5px; padding-top: 2px; }
.toast-x { border: 0; background: transparent; color: #8a94a6; padding: 2px; border-radius: 4px; line-height: 0; }
.toast-x:hover { background: #f1f4f8; }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Thẻ số liệu */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--tblr-border-color); border-radius: 8px; padding: 10px 16px; color: inherit; display: block; }
a.stat:hover { border-color: #b9cbe3; text-decoration: none; color: inherit; }
.stat .label { color: var(--tblr-secondary); font-size: 12.5px; }
.stat .val { font-size: 24px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--tblr-secondary); }

/* Biểu mẫu */
.fcard { background: #fff; border: 1px solid var(--tblr-border-color); border-radius: 8px; margin-bottom: 14px; }
.fcard-h { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 18px; border-bottom: 1px solid var(--tblr-border-color); }
.fcard-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.fcard-h .muted { color: var(--tblr-secondary); font-size: 13px; }
.fcard-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.fcard-b { padding: 16px 18px; }
.fcard-b.p0 { padding: 0; }
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 5px; color: #3d4756; }
.form-label .opt { color: var(--tblr-secondary); font-weight: 400; }
.form-hint { font-size: 12.5px; color: var(--tblr-secondary); margin-top: 4px; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #8a94a6; margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--tblr-secondary); font-weight: 400; } .kv dd { margin: 0; min-width: 0; }
.savebar { position: sticky; bottom: -24px; z-index: 5; margin: 6px -24px -24px; padding: 10px 24px; background: #fff;
  border-top: 1px solid var(--tblr-border-color); display: flex; align-items: center; gap: 10px; box-shadow: 0 -4px 12px rgba(15,23,42,.05); }
.savebar .info { color: var(--tblr-secondary); font-size: 13px; margin-right: auto; }
.savebar .btn { min-width: 104px; }
.form-check-input { border-color: #b9c2cf; cursor: pointer; }
textarea.form-control { font-size: 13.5px; }
textarea.mono, .form-control.mono { font-family: var(--tblr-font-monospace); font-size: 12.5px; }
.modal-header { padding: 14px 20px; } .modal-title { font-size: 16px; font-weight: 600; }
.modal-footer { padding: 10px 20px; }
.modal-footer .btn { min-width: 96px; }

.st-dot { white-space: nowrap; }
.st-dot::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: #a0aab5; }
.st-green::before { background: var(--ok); } .st-red::before { background: var(--bad); }
.st-blue::before { background: var(--info); } .st-yellow::before { background: var(--warn); }
.st-green { color: #1f7a30; } .st-red { color: var(--bad); }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #eef1f5; color: #4a5462; white-space: nowrap; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; line-height: 1.4; white-space: nowrap; }
.rules-table td { padding: 5px 6px !important; vertical-align: middle; }
.rules-table .form-control, .rules-table .form-select { font-size: 13px; padding: 5px 8px; min-height: 32px; }
pre.code-sample { background: #0f1720; color: #d6e2ee; padding: 12px; border-radius: 6px; font-size: 12px; max-height: 380px; overflow: auto; }
code.copy { cursor: pointer; } code.copied { background: rgba(47,179,68,.15); }
.bar { height: 6px; border-radius: 3px; background: #eef1f5; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--ok); }
.split { display: grid; gap: 14px; min-height: 0; }
.split-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split-73 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split-37 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.adm-main.fill > .split { flex: 1 1 auto; }
.split > .dv { min-height: 0; }
@media (max-width: 1100px) {
  .adm-body { overflow: auto; } .adm { height: auto; grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .adm-side { display: none; } .adm-main.fill { overflow: visible; } .split-2, .split-73, .split-37 { grid-template-columns: 1fr; }
  .dv-scroll { max-height: 70vh; }
}
.table-admin td form { display: inline; margin: 0; }

/* Trang soạn: thẻ (tab) + vùng nội dung cuộn + thanh lưu luôn ở đáy */
.editor { overflow: hidden; }
.ed-tabs { flex: none; display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--tblr-border-color); list-style: none; margin: 0; }
.ed-tab { display: inline-flex; align-items: center; gap: 6px; padding: 12px 14px 10px; color: #5b6574; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ed-tab:hover { color: var(--tblr-body-color); text-decoration: none; }
.ed-tab.active { color: var(--tblr-primary); border-bottom-color: var(--tblr-primary); }
.ed-tab .cnt { font-size: 11.5px; background: #eef1f5; color: #5b6574; border-radius: 9px; padding: 0 7px; line-height: 18px; }
.ed-tab.active .cnt { background: #e1ecfa; color: var(--tblr-primary); }
.ed-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px; background: #f8f9fb; }
.ed-body .fcard:last-child { margin-bottom: 0; }
.ed-body .split > div > .fcard:last-child { margin-bottom: 0; }
.ed-body .tab-pane > .split { align-items: start; }
.ed-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--tblr-border-color); background: #fff; border-radius: 0 0 8px 8px; }
.ed-foot .info { margin-right: auto; color: var(--tblr-secondary); font-size: 13px; }
.ed-foot .btn { min-width: 104px; }
.rules-table { margin: 0; }
.rules-table td:first-child, .rules-table th:first-child { padding-left: 14px !important; }
.rules-table tbody:empty::after { content: 'Chưa có dòng nào.'; display: table-caption; caption-side: bottom; padding: 14px; color: var(--tblr-secondary); text-align: center; }
.rules-table .seg { flex-wrap: nowrap; }
.rules-table input[name=r_points]:disabled { background: #f6f8fb; color: #a0aab5; }
.statement { white-space: pre-wrap; font-size: 15px; line-height: 1.6; }
.q-card .form-check { padding: 8px 12px; border: 1px solid var(--tblr-border-color); border-radius: 6px; margin-bottom: 6px; }
.q-card .form-check.correct { border-color: var(--ok); background: rgba(47,179,68,.08); }
.q-card img.q-img { max-width: 100%; max-height: 360px; border: 1px solid var(--tblr-border-color); border-radius: 6px; margin: 8px 0; }
.ed-body .tab-pane { display: none; } .ed-body .tab-pane.active { display: block; }
.ts-wrapper.multi .ts-control { flex-wrap: wrap; gap: 4px; padding-top: 5px; padding-bottom: 5px; }
.ts-wrapper.multi .ts-control > .item { margin: 0; border-radius: 4px; background: #e8f0fb; color: #1d4f91; padding: 1px 4px 1px 8px; }
.ts-wrapper.multi .ts-control > input { min-width: 4rem; }

/* Giao bài: 2 bảng chọn cao hết màn hình, phần tuỳ chọn + nút giao luôn ở đáy */
.adm-main.fill > form.assign { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.assign > .split { flex: 1 1 auto; min-height: 0; }
.assign-opts { flex: none; margin-top: 14px; background: #fff; border: 1px solid var(--tblr-border-color); border-radius: 8px;
  padding: 12px 16px; display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.assign-opts .opt-grid { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; flex: 1 1 auto; }
.assign-opts .opt-submit { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.assign-opts .opt-submit .btn { min-width: 120px; }
/* Kỳ thi: cột trái cuộn riêng, bảng chọn bài bên phải cao hết khung */
.ed-body.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px; overflow: hidden; }
.ed-body.cols > .col-scroll { overflow: auto; min-height: 0; }
.ed-body.cols > .dv { min-height: 0; }
.split.detail { grid-template-columns: 400px minmax(0, 1fr); }
.split > .col-scroll { overflow: auto; min-height: 0; padding-right: 2px; }
.split > .col-scroll > .fcard:last-child { margin-bottom: 0; }

/* Tổng quan: các khung chia đều phần còn lại của màn hình, mỗi khung cuộn riêng */
.adm-main.fill > .dash-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dash { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 14px; }
.dash-col { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.dash-col > .dv { flex: 1 1 0; min-height: 160px; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } .dash-col > .dv { flex: none; } }
.rep-stats { flex: none; display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--tblr-border-color); }
.rep-stats .rs { padding: 10px 22px; border-right: 1px solid #eef1f5; }
.rep-stats .label { font-size: 12px; color: var(--tblr-secondary); }
.rep-stats .val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.dv .ed-tabs { padding: 0 8px; }
.adm-main.fill > .live { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.live > .dv { flex: 1 1 auto; min-height: 0; }

/* Cột chữ dài tự co theo chỗ trống (cắt bằng …) thay vì đẩy bảng tràn ngang */
.table-admin td.grow-cell { max-width: 0; width: 45%; }
.table-admin td.grow-cell .truncate, .table-admin td.grow-cell .sub { max-width: 100% !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1440px) {
  .adm { --side-w: 200px; }
  .adm-main { padding: 14px 16px 16px; }
  .side-link { gap: 8px; padding: 7px 8px; }
  .table-admin > :not(caption) > * > * { padding: 7px 9px; }
  .seg-btn { padding: 5px 10px; }
  .seg-sm .seg-btn { padding: 3px 7px; }
  .savebar { margin: 6px -16px -16px; padding: 10px 16px; bottom: -16px; }
}
.rules-table { table-layout: fixed; width: 100%; }
.rules-table th { overflow: hidden; text-overflow: ellipsis; }
.rules-table .seg { display: flex; } .rules-table .seg-opt { flex: 1; } .rules-table .seg-btn { flex: 1; text-align: center; padding-left: 4px; padding-right: 4px; }
