/* An ninh trật tự (order.js): dùng chung bố cục .tv-* của traffic.css, phần dưới là riêng cho sự vụ. */
#orderView { display: none; }
body.tab-analytics #orderView { display: block; }
#orLiveBox[hidden], #orMore[hidden] { display: none; }

.livedot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px rgba(239,68,68,.22); flex: none; animation: blink 1.4s infinite; }
.stab svg { flex: none; }

/* dải "Đang diễn ra" */
.or-livebox { padding: 12px; }
.or-livebox .sec-t .tag { text-transform: none; letter-spacing: 0; }
.or-lives { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.lcard { flex: 0 0 250px; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid rgba(239,68,68,.35);
         background: rgba(239,68,68,.06); cursor: pointer; text-align: left; }
.lcard:hover { background: rgba(239,68,68,.11); }
.lcard.on { border-color: var(--accent); background: rgba(61,139,253,.1); }
.lcard .th { width: 66px; height: 44px; border-radius: 6px; overflow: hidden; flex: none; border: 1px solid var(--line); position: relative; background: #0b1016; }
.lcard .tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lcard b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard .c { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcard .d { font-size: 12px; color: #fca5a5; }

/* ảnh thu nhỏ: ảnh thật hoặc cảnh minh hoạ, khung sự vụ vẽ đè theo toạ độ chuẩn hoá */
.shot { position: relative; display: block; overflow: hidden; background: #0b1016; }
.shot > img, .shot > svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot .bx { position: absolute; border: 2px solid #f59e0b; border-radius: 2px; pointer-events: none; }
.shot .bx.m { border-width: 1.5px; border-color: #a78bfa; }
.shot .bx.g { border-style: dashed; border-color: #ef4444; background: rgba(239,68,68,.07); }
.shot .bx.fire { border-color: #f97316; background: rgba(148,163,184,.3); }
.shot .lv { position: absolute; left: 5px; top: 5px; font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; }

/* danh sách sự vụ */
.inc { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 8px 12px;
       border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; }
.inc:hover { background: #121a23; }
.inc.on { background: rgba(61,139,253,.09); border-color: rgba(61,139,253,.5); }
.inc .th { width: 104px; height: 62px; border-radius: 6px; border: 1px solid var(--line); }
.inc .mid { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.inc .t1 { display: flex; gap: 8px; align-items: center; min-width: 0; }
.inc .t1 b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc .t2 { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.inc .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.inc .rt .tag { font-size: 11px; padding: 0 8px; }
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.sev i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; background: currentColor; }
.sev.high { color: #f87171; } .sev.mid { color: #fbbf24; } .sev.low { color: #8b98a9; }

/* chi tiết */
.ohead { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ohead .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(239,68,68,.14); color: #fca5a5; }
.ohead .ic.vendor { background: rgba(245,158,11,.14); color: #fcd34d; } .ohead .ic.fire { background: rgba(249,115,22,.16); color: #fb923c; }
.ohead .tt { flex: 1; min-width: 160px; } .ohead .tt b { display: block; font-size: 16px; font-weight: 600; } .ohead .tt span { font-size: 12.5px; color: var(--muted); }
.stale { margin-top: 10px; font-size: 12.5px; color: #fcd34d; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35); border-radius: 8px; padding: 6px 10px; }
.pair { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pair figure { margin: 0; flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kf .im .shot { position: absolute; inset: 0; }
.pair .shot { aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--line); }
.pair figcaption { font-size: 12px; color: var(--muted); }
.big1 { margin-top: 14px; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px solid var(--line); }
.presence { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); margin-top: 5px; }
.presence span { display: block; height: 100%; }
.plbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 12px; }
.spark { margin-top: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.spark .h { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); } .spark .h b { color: var(--text); }
.spark svg { display: block; width: 100%; height: 70px; }
.call { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 1px solid rgba(239,68,68,.45); background: rgba(239,68,68,.08); }
.call .tx { flex: 1; min-width: 160px; } .call b { display: block; font-size: 14px; } .call span { font-size: 12.5px; color: #fca5a5; }
.call .btn { border-color: rgba(239,68,68,.5); color: #fecaca; }
.step { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 5px 0; font-size: 13px; }
.step .o { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; border: 2px solid #46515f; }
.step .o.done { border-color: var(--accent); background: var(--accent); }
.step .o.now { border-color: var(--bad); background: var(--bad); box-shadow: 0 0 0 3px rgba(239,68,68,.22); }
.step small { font-size: 12px; color: var(--muted); } .step .mono { font-size: 12.5px; color: #c9d3df; }
.mems { display: flex; flex-wrap: wrap; gap: 10px; }
.mem { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 70px; font-size: 11px; color: #c9d3df; text-align: center; }
.mem .a { width: 44px; height: 58px; border-radius: 6px; background: #0d1319; border: 1px solid var(--line); display: grid; place-items: center; }
.mem span + span { color: var(--muted); }
.mem { width: 84px; }
.mem .a { width: 64px; height: 92px; overflow: hidden; }
.mem .a img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mem .mt { font-size: 10.5px; line-height: 1.3; }
.mem.wait { opacity: .6; }
.veh { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.veh + .veh { margin-top: 8px; }
.veh .tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; } .veh .tx b { font-weight: 500; font-size: 13px; } .veh .tx span { font-size: 12px; color: var(--muted); }
.objs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hlog { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.hlog div { display: flex; gap: 10px; } .hlog .mono { color: var(--muted); flex: none; }
.hrow { display: flex; flex-wrap: wrap; gap: 10px; }
.hrow .fld { flex: 1 1 180px; }
.hrow .fld.w2 { flex: 2 1 220px; }

@media (max-width: 900px) { .inc { grid-template-columns: minmax(0, 1fr) auto; } .inc .th { display: none; } }

/* Hộp xem bằng chứng bán hàng rong: ảnh lớn + khung từng đồ vật + bảng kết luận */
.pair figure button.zoom { all: unset; cursor: zoom-in; display: block; border-radius: 8px; }
.pair figure button.zoom:focus-visible { outline: 2px solid var(--accent, #60a5fa); outline-offset: 2px; }
.pair figure button.zoom .shot { position: relative; }
.pair figure button.zoom .shot::after { content: 'Phóng to · phân tích'; position: absolute; right: 6px; bottom: 6px; font-size: 11px; padding: 2px 8px;
  border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; opacity: 0; transition: opacity .15s; }
.pair figure button.zoom:hover .shot::after, .pair figure button.zoom:focus-visible .shot::after { opacity: 1; }
#vdDlg { width: min(1320px, 97vw); max-height: 94vh; }
#vdDlg .mb { overflow: auto; }
.vd-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.vd-tg { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.vd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.vd-main { position: relative; border-radius: 10px; overflow: hidden; background: #0b1016; line-height: 0; }
.vd-main img { width: 100%; height: auto; display: block; }
.vd-main .ob { position: absolute; border: 2px solid var(--c); border-radius: 2px; pointer-events: none; line-height: 1.2; transition: box-shadow .12s; }
.vd-main .ob > b { display: none; position: absolute; left: -2px; bottom: 100%; white-space: nowrap; font-size: 11px; font-weight: 600; padding: 1px 5px;
  background: var(--c); color: #0b1016; border-radius: 3px 3px 3px 0; }
.vd-main .ob.low > b { top: 100%; bottom: auto; border-radius: 0 3px 3px 3px; }
.vd-main .ob.lb > b, .vd-main .ob.hl > b { display: block; }
.vd-main.hlon .ob:not(.hl):not(.cl) { opacity: .25; }
.vd-main .ob.hl { box-shadow: 0 0 0 1px #fff; z-index: 2; }
.vd-main .ob.cl { --c: #ef4444; border-width: 3px; border-style: dashed; }
.vd-main .ob.zn { --c: rgba(148,163,184,.9); border-style: dotted; background: rgba(148,163,184,.08); }
.vd-main .ob.pe { --c: #38bdf8; }
.vd-main .ob.old { border-style: dashed; opacity: .6; }
.vd-main:not(.old) .ob.old { display: none; }
.vd-objs tr.gone td { color: var(--muted); }
.vd-main.no-obj .ob.it, .vd-main.no-per .ob.pe, .vd-main:not(.zone) .ob.zn { display: none; }
.vd-main .ob.dt { border-width: 1px; opacity: .8; }                     /* detection thô: nét mảnh, dưới khung của cụm */
.vd-main .ob.dt.dr { --c: #94a3b8; border-style: dashed; opacity: .7; }  /* luật bỏ: ngoài vùng giám sát / quá nhỏ */
.vd-main.no-det .ob.dt { display: none; }
.vd-dets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; } .vd-dets .tag i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 5px; }
.vd-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vd-verdict { border-radius: 10px; padding: 12px 14px; border: 1px solid; }
.vd-verdict.ok { border-color: rgba(239,68,68,.55); background: rgba(239,68,68,.1); }
.vd-verdict.no { border-color: var(--line); background: var(--panel2, rgba(255,255,255,.03)); }
.vd-verdict b { display: block; font-size: 15px; }
.vd-verdict span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.vd-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vd-rules li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 8px; font-size: 13px; }
.vd-rules .ic { grid-row: span 2; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.vd-rules .ok .ic { background: rgba(34,197,94,.18); color: #4ade80; }
.vd-rules .no .ic { background: rgba(148,163,184,.15); color: var(--muted); }
.vd-rules .need { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.vd-rules .val { color: var(--muted); font-size: 12px; }
.vd-objs { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.vd-objs th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.vd-objs td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.vd-objs tr[data-g] { cursor: default; }
.vd-objs tr[data-g]:hover, .vd-objs tr[data-g].hl { background: rgba(255,255,255,.06); }
.vd-objs td.mono { white-space: nowrap; font-variant-numeric: tabular-nums; }
.vd-objs { table-layout: fixed; }
.vd-objs th { white-space: nowrap; }
.vd-objs th:nth-child(2) { width: 84px; }
.vd-objs th:nth-child(3) { width: 82px; }
.vd-objs td:nth-child(2) { white-space: nowrap; }
.vd-conf i { flex-basis: 34px; }
.vd-objs .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.vd-conf { display: flex; align-items: center; gap: 6px; }
.vd-conf i { flex: 0 0 44px; height: 5px; border-radius: 3px; background: rgba(148,163,184,.25); overflow: hidden; }
.vd-conf i::before { content: ''; display: block; height: 100%; width: var(--w); background: var(--c); }
.vd-note { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .vd-grid { grid-template-columns: 1fr; } }
