/* =====================================================================
   Bản máy chủ: màn đăng nhập, thẻ người dùng, ẩn nút theo quyền,
   trang tài khoản, hộp danh mục
   ===================================================================== */

/* ------------------------------------------------ màn đăng nhập */
.dn { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(120% 120% at 0% 0%, #1d3a8a 0%, var(--ink) 55%, #060e1f 100%); }
.dn::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px; }
.dn-the { position: relative; z-index: 1; width: min(420px, 100%); display: grid; gap: 14px; padding: 34px 32px 26px;
  background: #fff; border-radius: 22px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6); }
.dn-the img { width: 210px; height: auto; margin: 0 auto 4px; display: block; }
.dn-the h1 { text-align: center; font-family: var(--serif); font-size: 1.5rem; }
.dn-phu { margin: -8px 0 6px; text-align: center; color: var(--muted); font-size: .86rem; }
.dn-msg { margin: 0; min-height: 1.2em; color: var(--err); font-size: .85rem; font-weight: 600; }
.dn-the .btn { width: 100%; padding: 13px; font-size: 1rem; }
.dn-chan { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: .78rem; }
body.chua-dn .app { visibility: hidden; }

/* ------------------------------------------------ thẻ người dùng ở thanh bên */
body.may-chu .chi-cucbo { display: none; }
body:not(.may-chu) .sbn, body:not(.may-chu) .chi-tk { display: none; }
.sbn-dau { display: flex; align-items: center; gap: 10px; }
.sbn-chu { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 700; }
.sbn-dau b { display: block; color: #fff; font-size: .88rem; line-height: 1.25; }
.sbn-dau small { display: block; color: #9db6ff; font-size: .72rem; }
.sbn-nut { display: flex; gap: 6px; margin-top: 10px; }
.sbn-nut button { flex: 1; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85); font-size: .74rem; cursor: pointer; }
.sbn-nut button:hover { background: rgba(255,255,255,.14); color: #fff; }
.sbn-luu { margin-top: 8px; font-size: .7rem; color: rgba(255,255,255,.45); }
.sbn-luu::before { content: "●"; margin-right: 5px; color: #4fd18b; }
.sbn-luu.dang::before { color: #f4c152; }
.sbn-luu.loi { color: #ff9c9c; }
.sbn-luu.loi::before { color: #ff6b6b; }

/* ------------------------------------------------ ẩn phần không có quyền (máy chủ vẫn tự chặn) */
body.may-chu:not(.q-tai_khoan) .chi-tk,
body.may-chu:not(.q-nhap) [data-trang="nhap"], body.may-chu:not(.q-nhap) #b_nhanh,
body.may-chu:not(.q-nhap) #b_luu, body.may-chu:not(.q-nhap) #b_moi,
body.may-chu:not(.q-nhap) #kh_nhap, body.may-chu:not(.q-nhap) #kh_xuat, body.may-chu:not(.q-nhap) #kh_tra,
body.may-chu:not(.q-nhap) #cn_thu, body.may-chu:not(.q-nhap) #cn_chi,
body.may-chu:not(.q-nhap) #pk_luu, body.may-chu:not(.q-nhap) #tc_luu,
body.may-chu:not(.q-xoa) .xoa, body.may-chu:not(.q-xoa) .xoaPK, body.may-chu:not(.q-xoa) .xoaTC,
body.may-chu:not(.q-duyet) .duyet, body.may-chu:not(.q-duyet) #b_duyetHet,
body.may-chu:not(.q-xn) .kt-nut, body.may-chu:not(.q-xn) .kt-bo,
body.may-chu:not(.q-du_lieu) #b_t9, body.may-chu:not(.q-du_lieu) #b_mau, body.may-chu:not(.q-du_lieu) #b_xoaHet,
body.may-chu:not(.q-du_lieu) #b_nhap, body.may-chu:not(.q-du_lieu) #dl_xoa .kp { display: none !important; }
/* bản máy chủ không có "12 chuyến mẫu" (dữ liệu giả không được lẫn vào số thật) */
body.may-chu #b_mau { display: none !important; }

/* ------------------------------------------------ trang tài khoản */
.tkx-nhan { margin: 18px 0 8px; font-size: .78rem; font-weight: 700; color: var(--ink); }
.tkx-nhan i { color: var(--err); font-style: normal; }
.tkx-nhan em { font-style: normal; font-weight: 500; color: var(--muted); }
.tkx-vai { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tkx-vai .seg small { font-size: .74rem; }
.tkx-mang { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.tk-quyen td, .tk-quyen th { font-size: .8rem; }
.tkm-o { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-top: 8px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--line); }
.tkm-o span { color: var(--muted); font-size: .85rem; }
.tkm-o b { font-size: 1rem; color: var(--ink); letter-spacing: .02em; }

/* ------------------------------------------------ hộp danh mục */
.dmx-bool { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); font-size: .88rem; cursor: pointer; }
.dmx-bool input { width: 17px; height: 17px; accent-color: var(--brand); }
#dlg_dm .field input[readonly] { background: var(--ivory); color: var(--muted); }
