/* Xuất Excel từ câu SELECT (QEX-17…QEX-19) — chỉ class tiền tố sy-ex-; chỉ biến màu của app.css (trừ ô màu mẫu tiêu đề Excel); co giãn tới 375px (OPS-06).
   Excel export from a SELECT (QEX-17…QEX-19) — sy-ex- prefixed classes only; app.css colour variables only (except the Excel header swatches); scales to 375px (OPS-06). */
.sy-ex-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.sy-ex-cap { margin: 0; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sy-ex-keys { margin-left: auto; }
.sy-ex-sources { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.sy-ex-sources:empty { display: none; }
.sy-ex-src { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-size: .82rem; font-weight: 600; cursor: pointer; }
.sy-ex-src.sy-ex-on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.sy-ex-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.sy-ex-dot.sy-ex-ok, .sy-ex-pill.sy-ex-ok .sy-ex-dot { background: var(--green); }
.sy-ex-dot.sy-ex-err, .sy-ex-pill.sy-ex-err .sy-ex-dot { background: var(--red); }
.sy-ex-pill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .8rem; color: var(--ink-2); }
.sy-ex-pill-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sy-ex-sql { display: block; width: 100%; min-height: 230px; resize: vertical; tab-size: 2; white-space: pre; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 13px; line-height: 1.6; background: var(--bg); }
.sy-ex-suffix { display: flex; align-items: center; gap: 6px; }
.sy-ex-suffix input { flex: 1; min-width: 0; }
.sy-ex-colorbox { display: flex; flex-direction: column; gap: 4px; font-size: .87rem; color: var(--ink-2); }
.sy-ex-colors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: var(--ctl-h); }
.sy-ex-colors input[type=color] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.sy-ex-sw { width: 20px; height: 20px; padding: 0; border: 1px solid rgba(0, 0, 0, .3); border-radius: 4px; cursor: pointer; }
/* Màu mẫu của dòng tiêu đề trong file Excel (không phải màu giao diện) / Excel header sample colours (not UI colours) */
.sy-ex-sw-0 { background: #1F4E79; }
.sy-ex-sw-1 { background: #1D6F42; }
.sy-ex-sw-2 { background: #7A1F3D; }
.sy-ex-sw-3 { background: #3B3B3B; }
.sy-ex-sw-4 { background: #B45F06; }
.sy-ex-sw-5 { background: #D9E1F2; }
.sy-ex-sw-6 { background: #E2F0D9; }
.sy-ex-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: var(--ink-2); }
.sy-ex-checks label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.sy-ex-checks input { width: 16px; height: 16px; accent-color: var(--teal); }
.sy-ex-actions { align-items: center; flex-wrap: wrap; gap: 8px; }
.sy-ex-status { margin-bottom: 12px; }
.sy-ex-status-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.sy-ex-msg { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; }
.sy-ex-progress { display: block; width: 100%; height: 6px; margin-top: 10px; accent-color: var(--teal); }
.sy-ex-dl { margin: 8px 0 0; }
.sy-ex-dl a { font-weight: 600; color: inherit; }
.sy-ex-table { max-height: 460px; overflow: auto; }
.sy-ex-table th, .sy-ex-table td { white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.sy-ex-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sy-ex-kind { display: block; font-weight: 400; font-size: .7rem; color: var(--ink-3); }
.sy-ex-null { font-style: italic; color: var(--ink-3); }
.sy-ex-hist { list-style: none; margin: 0; padding: 0; }
.sy-ex-hitem { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.sy-ex-hitem:hover, .sy-ex-hitem:focus-visible { background: var(--teal-bg); }
.sy-ex-hsql { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--ink-2); }
@media (max-width: 640px) {
  .sy-ex-keys { display: none; }
  .sy-ex-sql { min-height: 180px; font-size: 16px; }
  .sy-ex-hitem time { display: none; }
  /* bảng xem trước giữ dạng bảng cuộn ngang trong khung, không cuộn cả trang / preview stays a scrollable table inside its frame */
  .sy-ex-table { max-width: 100%; }
}
