/* ===== Xuất / nạp dữ liệu điểm ===== */
.pt-io-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-io-row .btn { flex: 1 1 140px; }
.pl-head-acts { display: inline-flex; align-items: center; gap: 10px; }
.pl-export { background: none; border: 0; color: var(--teal); cursor: pointer; font-size: 13px; font-weight: 700; padding: 0; }
.pl-export:hover { text-decoration: underline; }

dialog.pio { width: min(980px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); }
dialog.pio-import { width: min(600px, calc(100vw - 24px)); }
.pio-card { height: min(700px, calc(100dvh - 24px)); }
.pio-card-sm { height: auto; max-height: calc(100dvh - 24px); }
.pio code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: rgba(37, 99, 235, .08); padding: 1px 5px; border-radius: 5px; }
.pio.is-busy .pio-body, .pio.is-busy .pio-im-body { opacity: .7; pointer-events: none; }

.pio-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: #f7f9fd; border-top: 1px solid var(--line); }
.pio-pick { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #fff; }
.pio-opts { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; overflow-y: auto; min-height: 0; }

.pio-tools { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 10px; }
.pio-search { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 11px; padding: 0 12px; background: #fff; color: var(--muted); }
.pio-search:focus-within { border-color: var(--pd-accent); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.pio-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 9px 0; font-size: 14px; color: var(--text); }
.pio-seg { display: flex; gap: 4px; padding: 3px; background: var(--panel2); border-radius: 11px; }
.pio-seg button { flex: 1; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.pio-seg button[aria-pressed="true"] { background: #fff; color: var(--pd-accent); box-shadow: 0 1px 3px rgba(15, 27, 51, .12); }
.pio-seg em { font-style: normal; font-size: 11.5px; margin-left: 2px; opacity: .8; }

.pio-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 16px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pio-all { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.pio-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.pio-all input, .pio-list input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--pd-accent); cursor: pointer; flex: none; }

.pio-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 6px 8px 10px; list-style: none; scrollbar-width: thin; }
.pio-list li + li { margin-top: 2px; }
.pio-list li > label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; border: 1.5px solid transparent; cursor: pointer; }
.pio-list li > label:hover { background: var(--panel2); }
.pio-list li.on > label { background: #eef4ff; border-color: #c9d9f7; }
.pio-list li > label:has(input:focus-visible) { border-color: var(--pd-accent); }
.pio-dot { width: 12px; height: 12px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); flex: none; margin: 0 4px; }
.pio-dot.has { background: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.pio-emoji { width: 20px; text-align: center; font-size: 17px; line-height: 1; flex: none; }
.pio-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pio-txt b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--pd-ink); }
.pio-txt small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pio-chip { flex: none; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pio-chip.off { background: #f1f5f9; color: #475569; }
.pio-chip.temp { background: var(--pd-warm-soft); color: #9a5a00; }
.pio-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 20px; color: var(--muted); }
.pio-empty svg { width: 30px; height: 30px; color: #9db4dc; }
.pio-empty strong { color: var(--text); font-size: 15px; }

.pio-group { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pio-group[hidden] { display: none; }
.pio-group legend, .pio .pd-label { font-weight: 800; font-size: 14px; color: var(--pd-ink); padding: 0; margin-bottom: 8px; }
.pio .pd-field .pd-label { margin-bottom: 0; }
.pio-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.pio-opt:hover { border-color: #b9cbea; }
.pio-opt:has(input:checked) { border-color: var(--pd-accent); background: #f3f7ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.pio-opt:has(input:focus-visible) { outline: 2.5px solid var(--pd-accent); outline-offset: 2px; }
.pio-opt input { margin: 3px 0 0; accent-color: var(--pd-accent); flex: none; }
.pio-opt > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pio-opt b { font-weight: 800; font-size: 14px; color: var(--pd-ink); }
.pio-opt small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pio-opt.disabled { opacity: .55; cursor: not-allowed; background: #fafbfd; }
.pio-opt.loading small { opacity: .6; }
.pio-opt.mini { padding: 8px 12px; }
.pio-opt-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--pd-accent-soft); color: var(--pd-accent); flex: none; }
.pio-opt-ico svg { width: 18px; height: 18px; }

.pio-row { display: flex; gap: 8px; }
.pio-row select { flex: 1; min-width: 0; }
.pio-name { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; overflow: hidden; }
.pio-name:focus-within { border-color: var(--pd-accent); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.pio-name .pd-input { border: 0; border-radius: 0; box-shadow: none !important; }
.pio-ext { display: grid; place-items: center; padding: 0 12px; background: var(--panel2); color: var(--muted); font-weight: 700; font-size: 13px; border-left: 1px solid var(--line); }
.pio .pd-input:focus { border-color: var(--pd-accent); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.pio-err { color: var(--red); font-size: 12.5px; font-weight: 700; }
.pio-err[hidden] { display: none; }

.pio-exist { padding: 12px; border-radius: 12px; background: var(--pd-warm-soft); }
.pio-exist-title { display: flex; align-items: center; gap: 6px; color: #9a5a00 !important; }
.pio-exist-title svg { width: 16px; height: 16px; }
.pio-exist .pio-opt:has(input:checked) { border-color: var(--pd-warm); background: #fffaf0; box-shadow: 0 0 0 3px rgba(217, 119, 6, .1); }
.pio-exist .pio-opt input { accent-color: var(--pd-warm); }

.pio-msg { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 11px; font-size: 13px; line-height: 1.45; background: var(--pd-accent-soft); color: #1e40af; }
.pio-msg[hidden] { display: none; }
.pio-msg[data-type="err"] { background: #fde8eb; color: #b91c1c; }
.pio-msg[data-type="ok"] { background: #e8f7ee; color: #15803d; }
.pio-msg svg { width: 16px; height: 16px; margin-top: 1px; }
.pio-foot-sum { font-size: 13px; color: var(--muted); font-weight: 700; }

/* Hộp thoại nạp */
.pio-im-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; overflow-y: auto; background: #f7f9fd; border-top: 1px solid var(--line); }
.pio-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.pio-files li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.pio-files li > svg { color: var(--pd-accent); }
.pio-files li.bad { border-color: #f5c2cc; background: #fff7f8; }
.pio-files li.bad > svg { color: var(--red); }
.pio-files span { display: flex; flex-direction: column; min-width: 0; }
.pio-files b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pio-files small { color: var(--muted); font-size: 12.5px; }
.pio-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.pio-stats span { padding: 5px 12px; border-radius: 999px; background: var(--pd-accent-soft); color: #1e40af; font-size: 13px; }
.pio-stats span.warn { background: var(--pd-warm-soft); color: #9a5a00; }
.pio-stats b { font-weight: 800; }

dialog.fp[data-library="datapoint"] .fp-badge { background: var(--pd-warm-soft, #fff4e0); color: #d97706; }

@media (max-width: 760px) {
  dialog.pio { width: 100vw; max-height: 100dvh; }
  .pio-card { height: 100dvh; border-radius: 0; }
  .pio-body { grid-template-columns: 1fr; overflow-y: auto; }
  .pio-pick { border-right: 0; border-bottom: 1px solid var(--line); min-height: 320px; }
  .pio-list { max-height: 46dvh; }
  .pio-opts { overflow: visible; }
  .pio-foot-sum { display: none; }
}
