:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1b2733;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --accent: #0b6b5d;
  --accent-ink: #ffffff;
  --accent-soft: #e2f3ef;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #1b7a3a;
  --ok-soft: #e4f5ea;
  --warn-soft: #fff4d6;
  --radius: 10px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12181e;
    --card: #1b242d;
    --ink: #e8edf2;
    --muted: #9aa8b6;
    --line: #2d3a46;
    --accent: #3dbba6;
    --accent-ink: #06201b;
    --accent-soft: #173a34;
    --danger: #ff8a80;
    --danger-soft: #3b1f1d;
    --ok: #6fd58c;
    --ok-soft: #173424;
    --warn-soft: #3a3217;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 16px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* Nút & ô nhập */
.btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); padding: .5rem .9rem; min-height: 40px;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 32px; padding: .2rem .6rem; font-size: .875rem; }
input, select, textarea {
  font: inherit; width: 100%; padding: .55rem .7rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); min-height: 42px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .25rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }

/* Trang chủ công khai */
.public-wrap { max-width: 640px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.public-wrap h1 { text-align: center; margin-top: 1rem; }
.public-wrap .lead { text-align: center; color: var(--muted); margin-bottom: 1.5rem; }
.search-row { display: flex; gap: .5rem; }
.search-row input { font-size: 1.25rem; letter-spacing: .06em; min-height: 52px; }
.search-row .btn { min-height: 52px; padding: 0 1.4rem; font-size: 1.05rem; white-space: nowrap; flex: none; }
.result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-top: 1rem; }
.result .name { font-size: 1.2rem; font-weight: 700; }
.result dl { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem 1rem; margin: .6rem 0 0; }
.result dt { color: var(--muted); }
.result dd { margin: 0; font-weight: 600; }
.notice { margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--radius); background: var(--warn-soft); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.foot { text-align: center; margin-top: 3rem; font-size: .85rem; }

/* Trang quản lý */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: .5rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.brand { font-weight: 700; margin-right: .5rem; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1 1 auto; min-width: 0; }
.nav a { padding: .4rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-group { position: relative; }
.nav-group-btn { font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .7rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink); white-space: nowrap; }
.nav-group-btn:hover, .nav-menu a:hover { background: var(--accent-soft); }
.nav-group-btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-group-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.caret { width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.nav-group-btn[aria-expanded="true"] .caret { transform: rotate(-135deg) translate(-1px, -1px); }
.nav-menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; z-index: 10; display: flex; flex-direction: column; gap: .1rem; padding: .3rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.nav-menu a { display: block; }
.userbox { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .9rem; margin-left: auto; }
main { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-head h2, .card-head h3 { margin: 0; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 1rem; }
.grow { flex: 1; min-width: 200px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
td.actions, th.actions { white-space: nowrap; text-align: right; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.off { background: var(--line); color: var(--muted); }
.badge.warn { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--line); }

.kv { display: grid; grid-template-columns: 8rem 1fr; gap: .3rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.sub { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-top: .8rem; }
.empty { color: var(--muted); padding: .6rem 0; }

/* Hộp thoại */
dialog.dlg { border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.4rem; width: min(520px, 94vw); background: var(--card); color: var(--ink); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .45); }
dialog.dlg .ask-row + .ask-row { margin-top: .7rem; }
dialog.dlg textarea { width: 100%; }
dialog.dlg .dup-list { margin: .2rem 0 .8rem; padding-left: 1.2rem; }
dialog.dlg .dup-list li + li { margin-top: .25rem; }
dialog.dlg.wide { width: min(600px, 96vw); }
.steps { margin: .4rem 0 .8rem; padding-left: 1.3rem; }
.steps li + li { margin-top: .3rem; }
.secret-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .6rem 0 .3rem; }
code.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; background: var(--accent-soft); color: var(--ink); padding: .4rem .7rem; border-radius: 8px; word-break: break-all; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .8rem; margin: .6rem 0; padding: 0; list-style: none; }
.codes code { display: block; text-align: center; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; user-select: all; }
.verify { padding: .5rem .7rem; border-radius: 8px; margin: .7rem 0 0; }
.verify.ok { background: var(--ok-soft); color: var(--ok); }
.err { color: var(--danger); background: var(--danger-soft); padding: .5rem .7rem; border-radius: 8px; margin: .8rem 0 0; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; z-index: 50; max-width: 90vw; }

/* Đăng nhập */
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 1rem; }

