/* Trang proxy — CSS riêng của trang (giao diện kiểu 9router: dashboard/proxy-pools) */

/* khung: mx-auto max-w-5xl flex-col gap-6 (mobile gap-4) */
.px-page { max-width: 1024px; margin-inline: auto; display: flex; flex-direction: column; gap: 24px; }
.px-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.px-title { font-size: 24px; line-height: 32px; font-weight: 600; min-width: 0; }
.px-actions { display: flex; align-items: center; gap: 8px; }

/* hàng chip Tổng / Hoạt động (mb-4 flex-wrap gap-2) */
.px-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.px-chips .badge[title] { cursor: help; }
.px-chips .px-assign { margin-left: auto; }
.px-selall { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--text-muted); cursor: pointer; }
.px-check { width: 16px; height: 16px; margin: 0; flex: none; border-radius: 4px; accent-color: var(--primary); cursor: pointer; }
.px-note { display: flex; align-items: flex-start; gap: 6px; margin: -4px 0 16px; font-size: 12px; line-height: 16px; color: var(--text-muted); }
.px-note .ms { font-size: 14px; line-height: 16px; color: var(--text-subtle); }

/* thanh thao tác khi chọn nhiều (border-primary/30 bg-primary/5) */
.px-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid rgba(229, 106, 74, .3); background: rgba(229, 106, 74, .05); }
.px-selbar > .ms { color: var(--primary); }
.px-selcount { font-size: 12px; font-weight: 500; color: var(--primary); }
.px-selbtns { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* trống (text-center py-10) */
.px-empty { text-align: center; padding: 40px 0; }
.px-empty b { display: block; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.px-empty p { font-size: 14px; line-height: 20px; color: var(--text-muted); margin-bottom: 16px; overflow-wrap: anywhere; }

/* danh sách (divide-y divide-white/[0.05]) */
.px-list { display: flex; flex-direction: column; }
.px-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.px-row + .px-row { border-top: 1px solid var(--hover); }
.px-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; flex: 1; }
.px-main .px-check { margin-top: 2px; }
.px-info { min-width: 0; flex: 1; }
.px-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.px-name { min-width: 0; max-width: 18rem; font-size: 14px; line-height: 20px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-head .badge.sm { font-size: 10px; line-height: 16px; }
.px-endpoint { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-last { margin-top: 4px; font-size: 11px; line-height: 16px; color: var(--text-muted); overflow-wrap: anywhere; }
.px-ok { color: var(--c-green); }
.px-err { color: var(--c-red); }
.px-btns { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex: none; }
.px-btns .icon-btn { border-radius: 4px; }
.px-btns .icon-btn:disabled { color: var(--primary); }
.px-spin { animation: spin 1s linear infinite; }

/* khung chờ tải (CardSkeleton) */
.px-skel { display: flex; flex-direction: column; }
.px-skel i { display: block; border-radius: 4px; background: var(--surface-2); animation: px-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
.px-skel-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.px-skel .w24 { width: 96px; height: 16px; }
.px-skel .box { width: 40px; height: 40px; border-radius: 10px; }
.px-skel .h8 { width: 64px; height: 32px; margin-bottom: 8px; }
.px-skel .w20 { width: 80px; height: 12px; }
@keyframes px-pulse { 50% { opacity: .5; } }

/* modal (max-w-md, nội dung flex-col gap-4, 2 nút full-width) */
.modal.px-modal { max-width: 448px; }
.px-form { display: flex; flex-direction: column; gap: 16px; }
.px-form .field { margin-bottom: 0; }
.px-textarea { min-height: 180px; font-family: var(--mono); font-size: 13px; }
.px-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 8px;
  border: 1px solid var(--border); }
.px-opt-title { font-size: 14px; line-height: 20px; font-weight: 500; }
.px-opt-desc { font-size: 12px; line-height: 16px; color: var(--text-muted); }
.px-status:empty { display: none; }
.px-busy { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: var(--text-muted); }
.px-msg { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 16px; }
.px-msg .ms { font-size: 14px; line-height: 16px; }
.px-msg.error { color: var(--c-red); }
.px-msg.info { color: var(--c-blue); }
.px-mbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* báo cáo sau khi nhập */
.px-report { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; border: 1px solid var(--border); }
.px-sum { display: flex; flex-wrap: wrap; gap: 6px; }
.px-sum .badge.sm { font-size: 10px; line-height: 16px; }
.px-report ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.px-report li { display: flex; align-items: flex-start; gap: 6px; font: 12px/16px var(--mono); overflow-wrap: anywhere; }
.px-report li .ms { font-size: 14px; line-height: 16px; }
.px-report li.ok { color: var(--c-green); }
.px-report li.fail { color: var(--c-red); }

/* mobile (< sm 640px): nút xếp dọc full-width, dòng proxy xếp dọc */
@media (max-width: 639px) {
  .px-page { gap: 16px; }
  .px-top { flex-direction: column; align-items: stretch; }
  .px-title { font-size: 20px; line-height: 28px; }
  .px-actions { display: grid; grid-template-columns: 1fr; }
  .px-row { flex-direction: column; align-items: stretch; }
  .px-name { max-width: 100%; }
  .px-opt { flex-direction: column; align-items: flex-start; }
  .px-textarea { font-size: 16px; }   /* iOS không tự phóng to khi gõ */
  .px-mbtns { grid-template-columns: 1fr; }
}
