/* ==========================================================================
   Website khách (Kết nối, Khoá web) + Thông báo khách + Kho kiến thức + Danh mục
   Nạp sau app.css. Tiền tố riêng: .ox-cx-*, .ox-kt--* (màu ô số), .ox-ki--* (icon ô số)
   ========================================================================== */

/* ---------- Ô số liệu: màu + icon theo ý nghĩa (đè màu xoay vòng mặc định) ---------- */
.ox-kpis--row .ox-kpi.ox-kt--green { --k-bg: var(--ox-green-soft); --k-fg: var(--ox-green); }
.ox-kpis--row .ox-kpi.ox-kt--red { --k-bg: var(--ox-red-soft); --k-fg: var(--ox-red); }
.ox-kpis--row .ox-kpi.ox-kt--amber { --k-bg: var(--ox-amber-soft); --k-fg: var(--ox-amber); }
.ox-kpis--row .ox-kpi.ox-kt--blue { --k-bg: var(--ox-blue-soft); --k-fg: var(--ox-blue); }
.ox-kpis--row .ox-kpi.ox-kt--slate { --k-bg: var(--ox-gray-soft); --k-fg: var(--ox-gray); }
.ox-kpis--row .ox-kpi.ox-ki--globe { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18 14 14 0 0 1 0-18z'/%3E%3C/svg%3E"); }
.ox-kpis--row .ox-kpi.ox-ki--off { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5M12 16.5h.01'/%3E%3C/svg%3E"); }
.ox-kpis--row .ox-kpi.ox-ki--download { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5M12 15V3'/%3E%3C/svg%3E"); }
.ox-kpis--row .ox-kpi.ox-ki--key { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.5'/%3E%3Cpath d='m10.7 12.3 9.3-9.3M17 6l3 3M14.5 8.5l2 2'/%3E%3C/svg%3E"); }
.ox-kpis--row .ox-kpi.ox-ki--lock { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.ox-kpis--row .ox-kpi.ox-ki--unlock { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 7.6-1.8'/%3E%3C/svg%3E"); }
.ox-kpis--row .ox-kpi.ox-ki--clock { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ox-kpis--row .ox-kpi.ox-ki--shield { --k-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-3.5 8-10V5l-8-3-8 3v7c0 6.5 8 10 8 10z'/%3E%3C/svg%3E"); }
/* Ô đang lọc */
.ox-kpis--row .ox-kpi.is-active { border-color: var(--k-fg); box-shadow: 0 0 0 1px var(--k-fg), 0 14px 26px -18px rgba(23, 32, 46, .35); }

/* ---------- Đầu trang: nút phụ ---------- */
.ox-cx-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ox-cx-head-actions .ox-btn .ox-icon { color: var(--ox-primary); }
.ox-cx-head-actions .ox-btn--primary .ox-icon { color: #fff; }

/* ---------- Thanh công cụ danh sách: tab viên thuốc + ô tìm/lọc trên 1 hàng ---------- */
.ox-cx-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ox-cx-toolbar .ox-subsubsub { margin: 0; }
.ox-cx-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 420px; justify-content: flex-end; }
.ox-cx-search .ox-input-icon { flex: 1 1 220px; max-width: 340px; }
.ox-app .ox-cx-search input[type="search"], .ox-app .ox-cx-search select { min-height: 42px; border-color: var(--ox-border); border-radius: 12px; background-color: #fff; box-shadow: var(--ox-shadow); }
.ox-app .ox-cx-search select { width: auto; min-width: 170px; max-width: 220px; }
.ox-cx-clear { display: inline-flex; align-items: center; gap: 4px; height: 42px; padding: 0 12px; border-radius: 12px; color: var(--ox-red) !important; font-size: 13px; font-weight: 600; white-space: nowrap; }
.ox-cx-clear:hover { background: var(--ox-red-soft); }

/* Bộ lọc trong thẻ (Kết nối) có nút bỏ lọc */
.ox-filters.ox-filters--insights.ox-cx-has-clear { grid-template-columns: minmax(220px, 1fr) 240px auto; }

/* ---------- Thẻ bảng: đầu thẻ có tiêu đề + số lượng ---------- */
.ox-cx-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 16px 20px; border-bottom: 1px solid var(--ox-border); }
.ox-cx-card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; }
.ox-cx-card-head h2 .ox-ic { width: 34px; height: 34px; }
.ox-cx-count { display: inline-flex; align-items: center; min-width: 24px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--ox-gray-soft); color: var(--ox-gray); font-size: 12px; font-weight: 600; justify-content: center; }
.ox-cx-card-head .ox-muted { font-size: 13px; }
.ox-cx-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--ox-primary-soft); color: var(--ox-primary-hover); font-size: 12.5px; font-weight: 600; }
.ox-cx-filter-chip a { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: inherit !important; }
.ox-cx-filter-chip a:hover { background: rgba(232, 64, 28, .12); }

/* Ô trống có icon */
.ox-cx-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--ox-muted); }
.ox-cx-empty .ox-ic { width: 52px; height: 52px; margin-bottom: 4px; }
.ox-cx-empty strong { color: var(--ox-text); font-size: 15px; }

/* ---------- Bảng chung của nhóm ---------- */
.ox-cx-table td { vertical-align: middle; }
.ox-cx-table th { white-space: nowrap; }
.ox-cx-table td small { line-height: 1.45; }
.ox-cx-sub { display: flex !important; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 3px; color: var(--ox-slate); font-size: 12.5px; }
.ox-cx-sub i { width: 3px; height: 3px; border-radius: 50%; background: #cfd4dc; }
.ox-table td .ox-cx-sub a:not(.ox-btn) { color: var(--ox-muted) !important; font-weight: 500; }
.ox-table td .ox-cx-sub a:not(.ox-btn):hover { color: var(--ox-primary) !important; }
.ox-cx-table .ox-badge { margin-top: 0 !important; }
.ox-cx-muted { color: var(--ox-slate); }

/* Nút icon có viền, nhấc nhẹ khi rê */
.ox-cx-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.ox-cx-tools form { display: contents; }
.ox-cx-tools .ox-tool, .ox-connect__row-actions .ox-tool { position: static; transform: none; display: inline-grid; width: 32px; height: 32px; border: 1px solid var(--ox-border); border-radius: 10px; background: #fff; color: var(--ox-muted) !important; transition: color .15s, border-color .15s, background .15s, transform .15s; }
.ox-cx-tools .ox-tool:hover, .ox-connect__row-actions .ox-tool:hover { border-color: #ffc6a8; background: var(--ox-primary-soft); color: var(--ox-primary) !important; transform: translateY(-1px); }
.ox-cx-tools .ox-tool--danger:hover { border-color: #f6c3bd; background: var(--ox-red-soft); color: var(--ox-red) !important; }

/* Badge xanh dương thật (app.css đặt --blue thành cam) */
.ox-badge.ox-cx-blue { background: var(--ox-blue-soft); color: var(--ox-blue) !important; }
.ox-badge.ox-cx-blue::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ox-badge.ox-cx-slate::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b4bcc8; }

/* Thanh tiến độ "đã đọc" */
.ox-cx-read { display: flex; flex-direction: column; gap: 5px; min-width: 90px; }
.ox-cx-read b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ox-cx-read b small { display: inline !important; margin-left: 2px; color: var(--ox-slate); font-weight: 500; font-size: 12px; }
.ox-cx-bar { position: relative; height: 5px; border-radius: 99px; background: var(--ox-gray-soft); overflow: hidden; }
.ox-cx-bar span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--ox-grad); }
.ox-cx-bar--green span { background: var(--ox-green); }

/* ---------- Kết nối website ---------- */
.ox-table--connect { min-width: 1040px; }
.ox-table--connect td { overflow: visible; }
.ox-cx-site { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ox-cx-site > div { min-width: 0; }
.ox-cx-site strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ox-cx-site small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ox-cx-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #cfd4dc; box-shadow: 0 0 0 4px var(--ox-gray-soft); }
.ox-cx-dot--green { background: var(--ox-green); box-shadow: 0 0 0 4px var(--ox-green-soft); }
.ox-cx-dot--red { background: var(--ox-red); box-shadow: 0 0 0 4px var(--ox-red-soft); }
.ox-cx-dot--amber { background: #e39a2b; box-shadow: 0 0 0 4px var(--ox-amber-soft); }
.ox-cx-dot--blue { background: var(--ox-blue); box-shadow: 0 0 0 4px var(--ox-blue-soft); }
.ox-cx-status { display: flex; flex-wrap: wrap; gap: 4px; }
.ox-connect__token .ox-input-tools { display: flex; align-items: center; max-width: 100%; }
.ox-app .ox-connect__token input[type] { min-height: 36px !important; padding: 6px 40px 6px 12px !important; border-color: var(--ox-border); border-radius: 10px; background: var(--ox-surface-2); color: #4a5363; font-size: 12px !important; letter-spacing: .01em; }
.ox-app .ox-connect__token input[type]:focus { background: #fff; }
.ox-connect__token .ox-tool { right: 3px; width: 30px; height: 30px; color: var(--ox-muted) !important; }
.ox-connect__token .ox-tool:hover { background: var(--ox-primary-soft); }
.ox-cx-create { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px dashed #f3b79b; border-radius: 10px; background: #fffaf6; color: var(--ox-primary-hover) !important; font: 600 13px/1 var(--ox-font); cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.ox-cx-create:hover { background: var(--ox-primary-soft); border-color: var(--ox-primary); border-style: solid; transform: translateY(-1px); }
.ox-connect__token form { margin: 0; }
.ox-connect__row-actions > div { gap: 6px; }
.ox-table--connect tr.is-none td { background: transparent; }
.ox-table--connect tr.is-none .ox-cx-site strong { color: #4a5363; }

/* ---------- Khoá website ---------- */
.ox-app .ox-lock-form { gap: 6px; flex-wrap: nowrap; }
.ox-app .ox-lock-form select { min-height: 36px; border-color: var(--ox-border); border-radius: 10px; background-color: var(--ox-surface-2); }
.ox-app .ox-lock-form select:focus { background-color: #fff; }
.ox-lock-form .ox-btn { min-height: 36px; border-color: #ffd9c4; background: var(--ox-primary-soft); color: var(--ox-primary-hover) !important; }
.ox-lock-form .ox-btn:hover { background: var(--ox-grad); border-color: transparent; color: #fff !important; }
.ox-lock-form .ox-inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ox-muted); white-space: nowrap; }
.ox-lock-form .ox-inline-check input { accent-color: var(--ox-primary); }
.ox-cx-expiry b { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.ox-table--locks { min-width: 980px; }

/* ---------- Danh sách bài (Thông báo, Kiến thức) ---------- */
.ox-cx-posts td:first-child { min-width: 280px; }
.ox-cx-posts .ox-post-cell { align-items: center; }
.ox-cx-posts .ox-post-cell__thumb { width: 72px; height: 46px; border-radius: 10px; }
.ox-cx-posts .ox-post-cell__thumb.is-video { position: relative; }
.ox-cx-posts .ox-post-cell__thumb.is-video::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: rgba(0, 0, 0, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ox-cx-posts .ox-post-cell__thumb:not([style]) { background: var(--ox-primary-soft); border-color: #ffe0d1; color: var(--ox-primary); }
.ox-cx-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ox-cx-title a { font-size: 14.5px; }
.ox-cx-pin { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px 1px 6px; border-radius: 99px; background: var(--ox-amber-soft); color: var(--ox-amber); font-size: 11.5px; font-weight: 600; }
.ox-cx-level { display: inline-flex; width: 34px; height: 34px; flex: none; }
.ox-cx-posts .ox-ic { width: 38px; height: 38px; }
.ox-cx-posts td.ox-cx-actions { width: 1%; white-space: nowrap; }

/* ---------- Soạn bài / thông báo ---------- */
.ox-cx-editor .ox-detail > aside { top: 90px; }
.ox-app .ox-cx-editor .ox-title-input { min-height: 60px !important; border-radius: 16px; box-shadow: var(--ox-shadow); font-size: 22px !important; }
.ox-cx-editor .wp-editor-wrap { display: flex; flex-direction: column; gap: 10px; }
.ox-cx-editor .wp-editor-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ox-cx-editor .wp-editor-tools::after, .ox-cx-editor .wp-editor-tools::before { content: none; }
.ox-cx-editor .wp-media-buttons { float: none; }
.ox-cx-editor .wp-media-buttons .button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--ox-border); border-radius: 10px; background: #fff; color: var(--ox-text); font: 600 13px var(--ox-font); box-shadow: none; }
.ox-cx-editor .wp-media-buttons .button:hover { border-color: #ffc6a8; background: var(--ox-primary-soft); color: var(--ox-primary-hover); }
.ox-cx-editor .wp-media-buttons .wp-media-buttons-icon { width: 16px; height: 16px; margin: 0; }
.ox-cx-editor .wp-editor-tabs { float: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--ox-surface-2); }
.ox-cx-editor .wp-switch-editor { float: none; height: auto; margin: 0; padding: 5px 12px; border: 0; border-radius: 8px; background: none; color: var(--ox-muted); font: 600 12.5px var(--ox-font); }
.ox-cx-editor .tmce-active .switch-tmce, .ox-cx-editor .html-active .switch-html { background: #fff; color: var(--ox-text); box-shadow: 0 1px 3px rgba(23, 32, 46, .12); }
.ox-cx-editor .wp-editor-container { border: 1px solid var(--ox-border); border-radius: 12px; overflow: hidden; }
.ox-cx-editor .quicktags-toolbar, .ox-cx-editor .mce-toolbar-grp { border-color: var(--ox-border) !important; background: var(--ox-surface-2) !important; }
.ox-cx-editor .wp-editor-tabs:empty { display: none; }
.ox-cx-editor .quicktags-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px !important; }
.ox-cx-editor .quicktags-toolbar input.button, .ox-cx-editor .quicktags-toolbar input.ed_button { min-height: 28px; margin: 0; padding: 0 10px; border: 1px solid var(--ox-border); border-radius: 8px; background: #fff; color: #4a5363; font: 600 12px/26px var(--ox-font); text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.ox-cx-editor .quicktags-toolbar input.button:hover, .ox-cx-editor .quicktags-toolbar input.ed_button:hover { border-color: #ffc6a8; background: var(--ox-primary-soft); color: var(--ox-primary-hover); }
.ox-app .ox-cx-editor textarea.wp-editor-area { border: 0; border-radius: 0; box-shadow: none; font-size: 14px; line-height: 1.65; }
.ox-cx-editor .ox-card__title { margin-bottom: 4px !important; font-size: 15.5px; }
.ox-cx-editor aside .ox-card { padding: 20px; }
.ox-cx-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ox-cx-card-title .ox-card__title { margin: 0 !important; }
.ox-cx-card-title > a { font-size: 12.5px; font-weight: 600; color: var(--ox-primary-hover) !important; }
.ox-cx-card-title > a:hover { color: var(--ox-primary) !important; }
.ox-cx-editor .ox-cx-pub { grid-template-columns: minmax(0, 1fr) 84px; gap: 10px; }
.ox-cx-opt { margin-left: auto; padding: 2px 9px; border-radius: 99px; background: var(--ox-gray-soft); color: var(--ox-muted); font-size: 11.5px; font-weight: 600; }
.ox-cx-hint { margin: -4px 0 0; color: var(--ox-muted); font-size: 12.5px; line-height: 1.5; }
.ox-cx-meta { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--ox-surface-2); font-size: 12.5px; color: var(--ox-muted); }
.ox-cx-meta > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ox-cx-meta b { color: var(--ox-text); font-weight: 600; }

/* Segment loại bài / mức độ có icon + chấm màu */
.ox-cx-editor .ox-segment { gap: 6px; padding: 4px; border-radius: 13px; background: var(--ox-surface-2); }
.ox-cx-editor .ox-segment span { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ox-muted); font-size: 13.5px; }
.ox-cx-editor .ox-segment span:hover { background: #fff; color: var(--ox-text); }
.ox-cx-editor .ox-segment input:checked + span { background: #fff; color: var(--ox-text); box-shadow: 0 1px 2px rgba(23, 32, 46, .06), 0 4px 12px -6px rgba(23, 32, 46, .25); }
.ox-cx-editor .ox-segment input:checked + span .ox-icon { color: var(--ox-primary); }
.ox-cx-editor .ox-segment--levels { gap: 2px; flex-wrap: nowrap; }
.ox-cx-editor .ox-segment--levels label { min-width: 0; }
.ox-cx-editor .ox-segment--levels span { gap: 5px; padding: 6px 2px; font-size: 12.5px; }
.ox-cx-editor .ox-segment--levels span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lv, var(--ox-slate)); }
.ox-cx-editor .ox-segment--levels input:checked + span { color: var(--lv); }

/* Ảnh xem trước YouTube */
.ox-cx-yt { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px; border-radius: 12px; background: var(--ox-surface-2); }
.ox-cx-yt img { display: block; width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px; }
.ox-cx-yt small { color: var(--ox-muted); font-size: 12.5px; line-height: 1.5; }
.ox-cx-yt a { font-weight: 600; font-size: 13px; }

/* Danh mục / chọn website trong cột phải */
.ox-cx-editor .ox-radios, .ox-cx-editor .ox-site-picks { gap: 2px; padding: 6px; border-radius: 12px; }
.ox-cx-editor .ox-radios label, .ox-cx-editor .ox-site-picks label { padding: 7px 8px; border-radius: 8px; transition: background .12s; }
.ox-cx-editor .ox-radios label:hover, .ox-cx-editor .ox-site-picks label:hover { background: var(--ox-surface-2); }
.ox-cx-editor .ox-radios label:has(input:checked) { background: var(--ox-primary-soft); color: var(--ox-primary-hover); font-weight: 600; }
.ox-cx-editor .ox-site-picks label:has(input:checked) { background: var(--ox-primary-soft); }
.ox-cx-editor .ox-checks label { padding: 10px 12px; border: 1px solid var(--ox-border); border-radius: 12px; width: 100%; }
.ox-cx-editor .ox-checks label:has(input:checked) { border-color: #ffd0b8; background: var(--ox-primary-soft); }
.ox-cx-editor .ox-thumb-pick__img { border-radius: 12px; border-color: #e6d9cf; background-color: var(--ox-surface-2); transition: border-color .15s, background-color .15s; }
.ox-cx-editor .ox-thumb-pick__img:hover { background-color: var(--ox-primary-soft); }
.ox-cx-editor .ox-thumb-pick__img span { flex-direction: column; gap: 6px; color: var(--ox-muted); }
.ox-cx-editor .ox-thumb-pick__img span .ox-icon { color: var(--ox-primary); }
.ox-cx-editor .ox-form-actions--split { margin-top: 2px; }

/* ---------- Danh mục (parts/terms.php) ---------- */
.ox-cx-terms { margin-top: 0; }
.ox-cx-terms .ox-card__title { margin-bottom: 4px !important; }
.ox-cx-terms .ox-cx-form { position: sticky; top: 90px; }
.ox-cx-terms .ox-cx-form.is-edit { border-color: #ffd0b8; box-shadow: 0 0 0 1px #ffd0b8, var(--ox-shadow); }
.ox-cx-term-name { display: flex; align-items: center; gap: 12px; }
.ox-cx-term-name .ox-ic { width: 36px; height: 36px; }
.ox-cx-num { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 9px; border-radius: 99px; background: var(--ox-gray-soft); color: var(--ox-text) !important; font-size: 12.5px; font-weight: 600 !important; font-variant-numeric: tabular-nums; }
a.ox-cx-num:hover { background: var(--ox-primary-soft); color: var(--ox-primary) !important; }

/* ---------- Màn hình hẹp ---------- */
@media (max-width: 1100px) {
    .ox-cx-search { flex-basis: 100%; justify-content: flex-start; }
    .ox-cx-search .ox-input-icon { max-width: none; }
}
@media (max-width: 760px) {
    .ox-filters.ox-filters--insights.ox-cx-has-clear { grid-template-columns: minmax(0, 1fr) auto; }
    .ox-filters.ox-filters--insights.ox-cx-has-clear .ox-filters__search { grid-column: 1 / -1; }
    .ox-cx-toolbar .ox-subsubsub { max-width: 100%; }
    .ox-cx-toolbar .ox-subsubsub a { white-space: nowrap; padding: 8px 12px; }
    .ox-cx-search .ox-input-icon { flex-basis: 100%; }
    .ox-app .ox-cx-search select { flex: 1 1 0; min-width: 0; max-width: none; }
    .ox-cx-yt { grid-template-columns: minmax(0, 1fr); }
    .ox-cx-yt img { width: 100%; }
    .ox-cx-terms .ox-cx-form { position: static; }
    .ox-page-head > .ox-cx-head-actions { width: 100%; }
    .ox-page-head > .ox-cx-head-actions .ox-btn { flex: 1; }

    /* Bảng => thẻ */
    .ox-cx-cards { min-width: 0 !important; table-layout: auto !important; }
    .ox-cx-cards colgroup, .ox-cx-cards thead { display: none; }
    .ox-cx-cards, .ox-cx-cards tbody { display: block; }
    .ox-cx-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--ox-border); }
    .ox-cx-cards tbody tr:last-child { border-bottom: 0; }
    .ox-cx-cards td { display: block; padding: 0 !important; border: 0 !important; background: none !important; text-align: left !important; width: auto !important; min-width: 0 !important; }
    .ox-cx-cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--ox-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
    .ox-cx-cards td.ox-cx-wide { grid-column: 1 / -1; }
    .ox-cx-cards td.ox-cx-head { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    /* Nút thao tác ghim góc phải trên của thẻ */
    .ox-cx-cards tr { position: relative; }
    .ox-cx-cards td.ox-cx-actions { position: absolute; top: 14px; right: 16px; }
    .ox-cx-cards tr:has(td.ox-cx-actions) > td:first-child { padding-right: 80px !important; }
    .ox-table--locks.ox-cx-cards tr > td:first-child { padding-right: 118px !important; }
    .ox-cx-cards td.ox-connect__row-actions:has(> div:empty) { display: none; }
    .ox-cx-cards .ox-cx-tools, .ox-cx-cards .ox-connect__row-actions > div { justify-content: flex-end; }
    .ox-cx-cards .ox-lock-form { flex-wrap: wrap; }
    .ox-app .ox-cx-cards .ox-lock-form select { flex: 1 1 140px; }
    .ox-cx-posts td:first-child { min-width: 0; }
    /* Danh mục: 1 hàng gọn (tên | số bài | nút) */
    .ox-cx-terms .ox-cx-cards tr { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
    .ox-cx-terms .ox-cx-cards td.ox-cx-wide { grid-column: auto; padding-right: 0 !important; }
    .ox-cx-terms .ox-cx-cards td[data-label]::before { display: none; }
    .ox-cx-terms .ox-cx-cards td.ox-cx-actions { position: static; }
    /* Kết nối: nút thao tác nằm cạnh ô Khoá; website chưa có mã chỉ còn tên + trạng thái + nút tạo mã */
    .ox-cx-cards td.ox-connect__row-actions { grid-column: auto; align-self: end; padding-top: 0 !important; border-top: 0 !important; }
    .ox-table--connect tr.is-none { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .ox-table--connect tr.is-none td[data-label="Đồng bộ"], .ox-table--connect tr.is-none td[data-label="Khoá"] { display: none; }
    .ox-table--connect tr.is-none td.ox-connect__token { grid-column: auto; }
    .ox-table--connect tr.is-none td.ox-connect__token::before { display: none; }
}