/* Nhập dữ liệu */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin: .8rem 0; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.stat b { display: block; }
.disabled-card { opacity: .65; }
.import-out { margin-top: 1.2rem; }

@media (max-width: 600px) {
  .result dl { grid-template-columns: 1fr; }
  .result dt { margin-top: .4rem; }
  .kv { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
}

/* Trình soạn trang thông tin (quản trị) */
.page-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .5rem; }
.page-bar h1 { margin: 0; }
.page-bar .btn { text-decoration: none; display: inline-flex; align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 1rem 0; border-bottom: 1px solid var(--line); }
.tab { font: inherit; cursor: pointer; padding: .55rem .9rem; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 600; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
/* Hàng thẻ + nút thêm trang ở góc phải */
.tabs-row { display: flex; align-items: flex-end; gap: .5rem 1rem; margin: 1rem 0; border-bottom: 1px solid var(--line); }
.tabs-row .tabs { flex: 1 1 auto; margin: 0; border-bottom: 0; }
.tabs-row .tab-add { flex: none; margin-bottom: .35rem; white-space: nowrap; }
@media (max-width: 700px) { .tabs-row { flex-direction: column-reverse; align-items: stretch; } .tabs-row .tab-add { align-self: flex-end; margin-bottom: 0; } }
/* Thanh công cụ góc phải mỗi trang */
.page-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .55rem .8rem; border: 1px dashed var(--line); border-radius: 10px; background: var(--card); }
.page-tools p { margin: 0; }
.page-tools .row { gap: .4rem; align-items: center; justify-content: flex-end; }
.grow { flex: 1 1 14rem; }
/* Đầu khối: tên khối + nút Ẩn khối */
.blk-head { align-items: flex-start; }
.blk-head h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.blk-tools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: .4rem; }
.blk-name { display: flex; flex-direction: column; gap: .15rem; margin: 0; }
.blk-name input { min-height: 32px; padding: .2rem .5rem; width: 15rem; max-width: 100%; }
.xb-title { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; flex: 1 1 16rem; }
.xb-title .grow { min-width: 12rem; }
.xb-title .badge { margin-bottom: .6rem; white-space: nowrap; }
.extras-title { margin: 1.5rem 0 0; }
.xblock { border-left: 4px solid var(--accent); }
/* Nút + Thêm khối: bảng chọn loại khối */
.add-menu { position: relative; }
.add-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.add-menu > summary::-webkit-details-marker { display: none; }
.add-pop { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; width: min(21rem, 90vw); padding: .4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); display: grid; gap: .2rem; }
.add-opt { font: inherit; text-align: left; display: grid; gap: .1rem; padding: .55rem .7rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.add-opt:hover, .add-opt:focus-visible { background: var(--accent-soft); }
.stack > * + * { margin-top: 1rem; }
.stack > .card + .card { margin-top: 1rem; }
.stack label { margin-top: 0; }
.rowcard { margin-bottom: .75rem; padding: .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; }
.fields > .wide { grid-column: 1 / -1; }
.fields label { margin-top: 0; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; margin-top: .6rem; }
.thumb-box { margin: .25rem 0 .5rem; }
.thumb.thumb-fit { width: 280px; max-width: 100%; height: auto; max-height: none; object-fit: cover; object-position: center; }
.thumb.thumb-whole { width: 420px; max-width: 100%; height: auto; max-height: none; }
.thumb-frame { display: grid; place-items: center; width: 280px; max-width: 100%; border: 1px dashed var(--line); border-radius: 8px; background: var(--card); color: var(--muted); font-size: .875rem; }
.img-spec { margin: .1rem 0 .45rem; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.img-spec b { color: var(--ink); }
.thumb { display: block; max-width: 260px; max-height: 150px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); object-fit: contain; }
.color-row { align-items: center; }
input.color { width: 56px; padding: 2px; min-height: 42px; flex: none; }
input.hexin { width: 8.5rem; flex: none; font-family: ui-monospace, Consolas, monospace; }
.swatch { padding: .6rem 1rem; border-radius: 8px; font-weight: 700; }
.text-sample { padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; color: #1b2733; font-weight: 700; }
.contrast-note { margin-top: .35rem; }
.contrast-note.warn { color: #8a5a00; }
.contrast-note.bad { color: var(--danger); font-weight: 600; }

/* Đăng ký tư vấn từ website */
.nav .count { display: inline-block; min-width: 1.35rem; margin-left: .35rem; padding: 0 .4rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.35rem; text-align: center; }
.check-row { display: flex; align-items: flex-start; gap: .6rem; }
.hang-pick { display: flex; flex-wrap: wrap; gap: .45rem 1.4rem; margin-top: .4rem; }
.hang-add { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .9rem; }
.hang-add label { margin: 0; }
.hang-add input { width: 9rem; }
td.hang-move { white-space: nowrap; width: 1%; }
td.hang-move .btn + .btn { margin-left: .25rem; }
.check-row input { width: auto; min-height: 0; margin-top: .25rem; flex: none; }
.check-row label { margin: 0; font-weight: 600; }
.consult { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem; align-items: flex-start; margin-bottom: 0; }
.consult.fresh { border-left: 4px solid var(--danger); }
.consult-main { flex: 1 1 18rem; min-width: 0; }
.consult-main .phone { font-size: 1.15rem; font-weight: 700; }
.consult-note { margin: .4rem 0; padding: .5rem .75rem; border-radius: 8px; background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Trình soạn bài viết (trang quản lý) ---------- */
.rte { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; padding: .4rem .5rem; border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; background: var(--bg); }
.rte-btn { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-width: 34px; height: 34px; padding: 0 .35rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.rte-btn:hover:not(:disabled) { background: var(--accent-soft); }
.rte-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.rte-btn:disabled { opacity: .4; cursor: default; }
.rte-btn:focus-visible, .rte-sw:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.rte-glyph { font-size: 1rem; font-weight: 700; line-height: 1; }
.rte-i .rte-glyph { font-family: Georgia, serif; font-style: italic; }
.rte-u .rte-glyph { text-decoration: underline; }
.rte-s .rte-glyph { text-decoration: line-through; }
.rte-color .rte-glyph { padding-bottom: 2px; border-bottom: 3px solid #b42318; }
.rte-sep { width: 1px; height: 22px; margin: 0 .25rem; background: var(--line); }
.rte-grow { flex: 1; }
.rte-bar select.rte-block { width: auto; min-height: 34px; padding: .15rem .5rem; }
.rte-codelabel { margin-left: .3rem; font-size: .85rem; font-weight: 600; }
.rte-colorwrap { position: relative; display: inline-flex; }
.rte-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: .4rem; width: 13rem; padding: .55rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 10px 28px rgb(0 0 0 / .22); }
.rte-pop[hidden] { display: none; }
.rte-sw { width: 28px; height: 28px; padding: 0; border: 2px solid var(--card); border-radius: 50%; outline: 1px solid var(--line); cursor: pointer; }
.rte-sw:not([style]) { width: auto; padding: 0 .65rem; border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: .8rem; }
.rte-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; padding: .4rem .6rem; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: .9rem; }
.rte-ctx[hidden], .rte-ctxgroup[hidden], .rte-area[hidden], .rte-code[hidden] { display: none; }
.rte-ctxgroup { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.rte-area { min-height: 240px; max-height: 70vh; overflow: auto; padding: 1rem 1.1rem; outline: none; }
.rte-area:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.rte-area td, .rte-area th { min-width: 3rem; height: 2.2rem; }
.rte-area img.rte-sel, .rte-area figure.rte-sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.rte-area figure.video { display: grid; place-items: center; max-width: 560px; margin: 0 0 1rem; background: #1b2733; color: #fff; font-weight: 600; user-select: none; cursor: default; }
.rte-code { display: block; width: 100%; min-height: 240px; padding: 1rem; border: 0; border-radius: 0; background: var(--card); color: var(--ink); font: .88rem/1.5 ui-monospace, Consolas, monospace; resize: vertical; }
.rte-status { margin: 0; padding: .3rem .8rem .5rem; min-height: 1.6em; }
@media (max-width: 700px) { .rte-codelabel { display: none; } }

/* Trình chỉnh menu */
.menu-card { background: var(--card); }
.menu-subs { margin: .9rem 0 0; padding: .75rem .85rem; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--bg); }
.menu-subs h4 { margin: 0 0 .6rem; font-size: .95rem; }
.subrow { margin: 0 0 .6rem; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.subrow .row-actions { margin-top: .4rem; }
.menu-card select, .subrow select { width: 100%; }
.menu-card input[type="text"][hidden] { display: none; }
.menu-card .fields input[type="text"] + input, .menu-card select + input { margin-top: .4rem; }
.menu-preview, .menu-preview ul { margin: 0; padding-left: 1.2rem; }
.menu-preview ul { list-style: disc; color: var(--muted); }

/* Thẻ "Tên trang và dòng mô tả đầu trang": xem trước giống phần nền đầu trang của website */
.head-card h3 { margin: 0; }
.head-prev { display: grid; gap: .25rem; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); }
.head-prev .hp-crumb { font-size: .78rem; opacity: .85; }
.head-prev .hp-title { font-size: 1.5rem; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; overflow-wrap: anywhere; }
.head-prev .hp-desc { font-size: .95rem; overflow-wrap: anywhere; }

/* Thẻ "Tra cứu": xem trước khung nhập số căn cước và mã xác nhận */
.lk-prev { display: grid; gap: .5rem; max-width: 26rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.lk-prev .lk-legend { font-size: .95rem; }
.lk-prev .lk-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.lk-prev .lk-opt { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; }
.lk-prev .lk-opt.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lk-prev .lk-label { font-size: .88rem; font-weight: 600; margin-top: .3rem; }
.lk-prev .lk-input { padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .9rem; }
.lk-prev .lk-cap { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.lk-prev .lk-img { padding: .35rem .9rem; border: 1px dashed var(--line); border-radius: 8px; letter-spacing: .25em; font-weight: 700; color: var(--muted); }
.lk-prev .lk-btn { padding: .3rem .7rem; border: 1px solid var(--accent); border-radius: 999px; font-size: .82rem; color: var(--accent); }
.lk-prev .lk-hint { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.lk-prev .lk-go { justify-self: start; padding: .5rem 1.2rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: .9rem; }

/* Quản lý bài viết: danh sách gọn, tìm kiếm, phân trang */
.art-tools { display: grid; grid-template-columns: minmax(12rem, 1fr) repeat(3, auto); gap: .5rem; }
.art-tools select { width: auto; max-width: 100%; }
.art-count { margin: .25rem 0 0; }
.art-list { margin-top: .25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.art-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: .5rem .85rem; align-items: center; padding: .6rem .75rem; }
.art-row + .art-row { border-top: 1px solid var(--line); }
.art-row:hover { background: var(--accent-soft); }
.art-th { display: block; width: 88px; height: 58px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; background: var(--bg); }
.art-th.none { display: grid; place-items: center; border-style: dashed; color: var(--muted); font-size: .72rem; text-align: center; line-height: 1.25; padding: 0 .25rem; }
.art-main { min-width: 0; }
.art-title { display: block; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.art-title:hover { color: var(--accent); text-decoration: underline; }
.art-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.art-meta { margin-top: .1rem; overflow-wrap: anywhere; }
.art-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.art-badges:empty { display: none; }
.art-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.art-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
.art-pager { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: center; margin-top: .75rem; }
.art-pager .btn.sm { min-width: 2.2rem; }
.art-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.art-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.art-foot .grow { flex: 1 1 1rem; }
@media (max-width: 760px) {
  .art-tools { grid-template-columns: 1fr 1fr; }
  .art-tools input { grid-column: 1 / -1; }
  .art-tools select { width: 100%; }
}
@media (max-width: 560px) {
  .art-row { grid-template-columns: 72px minmax(0, 1fr); }
  .art-th { width: 72px; height: 50px; }
  .art-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.fields.art-opts { grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); align-items: end; }
.art-opts .check-row { padding-bottom: .65rem; }
@media (max-width: 560px) { .fields.art-opts { grid-template-columns: 1fr; } .art-opts .check-row { padding-bottom: 0; } }

.stack.tight > * + * { margin-top: .35rem; }
.fields.art-opts > .stack.tight { align-self: end; padding-bottom: .1rem; }
.feat-sum { margin: 0; padding-left: 1.25rem; }
.feat-sum li { padding: .1rem 0; }
dialog.dlg .check-row { margin-top: .9rem; }

/* Danh sách học viên: chọn nhiều dòng, xóa hàng loạt, chọn số dòng */
.pick { width: 1.15rem; height: 1.15rem; min-height: 0; padding: 0; margin: 0; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
th.pickcell, td.pickcell { width: 2.4rem; padding-right: 0; }
td.pickcell { cursor: default; }
tr.sel td { background: var(--accent-soft); }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .6rem; }
.pager { justify-content: flex-start; gap: .6rem; }
.sizepick { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 400; font-size: .9rem; color: var(--muted); }
.pagesize { width: auto; min-height: 32px; padding: .2rem .5rem; }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; min-height: 46px; padding: .5rem .75rem; margin-bottom: .6rem; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); }
.selbar.idle { border-color: var(--line); background: transparent; font-size: .875rem; }
.table-wrap + .pager { margin-top: .6rem; }

/* Tổng hợp sát hạch */
.report-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem 1rem; }
.report-filter label { margin-top: 0; }
.report-filter input[type="date"] { width: 11.5rem; }
.report-filter .presets { padding-bottom: .15rem; }
.stat.tile { display: flex; flex-direction: column; gap: .15rem; }
.stat.tile .big { font-size: 1.9rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat.tile.ok .big { color: var(--ok); }
.stat.tile.bad .big { color: var(--danger); }
table.report th.n, table.report td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.report td.ok-t { color: var(--ok); font-weight: 600; }
table.report td.bad-t { color: var(--danger); font-weight: 600; }
table.report tr.total td { border-top: 2px solid var(--ink); background: var(--bg); }

/* Kỳ sát hạch */
.row.between { justify-content: space-between; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .4rem 1.5rem; margin: .6rem 0 1rem; }
.doc-grid h3 { font-size: 1rem; margin: .4rem 0 .3rem; color: var(--muted); }
.doc-row { display: flex; align-items: center; gap: .4rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.doc-row .doc-name { flex: 1 1 auto; min-width: 0; }
.warn-line { padding: .5rem .75rem; border-radius: 8px; background: var(--warn-soft); border: 1px solid var(--line); }
.info-sec { border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0; background: var(--card); }
.info-sec > summary { cursor: pointer; padding: .6rem .9rem; font-weight: 600; }
.info-sec[open] > summary { border-bottom: 1px solid var(--line); }
.info-body { padding: .6rem .9rem .9rem; }
.info-body h3 { font-size: 1rem; margin: .8rem 0 .3rem; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .5rem .9rem; margin: .4rem 0; }
.fld { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.fld.wide { grid-column: span 2; }
@media (max-width: 560px) { .fld.wide { grid-column: auto; } }
.fld > span { font-size: .875rem; color: var(--muted); }
.fld input, .fld textarea { width: 100%; }
.check { display: flex; align-items: center; gap: .5rem; margin: .8rem 0 .4rem; }
.check input { width: auto; }
table.etab { border-collapse: collapse; width: 100%; min-width: 640px; margin-bottom: .5rem; }
table.etab th { text-align: left; font-size: .8125rem; color: var(--muted); font-weight: 600; padding: .2rem .3rem; }
table.etab td { padding: .15rem .25rem; vertical-align: top; }
table.etab input { width: 100%; min-width: 5rem; }
.savebar { margin-top: 1rem; position: sticky; bottom: 0; background: var(--card); padding: .6rem 0; border-top: 1px solid var(--line); }
details.cand > summary { cursor: pointer; list-style: none; }
details.cand > summary h2.inline { display: inline; margin-right: .4rem; }
details.cand[open] > summary { margin-bottom: .6rem; }
.filters { margin-bottom: .6rem; }
.filters input[type="search"] { flex: 1 1 16rem; max-width: 24rem; }
.problems { margin: .3rem 0 .6rem 1.1rem; padding: 0; }
table.cand-tab td, table.cand-tab th { white-space: nowrap; }
.doc-row .btn { white-space: nowrap; }
.card h3 { margin-top: 1rem; }
table.etab { min-width: 780px; }
table.etab .cw-l { width: 27%; }

/* Quên mật khẩu */
.login .row.between { margin-top: 1rem; align-items: center; }
.forgot ol { margin: .25rem 0 .9rem; padding-left: 1.4rem; }
.forgot li { margin: .3rem 0; }
.forgot code { font-size: .92em; background: var(--soft, #f1f3f2); padding: .05rem .3rem; border-radius: 4px; white-space: nowrap; }

/* Kỳ sát hạch: tạo trước, nhập kết quả sau */
.title-badge { margin-left: .6rem; vertical-align: middle; }
.import-cta { border-left: 4px solid var(--accent); }
.import-cta h2 { margin-top: 0; }
.hang-sel { max-width: 8.5rem; padding: .25rem .4rem; font-size: .9rem; }
.warn-line p { margin: .15rem 0 .4rem; }
.warn-line .row { margin: .3rem 0; }
.warn-line select { width: auto; max-width: 14rem; }
