/* Khu quản trị — dùng chung bảng màu với trang trình chiếu. */
:root {
  --do: #C8102E;
  --do-dam: #8C0A1F;
  --vang: #FFCD00;
  --nen: #EEF1F6;
  --mat: #FFFFFF;
  --mat-2: #F5F7FA;
  --chu: #111A2A;
  --phu: #4A5568;
  --vien: #D5DCE7;
  --xanh: #1D4ED8;
  --tot: #13743A;
  --tot-nen: #DCF3E3;
  --loi: #B42318;
  --loi-nen: #FDE7E4;
  --font: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 400 15px/1.55 var(--font); }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
a { color: var(--xanh); }
:focus-visible { outline: 3px solid var(--vang); outline-offset: 2px; border-radius: 4px; }
.so { font-variant-numeric: tabular-nums; }

.qt-dau {
  background: linear-gradient(115deg, var(--do-dam), var(--do));
  color: #fff; padding-block: .6rem; padding-inline: 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
}
.qt-dau a { color: #fff; text-decoration: none; }
.qt-thuong-hieu { display: flex; align-items: center; gap: .6rem; font-weight: 800; }
.qt-menu { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.qt-menu a { padding: .5rem .8rem; border-radius: 8px; font-weight: 500; min-height: 40px; display: inline-flex; align-items: center; }
.qt-menu a:hover { background: rgb(255 255 255 / .12); }
.qt-menu a[aria-current="page"] { background: #fff; color: var(--do); font-weight: 600; }
.qt-nguoi { display: flex; align-items: center; gap: 1rem; font-size: 14px; margin-left: auto; }
.qt-nguoi form { margin: 0; }
.nut-chu { background: none; border: 1px solid rgb(255 255 255 / .5); color: #fff; font: inherit; padding: .4rem .75rem; border-radius: 8px; cursor: pointer; }

.qt-than { max-width: 1180px; margin: 0 auto; padding-block: 24px 64px; padding-inline: 20px; display: flex; flex-direction: column; gap: 20px; }
.hop { background: var(--mat); border: 1px solid var(--vien); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.hop-hep { max-width: 440px; margin: 40px auto; width: 100%; }
.hop h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.hop h2 { font-size: 17px; font-weight: 800; }
.dau-trang { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.dau-trang h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.dau-trang p { color: var(--phu); }
.nhan-nho { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--do); }
.goi-y { font-size: 13px; color: var(--phu); }

.thong-bao { padding: 10px 14px; border-radius: 10px; font-weight: 500; }
.thong-bao.ok { background: var(--tot-nen); color: var(--tot); }
.thong-bao.loi { background: var(--loi-nen); color: var(--loi); }

label { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; gap: 5px; }
label .goi-y { font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  font: inherit; color: var(--chu); background: var(--mat); border: 1px solid var(--vien); border-radius: 8px;
  padding: 8px 10px; min-height: 40px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--xanh); outline: 2px solid rgb(29 78 216 / .2); }
input[aria-invalid="true"] { border-color: var(--loi); background: var(--loi-nen); }
.o-chon { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.o-chon input { width: 18px; height: 18px; }
.luoi-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.hang-nut { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 14px/1 var(--font); padding: 11px 16px; min-height: 42px; border-radius: 10px; cursor: pointer;
  background: var(--do); color: #fff; border: 1px solid var(--do); text-decoration: none;
}
.nut:hover { background: var(--do-dam); }
.nut.phu { background: var(--mat); color: var(--chu); border-color: var(--vien); }
.nut.phu:hover { border-color: var(--chu); }
.nut.nguy { background: var(--mat); color: var(--loi); border-color: #F1B5AE; }
.nut.nho { padding: 7px 11px; min-height: 34px; font-size: 13px; }

.bang-cuon { overflow-x: auto; border: 1px solid var(--vien); border-radius: 12px; background: var(--mat); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--phu); background: var(--mat-2); padding: 10px 12px; border-bottom: 1px solid var(--vien); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--vien); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.so, th.so { text-align: right; }
.cham-mau { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.the-nho { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--mat-2); color: var(--phu); }
.the-nho.admin { background: #FDE7E4; color: var(--do); }
.the-nho.tat { background: #EEE; color: #555; }

/* Bảng nhập số */
.nhom-lv { border: 1px solid var(--vien); border-radius: 14px; background: var(--mat); overflow: hidden; }
.nhom-lv > h2 { font-size: 16px; font-weight: 800; padding: 12px 16px; background: var(--mat-2); border-bottom: 1px solid var(--vien); display: flex; align-items: center; gap: 8px; }
.dong-nhap { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(130px, .8fr) minmax(110px, .6fr) minmax(140px, .7fr) minmax(180px, 1.2fr); gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--vien); align-items: start; }
.dong-nhap:last-child { border-bottom: 0; }
.dong-nhap .ten b { display: block; font-weight: 600; }
.dong-nhap .ten span { font-size: 12.5px; color: var(--phu); }
/* Lối tắt sửa định nghĩa chỉ tiêu ngay trong lúc nhập số; mờ đi để không tranh chỗ với ô nhập. */
.sua-ct { margin-left: 8px; font-size: 12px; color: var(--phu); text-decoration: underline; text-underline-offset: 2px; opacity: .55; }
.dong-nhap:hover .sua-ct, .sua-ct:focus-visible { opacity: 1; color: var(--chinh); }
.dong-nhap label { font-size: 12px; color: var(--phu); font-weight: 600; }
.ky-truoc { font-size: 12px; color: var(--phu); }
.loi-o { font-size: 12.5px; color: var(--loi); font-weight: 600; }
.thanh-luu { position: sticky; bottom: 0; background: rgb(238 241 246 / .92); backdrop-filter: blur(6px); padding-block: 12px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--vien); }

@media (max-width: 860px) {
  .dong-nhap { grid-template-columns: 1fr 1fr; }
  .dong-nhap .ten { grid-column: 1 / -1; }
  .qt-nguoi { margin-left: 0; }
}

input[type=file] {
  font: inherit; color: var(--chu); background: var(--mat-2); border: 1px dashed var(--vien);
  border-radius: 8px; padding: 14px; width: 100%; cursor: pointer;
}
input[type=file]:hover { border-color: var(--xanh); }
input[type=file]::file-selector-button {
  font: 600 13px var(--font); color: #fff; background: var(--do); border: 0;
  border-radius: 6px; padding: 8px 12px; margin-right: 12px; cursor: pointer;
}
.nhom-lv > h2 { justify-content: flex-start; }

/* Lưới sửa bảng dữ liệu — mỗi ô một ô nhập, gọn để thấy được nhiều cột */
.luoi-o { max-height: 70vh; overflow: auto; }
.luoi-o table { font-size: 13px; }
.luoi-o thead th { position: sticky; top: 0; z-index: 1; text-transform: none; letter-spacing: 0; vertical-align: top; min-width: 140px; }
.luoi-o thead th:first-child, .luoi-o thead th:last-child { min-width: 0; }
.luoi-o td { padding: 2px 4px; vertical-align: middle; }
.luoi-o input[type=text], .luoi-o textarea { min-height: 30px; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
.luoi-o textarea { min-height: 30px; min-width: 260px; }
.luoi-o th input[type=text] { font-weight: 600; background: var(--mat); }
.xoa-cot { font-size: 11.5px; font-weight: 400; margin-top: 4px; color: var(--phu); }
.xoa-cot input { width: 14px; height: 14px; }
.dong-moi td { background: #FFFBEA; }
.ma-mau { overflow-x: auto; background: var(--mat-2); padding: 12px; border-radius: 8px; font-size: 13px; margin: 0; }

.an-chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nut[disabled] { opacity: .5; cursor: not-allowed; }

/* Cấu hình hiển thị */
.cau-hinh { display: flex; flex-direction: column; gap: 12px; }
.cau-hinh h3 { font-size: 15px; font-weight: 800; margin-top: 8px; }
.cau-hinh td { padding: 6px 8px; vertical-align: middle; }
.cau-hinh select, .cau-hinh input[type=text] { min-height: 34px; padding: 5px 8px; font-size: 13.5px; }
.tieu-de-phan { font-size: 18px; font-weight: 800; }

.luoi-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px 28px; }
.luoi-2 h2 { font-size: 16px; }
