/* page-exchange — Trao đổi nội bộ. ceoacc không có trang này, nên mỗi khối dựng bằng đúng số đo của khối ceoacc tương ứng:
   - đầu trang, thanh tiêu đề danh sách, thẻ bài, trạng thái trống = Trung tâm hướng dẫn (client_blogs: .tc-hero/.tc-toolbar/.tc-card/.tc-empty)
   - thẻ "Đăng bài mới" + nút nhỏ "Tải lại" = Lịch sử mua hàng (client_orders: .orders-card, .orders-hero .btn)
   - ô nhập, nhãn, dòng gợi ý, nút, hàng nút = trang Công cụ (client_ceotools: .form-control, .form-text, .btn, .ig-check-actions)
   Số đo lấy từ getComputedStyle trên bản gốc (đơn vị CSS chưa nhân zoom .86); px chỗ gốc dùng px, rem chỗ gốc dùng rem.
   Mọi luật gói trong #page-exchange. */
#page-exchange {
  --ex-label: #213446;
  --ex-search-icon: #8491a8;
  --ex-placeholder: #757575;     /* gốc không tô placeholder ô tìm ở chế độ sáng → màu mặc định của Chrome */
  --ex-empty-line: #cbd7e8;
  --ex-fill: #2465bd;
  --ex-secondary: #8f9fbc;
  --ex-heading: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.cg-dark #page-exchange {
  --ex-label: var(--cg-text);
  --ex-search-icon: #9db1ce;
  --ex-placeholder: #aab8cc;
  --ex-empty-line: #3c4c64;
}
#page-exchange [hidden] { display: none !important; }

/* === Đầu trang (.tc-hero) === */
#page-exchange .ex-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 17px 20px; margin-bottom: 18px;
  border: 1px solid var(--cg-line); border-radius: 24px;
  background: linear-gradient(135deg, var(--cg-surface) 35%, var(--cg-blue-soft));
  box-shadow: var(--cg-shadow); color: var(--cg-text);
}
#page-exchange .ex-hero-icon {
  display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center;
  border: 1px solid var(--cg-line); border-radius: 14px;
  background: var(--cg-blue-soft); color: var(--cg-primary); font-size: 20px;
}
#page-exchange .ex-hero-copy { flex: 1; min-width: 0; }
#page-exchange .ex-hero h1 {
  margin: 0 0 4px; font-family: var(--ex-heading);
  font-size: 24px; font-weight: 600; line-height: 1.35; letter-spacing: -.025em; color: var(--cg-text);
}
#page-exchange .ex-hero p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--cg-muted); }
/* Ô tìm (.tc-search): nhãn bọc mang màu/độ đậm label chung của gốc */
#page-exchange .ex-search { position: relative; flex: 0 1 320px; margin: 0; font-weight: 500; color: var(--ex-label); }
#page-exchange .ex-search i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ex-search-icon); pointer-events: none;
}
#page-exchange .ex-search input {
  display: inline-block; width: 100%; height: 42px; padding: 0 14px 0 40px;
  border: 1px solid var(--cg-line); border-radius: 16px; background: var(--cg-surface); color: var(--cg-text);
  font-family: inherit; font-size: 14px; font-weight: 400; line-height: 1.55;
  outline: 0; outline-offset: -2px; -webkit-appearance: none; appearance: none;
}
#page-exchange .ex-search input::placeholder { color: var(--ex-placeholder); opacity: 1; }
/* Gốc chỉ thêm vòng sáng 2px khi focus, viền giữ nguyên */
#page-exchange .ex-search input:focus { box-shadow: 0 0 0 2px var(--cg-field-ring); }

/* === Thẻ có tiêu đề (.orders-card > .card-header + .card-body) === */
#page-exchange .ex-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; margin-bottom: 30px;
  border: 1px solid var(--cg-line); border-radius: 24px;
  background: linear-gradient(155deg, var(--cg-surface) 65%, var(--cg-soft));
  box-shadow: var(--cg-shadow); color: var(--cg-text); font-size: 14px; line-height: 1.6;
}
#page-exchange .ex-card-header {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--cg-line); border-radius: 23px 23px 0 0; background: var(--cg-surface);
}
#page-exchange .ex-card-title { margin: 0; font-family: var(--ex-heading); font-size: 17px; font-weight: 700; line-height: 1.5; color: var(--cg-text); }
#page-exchange .ex-card-body { flex: 1 1 auto; padding: 20px; }

