/* THIẾT LẬP nhóm 1 — doanh nghiệp & logo & mẫu in, tên gọi, danh sách lựa chọn, quy tắc & con số, ô thông tin thêm.
   Dùng cho các màn hình web/js/screens/settings/{company,terms,lists,rules,fields}.js. Mọi lớp bắt đầu bằng "set-" để không đụng tệp CSS khác.
   Màu và cỡ chữ chung lấy từ biến trong app.css (--brand, --line, --sub…). */

/* Ẩn một phần tử (dòng không khớp ô tìm, ô "Các lựa chọn" khi kiểu ô không phải danh sách). */
.set-hide { display: none !important; }

/* Khung giải thích đầu màn hình */
.set-explain { font-size: 15px; }
.set-explain p { margin: 0 0 6px; }
.set-explain p:last-child { margin-bottom: 0; }
.set-explain ul { margin: 4px 0 0; padding-left: 20px; color: var(--sub); font-size: 14px; }
.set-explain li { margin: 3px 0; }

/* Nút "+ Thêm…" nằm dưới mỗi danh sách */
.btn.set-add { margin-top: 8px; background: var(--brand-soft); color: var(--brand); overflow-wrap: anywhere; }
.set-actions { padding: 10px 16px 14px; }
.set-list .note { margin: 0 16px 8px; }
.set-list .search { margin: 0 0 8px; }

/* Mục đang ẩn: chữ nhạt hơn */
.row.set-off .title { color: var(--sub); font-weight: 500; }
.row .right .badge { margin-bottom: 2px; }
.set-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

/* Logo */
.set-logo-card { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.set-logo { width: 96px; height: 96px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #fafafc; flex-shrink: 0; }
.set-logo.none { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--sub); font-size: 13px; padding: 6px; }
.set-logo-side { flex: 1 1 180px; min-width: 0; }
.set-logo-side .hint { margin: 0; }
.set-file { display: none; }
.set-logo-try { text-align: center; margin-bottom: 10px; }
.set-logo-try img { max-width: 100%; max-height: 200px; object-fit: contain; border: 1px dashed var(--line); border-radius: 12px;
  background: repeating-conic-gradient(#f1f1f4 0% 25%, #fff 0% 50%) 0 0 / 18px 18px; }

/* Tên gọi */
.set-term .sub s { color: var(--red); text-decoration-thickness: 1px; }
.set-term .title { color: var(--brand); }
.set-samples p { margin: 0 0 8px; font-size: 15px; }
.set-samples p:last-child { margin: 0; }
.set-preview { margin-bottom: 9px; }
.set-pair { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; overflow-wrap: anywhere; }
.set-pair:last-child { border-bottom: 0; }
.set-pair s { color: var(--sub); }
.set-pair b { color: #0f4d39; font-weight: 600; }

/* Quy tắc & con số */
.set-rule { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.set-rule:last-child { border-bottom: 0; }
.set-rule-top { display: flex; gap: 12px; align-items: flex-start; }
.set-rule .main { flex: 1; min-width: 0; }
.set-rule .title { font-weight: 600; overflow-wrap: anywhere; }
.set-rule .sub { color: var(--sub); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.btn.set-reset { margin-top: 8px; }
/* Công tắc bật / tắt: vùng chạm 44 px, có chữ Bật / Tắt để không chỉ dựa vào màu */
.set-switch { flex-shrink: 0; border: 0; background: none; padding: 0; min-height: 44px; min-width: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.set-switch .knob { position: relative; width: 52px; height: 30px; border-radius: 15px; background: #d1d1d6; transition: background .15s; }
.set-switch .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.set-switch.on .knob { background: var(--brand); }
.set-switch.on .knob::after { transform: translateX(22px); }
.set-switch .state { font-size: 12px; font-weight: 600; color: var(--sub); }
.set-switch.on .state { color: var(--brand); }
.set-switch:focus-visible, .set-value:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
/* Ô giá trị (số, tiền tố): chạm để đổi */
.set-value { flex-shrink: 0; min-height: 44px; min-width: 64px; border: 1px solid var(--line); background: #fafafc; border-radius: 10px; padding: 6px 12px;
  font-weight: 700; font-size: 16px; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.set-code { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Ô đánh dấu đơn trong biểu mẫu (bắt buộc nhập, in lên phiếu): giữ ô vuông 22 px, thẳng hàng với chữ. */
/* Ô chọn mục đích khi gộp hai mục */
.field.custom .set-merge { margin-bottom: 0; }
.set-merge select { width: 100%; }
