/* Lớp tc-* của trang Cấu hình máy DeepStream (agent-config.js: Giao thông, Bán hàng rong, Tụ tập, Danh tính). Bố cục trang +
   phần gắn với từng trang ở agent-config.css. */
body.tv-cfg #trafficView .tv-body { display: none; }
.stab.cfg { gap: 7px; }

.tc-side { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 0; }
.tc-nrow { display: flex; gap: 6px; }
.tc-nrow select.sel { flex: 1; min-width: 0; }
.tc-plus { width: 38px; padding: 0; justify-content: center; font-size: 20px; font-weight: 500; flex: none; }
.tc-nstat { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.tc-nstat .tag { font-size: 11px; padding: 1px 8px; }
.tc-nstat > div { flex-basis: 100%; }
.tc-nstat .bad, .tc-msg.bad, .tc-noimg .bad { color: #fca5a5; }
.tc-err { color: #fca5a5; font-size: 12px; word-break: break-word; }
.tc-cams { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.tc-cams .crow { padding: 6px 8px; min-height: 46px; text-align: left; }
.tc-cams .crow .nm { display: flex; flex-direction: column; gap: 1px; }
.tc-cams .crow .nm small { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.tc-newrow { cursor: default; border-style: dashed !important; }
.tc-newrow .d { background: var(--warn) !important; }
.tc-side > .btn { justify-content: center; }

.tc-stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.tc-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.tc-bar .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-canvas { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; background: #0b1016; }
.tc-noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-size: 13.5px;
            background: rgba(11,16,22,.82); }
.tc-noimg[hidden] { display: none; }
.tc-noimg .spin { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.tc-hint { min-height: 40px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: #c9d3df; }

.tc-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 0; overflow-y: auto; }
.tc-form { display: flex; flex-wrap: wrap; gap: 10px; }
.tc-form .fld { flex: 1 1 150px; }
.tc-form .fld.w2, .tc-form .btn.w2 { flex: 1 1 100%; justify-content: center; }
.tc-form input:disabled { opacity: .6; }
.tc-feats { display: flex; flex-direction: column; gap: 8px; }
.tc-feat { border: 1px solid var(--line2); border-left: 3px solid var(--fc); border-radius: 9px; background: var(--panel); }
.tc-feat.act { box-shadow: 0 0 0 1px var(--fc); }
.tc-fh { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: pointer; font-size: 13.5px; }
.tc-fh .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--fc); flex: none; }
.tc-fh .muted { font-size: 12px; }
.tgl { position: relative; flex: none; width: 34px; height: 19px; }
.tgl input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tgl i { position: absolute; inset: 0; border-radius: 999px; background: var(--panel3); border: 1px solid var(--line2); transition: .15s; pointer-events: none; }
.tgl i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #8b98a9; transition: .15s; }
.tgl input:checked + i { background: var(--fc); border-color: var(--fc); }
.tgl input:checked + i::after { left: 17px; background: #fff; }
.tgl input:disabled + i { opacity: .4; }
.tgl input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.tc-fb { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.tc-slot { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 8px; border: 1px solid transparent; border-radius: 7px; font-size: 12.5px; cursor: pointer; }
.tc-slot:hover { background: var(--panel2); }
.tc-slot.sel { border-color: var(--fc); background: var(--panel2); }
.tc-slot.drawing { border-color: var(--fc); border-style: dashed; }
.tc-slot em { color: var(--dim); font-style: normal; }
.tc-slot .btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.tc-slot .k { width: 14px; height: 10px; flex: none; border: 2px solid var(--fc); border-radius: 2px; }
.tc-slot .k.polygon { background: color-mix(in srgb, var(--fc) 25%, transparent); clip-path: polygon(0 100%, 30% 0, 100% 20%, 85% 100%); border-radius: 0; }
.tc-slot .k.line { height: 0; border-width: 2px 0 0; border-radius: 0; }
.tc-slot .k.arrow { height: 0; border-width: 2px 0 0; border-radius: 0; position: relative; }
.tc-slot .k.arrow::after { content: ''; position: absolute; right: -2px; top: -5px; border: 4px solid transparent; border-left: 6px solid var(--fc); }
.tc-add { align-self: flex-start; }
.tc-chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #c9d3df; cursor: pointer; }
.tc-row2 { display: flex; gap: 10px; }
.tc-note { font-size: 11.5px; }
.tc-cls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12px; }
.tc-cls .qchip { height: 24px; padding: 0 9px; font-size: 11.5px; }
.tc-warn { font-size: 12px; color: #fcd34d; }
.tc-actions { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.tc-msg { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line2); color: #c9d3df; word-break: break-word; }
.tc-msg.ok { border-color: rgba(34,197,94,.45); color: #86efac; }
.tc-msg.warn { border-color: rgba(245,158,11,.45); color: #fcd34d; }
.tc-msg.bad { border-color: rgba(239,68,68,.45); }
.tc-msg .spin { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 6px; }

@media (max-width: 1100px) { .tc-canvas { min-height: 320px; } }
.tc-pend { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; padding: 9px 10px; border-radius: 8px; font-size: 12px; color: #fde68a;
           background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.4); }
.tc-pend .btn { align-self: stretch; justify-content: center; }
.tc-cams .crow .tc-ptag { color: #fcd34d; font-weight: 600; }