/* === Nhãn, ô nhập, dòng gợi ý (.form-label / .form-control / .form-text) === */
#page-exchange .ex-group { margin-bottom: 1.25rem; }
#page-exchange .ex-label { display: inline-block; margin-bottom: .5rem; font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--ex-label); }
#page-exchange .ex-input {
  display: block; width: 100%; height: 46px; padding: 10px 14px;
  border: 1px solid var(--cg-line-strong); border-radius: 12px; background: var(--cg-surface); color: var(--cg-text);
  font-family: inherit; font-size: 14px; font-weight: 400; line-height: 45px; transition: border-color .15s, box-shadow .15s;
}
#page-exchange textarea.ex-input { height: auto; padding: 6px 14px; line-height: 1.3; resize: vertical; }
#page-exchange .ex-input::placeholder { color: var(--cg-muted); opacity: 1; }
#page-exchange .ex-input:focus { outline: 0; border-color: var(--cg-primary); box-shadow: 0 0 0 2px var(--cg-field-ring); }
#page-exchange .ex-help { display: block; margin-top: .25rem; font-size: 14px; line-height: 1.6; color: var(--cg-text); }

/* === Nút (.btn) + hàng nút (.ig-check-actions) === */
#page-exchange .ex-btn {
  display: inline-block; padding: .625rem 1.25rem;
  border: 1px solid transparent; border-radius: 12px; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 21px;
  text-align: center; vertical-align: middle; cursor: pointer; user-select: none;
  transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s;
}
#page-exchange .ex-btn:disabled { opacity: .65; cursor: default; }
#page-exchange .ex-btn-primary { background: var(--ex-fill); border-color: var(--ex-fill); color: #fff; box-shadow: 0 4px 8px rgba(255, 255, 255, .05); }
/* Gốc: nút xanh không đổi khi rê chuột; chỉ khi đang nhấn mới đậm lên */
#page-exchange .ex-btn-primary:not(:disabled):active { background: #0056ff; border-color: #0052f2; }
#page-exchange .ex-btn:is(:focus, :disabled, :active) { box-shadow: none; }
#page-exchange .ex-btn-outline-secondary { color: var(--ex-secondary); border-color: var(--ex-secondary); }
#page-exchange .ex-btn-outline-secondary:not(:disabled):is(:hover, :active) { color: #fff; background: var(--ex-secondary); }
.cg-dark #page-exchange .ex-btn-outline-secondary { color: #fff; }
#page-exchange .ex-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#page-exchange .ex-actions > .ex-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; margin: 0; padding: 10px 20px; font-weight: 600; white-space: nowrap;
}
/* Nút nhỏ nền trắng (.orders-hero .btn.btn-sm): chữ phông tiêu đề, không đổi khi rê chuột */
#page-exchange .ex-btn-sm { padding: .25rem .5rem; font-size: 12px; line-height: 18px; border-radius: 10px; }
#page-exchange .ex-btn-light { flex: 0 0 auto; color: var(--cg-primary); background: var(--cg-surface); border-color: var(--cg-line); font-family: var(--ex-heading); }
#page-exchange .ex-btn-light i { margin-right: .3125rem; }

/* === Thông báo (.alert) === */
#page-exchange .ex-alert {
  display: flex; align-items: stretch; margin-bottom: 1rem; padding: .55rem 1rem;
  border: 1px solid transparent; border-radius: 20px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere;
}
#page-exchange .ex-alert-danger { color: #7f1620; background: #fdd5d8; border-color: #cd2433; }
.cg-dark #page-exchange .ex-alert-danger { color: #f42b3d; background: rgba(244, 43, 61, .2); }

