/* KHUNG CHUNG cho mọi phác thảo giai đoạn 1 — việc sổ 20261104-17 vòng 2.
   Không nạp phông ngoài (trang Sổ không được gọi máy chủ khác). Bản thật: tự phục vụ tệp phông Be Vietnam Pro / Lexend
   từ chính song.pvcuong.com bằng @font-face; máy chưa có tệp phông thì rơi về Segoe UI. */
:root {
  --bg: #F6F8FC; --mat: #FFFFFF; --chu: #172033; --mo: #5A6478; --mo2: #6B7488; --vien: #DCE3EF;
  --xanh: #2563EB; --xanh-dam: #1D4FBF; --xanh-nhat: #E8EFFD; --xanh-chu-nhat: #EDF2FF;
  --tot: #15803D; --tot-nhat: #E7F6EC; --canh: #B45309; --canh-nhat: #FDF3E4; --do: #B91C1C; --do-nhat: #FBEAEA;
  --f-tieude: "Lexend", "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --f-chu: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-so: "JetBrains Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--chu); font: 14.5px/1.5 var(--f-chu); }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 3px solid var(--xanh); outline-offset: 2px; }
.vidu { display: inline-block; font: 600 11.5px var(--f-chu); color: #8A4A0A; background: var(--canh-nhat); border-radius: 999px; padding: 1px 9px; letter-spacing: .02em; vertical-align: 4px; }

/* ===== khung máy tính: menu trái + nội dung ===== */
.may-tinh { height: 100vh; overflow: hidden; }
.khung { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100vh; }
nav.menu-trai { background: var(--mat); border-right: 1px solid var(--vien); padding: 18px 14px 14px; display: flex; flex-direction: column; min-height: 0; }
.ten-ht { font: 700 17px/1.25 var(--f-tieude); margin: 0 6px 2px; }
.phu-ht { color: var(--mo); font-size: 12.5px; margin: 0 6px 14px; }
.menu { display: grid; gap: 2px; }
.menu a, .menu .mo-mo { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 44px; padding: 4px 10px; border-radius: 9px; color: var(--chu); text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--xanh-nhat); }
.menu a[aria-current="page"] { background: var(--xanh); color: #fff; }
.menu .so { font: 600 12px var(--f-tieude); color: var(--mo); text-align: center; }
.menu a[aria-current="page"] .so { color: #fff; }
.menu .mo-mo { color: var(--mo2); cursor: not-allowed; }
.menu .mo-mo small { display: block; font-size: 11.5px; font-weight: 500; line-height: 1.2; color: var(--mo2); }
.menu .nho { display: block; font-size: 11.5px; font-weight: 400; line-height: 1.2; color: var(--mo); }
.menu a[aria-current="page"] .nho { color: var(--xanh-chu-nhat); }
.chan { margin-top: auto; border-top: 1px solid var(--vien); padding-top: 10px; display: grid; gap: 6px; }
.zalo { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 12.5px; color: var(--mo); padding: 0 10px; }
.zalo i { width: 9px; height: 9px; border-radius: 50%; background: var(--tot); }
main.noi-dung { display: grid; min-height: 0; padding: 20px 28px; gap: 14px; }
.dau { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.dau > * { min-width: 0; }
h1 { font: 700 25px/1.2 var(--f-tieude); margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dan { color: var(--mo); margin: 4px 0 0; font-size: 14px; }
.cum { display: flex; gap: 8px; align-items: center; }
.nut { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--vien); background: var(--mat); color: var(--xanh-dam); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.nut.chinh { background: var(--xanh); color: #fff; border-color: var(--xanh); }
.nut.do { color: var(--do); }
.nut.hoi { min-width: 44px; padding: 0; font-size: 16px; color: var(--mo); }
.khoi { background: var(--mat); border: 1px solid var(--vien); border-radius: 14px; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.khoi-dau { padding: 12px 16px; border-bottom: 1px solid var(--vien); display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
.khoi-dau h2 { font: 600 15.5px var(--f-tieude); margin: 0; flex: none; }
.khoi-dau p { margin: 0; color: var(--mo); font-size: 13px; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.cuon { overflow-y: auto; min-height: 0; flex: 1; }
.rong { padding: 28px 20px; color: var(--mo); text-align: center; }

/* ===== ô nhập + 3 dòng hướng dẫn (chữ đọc từ huong-dan.json) ===== */
.truong { display: grid; gap: 4px; margin-bottom: 12px; min-width: 0; }
.truong > label, .truong > .nhan-o { font-weight: 600; font-size: 13.5px; }
.truong input, .truong select, .truong textarea, .o-nhap { min-height: 44px; border: 1px solid var(--vien); border-radius: 9px; padding: 8px 12px; font-size: 15px; color: var(--chu); background: var(--mat); width: 100%; min-width: 0; }
.truong textarea { min-height: 72px; resize: vertical; }
input[aria-invalid="true"] { border-color: var(--do); }
.hd3 { display: grid; gap: 0; font-size: 12.5px; line-height: 1.45; color: var(--mo); overflow-wrap: anywhere; }
.hd3 b { font-weight: 600; color: #3F4A60; }
.loi-o { color: var(--do); font-size: 12.5px; font-weight: 600; }
.hai { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bong-hd { position: absolute; z-index: 25; background: var(--mat); border: 1px solid var(--vien); border-radius: 12px; box-shadow: 0 8px 24px rgba(23,32,51,.14); padding: 12px 14px; width: 320px; }

/* ===== cửa sổ: đóng bằng X, bấm ra ngoài, Esc ===== */
.nen { position: fixed; inset: 0; background: rgba(23,32,51,.45); display: none; align-items: center; justify-content: center; z-index: 20; }
.nen.mo { display: flex; }
.hop { background: var(--mat); width: min(600px, calc(100vw - 40px)); border-radius: 16px; padding: 22px 24px; position: relative; max-height: calc(100vh - 48px); overflow-y: auto; }
.hop h3 { font: 600 18px var(--f-tieude); margin: 0 48px 14px 0; overflow-wrap: anywhere; }
.x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--bg); font: 600 22px var(--f-chu); color: var(--mo); cursor: pointer; }
.cuoi-hop { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.hd ul { padding-left: 20px; margin: 0; } .hd li { margin: 6px 0; font-size: 14px; }

/* ===== thông báo nổi: phía trên bên phải, chừa 310px cho các nút đầu trang (không đè nút Hướng dẫn / Thêm) ===== */
.bao { position: fixed; top: 14px; right: 310px; z-index: 30; display: none; align-items: center; gap: 12px; background: #172033; color: #fff; font-size: 14px; padding: 6px 6px 6px 16px; border-radius: 12px; max-width: min(460px, calc(100vw - 40px)); box-shadow: 0 8px 24px rgba(23,32,51,.25); }
.bao.hien { display: flex; }
.bao { pointer-events: none; } .bao button { pointer-events: auto; }
.bao span { overflow-wrap: anywhere; min-width: 0; padding: 6px 0; }
.bao button { min-height: 44px; padding: 0 14px; border-radius: 9px; border: 0; background: #2E3A55; color: #fff; font-weight: 600; cursor: pointer; flex: none; }
.bao:not(.co-nut) { padding-right: 16px; }

/* ===== màn máy tính mở trên điện thoại: nói rõ, không vỡ bố cục ===== */
.chi-may-tinh { display: none; padding: 32px 20px; max-width: 460px; margin: 0 auto; }
.chi-may-tinh h1 { font-size: 21px; margin-bottom: 8px; }
.chi-may-tinh p { color: var(--mo); }
.chi-may-tinh .dt-ds { margin: 16px 0 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; overflow-wrap: anywhere; }
.chi-may-tinh .dt-nut { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.chi-may-tinh .dt-nut .nut { min-height: 44px; }
@media (max-width: 999px) {
  .may-tinh { height: auto; overflow: auto; }
  .may-tinh .khung { display: none; }
  .may-tinh .chi-may-tinh { display: block; }
}

/* ===== vòng 2 soát màn (việc 20261104-20) ===== */
[hidden] { display: none !important; }   /* thuộc tính hidden thắng mọi display của .nut/.truong (lỗi M9) */
.nut:disabled { opacity: .55; cursor: not-allowed; }
/* thông báo nổi: ĐÁY GIỮA màn (không đè nút đầu trang) */
.bao { top: auto; bottom: 24px; left: 50%; right: auto; transform: translateX(-50%); }
