:root {
  --xanh: #02296E; --xanh-nhat: #e8eef9; --cam: #F6791C; --cam-nhat: #fff1e6;
  --chu: #1d2433; --chu-phu: #5b6475; --vien: #dfe4ec; --nen: #f4f6fa; --trang: #fff;
  --xanh-la: #13834a; --xanh-la-nhat: #e3f5ea; --do: #c62828; --do-nhat: #fdecec;
  --tim: #6a3fb5; --tim-nhat: #f0e9fb; --vang-nhat: #fff6d6;
  --bo: 14px; --bong: 0 1px 3px rgba(2,41,110,.08), 0 4px 14px rgba(2,41,110,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 16px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { font-family: Montserrat, "Be Vietnam Pro", system-ui, sans-serif; margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.dau-trang { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--xanh); color: #fff; }
.logo { width: 40px; height: 40px; border-radius: 10px; background: #fff; padding: 3px; flex: none; }
.ten-trang { flex: 1; min-width: 0; }
.ten-trang h1 { font-size: 18px; font-weight: 800; }
.dong-lich { margin: 2px 0 0; font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nut-tl { display: flex; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 15px; flex: none; }
.nut-tl span { font-size: 13px; font-weight: 600; }

.tab-chinh { display: grid; grid-template-columns: 1fr 1fr; background: var(--xanh); padding: 0 16px; gap: 6px; }
.tab-chinh button { border: 0; background: transparent; color: rgba(255,255,255,.75); padding: 12px 6px; font-weight: 700; font-size: 16px; border-bottom: 4px solid transparent; font-family: Montserrat, sans-serif; }
.tab-chinh button.dang-chon { color: #fff; border-bottom-color: var(--cam); }
.tab-chinh b, .phan-chon b { font-weight: 700; font-size: 12px; background: rgba(255,255,255,.18); border-radius: 99px; padding: 1px 7px; margin-left: 2px; }

main { max-width: 760px; margin: 0 auto; padding: 14px 16px 40px; }
.phan-chon { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--trang); border: 1px solid var(--vien); border-radius: 12px; padding: 4px; }
.phan-chon button { border: 0; background: transparent; padding: 10px 4px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--chu-phu); }
.phan-chon button.dang-chon { background: var(--xanh-nhat); color: var(--xanh); }
.phan-chon b { background: var(--nen); color: var(--chu-phu); }

.loc { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.loc::-webkit-scrollbar { display: none; }
.loc button { flex: none; border: 1px solid var(--vien); background: var(--trang); border-radius: 99px; padding: 7px 14px; font-size: 14px; font-weight: 500; }
.loc button.dang-chon { background: var(--cam); border-color: var(--cam); color: #fff; }
.loc-tt { padding: 6px 0 10px; }
.loc-tt label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--chu-phu); }
.loc-tt select { flex: 1; max-width: 260px; }

select, input[type=text], input[type=url], input[type=password], input[type=number], input[type=time], textarea {
  width: 100%; border: 1px solid var(--vien); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 16px; }
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--cam); outline-offset: 0; border-color: transparent; }

.nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: 15px; background: var(--xanh); color: #fff; min-height: 44px; }
.nut-phu { background: var(--trang); color: var(--xanh); border-color: var(--vien); }
.nut-do { background: var(--do); color: #fff; }
.nut-them { width: 100%; background: var(--trang); color: var(--xanh); border: 2px dashed #b9c6de; margin: 4px 0 12px; }
.nut-xong { width: 100%; background: var(--xanh-la); color: #fff; font-size: 19px; font-weight: 800; padding: 14px; min-height: 56px; border-radius: 12px; font-family: Montserrat, sans-serif; letter-spacing: .2px; box-shadow: 0 3px 0 #0d5c33; }
.nut-xong:active { transform: translateY(2px); box-shadow: 0 1px 0 #0d5c33; }
.nut-nho { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.nut:disabled { opacity: .6; cursor: wait; }

.ds { display: grid; gap: 12px; }
.the { background: var(--trang); border: 1px solid var(--vien); border-radius: var(--bo); padding: 14px; box-shadow: var(--bong); }
.the-dau { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ma { font-weight: 800; font-size: 13px; color: var(--xanh); font-family: Montserrat, sans-serif; }
.chip { font-size: 12.5px; font-weight: 600; border-radius: 99px; padding: 2px 10px; background: var(--nen); color: var(--chu-phu); }
.chip-tl { background: var(--cam-nhat); color: #a94a05; }
.tt-moi { background: #eceff3; color: #4b5563; }
.tt-xong { background: var(--xanh-la-nhat); color: var(--xanh-la); }
.tt-dung, .tt-doc { background: var(--xanh-nhat); color: var(--xanh); }
.tt-dang { background: var(--tim-nhat); color: var(--tim); }
.tt-khac { background: var(--vang-nhat); color: #8a6200; }
.the h3 { font-size: 17px; font-weight: 700; color: var(--xanh); margin-bottom: 4px; }
.phu { font-size: 13.5px; color: var(--chu-phu); }
.da-xong { margin: 10px 0 0; padding: 9px 12px; background: var(--xanh-la-nhat); color: #0d5c33; border-radius: 10px; font-size: 14px; }
.may-ghi { margin: 10px 0 0; padding: 9px 12px; background: var(--xanh-nhat); color: var(--xanh); border-radius: 10px; font-size: 14px; white-space: pre-wrap; }
.the .nut-xong, .the .nut-mo { margin-top: 12px; }
.nut-mo { width: 100%; background: var(--nen); color: var(--xanh); border: 1px solid var(--vien); }
.chi-tiet { margin-top: 12px; border-top: 1px dashed var(--vien); padding-top: 12px; display: grid; gap: 12px; }
.muc-ct h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--cam); font-family: Montserrat, sans-serif; }
.muc-ct p, .muc-ct div.chu { margin: 0; white-space: pre-wrap; font-size: 15px; }
.loi-doc { background: #fffdf7; border: 1px solid #f3e3c8; border-radius: 10px; padding: 12px; font-size: 17px !important; line-height: 1.65; }
.dong-chep { display: flex; gap: 8px; align-items: center; }
.dong-chep code { flex: 1; min-width: 0; background: var(--nen); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; word-break: break-all; }
.thao-tac { display: flex; gap: 8px; margin-top: 12px; }
.thao-tac .nut { flex: 1; }

.o-dan { background: var(--trang); border: 1px solid var(--vien); border-radius: var(--bo); padding: 14px; display: grid; gap: 10px; margin-bottom: 12px; box-shadow: var(--bong); }
.o-dan .nut-them { margin: 0; border-style: solid; background: var(--cam); color: #fff; border-color: var(--cam); }
.nhan { display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: var(--chu-phu); }
.dong-link { display: flex; align-items: center; gap: 8px; }
.bt-nen { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: #8b95a7; font-family: Montserrat, sans-serif; }
.bt-TikTok { background: #111; }
.bt-Facebook { background: #1877F2; }
.bt-YouTube { background: #FF0000; }
.bt-Instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.bt-Baiviet { background: var(--xanh); }
.link-dau { display: flex; gap: 10px; align-items: center; }
.link-dau a { color: var(--xanh); font-weight: 600; word-break: break-all; font-size: 14.5px; }
.trong { text-align: center; color: var(--chu-phu); padding: 30px 10px; background: var(--trang); border: 1px dashed var(--vien); border-radius: var(--bo); }

.chan { text-align: center; font-size: 12.5px; color: var(--chu-phu); padding: 10px 16px 30px; }

.phu-nen { position: fixed; inset: 0; z-index: 50; background: rgba(10,20,40,.5); display: flex; align-items: flex-end; justify-content: center; }
.phu-nen-tren { z-index: 60; align-items: center; padding: 16px; }
.hop { background: var(--trang); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; }
.hop-nho { border-radius: 16px; max-width: 420px; padding: 18px; }
.hop-nho p { margin: 0 0 14px; font-size: 16px; }
.hop-dau { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--vien); }
.hop-dau h2 { flex: 1; font-size: 17px; color: var(--xanh); }
.nut-dong { border: 0; background: var(--nen); border-radius: 50%; width: 36px; height: 36px; font-size: 16px; }
.hop-than { padding: 14px 16px; overflow-y: auto; display: grid; gap: 12px; }
.hop-chan { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--vien); }
.hop-nho .hop-chan { padding: 0; border: 0; }
.hop-chan .nut { flex: 1; }
.hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goi-y { font-size: 13px; color: var(--chu-phu); font-weight: 400; }
.nhom-tl { border: 1px solid var(--vien); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.nhom-tl h3 { font-size: 15px; color: var(--xanh); }
.dong-tl { display: flex; gap: 6px; align-items: center; }
.dong-tl input { flex: 1; min-width: 0; }
.dong-tl select { width: 128px; flex: none; font-size: 14px; padding: 10px 6px; }
.dong-tl button { flex: none; width: 40px; height: 42px; border: 1px solid var(--vien); background: #fff; border-radius: 10px; }
.nhom-tl .nut-phu { justify-self: start; }

.doc-to { position: fixed; inset: 0; z-index: 70; background: #111; color: #fff; display: flex; flex-direction: column; }
.doc-to-dau { display: flex; gap: 8px; padding: 10px 16px; justify-content: flex-end; }
.doc-to-chu { flex: 1; overflow-y: auto; padding: 10px 22px 60px; font-size: 30px; line-height: 1.6; white-space: pre-wrap; }

.bao { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; background: #1d2433; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 15px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.bao.loi { background: var(--do); }

@media (min-width: 700px) {
  .phu-nen { align-items: center; padding: 20px; }
  .hop { border-radius: 18px; }
}

/* Dòng trạng thái trong Thiết lập: tên chiếm cả hàng, "máy hiểu là" + nút xuống hàng dưới (điện thoại) */
.dong-tl:has(select) { flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px dashed var(--vien); }
.dong-tl:has(select) input { flex-basis: 100%; }
.dong-tl:has(select) select { flex: 1; width: auto; }
@media (max-width: 420px) {
  .ten-trang h1 { font-size: 16px; }
  .dong-lich { white-space: normal; }
}