/* === Thanh tiêu đề danh sách (.tc-toolbar) === */
#page-exchange .ex-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
#page-exchange .ex-toolbar h2 { margin: 0; font-family: var(--ex-heading); font-size: 17px; font-weight: 750; line-height: 1.2; color: var(--cg-text); }
/* Nhóm bên phải (bộ đếm + nút "Tải lại" riêng FunTools) cao đúng một dòng tiêu đề 17px × 1.2 = 20.4px:
   nút tràn đều trên/dưới nên thanh giữ nguyên chiều cao 20.4px như .tc-toolbar của gốc */
#page-exchange .ex-toolbar-right { display: flex; align-items: center; gap: 10px; height: 20.4px; }
#page-exchange .ex-count { font-size: 13px; color: var(--cg-muted); }

/* === Bài đăng (.tc-card > .tc-card-body) === */
#page-exchange .ex-post {
  overflow: hidden; margin-bottom: 1.25rem;
  border: 1px solid var(--cg-line); border-radius: 24px;
  background: linear-gradient(155deg, var(--cg-surface) 65%, var(--cg-soft));
  box-shadow: var(--cg-shadow); color: var(--cg-text); font-size: 14px; line-height: 1.6;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#page-exchange .ex-post:hover { transform: translateY(-2px); border-color: var(--cg-line-strong); }
#page-exchange .ex-post-body { display: flex; flex-direction: column; min-height: 108px; padding: 17px 18px; }
/* Ảnh đại diện chữ cái: riêng FunTools, tô như ô biểu tượng đầu trang (.tc-hero-icon) */
#page-exchange .ex-post-head { display: flex; align-items: center; gap: 12px; }
#page-exchange .ex-avatar {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--cg-line); border-radius: 12px; background: var(--cg-blue-soft); color: var(--cg-primary);
  font-family: var(--ex-heading); font-size: 14px; font-weight: 700;
}
#page-exchange .ex-post-who { min-width: 0; }
/* Tên người đăng: kiểu chữ của tiêu đề thẻ bài (.tc-card h3) */
#page-exchange .ex-post-author {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0;
  font-family: var(--ex-heading); font-size: 14px; font-weight: 750; line-height: 1.48; color: var(--cg-text);
}
/* Nhãn "Ghim": kiểu chip .ctools-kicker */
#page-exchange .ex-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 11px; font-weight: 500; line-height: 1.55; letter-spacing: .04em;
  color: var(--cg-primary); background: var(--cg-blue-soft);
}
/* Dòng thời gian (.tc-meta) */
#page-exchange .ex-post-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--cg-muted); }
#page-exchange .ex-post-meta .fa-clock { margin-right: .3125rem; }
#page-exchange .ex-post-text { margin-top: 10px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--cg-text); }

/* === Trạng thái trống (#tc-filter-empty .tc-empty) === */
#page-exchange .ex-empty {
  padding: 55px 20px; text-align: center;
  border: 1px dashed var(--ex-empty-line); border-radius: 15px; background: var(--cg-soft); color: var(--cg-muted);
}
#page-exchange .ex-empty i { margin-bottom: .625rem; }


/* === Điện thoại (luật gốc ≤767.98px của client_blogs / client_orders + ceo-glass-pages ≤600px) === */
@media (max-width: 767.98px) {
  /* lề container 10px thay 15px như .tc-page / .orders-page của gốc */
  #page-exchange { margin: 0 -5px; }
  #page-exchange .ex-hero { align-items: flex-start; flex-wrap: wrap; padding: 15px; }
  #page-exchange .ex-hero-icon { flex-basis: 42px; width: 42px; height: 42px; }
  #page-exchange .ex-search { flex-basis: 100%; max-width: none; }
  #page-exchange .ex-toolbar { padding: 0 2px; }
  #page-exchange .ex-btn-light { padding: .45rem .6rem; }
}
@media (max-width: 600px) {
  #page-exchange :is(.ex-hero, .ex-card, .ex-post) { border-radius: 20px; }
  #page-exchange .ex-card-header { padding: 14px 16px; border-radius: 19px 19px 0 0; }
  #page-exchange .ex-card-body { padding: 16px; }
  #page-exchange .ex-hero h1 { font-size: 22px; }
  #page-exchange .ex-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #page-exchange .ex-post:hover { transform: none; }
}
