/* Module XẾP TUYẾN (0.9, theo yêu cầu anh Vũ 28/09) — kiểu riêng, tiền tố .tx-, CHỈ dùng biến của web/giao_dien.css (đúng cả chế độ tối).
   Bản web (body.hc-web): 2 cột (trái: sales → tuyến · phải: tuyến đang chọn), danh sách điểm kéo-thả, bản đồ cạnh danh sách, lịch tuần 7 cột.
   Bản điện thoại: một cột, ▲▼ ≥ 44 px, chân nút dính đáy. Không mã màu cứng (trừ trắng). */

/* ---- bố cục 2 cột (web) */
.tx-web{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start}
body.hc-web .tx-web{grid-template-columns:minmax(300px,340px) minmax(0,1fr)}
body.hc-web .tx-trai{position:sticky;top:calc(var(--web-tren,64px) + 16px);max-height:calc(100vh - var(--web-tren,64px) - 32px);overflow:auto;scrollbar-width:thin;padding-right:4px}
.tx-phai{min-width:0}
@media (max-width:1500px){ body.hc-web .tx-web{grid-template-columns:minmax(260px,290px) minmax(0,1fr);gap:16px} }

/* ---- cột trái: tìm + sales → tuyến */
.tx-tim{margin-bottom:8px}
.tx-trai-phu{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 2px 10px}
.tx-trai-phu .tx-nut-tao{margin-left:auto}
.tx-sales{margin:0 0 10px;border:1px solid var(--vien-2);border-radius:var(--r-lon,16px);background:var(--the);box-shadow:var(--bong-1);overflow:hidden}
.tx-sales-dau{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px 8px;border-bottom:1px solid var(--vien-2)}
.tx-sales-ten{flex:1;min-width:0}
.tx-sales-ten>b{display:block;font:800 15px/1.3 var(--tieu-de);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx-sales-ten small{display:block;font-size:12.5px;color:var(--mo);margin-top:1px;line-height:1.4}
.tx-sales-ten small b{font-weight:700}
.tx-nut-moi{flex:none;width:44px;height:44px;margin:-8px -6px -8px 0;display:grid;place-items:center;border-radius:12px;color:var(--chinh);text-decoration:none}
.tx-nut-moi:hover{background:var(--chinh-nhat)}
.tx-tuyen-ds{display:flex;flex-direction:column}
.tx-tuyen{display:flex;align-items:center;gap:10px;min-height:52px;padding:6px 10px 6px 12px;color:var(--chu);text-decoration:none;border-bottom:1px solid var(--vien-2)}
.tx-tuyen:last-child{border-bottom:0}
.tx-tuyen:hover{background:var(--nen)}
.tx-tuyen.tx-dang-chon{background:var(--vang-nhat);box-shadow:inset 3px 0 0 var(--vang)}
.tx-tuyen.tx-ngung{opacity:.62}
.tx-tuyen-giua{flex:1;min-width:0}
.tx-tuyen-giua b{display:block;font-size:14px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx-tuyen-giua small{display:block;font-size:12px;color:var(--mo);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx-tuyen-cb{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.tx-tuyen-cb .hc-chip{height:20px;font-size:11px;padding:0 7px}
.tx-chu-cam{color:var(--cam-dam);font-weight:700} .tx-chu-mo{color:var(--mo)}
.tx-tuyen-cuoi{flex:none;display:flex;align-items:center;gap:4px;color:var(--mo)}
.tx-cham{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--vien)}
.tx-cham.cam{background:var(--cam)} .tx-cham.do{background:var(--do)} .tx-cham.cham{background:var(--chinh)} .tx-cham.xam{background:var(--mo);opacity:.5}
.tx-trong{margin:0;padding:12px;font-size:13px;color:var(--mo)}
.tx-thu{flex:none;min-width:38px;height:30px;padding:0 6px;border-radius:9px;display:inline-grid;place-items:center;background:var(--cham);color:#fff;font:800 13px/1 var(--tieu-de);letter-spacing:.02em}
.tx-thu.tx-thu-dp{background:var(--vien);color:var(--mo)}
.tx-thu.tx-thu-lon{min-width:52px;height:44px;font-size:18px;border-radius:12px}

/* ---- cột phải: tổng quan (chưa chọn tuyến) */
.tx-hero{margin-bottom:12px}
.tx-cb-ds{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:10px}
.tx-cb{margin:0}
.tx-cb h3{display:flex;align-items:center;gap:8px;font-size:15px}
.tx-cb .hc-hang-ngang{justify-content:flex-end;max-width:52%}
.tx-xt-link{gap:6px}

/* ---- đầu tuyến */
.tx-dau{padding:12px 14px}
.tx-dau-hang{display:flex;align-items:flex-start;gap:12px}
.tx-dau-giua{min-width:0;flex:1}
.tx-dau-giua h3{margin:0;font:800 19px/1.25 var(--tieu-de);overflow-wrap:anywhere}
.tx-dau-giua .hc-phu{margin-top:3px}
.tx-ma{font-size:12.5px}
.tx-chip-hang{margin-top:10px}
.tx-dau-nut{margin:10px 0 0;flex-wrap:wrap}
.tx-dau-nut>*{flex:0 1 auto;min-width:0}
.tx-ap-dung{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 10px}
.tx-ap-dung>span{font:600 13px var(--noi-dung);color:var(--mo)}
.tx-ap-dung .hc-tab{margin:0;flex:0 0 auto}
.tx-ap-dung .hc-tab>button{flex:0 0 auto}

/* ---- 2 nửa trong cột phải (web): danh sách điểm | bản đồ */
.tx-2{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
body.hc-web .tx-2{grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr)}
@media (max-width:1100px){ body.hc-web .tx-2{grid-template-columns:minmax(0,1fr)} }
.tx-tab-web{max-width:440px}
.tx-2-phai{position:sticky;top:calc(var(--web-tren,64px) + 16px)}
.tx-bd-the{margin:0;padding:12px 14px}
.tx-bd-dau{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:8px}
.tx-bd-dau h3{margin:0;font:800 16px/1.3 var(--tieu-de)}
.tx-bd-phu{margin:8px 0 0;font-size:12.5px}
.tx-bd-chu-giai{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;margin:6px 0 0;font-size:12px;color:var(--mo)}
.tx-cg-cham{display:inline-block;width:12px;height:12px;border-radius:50%;background:var(--cham);border:2px solid var(--the);box-shadow:0 0 0 1px var(--vien);margin-right:4px;vertical-align:-2px}
.tx-cg-cham.tx-cg-ts{background:var(--vang)} .tx-cg-cham.tx-cg-ngung{background:var(--do)}
.tx-map{position:relative;height:420px;border-radius:12px;overflow:hidden;background:var(--nen-2);z-index:0}
.tx-map.tx-map-nho{height:300px}
.tx-map .leaflet-container{width:100%;height:100%;font-family:var(--noi-dung)}
.tx-map .hc-tai{height:100%;border-radius:0;margin:0}
.tx-rong-bd{padding:36px 16px}
.tx-dau-bd span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--cham);color:#fff;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.35);font:800 12.5px/1 var(--tieu-de)}
.tx-dau-bd span.tx-bd-ts{background:var(--vang);color:var(--cham-dam)}
.tx-dau-bd span.tx-bd-ngung{background:var(--do)}

/* ---- danh sách điểm (thứ tự) */
.tx-tab{margin-bottom:10px}
.tx-cong-cu{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:0 2px 8px;min-height:32px}
.tx-cong-cu-phai{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tx-ds{display:flex;flex-direction:column;gap:8px}
.tx-diem{position:relative;display:flex;align-items:center;gap:10px;padding:10px 8px 10px 10px;border:1px solid var(--vien-2);border-radius:14px;background:var(--the);box-shadow:var(--bong-1);min-width:0}
.tx-diem.tx-nghi{opacity:.72}
.tx-diem.tx-dang-chon{background:var(--vang-nhat);border-color:var(--vang)}
.tx-diem.tx-vua-doi{animation:tx-nhay 1.4s ease}
@keyframes tx-nhay{0%{background:var(--vang-nhat)}100%{background:var(--the)}}
.tx-diem.tx-dang-keo{opacity:.4}
.tx-diem.tx-tren::before,.tx-diem.tx-duoi::after{content:"";position:absolute;left:8px;right:8px;height:3px;border-radius:3px;background:var(--vang)}
.tx-diem.tx-tren::before{top:-6px} .tx-diem.tx-duoi::after{bottom:-6px}
.tx-keo{flex:none;width:24px;height:44px;display:grid;place-items:center;color:var(--mo);cursor:grab;touch-action:none}
.tx-diem[draggable="true"]{cursor:grab} .tx-diem.tx-dang-keo{cursor:grabbing}
.tx-o-chon{flex:none;width:44px;height:44px;display:grid;place-items:center;cursor:pointer}
.tx-o-chon input{width:22px;height:22px;margin:0;accent-color:var(--cham)}
.tx-stt{width:36px;height:36px;font-size:14px}
.tx-diem-giua{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.tx-ten-dong{display:flex;align-items:flex-start;gap:6px;min-width:0}
.tx-ten-dong .hc-hang{flex:none;margin-top:0;min-width:22px;height:22px;font-size:12.5px;border-radius:7px}
.tx-ten{font:700 15px/1.3 var(--noi-dung);color:var(--chu);text-decoration:none;overflow-wrap:anywhere;min-width:0}
.tx-ten:hover{color:var(--chinh);text-decoration:underline}
.tx-phu{font-size:12.5px;color:var(--mo);line-height:1.35;overflow-wrap:anywhere}
body.hc-web .tx-phu{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tx-chips{gap:5px}
.tx-chips .hc-chip{height:22px;font-size:11.5px;padding:0 8px}
button.tx-ts{border:1.5px solid var(--vien);cursor:pointer;font-family:inherit;min-height:32px;padding:0 10px}
button.tx-ts:disabled{cursor:default;opacity:1}
button.tx-ts:not(:disabled):hover{border-color:var(--chinh)}
.tx-diem-nut{flex:none;display:grid;grid-template-columns:44px 44px;gap:2px;align-items:center}
.tx-diem-nut>button{width:44px;height:44px;border:0;border-radius:10px;background:var(--nen-2);color:var(--chinh);font:800 15px/1 var(--noi-dung);cursor:pointer}
.tx-diem-nut>button:disabled{opacity:.3;cursor:default}
.tx-diem-nut>button:not(:disabled):hover{background:var(--chinh-nhat)}
.tx-diem-nut>button:focus-visible{outline:2px solid var(--chinh-2);outline-offset:1px}
.tx-diem-nut .tx-nut-them{grid-column:1/-1;height:36px;font-size:20px;letter-spacing:.1em}
body.hc-web .tx-diem-nut{grid-template-columns:36px 36px 36px}
body.hc-web .tx-diem-nut>button{width:36px;height:44px}
body.hc-web .tx-diem-nut .tx-nut-them{grid-column:auto;height:44px}
@media (max-width:420px){ .tx-diem{padding:8px 6px 8px 8px;gap:8px} .tx-stt{width:30px;height:30px;font-size:13px} .tx-diem-nut{grid-template-columns:40px 40px} .tx-diem-nut>button{width:40px;height:40px} }
.tx-chan{margin:0}
body.hc-web .tx-chan{margin:12px 0 0;justify-content:flex-end}
body.hc-web .tx-chan>*{flex:0 0 auto;min-width:180px}

/* ---- tấm thêm điểm / chọn tần suất */
.tx-loc-tim{margin:8px 0}
.tx-kq-tim{max-height:min(52vh,520px);overflow:auto;scrollbar-width:thin}
.tx-kq-ds{display:flex;flex-direction:column;gap:6px}
.tx-kq{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;padding:8px 10px;border:1px solid var(--vien-2);border-radius:12px;background:var(--the);color:var(--chu);font:inherit;text-align:left;cursor:pointer}
.tx-kq:hover{border-color:var(--chinh);background:var(--nen)}
.tx-kq>svg{flex:none;color:var(--mo)}
.tx-kq-giua{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.tx-kq-giua b{font-size:14.5px;line-height:1.3}
.tx-kq-giua small{font-size:12.5px;color:var(--mo);overflow-wrap:anywhere}
.tx-kq-giua .hc-chip{height:20px;font-size:11px;padding:0 7px}
.tx-chon-diem{margin:0 0 10px;display:flex;flex-direction:column;gap:2px}
.tx-sheet-them .hc-bao,.tx-sheet-them>div>p.hc-phu{margin-bottom:12px}
.tx-o-chon-dong{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14.5px;cursor:pointer;margin:0 0 10px}
.tx-o-chon-dong input{width:22px;height:22px;margin:0;accent-color:var(--cham);flex:none}
.tx-ts-chon>button b{font-size:15px} .tx-ts-chon>button.chon span{color:#fff;opacity:.85}
.tx-sheet-them{max-height:92vh}

/* ---- xem trước tuần */
.tx-xt-dh{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 10px}
.tx-xt-dh b{font:800 15px var(--tieu-de);text-align:center}
.tx-xt-ten{margin:0 0 8px}
.tx-tuan{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
body.hc-web .tx-tuan{grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));align-items:start}
.tx-ngay{border:1px solid var(--vien-2);border-radius:14px;background:var(--the);box-shadow:var(--bong-1);padding:10px 12px;min-width:0}
.tx-ngay.tx-hom-nay{border-color:var(--vang);box-shadow:inset 0 3px 0 var(--vang)}
.tx-ngay header{display:flex;flex-direction:column;gap:2px;margin-bottom:8px}
.tx-ngay header b{font:800 15px/1.3 var(--tieu-de)} .tx-ngay header b small{font-weight:600;color:var(--mo)}
.tx-ngay header>span{font-size:13px;color:var(--chu)} .tx-ngay header>small{font-size:11.5px;color:var(--mo);line-height:1.4}
.tx-xt-tuyen a{display:block;font-size:13px;color:var(--chinh);text-decoration:none;margin:6px 0 4px}
.tx-xt-ds{list-style:none;margin:0;padding:0;font-size:13px;line-height:1.45}
.tx-xt-ds li{display:flex;gap:6px;overflow-wrap:anywhere} .tx-xt-ds li>span:last-child{min-width:0}
.tx-xt-so{flex:none;min-width:20px;text-align:right;color:var(--mo);font-variant-numeric:tabular-nums}
.tx-xt-ds li.tx-an{color:var(--mo);opacity:.65} .tx-xt-ds li.tx-an>span:last-child{text-decoration:line-through}
.tx-xt-tuyen li i{font-style:normal;font-size:11px;color:var(--cam-dam)}
.tx-ghi{margin:10px 2px 0}

/* ---- lịch sử */
.tx-tg .nd .hc-chip{margin-right:4px;vertical-align:1px}
.tx-tg small{display:inline-block;margin-top:3px}
