/* Trang công khai /dataset (Danh sách tập dữ liệu mở) — giao diện phương án 3, duyệt 2026-10-21.
   Phạm vi: body.ds3 (template tim-kiem-tap-du-lieu.html). Nạp SAU khối <style> nội tuyến của template.
   Thẻ dữ liệu (.ds-card) vẫn do dataset.js tự tiêm CSS (#ds-grid-css).
   Panel thả xuống của select2 gắn vào <body> nên bám lớp .ds-dd (dataset.js gắn), không bám .ds3. */

body.ds3 { background: #F5F7FB; }

/* ---------- Đầu trang ---------- */
.ds3 .ds3-head {
    position: relative; background-color: #fff; text-align: center; border-bottom: 1px solid #E6EBF2;
    background-image: radial-gradient(rgba(18,63,143,.07) 1px, transparent 1.5px); background-size: 22px 22px;
}
.ds3 .ds3-head-in { position: relative; padding-top: 40px; padding-bottom: 36px; }
.ds3 .ds3-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px;
    background: #EEF4FC; border: 1px solid #D6E3F7; color: #1F4FA0; font-size: 12px; font-weight: 700; letter-spacing: .5px; line-height: 1;
}
.ds3 .ds3-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: #1F6FDD; }
.ds3 .ds3-title { margin: 14px 0 8px; font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: #0F2F6B; text-transform: none; }
.ds3 .ds3-sub { margin: 0; font-size: 15.5px; color: #5B6478; }

/* 4 viên số liệu */
.ds3 .ds3-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.ds3 .ds3-pill {
    display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px 0 6px; border-radius: 999px;
    background: #F5F8FD; border: 1px solid #E1E8F3; text-align: left;
}
.ds3 .ds3-pill .pi {
    width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid #DCE6F5; color: #1F6FDD;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ds3 .ds3-pill .pi svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ds3 .ds3-pill strong { font-size: 17px; font-weight: 800; color: #123F8F; line-height: 1; }
.ds3 .ds3-pill .l { font-size: 13px; color: #5B6478; font-weight: 500; white-space: nowrap; }

/* Ô tìm kiếm */
.ds3 .ds-search-box { display: flex; align-items: stretch; gap: 10px; max-width: 780px; margin: 24px auto 0; text-align: left; }
.ds3 .ds-search-inputwrap { position: relative; flex: 1 1 auto; min-width: 0; }
.ds3 .ds-search-ico {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: auto; height: auto; padding: 0;
    display: flex; color: #7C879A; pointer-events: none;
}
.ds3 #text-search.ds-search-input {
    width: 100% !important; height: 54px !important; border: 1.5px solid #D5DFEC !important; border-radius: 14px !important;
    background: #fff !important; padding: 0 58px 0 46px !important; font-size: 15px !important; color: #1F2937 !important;
    outline: none !important; box-shadow: 0 10px 26px -14px rgba(18,63,143,.35) !important; transition: border-color .15s, box-shadow .15s;
}
.ds3 #text-search.ds-search-input::placeholder { color: #7C879A !important; opacity: 1; padding-left: 0; font-size: 15px; }
.ds3 #text-search.ds-search-input:focus { border-color: #2F7DEA !important; box-shadow: 0 0 0 4px #EEF4FC !important; }
.ds3 .ds-search-refresh {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; padding: 0;
    border: 0; border-radius: 10px; background: #FFF0F0; color: #D93F40; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.ds3 .ds-search-refresh:hover { background: #FFE1E1; }
.ds3 .ds-btn-search-main {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; height: 54px; padding: 0 26px; border: 0; border-radius: 14px;
    background: #1F6FDD; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
    box-shadow: 0 10px 22px -10px rgba(31,111,221,.7); transition: background .15s;
}
.ds3 .ds-btn-search-main:hover { background: #185FC2; }

/* bấm chuột vào <button> không hiện khung đen (button:focus của bootstrap reboot), vẫn giữ vòng nhấn bàn phím */
.ds3 .ds3-head button:focus, .ds3 .ds3-filter button:focus { outline: 0; }
.ds3 .ds3-head .ds-search-refresh:focus-visible,
.ds3 .ds3-head .ds-btn-search-main:focus-visible,
.ds3 .ds3-filter .ds-clr:focus-visible { outline: 2px solid #1F6FDD; outline-offset: 2px; }

/* ---------- Khung bộ lọc ---------- */
.ds3 .ds3-body { background: #F5F7FB; }
/* 23px: danh sách #faq-1 có margin-top -15px + padding 10px ở khung cha → khung lọc cách thẻ đầu đúng 18px = khoảng cách giữa các thẻ */
.ds3 .ds-search-wrap { margin-bottom: 23px; }
/* NỔI KHỐI cùng hệ với thẻ tập dữ liệu (#faq-1 .ds-card trong dataset.js): viền xanh nhạt + bóng 3 lớp */
.ds3 .ds3-filter {
    position: relative; background: #fff; border: 1px solid #D3DFF2; border-radius: 16px; padding: 16px 18px 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 14px -6px rgba(18,63,143,.20), 0 22px 28px -18px rgba(18,63,143,.45);
}
/* Khung trang giữ chuẩn 1140 (lưới lọc rộng 1072px). 3 ô giá trị dài (Thẻ / Lĩnh vực / Cơ quan)
   chia phần còn lại; 3 ô giá trị ngắn (Hình thức / Sắp xếp / Loại danh sách) cố định hẹp.
   Đo chữ 14px đậm: thẻ ≤ 81px, hình thức ≤ 51px, nhãn ngắn Sắp xếp ≤ 70px, Loại danh sách ≤ 76px
   (+ 62px icon trái / mũi tên phải); nhãn "Hình thức cung cấp" 12.5px đậm = 121px nên cột này 126px. Lĩnh vực ≤ 155px, cơ quan 250–287px: dài quá thì xuống 2 dòng (xem dưới). */
.ds3 .ds-filter-grid {
    display: grid; gap: 12px;
    grid-template-columns: minmax(148px, .6fr) minmax(200px, 1fr) minmax(0, 1.5fr) 126px 132px 140px;
}
.ds3 .ds-filter-grid:has(> #filter-type-list:empty) { grid-template-columns: minmax(148px, .6fr) minmax(200px, 1fr) minmax(0, 1.5fr) 126px 132px; }
.ds3 #filter-type-list { display: contents; }
.ds3 .ds-field { display: flex; flex-direction: column; min-width: 0; }
.ds3 .ds-field > label {
    display: block; margin: 0 0 7px; font-size: 12.5px; font-weight: 700; color: #475467; letter-spacing: 0; text-transform: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ds3 .ds-select-wrap { position: relative; }

/* ô chọn gốc (trước khi select2 dựng xong) */
.ds3 .ds-select {
    width: 100%; height: 44px; padding: 0 34px 0 12px; border: 1px solid #DFE5EE; border-radius: 11px; background: #fff;
    font-size: 14px; color: #1F2937; outline: none; cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.ds3 .ds-select-wrap .ds-chevron { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.ds3 .select2-hidden-accessible ~ .ds-chevron { display: none; }

/* ô chọn select2 */
.ds3 .ds-field .select2-container { width: 100% !important; }
.ds3 .ds-field .select2-container--default .select2-selection--single {
    height: 44px !important; display: flex !important; align-items: center; padding: 0; cursor: pointer;
    border: 1px solid #DFE5EE !important; border-radius: 11px !important; background-color: #fff;
    background-repeat: no-repeat; background-position: 11px center; background-size: 16px 16px;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.ds3 .ds-field .select2-container--default .select2-selection--single .select2-selection__rendered {
    flex: 1; min-width: 0; padding: 0 28px 0 34px !important; line-height: 42px !important;
    font-size: 14px !important; font-weight: 500; color: #1F2937 !important;
}
.ds3 .ds-field .select2-container--default .select2-selection--single .select2-selection__arrow { top: 0; right: 6px; width: 20px; height: 42px; }
.ds3 .ds-field .select2-container--default .select2-selection--single .select2-selection__arrow b { display: none !important; }
.ds3 .ds-field .select2-container--default .select2-selection--single .select2-selection__arrow::after {
    content: "" !important; position: absolute; left: 3px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
    font-size: 0 !important; border: 0 !important;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat center / 14px 14px !important;
    transition: transform .15s;
}
.ds3 .ds-field .select2-container--open .select2-selection--single { border-color: #2F7DEA !important; box-shadow: 0 0 0 3px #EEF4FC; background-color: #fff; }
.ds3 .ds-field .select2-container--open .select2-selection__arrow::after { transform: rotate(180deg); }
.ds3 .ds-field .select2-container:not(.select2-container--open) .select2-selection--single:hover { border-color: #C3CCDA !important; }
.ds3 .ds-field.is-on .select2-container:not(.select2-container--open) .select2-selection--single { border-color: #BFD3F4 !important; background-color: #F5F9FF; }
.ds3 .ds-field.is-on .select2-container--default .select2-selection--single .select2-selection__rendered { color: #123F8F !important; font-weight: 600; }
/* 3 ô giá trị dài: tên dài thì xuống tối đa 2 dòng ngay trong ô (vẫn cao 44px) thay vì cắt "…" */
.ds3 #tag-search + .select2 .select2-selection--single .select2-selection__rendered,
.ds3 #topic-filter + .select2 .select2-selection--single .select2-selection__rendered,
.ds3 #license + .select2 .select2-selection--single .select2-selection__rendered {
    display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    white-space: normal !important; overflow: hidden; line-height: 1.2 !important; word-break: break-word;
}
/* ô đang lọc: nút × đứng đúng chỗ mũi tên (không chiếm thêm bề ngang) */
.ds3 .ds-field.is-on .select2-container--default .select2-selection--single .select2-selection__arrow { opacity: 0; }

/* biểu tượng đầu ô */
.ds3 #tag-search + .select2 .select2-selection { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M20.6 13.4l-7.2 7.2a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z'/><circle cx='7.5' cy='7.5' r='1.3'/></svg>"); }
.ds3 #topic-filter + .select2 .select2-selection { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><rect x='3.5' y='3.5' width='7' height='7' rx='1.6'/><rect x='13.5' y='3.5' width='7' height='7' rx='1.6'/><rect x='3.5' y='13.5' width='7' height='7' rx='1.6'/><rect x='13.5' y='13.5' width='7' height='7' rx='1.6'/></svg>"); }
.ds3 #license + .select2 .select2-selection { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M4 21V5.5A1.5 1.5 0 0 1 5.5 4h8A1.5 1.5 0 0 1 15 5.5V21'/><path d='M15 9.5h3.5A1.5 1.5 0 0 1 20 11v10'/><path d='M2.5 21h19'/><path d='M8 8h3M8 12h3M8 16h3'/></svg>"); }
.ds3 #filter-resouces + .select2 .select2-selection { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><path d='M14 2v6h6'/></svg>"); }
.ds3 #filter-fast + .select2 .select2-selection { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6h13M3 12h9M3 18h5M17 10v10M14 17l3 3 3-3'/></svg>"); }
.ds3 #type-list + .select2 .select2-selection { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/></svg>"); }

/* nút × bỏ lựa chọn (dataset.js chèn; chỉ hiện khi ô đang lọc) */
.ds3 .ds-clr {
    position: absolute; right: 5px; top: 11px; z-index: 2; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: #98A3B6; display: none; align-items: center; justify-content: center; cursor: pointer;
    transition: background .15s, color .15s;
}
.ds3 .ds-field.is-on .ds-clr { display: flex; }
.ds3 .ds-clr:hover { background: #FDECEC; color: #D93F40; }

/* ---------- Panel thả xuống (cùng kiểu .dsx-dd ở màn Thêm mới tập dữ liệu) ---------- */
.select2-container--default .select2-dropdown.ds-dd {
    background: #fff; border: 1px solid #E3E8F0 !important; border-radius: 12px !important; overflow: hidden; max-width: 360px;
    box-shadow: 0 16px 36px -8px rgba(16,36,80,.20), 0 2px 6px rgba(16,36,80,.06) !important;
    font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.select2-container--default .select2-dropdown.ds-dd.select2-dropdown--below { margin-top: 6px; }
.select2-container--default .select2-dropdown.ds-dd.select2-dropdown--above { margin-top: -6px; }
.select2-container--default .ds-dd .select2-search--dropdown { display: block !important; padding: 8px !important; border-bottom: 1px solid #EEF1F5; }
.select2-container--default .ds-dd .select2-search--dropdown.select2-search--hide { display: none !important; }
.select2-container--default .ds-dd .select2-search--dropdown .select2-search__field {
    display: block; width: 100%; height: 36px; margin: 0; padding: 0 12px 0 34px; border: 1px solid #E3E8F0; border-radius: 9px; outline: none; box-shadow: none;
    background: #F6F8FB url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 11px center / 15px 15px;
    font-family: inherit; font-size: 13.5px; color: #1F2937; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.select2-container--default .ds-dd .select2-search--dropdown .select2-search__field:focus { background-color: #fff; border-color: #2F7DEA; box-shadow: 0 0 0 3px #EEF4FC; }
.select2-container--default .ds-dd .select2-search--dropdown .select2-search__field::placeholder { color: #AEB7C6 !important; opacity: 1; padding-left: 0; font-size: 13.5px; }
.select2-container--default .ds-dd .select2-results > .select2-results__options { max-height: 268px; padding: 6px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #D3DAE4 transparent; }
.select2-container--default .ds-dd .select2-results > .select2-results__options::-webkit-scrollbar { width: 10px; }
.select2-container--default .ds-dd .select2-results > .select2-results__options::-webkit-scrollbar-thumb { background: #D3DAE4; border-radius: 10px; border: 3px solid #fff; }
.select2-container--default .ds-dd .select2-results__option {
    position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0; padding: 8px 36px 8px 12px; border-radius: 8px;
    font-size: 13.5px; font-weight: 400; line-height: 1.4; color: #1F2937; background: transparent; cursor: pointer; white-space: normal;
    transition: background-color .12s, color .12s;
}
.select2-container--default .ds-dd .select2-results__option + .select2-results__option { margin-top: 2px; }
.select2-container--default .ds-dd .select2-results__option.select2-results__option--highlighted[aria-selected] { background: #F3F6FB !important; background-color: #F3F6FB !important; color: #123F8F !important; }
.select2-container--default .ds-dd .select2-results__option[aria-selected=true] { background: #EEF4FC; color: #123F8F; font-weight: 600; }
.select2-container--default .ds-dd .select2-results__option.select2-results__option--highlighted[aria-selected=true] { background: #E2ECFA !important; background-color: #E2ECFA !important; }
.select2-container--default .ds-dd .select2-results__option[aria-selected=true]::after {
    content: ""; position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23123F8F' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") no-repeat center / 16px 16px;
}
.select2-container--default .ds-dd .select2-results__option.select2-results__message { display: block; padding: 18px 12px; text-align: center; font-size: 13px; color: #5B6478; background: transparent !important; cursor: default; }

/* ---------- Phân trang (common.renderPagination dựng) ---------- */
.ds3 #pagination {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between !important; gap: 14px;
    margin-top: 24px !important; padding: 12px 14px 12px 18px; background: #fff; border: 1px solid #E6EBF2; border-radius: 14px;
}
.ds3 #pagination:not(:has(*)) { display: none; }
.ds3 #pagination .form-inline { gap: 10px; }
.ds3 #pagination .form-inline label { margin: 0; font-size: 13px; font-weight: 600; color: #667085; }
.ds3 #pagination #id-number-page {
    margin-left: 0 !important; width: auto; height: 38px; padding: 0 30px 0 12px; border: 1px solid #DFE5EE; border-radius: 10px;
    font-size: 14px; font-weight: 600; color: #1F2937; cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238996AB' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 10px center / 14px 14px;
}
.ds3 #pagination .pagination { margin: 0; gap: 6px; flex-wrap: wrap; }
.ds3 #pagination .page-link {
    min-width: 40px; height: 40px; margin: 0 !important; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #E3E8F0 !important; border-radius: 10px !important; background: #fff !important; color: #344054 !important;
    font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: none !important;
}
.ds3 #pagination .page-link:hover { border-color: #2F7DEA !important; color: #2F7DEA !important; }
.ds3 #pagination .page-item.active .page-link { background: #123F8F !important; border-color: #123F8F !important; color: #fff !important; }
.ds3 #pagination .page-item.disabled .page-link { opacity: .45; cursor: default; }

/* ---------- Màn hẹp ---------- */
/* dưới 1200px khung còn 960 -> không đủ cho 6 ô một hàng -> 3 cột đều, 2 hàng.
   Mốc .98 như bootstrap: khi trình duyệt phóng/thu, bề rộng có thể lẻ (1199,5px) lọt giữa 1199 và 1200. */
@media (max-width: 1199.98px) {
    .ds3 .ds-filter-grid, .ds3 .ds-filter-grid:has(> #filter-type-list:empty) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 760.98px) {
    .ds3 .ds-filter-grid, .ds3 .ds-filter-grid:has(> #filter-type-list:empty) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
    /* tên cơ quan dài (tới 287px): ô 148px cắt 11/19 tên -> cho ô này chiếm cả hàng */
    .ds3 .ds-field:has(#license) { grid-column: 1 / -1; }
    .ds3 .ds3-filter { padding: 14px; }
}
@media (max-width: 640.98px) {
    .ds3 .ds3-head-in { padding-top: 24px; padding-bottom: 22px; }
    .ds3 .ds3-title { font-size: 24px; margin-top: 12px; }
    .ds3 .ds3-sub { font-size: 13.5px; }
    .ds3 .ds3-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
    .ds3 .ds3-pill { height: 44px; padding: 0 10px 0 5px; gap: 8px; min-width: 0; }
    .ds3 .ds3-pill .pi { width: 32px; height: 32px; }
    .ds3 .ds3-pill strong { font-size: 16px; }
    .ds3 .ds3-pill .l { font-size: 12px; line-height: 1.2; white-space: normal; }
    .ds3 .ds-search-box { flex-wrap: wrap; margin-top: 18px; }
    .ds3 #text-search.ds-search-input { height: 52px !important; }
    .ds3 .ds-btn-search-main { width: 100%; justify-content: center; height: 50px; }
    .ds3 #pagination { flex-direction: column; align-items: center; }
}
