:root {
  --xanh: #16A34A; --xanh-dam: #15803D; --xanh-dam2: #166534; --xanh-nhat: #DCFCE7; --xanh-nen: #F3FBF5;
  --cam: #EA580C; --cam-nhat: #FFEDD5;
  --chu: #14201A; --chu-phu: #55625A; --vien: #DDE7E0; --the: #FFFFFF;
  --do: #C81E1E; --do-nhat: #FDECEC; --vang: #B45309; --vang-nhat: #FEF3C7; --duong: #1D4ED8; --duong-nhat: #DBEAFE;
  --bo: 16px; --bong: 0 1px 2px rgba(20,32,26,.05), 0 6px 18px rgba(20,32,26,.07);
  --chuyen: linear-gradient(135deg, #22C55E 0%, #16A34A 50%, #15803D 100%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--chu); background: var(--xanh-nen); min-height: 100vh; }
a { color: var(--xanh-dam); }
img { max-width: 100%; }
h1 { font-size: 1.35rem; margin: .2rem 0 .6rem; line-height: 1.3; }
h2 { font-size: 1.12rem; margin: 1.2rem 0 .6rem; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 1.02rem; margin: 1rem 0 .4rem; }
.bt { width: 22px; height: 22px; flex: 0 0 auto; vertical-align: -5px; }
.bt-nho { width: 17px; height: 17px; vertical-align: -3px; }
.an { display: none !important; }

/* ---------- Dau trang va thanh menu day ---------- */
.dau { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--chuyen); color: #fff; box-shadow: 0 3px 14px rgba(21,128,61,.25); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: #fff; text-decoration: none; min-width: 0; }
.logo img { border-radius: 10px; background: #fff; flex: 0 0 auto; }
.logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo small { display: block; font-weight: 500; font-size: .78rem; opacity: .92; }
.dau .nut-dau { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 12px; min-height: 42px; padding: 0 12px; font: inherit; font-weight: 700; font-size: .9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px 110px; }
.menu-day { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--vien); padding: 6px 6px max(6px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(20,32,26,.06); }
.menu-day a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px;
  color: var(--chu-phu); text-decoration: none; font-size: .78rem; font-weight: 700; border-radius: 12px; }
.menu-day a .bt { width: 25px; height: 25px; }
.menu-day a.chon { color: var(--xanh-dam); background: var(--xanh-nhat); }
.menu-day a.dang { color: #fff; }
.menu-day a.dang .vong { width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; background: var(--chuyen); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(21,128,61,.4); border: 4px solid #fff; }
.menu-day a.dang span:last-child { color: var(--xanh-dam); }
.cham-do { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--do); color: #fff; font-size: .72rem; line-height: 20px; text-align: center; }
@media (min-width: 820px) { .menu-day { max-width: 760px; margin: 0 auto; border-radius: 18px 18px 0 0; border: 1px solid var(--vien); } }

/* ---------- Nut ---------- */
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 20px; border: 0; border-radius: 14px;
  background: var(--chuyen); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 0 4px 12px rgba(21,128,61,.22); }
.nut:active { transform: translateY(1px); }
.nut:disabled { opacity: .55; cursor: default; }
.nut-nho { min-height: 42px; padding: 6px 14px; font-size: .95rem; border-radius: 12px; }
.nut-vien { background: #fff; color: var(--xanh-dam); box-shadow: inset 0 0 0 2px var(--xanh); }
.nut-xam { background: #EEF2EF; color: var(--chu); box-shadow: none; }
.nut-do { background: linear-gradient(135deg, #EF4444, #B91C1C); box-shadow: 0 4px 12px rgba(185,28,28,.2); }
.nut-do-vien { background: #fff; color: var(--do); box-shadow: inset 0 0 0 2px #F3B4B4; }
.nut-zalo { background: linear-gradient(135deg, #2F80ED, #0068FF); box-shadow: 0 4px 12px rgba(0,104,255,.25); }
.nut-rong { width: 100%; }
.hang-nut { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.hang-nut > .nut { flex: 1 1 140px; }

/* ---------- Khoi chung ---------- */
.the { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo); padding: 16px; margin-bottom: 14px; box-shadow: var(--bong); }
.phu { color: var(--chu-phu); font-size: .93rem; }
.nho { font-size: .88rem; }
.dam { font-weight: 700; }
.giua { text-align: center; }
.nhan { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #EEF2EF; color: var(--chu); white-space: nowrap; }
.nhan-cu-dan { background: var(--xanh-nhat); color: var(--xanh-dam2); }
.nhan-ngoai { background: var(--cam-nhat); color: #9A3412; }
.nhan-xanh { background: var(--xanh-nhat); color: var(--xanh-dam2); }
.nhan-cam { background: var(--vang-nhat); color: var(--vang); }
.nhan-do { background: var(--do-nhat); color: var(--do); }
.nhan-duong { background: var(--duong-nhat); color: var(--duong); }
.hop-bao { padding: 12px 14px; border-radius: 14px; margin: 10px 0; font-size: .95rem; }
.hop-bao.vang { background: var(--vang-nhat); color: #78350F; }
.hop-bao.xanh { background: var(--xanh-nhat); color: var(--xanh-dam2); }
.hop-bao.do { background: var(--do-nhat); color: #7F1D1D; }
.hop-bao.duong { background: var(--duong-nhat); color: #1E3A8A; }
.trong { text-align: center; color: var(--chu-phu); padding: 30px 10px; }
.trong .bt { width: 44px; height: 44px; opacity: .5; }
.dong-tt { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--vien); }
.dong-tt:last-child { border-bottom: 0; }
.dong-tt > span:first-child { color: var(--chu-phu); }
.dong-tt > span:last-child { text-align: right; font-weight: 600; }

/* ---------- Form ---------- */
label.o { display: block; margin: 12px 0; font-weight: 600; font-size: .95rem; }
label.o > input, label.o > select, label.o > textarea, .o-mk { display: block; width: 100%; margin-top: 6px; }
input, select, textarea { font: inherit; font-size: 17px; padding: 12px 14px; border: 1.5px solid #C9D6CD; border-radius: 12px; background: #fff; color: var(--chu); min-height: 50px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(22,163,74,.25); border-color: var(--xanh); }
.hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ba-cot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
.goi-y { font-weight: 400; color: var(--chu-phu); font-size: .85rem; margin-top: 4px; display: block; }
.o-tich { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; font-size: .95rem; line-height: 1.45; cursor: pointer; }
.o-tich input { width: 24px; height: 24px; min-height: 0; flex: 0 0 auto; margin-top: 1px; accent-color: var(--xanh); }
.o-mk { position: relative; }
.o-mk input { width: 100%; padding-right: 52px; }
.nut-mat { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--chu-phu); cursor: pointer; }
.chon-nhom { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chon-nhom label { flex: 1 1 120px; display: flex; align-items: center; gap: 8px; padding: 12px; border: 1.5px solid #C9D6CD; border-radius: 12px; font-weight: 600; cursor: pointer; background: #fff; }
.chon-nhom label:has(input:checked) { border-color: var(--xanh); background: var(--xanh-nhat); }
.chon-nhom input { min-height: 0; width: 20px; height: 20px; accent-color: var(--xanh); }

/* O nhap PIN */
.o-pin { letter-spacing: .5em; text-align: center; font-size: 1.5rem; font-weight: 700; }

/* ---------- Trang cho ---------- */
.tieu-cc { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tim { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid #C9D6CD; border-radius: 14px; padding: 0 6px 0 12px; }
.tim input { border: 0; flex: 1; min-width: 0; padding-left: 0; }
.tim input:focus { outline: none; }
.ghim { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #FFFBEB; border: 1px solid #FDE68A; margin: 12px 0; font-size: .95rem; }
.ghim .bt { color: var(--vang); }
.danh-muc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.o-dm { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 600; color: var(--chu); text-align: center; line-height: 1.2; cursor: pointer; border-radius: 14px; text-decoration: none; }
.o-dm .vong { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; }
.o-dm .vong .bt { width: 28px; height: 28px; }
.o-dm.chon { background: var(--xanh-nhat); }
.loc { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 8px 0; }
.loc select { min-height: 42px; padding: 6px 10px; font-size: .9rem; flex: 0 0 auto; }
.ngang { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; }
.ngang .o-tin { flex: 0 0 168px; scroll-snap-align: start; }
.luoi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 620px) { .luoi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.o-tin { display: block; background: #fff; border: 1px solid var(--vien); border-radius: 16px; overflow: hidden; color: var(--chu); text-decoration: none; box-shadow: var(--bong); }
.o-tin .anh { aspect-ratio: 1; background: #E7EFE9 center/cover no-repeat; position: relative; }
.o-tin .anh .nhan { position: absolute; left: 8px; top: 8px; }
.o-tin .anh .het { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.6); font-weight: 800; color: var(--chu-phu); }
.o-tin .noi { padding: 10px 12px 12px; }
.o-tin .ten { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.o-tin .gia { color: var(--xanh-dam); font-weight: 800; margin-top: 4px; }
.o-tin .gia s { color: var(--chu-phu); font-weight: 400; font-size: .85rem; margin-left: 4px; }
.o-tin .dong { display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; color: var(--chu-phu); margin-top: 4px; }
.sao { color: #F59E0B; }

/* ---------- Chi tiet tin ---------- */
.truot { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 16px; background: #E7EFE9; margin: -2px 0 12px; }
.truot img { flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: center; }
.gia-lon { font-size: 1.7rem; font-weight: 800; color: var(--xanh-dam); }
.gia-lon small { font-size: 1rem; color: var(--chu-phu); font-weight: 500; }
.hop-nb { display: flex; gap: 12px; align-items: center; }
.anh-dai-dien { width: 52px; height: 52px; border-radius: 50%; background: var(--xanh-nhat); color: var(--xanh-dam); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: 0 0 auto; }
.thanh-dat { position: fixed; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 25; padding: 10px 16px; background: rgba(255,255,255,.96); border-top: 1px solid var(--vien); }
.thanh-dat .trong-thanh { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.thanh-dat .nut { flex: 1; }
.so-luong { display: flex; align-items: center; gap: 0; border: 1.5px solid #C9D6CD; border-radius: 14px; overflow: hidden; width: max-content; }
.so-luong button { width: 54px; height: 54px; border: 0; background: #EEF2EF; font-size: 1.5rem; font-weight: 700; cursor: pointer; color: var(--chu); }
.so-luong input { width: 70px; border: 0; text-align: center; font-weight: 800; font-size: 1.2rem; border-radius: 0; }

/* ---------- Don hang ---------- */
.tab { display: flex; gap: 6px; background: #E7EFE9; padding: 4px; border-radius: 14px; margin-bottom: 12px; }
.tab a, .tab button { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-weight: 700; color: var(--chu-phu); text-decoration: none; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; }
.tab .chon { background: #fff; color: var(--xanh-dam); box-shadow: var(--bong); }
.o-don { display: flex; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--vien); border-radius: 16px; margin-bottom: 10px; color: var(--chu); text-decoration: none; }
.o-don .anh { width: 64px; height: 64px; border-radius: 12px; background: #E7EFE9 center/cover; flex: 0 0 auto; }
.o-don .noi { flex: 1; min-width: 0; }
.tien-trinh { display: flex; gap: 4px; margin: 12px 0 4px; }
.tien-trinh i { flex: 1; height: 6px; border-radius: 3px; background: #DDE7E0; }
.tien-trinh i.xong { background: var(--xanh); }
.ghi-chu-don { border-left: 3px solid var(--xanh); padding: 6px 10px; margin: 8px 0; background: var(--xanh-nen); border-radius: 0 10px 10px 0; font-size: .95rem; }
.qr { display: block; width: 260px; max-width: 100%; margin: 8px auto; border-radius: 12px; border: 1px solid var(--vien); }
.chon-sao { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.chon-sao button { border: 0; background: none; font-size: 2.2rem; line-height: 1; color: #D1D5DB; cursor: pointer; padding: 2px; }
.chon-sao button.chon { color: #F59E0B; }

/* ---------- Anh khi dang tin ---------- */
.ds-anh { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ds-anh .o-anh { position: relative; aspect-ratio: 1; border-radius: 12px; background: #E7EFE9 center/cover; }
.ds-anh .o-anh button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.1rem; cursor: pointer; }
.ds-anh .o-anh .dai-dien { position: absolute; left: 4px; bottom: 4px; }
.ds-anh .them-anh { aspect-ratio: 1; border: 2px dashed #A7BFB0; border-radius: 12px; display: grid; place-items: center; color: var(--xanh-dam); font-weight: 700; cursor: pointer; text-align: center; font-size: .85rem; }

/* ---------- Mau hinh ---------- */
.mau-hinh { width: 260px; max-width: 80vw; display: block; margin: 10px auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.mau-hinh .vung { fill: transparent; }
.mau-hinh .cham { fill: #A7BFB0; transition: r .1s; }
.mau-hinh g.chon .cham { fill: var(--xanh); r: 14; }
.mau-hinh .net, .mau-hinh .net-keo { stroke: var(--xanh); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.mau-hinh.sai .net { stroke: var(--do); }
.mau-hinh.sai g.chon .cham { fill: var(--do); }

/* ---------- Thong bao ---------- */
.o-tb { display: flex; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--vien); border-radius: 14px; margin-bottom: 8px; color: var(--chu); text-decoration: none; }
.o-tb.moi { border-color: var(--xanh); background: #F7FEF9; }
.o-tb .bt { color: var(--xanh-dam); margin-top: 2px; }
#thong-bao { position: fixed; left: 50%; transform: translateX(-50%); top: calc(70px + env(safe-area-inset-top)); z-index: 50; width: min(92vw, 480px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#thong-bao > div { background: #14532D; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 600; }
#thong-bao > div.loi { background: #991B1B; }

/* ---------- Hop thoai ---------- */
.nen-mo { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.hop-thoai { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
@media (min-width: 620px) { .nen-mo { align-items: center; } .hop-thoai { border-radius: 20px; } }
.hop-thoai h2 { margin-top: 0; }

/* ---------- Quy dinh ---------- */
.quy-dinh h3 { color: var(--xanh-dam2); }
.quy-dinh ol { padding-left: 22px; margin: 0; }
.quy-dinh li { margin: 6px 0; font-size: .95rem; }

/* ---------- Trang quan tri ---------- */
.qt main { max-width: 1100px; padding-bottom: 40px; }
.qt-menu { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.qt-menu a { flex: 0 0 auto; padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--vien); color: var(--chu); text-decoration: none; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.qt-menu a.chon { background: var(--xanh-dam); color: #fff; border-color: var(--xanh-dam); }
.qt-menu .so { background: var(--do); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .78rem; margin-left: 4px; }
.chi-so { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.chi-so .the { margin: 0; }
.chi-so .so-lon { font-size: 1.6rem; font-weight: 800; color: var(--xanh-dam); }
table.bang { width: 100%; border-collapse: collapse; font-size: .92rem; background: #fff; }
.bang th, .bang td { padding: 8px 10px; border-bottom: 1px solid var(--vien); text-align: left; vertical-align: top; }
.bang th { background: #F1F6F2; font-size: .82rem; color: var(--chu-phu); }
.cuon-ngang { overflow-x: auto; border: 1px solid var(--vien); border-radius: 12px; }
.anh-nho { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: #E7EFE9; }
.anh-cccd { max-width: 100%; width: 320px; border-radius: 10px; border: 1px solid var(--vien); cursor: zoom-in; }
[hidden] { display: none !important; }
.bt-to { width: 46px; height: 46px; opacity: .85; }
.thanh-dat .nut { min-height: 52px; }
.o-tb > div { min-width: 0; }
.anh-minh-chung { display: block; max-width: 100%; max-height: 260px; margin: 8px auto; border-radius: 12px; border: 1px solid var(--vien); background: #E7EFE9; min-height: 80px; cursor: zoom-in; }
/* Tong quan */
.chip-ky { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; scrollbar-width: none; }
.chip-ky a { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--vien); background: #fff; color: var(--chu-phu); font-weight: 600; font-size: .9rem; text-decoration: none; }
.chip-ky a.chon { background: var(--xanh-dam); border-color: var(--xanh-dam); color: #fff; }
.luoi-so { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.o-so { background: #fff; border: 1px solid var(--vien); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.o-so .gia-tri { font-size: 1.3rem; font-weight: 800; margin: 2px 0; overflow-wrap: anywhere; }
.o-so-chinh { grid-column: 1 / -1; background: var(--xanh-nhat); border-color: var(--xanh); }
.o-so-chinh .gia-tri { font-size: 1.7rem; color: var(--xanh-dam); }
.o-so-canh-bao .gia-tri { color: #C2410C; }
.bieu-do { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 6px; border-bottom: 1px solid var(--vien); }
.cot-bd { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.cot-bd i { display: block; width: 100%; background: var(--xanh); border-radius: 4px 4px 0 0; }
.loi-chao { display: flex; align-items: center; gap: 12px; margin: 2px 0 12px; color: var(--chu); text-decoration: none; }
.loi-chao .anh-dai-dien { width: 44px; height: 44px; font-size: 1.1rem; flex: none; }
.loi-chao .ten-chao { font-size: 1.2rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
