:root {
  /* Accent — đổi 1 dòng này để đổi màu nhấn toàn app */
  --pink: #15803d; --pink-d: #166534;
  --bg: #f8fafc; --card: #ffffff; --ink: #0f172a; --muted: #64748b;
  --green: #15803d; --line: #e2e8f0;
  --amber: #b45309; --blue: #0369a1;
  --brown-d: #0f172a; --beige: #f1f5f9;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; border-radius: 9px; }
.brand-name { color: var(--brown-d); }
.brand-name b { color: var(--pink); }
.muted { color: var(--muted); font-weight: normal; font-size: 13px; }
select, input, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { width: 100%; resize: vertical; }

/* Bố cục 2 khối: cột module dọc bên trái (sidebar) + vùng nội dung bên phải */
.layout { display: flex; align-items: flex-start; }
/* --- Cột module dọc bên trái --- */
.tabs {
  flex: 0 0 190px; width: 190px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 10px; border-right: 1px solid var(--line);
  background: var(--card);
  position: sticky; top: 64px; align-self: flex-start;
  max-height: calc(100vh - 64px); overflow-y: auto;
}
.tab {
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--muted); text-align: left;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.tab .tab-ic { width: 18px; height: 18px; flex: 0 0 18px; }
.tab .tab-lb { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab:hover { color: var(--ink); background: var(--bg); }
.tab.active { color: var(--pink); font-weight: 600; background: #f0fdf4; border-left-color: var(--pink); }
.badge { background: var(--pink); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600; margin-left: auto; }

/* ---- Nhóm tab cha "Đăng bài" + submenu ---- */
.tab-group { display: flex; flex-direction: column; gap: 3px; }
.tab-parent .tab-caret { width: 15px; height: 15px; flex: 0 0 15px; margin-left: auto; transition: transform .18s; opacity: .7; }
.tab-group.open .tab-parent .tab-caret { transform: rotate(180deg); }
.tab-parent.has-active { color: var(--pink); }
.tab-sub {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .22s ease, opacity .18s ease;
}
.tab-group.open .tab-sub { max-height: 260px; opacity: 1; }
.tab-child { padding-left: 40px; font-size: 13.5px; }
.tab-child::before {
  content: ''; position: absolute; left: 22px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--line);
}
.tab-child { position: relative; }
.tab-child.active::before { background: var(--pink); }

/* ---- Chế độ #view-products: "Đăng bài mới" (content) vs "Sản phẩm" (info) ---- */
/* content = viết bài: ẩn nút thuộc nhóm Sản phẩm (.sp-only) */
#view-products.mode-content .sp-only { display: none !important; }
/* info = Sản phẩm: ẩn nút viết bài (.post-only) */
#view-products.mode-info .post-only { display: none !important; }

main { flex: 1; min-width: 0; padding: 16px 20px 60px; }
.view.hidden { display: none; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
/* Cột trái (danh sách SP) và cột phải (form) cuộn ĐỘC LẬP, dính theo màn hình.
   Tabs giờ nằm dọc bên trái nên chỉ còn header(~64) chiếm phía trên. */
.split .list-col, .split .form-col {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Đầu cột + ô lọc đứng yên; chỉ danh sách sản phẩm cuộn bên trong. */
.split .list-col .product-list { flex: 1; overflow-y: auto; padding-right: 4px; }
/* Form bên phải cuộn riêng khi dài, luôn thấy khi cuộn danh sách. */
.split .form-col { overflow-y: auto; padding-right: 4px; }
@media (max-width: 780px) {
  /* Màn hẹp: cột module dọc gập về thanh ngang cuộn được cho dễ bấm trên điện thoại */
  .layout { flex-direction: column; align-items: stretch; }
  .tabs {
    flex: none; width: 100%;
    flex-direction: row; gap: 4px;
    padding: 8px 12px; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; max-height: none;
  }
  .tab { width: auto; flex: 0 0 auto; border-left: none; border-radius: 8px; }
  .tab .tab-lb { text-overflow: clip; }
  .tab.active { border-left: none; }
  .badge { margin-left: 6px; }
  /* Màn hẹp: nhóm "Đăng bài" trải phẳng thành các tab ngang, ẩn nút cha + submenu luôn mở */
  .tab-group { flex-direction: row; gap: 4px; }
  .tab-parent { display: none; }
  .tab-sub { flex-direction: row; gap: 4px; max-height: none; opacity: 1; overflow: visible; }
  .tab-child { padding-left: 12px; }
  .tab-child::before { display: none; }
  .split { grid-template-columns: 1fr; }
  /* Màn hẹp: trả về cuộn thường cho dễ thao tác. */
  .split .list-col, .split .form-col { position: static; max-height: none; overflow: visible; }
  .split .list-col .product-list { max-height: 60vh; }
}
.col-head { font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.mini { font-size: 12px; padding: 4px 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.mini:disabled { opacity: .45; cursor: not-allowed; }
.mini.danger { color: #b42318; border-color: #f0c2bd; }
.mini.danger:hover:not(:disabled) { background: #fef3f2; }

/* Nút công cụ dạng biểu tượng (hiện chữ khi rê chuột qua title) */
.icon-btn {
  position: relative;
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--bg); border-color: var(--pink); color: var(--pink); }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn.danger { color: #b42318; }
.icon-btn.danger:hover:not(:disabled) { background: #fef3f2; border-color: #f0c2bd; color: #b42318; }
/* huy hiệu số lượng đã chọn trên nút icon */
.icon-btn .cnt { display: none; }
.icon-btn.has-count .cnt {
  display: flex; align-items: center; justify-content: center;
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; border-radius: 999px;
}
.icon-btn.danger.has-count .cnt { background: #b42318; }
/* trạng thái đang chạy: xoay nhẹ biểu tượng cho biết đang xử lý */
.icon-btn.busy svg { animation: iconspin 1s linear infinite; }
@keyframes iconspin { to { transform: rotate(360deg); } }

/* Đầu cột danh sách SP: tiêu đề 1 hàng, thanh công cụ xuống hàng dưới (không bóp chữ) */
.list-head { display: block; }
.list-head .lh-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.list-head .lh-all { font-weight: 400; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; cursor: pointer; margin-left: auto; }
.list-head .lh-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.list-head .lh-tools .mini { white-space: nowrap; }

.product-list { display: flex; flex-direction: column; gap: 8px; }
.prod-item { display: flex; gap: 10px; align-items: center; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.prod-item.active { border-color: var(--pink); box-shadow: 0 0 0 2px #15803d33; }
.prod-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.prod-item .name { font-weight: 600; }
.prod-item .sub { font-size: 12px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.form-col .empty, .empty { color: var(--muted); padding: 40px; text-align: center; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); }
.field input { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

button { font-family: inherit; }
button.primary { background: var(--pink); color: #fff; border: 1px solid var(--pink); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s, border-color .15s; }
button.primary:hover { background: var(--pink-d); border-color: var(--pink-d); }
button.primary:disabled { opacity: .45; cursor: default; }
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: background .15s, border-color .15s; }
button.ghost:hover { background: var(--beige); border-color: #cbd5e1; }
button.green { background: var(--green); color: #fff; border: 1px solid var(--green); padding: 9px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s; }
button.green:hover { background: var(--pink-d); }
button.danger { color: #c0392b; background: #fff; border: 1px solid #f0c9c4; padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: background .15s; }
button.danger:hover { background: #fef2f2; border-color: #e5b0a8; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }

.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.post .head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.post .thumbs { align-items: center; gap: 5px; }
.post .thumbs img { width: 78px; height: 78px; }
.post textarea { min-height: 150px; font-size: 14px; line-height: 1.5; }
.post .content-ro { white-space: pre-wrap; font-size: 14px; line-height: 1.55; background: var(--beige); border-radius: 8px; padding: 10px; }
.post .foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tagname { background: var(--beige); color: var(--pink-d); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.sched { font-size: 12px; }

/* ===== LỊCH "Chờ đăng": mỗi ngày 1 cột dọc, bài lên lịch xếp chồng theo giờ ===== */
/* #list-approved & #list-posted dùng chung class .posts (grid) — override về block để lịch chiếm full bề ngang */
#list-approved.posts, #list-posted.posts { display: block; }
.cal-note { font-size: 13px; color: var(--ink); background: var(--beige); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.cal-board { display: flex; width: 100%; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px; }
.cal-day {
  flex: 0 0 250px; width: 250px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column;
}
.cal-day.today { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink) inset; }
.cal-day-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--card); border-radius: 12px 12px 0 0; font-weight: 600;
}
.cal-day.today .cal-day-head { background: #f0fdf4; color: var(--pink); }
.cal-day-head .cd-wd { font-size: 14px; }
.cal-day-head .cd-date { font-size: 13px; color: var(--muted); font-weight: 500; }
.cal-day.today .cal-day-head .cd-date { color: var(--pink); }
.cal-day-head .cd-count { margin-left: auto; background: var(--pink); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.cal-day-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.cal-day-body .empty { padding: 20px; font-size: 13px; }
/* Bài trong cột lịch: gọn ảnh lại cho vừa cột hẹp */
.cal-day-body .post { padding: 10px; gap: 6px; }
.cal-day-body .post .thumbs img { width: 48px; height: 48px; }
.cal-day-body .post textarea { min-height: 90px; font-size: 13px; }
/* Giờ đăng in đậm nổi bật ở đầu mỗi bài */
.post-time { display: flex; align-items: baseline; gap: 8px; background: var(--beige); border-radius: 8px; padding: 6px 10px; }
.post-time .pt-h { font-size: 20px; font-weight: 800; color: var(--pink-d); letter-spacing: .5px; line-height: 1; }
.post-time .pt-d { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-day.today .post-time { background: #f0fdf4; }
.cal-day.today .post-time .pt-h { color: var(--pink); }
@media (max-width: 780px) {
  /* Màn hẹp: các cột ngày xếp dọc, cuộn trang bình thường */
  .cal-board { flex-direction: column; overflow-x: visible; }
  .cal-day { flex: none; width: 100%; }
  .cal-day-head { position: static; }
  .cal-day-body .post .thumbs img { width: 60px; height: 60px; }
}

.settings label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.settings input, .settings textarea { width: 100%; margin-top: 4px; }
.settings .hint { font-size: 12px; color: var(--green); }
.guide { margin-top: 16px; font-size: 13px; }
.guide summary { cursor: pointer; font-weight: 600; }
.guide code { background: #f2f2f2; padding: 1px 5px; border-radius: 4px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #2b2b2b; color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 20; max-width: 90%; }
.toast.err { background: #c0392b; }
.toast.hidden { display: none; }
.spin { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ô ADN phong cách theo page */
.adn-box { margin-bottom: 18px; border-left: 5px solid var(--brown-d); }
.adn-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--brown-d); }
.adn-box textarea { width: 100%; min-height: 130px; line-height: 1.5; }
/* Tự động viết bài + lên lịch */
.ap-box { margin-bottom: 18px; border-left: 5px solid var(--pink); }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ap-info { min-width: 0; }
.ap-title { font-weight: 700; color: var(--ink); font-size: 15px; }
.ap-sub { font-size: 12.5px; margin-top: 3px; line-height: 1.5; }
.ap-state { font-size: 12.5px; margin-top: 4px; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: 0 0 auto; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: .2s; }
.switch-slider::before { content: ''; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch-slider { background: var(--pink); }
.switch input:checked + .switch-slider::before { transform: translateX(22px); }
@media (max-width: 720px) { .ap-box { margin-bottom: 12px; } }
a { color: var(--pink); }

/* Nút Cài đặt trên header */
.header-right { display: flex; align-items: center; gap: 12px; }
.settings-btn { background: var(--card); border: 1px solid var(--line); color: var(--brown-d); padding: 9px 14px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; }
.settings-btn:hover { background: var(--beige); }
.settings-btn.active { background: var(--brown-d); color: #fff; border-color: var(--brown-d); }
@media (max-width: 640px) { header { flex-wrap: wrap; gap: 10px; } .header-right { width: 100%; justify-content: space-between; } }

/* Số ảnh & đổi ảnh trên bài */
.imgline { display: flex; align-items: center; gap: 8px; }
.imgcount { font-size: 12px; color: var(--brown-d); background: var(--beige); padding: 2px 8px; border-radius: 6px; font-weight: 600; }
label.chk { display: flex; align-items: center; gap: 8px; }
label.chk input { width: auto; margin: 0; }
.img-rule .row2 label { margin-bottom: 6px; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* Nút Đăng luôn ở bài Chưa duyệt */
button.postnow { background: var(--pink); color: #fff; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; }
button.postnow:hover { background: var(--pink-d); }
button.postnow:disabled { opacity: .6; cursor: default; }

/* Câu trả lời mẫu Pancake */
.reply-card { margin-top: 14px; border: 1px dashed var(--pink); border-radius: 10px; padding: 12px; background: #fffaf3; }
.reply-h { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--brown-d); margin: 8px 0 4px; }
.reply-txt { white-space: pre-wrap; font-size: 14px; line-height: 1.55; background: var(--beige); border-radius: 8px; padding: 10px; margin: 0; font-family: inherit; }
.copy { cursor: pointer; }

/* Thu gọn thông tin + ô số bài */
.form-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
#fieldsBlock.hidden { display: none; }
.gen-wrap { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
#genCount { width: 56px; text-align: center; padding: 8px 6px; }

/* Trường POS + nút Up lên POS */
.pos-fields { margin-top: 8px; padding: 10px; border: 1px dashed var(--blue); border-radius: 10px; background: #f6f8fb; }
.pos-label { font-weight: 600; color: var(--blue); margin-bottom: 8px; }
button.pos-btn { background: var(--blue); color: #fff; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; }
button.pos-btn:hover { filter: brightness(0.92); }
button.pos-btn:disabled { opacity: .6; cursor: default; }
.pos-settings label { display: block; margin: 10px 0; }
.pos-settings input { width: 100%; margin-top: 4px; }
.pos-settings .hint { font-size: 12px; color: var(--green); }

/* Thẻ bài gọn: nút icon + đổi ảnh dạng tròn */
.post .thumbs .shuffle { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.post .thumbs .shuffle:hover { background: var(--beige); transform: rotate(90deg); transition: .15s; }
.post .foot { gap: 6px; align-items: center; }
.post .foot .when { flex: 1; min-width: 128px; padding: 6px 8px; font-size: 13px; }
button.ic { width: 40px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-size: 15px; flex: none; }
button.ic:hover { filter: brightness(0.95); }
button.ic.go { background: var(--green); color: #fff; border-color: var(--green); }
button.ic.go:hover { background: var(--pink-d); border-color: var(--pink-d); filter: none; }
button.ic.postnow { background: var(--pink); color: #fff; border-color: var(--pink); }
button.ic.postnow:hover { background: var(--pink-d); border-color: var(--pink-d); filter: none; }
button.ic.del { color: #c0392b; }
button.ic.del:hover { background: #fef2f2; border-color: #e5b0a8; filter: none; }
button.ic:disabled { opacity: .5; cursor: default; }
button.ic.busy { display: inline-block; animation: spin .9s linear infinite; }
.post { padding: 12px; gap: 7px; }

/* Lightbox phóng to ảnh */
.thumbs img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.lightbox.hidden { display: none; }
.lightbox img { max-width: 95%; max-height: 92%; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.5); object-fit: contain; }
.lb-close { position: absolute; top: 16px; right: 22px; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; opacity: .85; }
.lb-close:hover { opacity: 1; }

/* ---- Builder phân loại + kéo ảnh ---- */
.thumbs img { cursor: grab; }
.thumbs img:active { cursor: grabbing; }
.vb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.vb-head select { padding: 4px 6px; border: 1px solid #d8cfc0; border-radius: 6px; }
/* chật (form hẹp) thì ô giá xuống hàng dưới, không bóp ô kéo ảnh (min-width ở .vb-drop) */
.vb-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.vb-row .vm-name { flex: 0 0 150px; font-size: 13px; font-weight: 600; }
.vb-row .vb-price-wrap { flex: 0 0 150px; }
.vm-head { margin: 10px 0 6px; font-size: 12px; color: var(--muted); }
.vm-head b { color: var(--text, #222); font-size: 13px; }
/* Thuộc tính kiểu POS: [tên] [thẻ giá trị… ô gõ] [🗑] */
.va-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.field .va-row .va-name { flex: 0 0 120px; width: auto; }
.va-vals { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px;
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: text; }
.field .va-vals .va-input { flex: 1 1 140px; width: auto; min-width: 120px; border: none; outline: none; box-shadow: none; padding: 4px 2px; }
.va-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px;
  background: #f3ece0; border: 1px solid #e0d3bd; font-size: 13px; }
.va-chip i { font-style: normal; cursor: pointer; color: #b42318; font-weight: 700; padding: 0 2px; }
.va-del { background: none; border: none; cursor: pointer; font-size: 15px; }
/* giá đang theo "Giá bán" (chưa sửa riêng) → chữ xám; gõ giá riêng → chữ đậm */
.vb-price:not([data-custom="1"]) { color: var(--muted); }
.vb-price[data-custom="1"] { font-weight: 600; }
.vb-drop { flex: 1; min-width: 160px; min-height: 46px; border: 1.5px dashed #cbb89a; border-radius: 8px;
  padding: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: #fffdf9; }
.vb-drop.over { border-color: #a9772e; background: #fbf3e4; }
.vb-drop:empty::before { content: "Kéo ảnh vào đây"; color: #b3a58a; font-size: 12px; padding: 0 6px; }
.vb-thumb { position: relative; display: inline-block; }
.vb-thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.vb-thumb .vb-x { position: absolute; top: -6px; right: -6px; background: #c0392b; color: #fff;
  width: 16px; height: 16px; border-radius: 50%; font-size: 12px; line-height: 16px; text-align: center; cursor: pointer; }

/* ---- Tích chọn sản phẩm ---- */
.prod-check { width: 18px; height: 18px; flex: 0 0 auto; margin-right: 2px; cursor: pointer; accent-color: #a9772e; }
.sel-count { font-size: 12px; color: #a9772e; font-weight: 600; margin-left: 6px; }

#adnBody.hidden { display: none; }

/* ---- Ô tiền tệ ---- */
.money-wrap { display: flex; align-items: center; gap: 6px; }
.money-wrap .money { flex: 1; text-align: right; }
.money-wrap .vnd { font-size: 12px; color: var(--muted); font-weight: 600; }
input[readonly] { background: var(--beige); color: var(--muted); }

/* ---- Chọn Page: mỗi page 1 ô riêng (tab), luôn thấy đang ở page nào ---- */
.page-select { display: flex; align-items: center; gap: 8px; background: var(--beige); padding: 5px 8px; border-radius: 10px; border: 1px solid var(--line); }
.page-select .page-label { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .3px; white-space: nowrap; }
.page-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.page-btn { font-size: 14px; font-weight: 600; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 6px 12px; cursor: pointer; font-family: inherit; }
.page-btn:hover { background: #fff; border-color: var(--line); }
.page-btn.active { background: var(--pink); color: #fff; border-color: var(--pink); }
@media (max-width: 640px) { .page-btn { font-size: 13px; padding: 5px 10px; } }

/* ---- Đăng nhập & phân quyền ---- */
.login-screen { position: fixed; inset: 0; background: linear-gradient(135deg,#f8fafc,#e2e8f0); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.login-screen.hidden { display: none; }
.login-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 30px 26px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 11px; box-shadow: 0 12px 44px rgba(15,23,42,.12); text-align: center; }
.login-logo { width: 56px; height: 56px; border-radius: 12px; align-self: center; }
.login-box h2 { margin: 4px 0 0; color: var(--brown-d); font-size: 20px; }
.login-box p { margin: 0 0 4px; }
.login-box input { width: 100%; padding: 11px 12px; font-size: 15px; text-align: left; }
.login-box .primary { margin-top: 4px; padding: 12px; font-size: 15px; }
.login-err { color: #c0392b; font-size: 13px; min-height: 16px; }
.user-chip { font-size: 13px; font-weight: 700; color: var(--brown-d); background: var(--beige); padding: 6px 10px; border-radius: 8px; white-space: nowrap; }

/* Ẩn phần chỉ dành cho admin khi nhân viên đăng nhập */
body.staff .admin-only { display: none !important; }

/* ---- Form gọn dạng lưới (ô ngắn lại, xếp 2 cột) ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; max-width: 840px; align-items: start; }
.form-grid .field { margin-bottom: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.pos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: start; }
@media (max-width: 620px) { .form-grid, .pos-grid { grid-template-columns: 1fr; } }

/* ---- Ảnh trong bài nháp: nút X bỏ ảnh + kéo đổi vị trí ---- */
.thumbs.edit { align-items: center; }
.thumbs.edit .pthumb { position: relative; display: inline-block; cursor: grab; }
.thumbs.edit .pthumb:active { cursor: grabbing; }
.thumbs.edit .pthumb.dragging { opacity: .4; }
.thumbs.edit .pthumb img { display: block; }
.thumbs.edit .pthumb .rm { position: absolute; top: -6px; right: -6px; background: #c0392b; color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 13px; line-height: 18px; text-align: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.thumbs.edit .pthumb .rm:hover { background: #a93226; }

/* Nút "Thêm ảnh" trong bài (nối cạnh nút 🔄) */
.thumbs.edit .addimg { border: 1px dashed var(--line); background: #fff; color: var(--green); cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; flex: none; white-space: nowrap; }
.thumbs.edit .addimg:hover { background: var(--beige); }

/* ---- Popup chọn ảnh để Thêm vào bài ---- */
.addimg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.addimg-box { background: #fff; border-radius: 14px; width: min(640px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.addimg-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.addimg-head b { font-size: 16px; }
.addimg-head .addimg-x { margin-left: auto; border: none; background: none; font-size: 18px; cursor: pointer; color: #888; }
.addimg-head .addimg-x:hover { color: #c0392b; }
.addimg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 14px 16px; overflow-y: auto; }
.addimg-grid .ai-cell { position: relative; cursor: pointer; border-radius: 8px; overflow: hidden; border: 2px solid transparent; aspect-ratio: 1/1; }
.addimg-grid .ai-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.addimg-grid .ai-cell .ai-tick { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 13px; display: none; align-items: center; justify-content: center; }
.addimg-grid .ai-cell.sel { border-color: var(--green); }
.addimg-grid .ai-cell.sel .ai-tick { display: inline-flex; background: var(--green); }
.addimg-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.addimg-foot .ai-count { margin-right: auto; }
.addimg-foot .ai-ok { background: var(--green); color: #fff; border: none; }
.addimg-foot .ai-ok:disabled { opacity: .5; cursor: default; }

/* ================= ĐIỆN THOẠI: gọn gàng + KHÔNG kéo ngang được ================= */
html, body { max-width: 100%; overflow-x: hidden; }

@media (max-width: 680px) {
  header { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand .logo { width: 34px; height: 34px; }
  .brand .muted { display: none; }                 /* ẩn phụ đề cho gọn */

  .header-right { flex-wrap: wrap; gap: 8px; width: 100%; justify-content: flex-start; }
  .page-select { flex: 1 1 100%; padding: 8px 10px; }
  .page-tabs { flex: 1; gap: 6px; }
  .page-btn { flex: 1 1 44%; text-align: center; font-size: 15px; padding: 9px 6px; }
  .settings-btn, .user-chip { flex: 1 1 auto; justify-content: center; text-align: center; display: inline-flex; align-items: center; white-space: nowrap; }

  main { padding: 12px 12px 60px; }
  .tabs { padding: 8px 12px; }
  .card { padding: 12px; }
  .adn-box { margin-bottom: 12px; }

  .col-head { flex-wrap: wrap; gap: 6px; }
  .col-head .mini { flex: 1 1 auto; text-align: center; }

  .posts { grid-template-columns: 1fr; }
  .thumbs img { width: 60px; height: 60px; }

  .toast { left: 12px; right: 12px; transform: none; max-width: none; text-align: center;
           bottom: calc(20px + env(safe-area-inset-bottom)); }

  /* --- Vùng bấm đủ to cho ngón tay (chuẩn ~44px) --- */
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn svg { width: 20px; height: 20px; }

  /* Điện thoại KHÔNG rê chuột được nên tooltip (title=) vô dụng: 5 nút chỉ có biểu tượng
     thì không đoán nổi nút nào làm gì. Hiện luôn tên nút lấy từ aria-label. */
  .lh-tools .icon-btn { width: auto; min-width: 42px; padding: 0 12px; gap: 7px; }
  .lh-tools .icon-btn::after {
    content: attr(aria-label);
    font-size: 12.5px; font-weight: 600; white-space: nowrap;
  }
  .lh-tools .icon-btn.has-count .cnt { top: -5px; right: -5px; }

  /* Ô ADN: tiêu đề và trạng thái xếp dọc, không chen nhau vỡ chữ */
  .adn-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .adn-head .muted { font-size: 12px; }
  .mini { padding: 8px 12px; font-size: 13px; }
  .prod-check, .camp-check { width: 22px; height: 22px; }
  .lh-head .lh-all, .list-head .lh-all { padding: 4px 0; }
  .emo-btn { width: 36px; height: 36px; }
  .lb-close { top: calc(10px + env(safe-area-inset-top)); right: 14px; font-size: 38px; padding: 6px; }

  /* Thẻ sản phẩm: to hơn, dễ trúng ngón tay */
  .prod-item { padding: 10px; gap: 12px; }
  .prod-item img { width: 54px; height: 54px; }

  /* Bấm sản phẩm sẽ tự cuộn tới form — chừa chỗ cho thanh module dính,
     không thì tên SP + nút "Ẩn thông tin" bị thanh đó che mất. */
  #productForm { scroll-margin-top: 76px; }

  /* Hàng "Loại: [chọn] [Thêm phân loại] [AI tự phân loại]": cho xuống dòng,
     ép chung 1 hàng thì chữ trong nút vỡ thành 3 dòng. */
  .vb-head { flex-wrap: wrap; }
  .vb-head .mini, .vb-head button { flex: 1 1 auto; }

  /* Ô kéo ảnh phân loại: xếp dọc cho khỏi bị bóp */
  .vb-row { flex-wrap: wrap; }
  .vb-row .vm-name { flex: 1 1 100%; }
  .vb-drop { flex: 1 1 100%; min-height: 56px; }
  .vb-row .vb-price-wrap { flex: 1 1 auto; }
  /* thuộc tính: tên + 🗑 một hàng, ô thẻ giá trị xuống hàng dưới đủ rộng */
  .va-row { flex-wrap: wrap; }
  .field .va-row .va-name { flex: 1 1 auto; }
  .va-vals { flex: 1 1 100%; order: 3; }
  .va-del { font-size: 20px; padding: 6px 2px; }

  /* (Các luật riêng cho tab Chiến dịch nằm ở CUỐI FILE — xem ghi chú ở đó) */

  /* Bảng emoji không tràn khỏi màn hình */
  .emoji-picker { width: min(330px, calc(100vw - 24px)); }
}

/* Hàng "Duyệt & đăng FB" trong bài nháp */
.fb-post-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-post-row .when { flex: 1; min-width: 150px; }
.fb-post-row .muted { font-size: 12px; }

/* Ô lọc tên sản phẩm */
.prod-filter { width: 100%; margin-bottom: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 14px; }
.prod-filter:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 2px #15803d22; }

/* ---------- CHIẾN DỊCH (Dọn kho) ---------- */
.camp-intro { border-left: 5px solid var(--pink); }
.camp-intro h3 { color: var(--brown-d); margin-bottom: 6px; }
.camp-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.camp-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--brown-d); }
.camp-form input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; }
.camp-form input:focus, .camp-form select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 2px #15803d22; }
.camp-form select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; cursor: pointer; }
.camp-mode { display: flex; gap: 16px; align-items: center; padding: 6px 0; }
.camp-radio { flex-direction: row !important; align-items: center; gap: 6px !important; font-weight: 500 !important; cursor: pointer; }
.camp-radio input { width: auto; padding: 0 !important; margin: 0; accent-color: var(--pink); cursor: pointer; }
.camp-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.camp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; padding: 10px 12px; background: var(--beige); border: 1px solid var(--line); border-radius: 10px; }
.camp-search { flex: 1; min-width: 180px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.camp-search:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 2px #15803d22; }
.camp-fbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.camp-fbtn.on { background: var(--pink); color: #fff; border-color: var(--pink); }
.camp-range { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--brown-d); font-weight: 600; }
.camp-range input { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: center; }
.camp-range input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 2px #15803d22; }
.camp-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.camp-item.on { border-color: var(--pink); box-shadow: 0 0 0 2px #15803d22; background: #f0fdf4; }
.camp-check { width: 18px; height: 18px; flex: none; cursor: pointer; }
.camp-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--beige); flex: none; }
.camp-info { flex: 1; min-width: 0; }
.camp-name { font-weight: 700; color: var(--brown-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camp-price { font-size: 13px; color: var(--muted); }
.camp-stock { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.camp-st { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.camp-st.ok { color: #1e7d34; background: #e6f5ea; }
.camp-st.low { color: #b9770a; background: #fff2d9; }
.camp-st.out { color: #b02a1a; background: #fde3de; }
.camp-st.inc { color: #2b5fb0; background: #e5eefb; }
.camp-st.muted { color: var(--muted); background: #f0ebe4; font-weight: 600; }
.camp-sale { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: #c0392b; flex: none; }
.camp-sale input { width: 130px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: right; }
.camp-sale input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 2px #15803d22; }
.camp-history { display: flex; flex-direction: column; gap: 12px; }
.camp-hist { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.camp-hist-head { display: flex; align-items: center; gap: 6px; color: var(--brown-d); }
.camp-hist-head .camp-del { margin-left: auto; border-color: #d9b3a8; }
.camp-hist-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.camp-hist-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.camp-hist-thumb:hover { border-color: var(--pink); }

/* Bảng emoji chèn nhanh */
.emoji-bar { display: flex; flex-wrap: wrap; gap: 2px; margin: 4px 0; }
.emoji-bar .emo { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 3px 6px; font-size: 16px; line-height: 1; cursor: pointer; }
.emoji-bar .emo:hover { background: var(--beige); transform: scale(1.12); }
/* Ô tự viết bài (không dùng AI) */
.manual-box { margin-top: 14px; border: 1px dashed var(--pink); border-radius: 10px; padding: 12px; background: #fbfdfb; }
.manual-h { font-weight: 700; color: var(--pink); margin-bottom: 6px; }
.manual-ta { width: 100%; min-height: 120px; line-height: 1.5; font-size: 14px; }

/* Nút mở bảng emoji + bảng emoji đầy đủ (popup) */
.emo-btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--muted); cursor: pointer; align-self: flex-start; }
.emo-btn svg { width: 18px; height: 18px; }
.emo-btn:hover { background: var(--beige); color: var(--ink); }
.emoji-picker { position: fixed; z-index: 60; width: 330px; max-height: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 44px rgba(0,0,0,.2); display: flex; flex-direction: column; overflow: hidden; }
.emoji-picker.hidden { display: none; }
.ep-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--brown-d); }
.ep-close { border: none; background: transparent; cursor: pointer; font-size: 16px; color: var(--muted); }
.ep-body { overflow-y: auto; padding: 4px 10px 10px; }
.ep-cat-h { font-size: 11px; color: var(--muted); font-weight: 600; margin: 8px 0 3px; position: sticky; top: 0; background: #fff; padding: 2px 0; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; }
.ep-emo { border: none; background: transparent; font-size: 20px; line-height: 1; padding: 4px; cursor: pointer; border-radius: 6px; }
.ep-emo:hover { background: var(--beige); transform: scale(1.15); }

/* Cổng bắt Chrome tự điền: ô lọc bị autofill sẽ chạy animation rỗng này,
   JS nghe 'animationstart' là biết mà xoá ngay (không đổi gì về mặt hình ảnh). */
@keyframes duhuAutofill { from { opacity: 1; } to { opacity: 1; } }
#prodFilter:-webkit-autofill { animation-name: duhuAutofill; animation-duration: 1ms; }

/* Menu chọn page đích khi nhân bản sản phẩm */
.page-menu { position: fixed; z-index: 60; width: 220px; max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 44px rgba(0,0,0,.2); padding: 6px; }
.pm-head { font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 8px 6px; }
.pm-item { display: block; width: 100%; text-align: left; border: none; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink); }
.pm-item:hover { background: var(--beige); color: var(--pink); }

/* Chọn ảnh khi tự viết bài */
.manual-imgs { margin-bottom: 8px; }
.mi-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.mimg-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.mimg { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid var(--line); opacity: .5; }
.mimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mimg.selected { opacity: 1; border-color: var(--pink); }
.mimg .tick { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 12px; display: none; align-items: center; justify-content: center; line-height: 1; }
.mimg.selected .tick { display: flex; }

/* ---------- Tổng quan ---------- */
.ov-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.ov-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.ov-card .ov-v { font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.ov-card .ov-lb { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 4px; }
.ov-card .ov-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ov-tablecard { padding: 0; overflow: hidden; }
.ov-thead { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.ov-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.ov-stock { padding: 7px 10px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.ov-filter { min-width: 180px; max-width: 240px; padding: 7px 10px; font-size: 13px; }
.ov-table { width: 100%; }
.ov-scroll { max-height: 62vh; overflow-y: auto; }
.ov-scroll .ovr-head { position: sticky; top: 0; z-index: 2; }
.ovr { display: grid; grid-template-columns: 2fr 76px 76px 72px 82px 72px 108px 165px; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ovr.has-act { grid-template-columns: 2fr 76px 76px 72px 82px 72px 108px 165px 120px; }
.ovr:last-child { border-bottom: none; }
.ovr-head { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; background: var(--beige); }
.ovr > span:not(.ov-name):not(.ov-when) { text-align: center; }
.ovr .ov-name { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 500; }
.ovr .ov-name-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ovr-head .ov-name { white-space: nowrap; }
.ov-thumb { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--beige); border: 1px solid var(--line); }
.ov-thumb-x { position: relative; }
.ov-thumb-x::after { content: '📦'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; opacity: .5; }
.ovr .ov-when { text-align: center; color: var(--muted); font-size: 13px; }
.ovr .ov-when a { color: var(--pink); text-decoration: none; }
.ovr .ov-when a:hover { text-decoration: underline; }
.ovr .ov-hot { font-weight: 700; color: var(--pink); }
.ovr .ov-zero { color: #cbd5e1; }
.ovr .ov-coming { font-weight: 600; color: #0891b2; }  /* sắp về: xanh cyan */
.ovr .ov-neg { font-weight: 700; color: #dc2626; }      /* âm kho: đỏ cảnh báo */
.ovr:not(.ovr-head):hover { background: #f8fafc; }
.ov-mt { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 9px; font-size: 12.5px; color: var(--ink); }
.ov-mt .mt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-mt .mt-reach { color: var(--muted); }
.ov-load { animation: ovpulse 1s ease-in-out infinite; }
@keyframes ovpulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.ov-note { margin: 0; padding: 10px 16px; font-size: 13px; line-height: 1.5; color: #92400e; background: #fffbeb; border-bottom: 1px solid #fde68a; }
.ov-note b { font-weight: 600; }
.ov-act { text-align: center; }
.ov-post { border: 1px solid var(--pink); background: #fff; color: var(--pink); font-weight: 600; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.ov-post:hover { background: var(--pink); color: #fff; }

/* ───────────── Popup Đăng bài (từ bảng Hiệu quả) ───────────── */
.pm-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.pm-overlay.hidden { display: none; }
.pm-box { position: relative; width: 100%; max-width: 640px; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.pm-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: none; background: var(--beige); color: var(--ink); border-radius: 50%; font-size: 16px; cursor: pointer; line-height: 1; }
.pm-close:hover { background: #e2e8f0; }
.pm-body { padding: 22px 22px 24px; }
.pm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-right: 30px; }
.pm-thumb { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--beige); border: 1px solid var(--line); }
.pm-thumb-x { position: relative; }
.pm-thumb-x::after { content: '📦'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; opacity: .5; }
.pm-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.pm-gen { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: var(--beige); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
.pm-gen #pmCount { width: 56px; padding: 6px 8px; text-align: center; }
.pm-manual { border-top: 1px dashed var(--line); padding-top: 14px; }
@media (max-width: 720px) {
  .pm-overlay { padding: 16px 10px; }
  .pm-body { padding: 18px 16px 20px; }
}
@media (max-width: 720px) {
  .ov-cards { grid-template-columns: repeat(2, 1fr); }
  /* Trên điện thoại ưu tiên: tên SP + tồn kho + có thể bán + sắp về */
  .ovr { grid-template-columns: 1.5fr 56px 62px 56px; gap: 6px; padding: 10px 12px; font-size: 13px; }
  .ovr.has-act { grid-template-columns: 1.4fr 52px 58px 52px 96px; }
  .ovr > span:nth-child(2), .ovr-head > span:nth-child(2),   /* Đã đăng */
  .ovr > span:nth-child(3), .ovr-head > span:nth-child(3),   /* Đang chờ */
  .ovr > span:nth-child(7), .ovr-head > span:nth-child(7),   /* Gần nhất */
  .ovr > span:nth-child(8), .ovr-head > span:nth-child(8) {  /* Tương tác */
    display: none;
  }
  .ov-post { padding: 6px 8px; font-size: 12px; }
}

/* ───────────── Việc cần làm hôm nay (đầu tab Tổng quan) ───────────── */
.todo-card { margin-bottom: 14px; }
.todo-head { display: flex; align-items: center; justify-content: space-between; }
.todo-date { font-size: 12.5px; }
.todo-list { padding: 2px 0; }
.todo-all-done { margin: 4px 14px 8px; padding: 8px 12px; border-radius: 8px; background: #dcfce7; color: #166534; font-weight: 600; font-size: 13px; }
.todo-item { display: flex; gap: 10px; align-items: center; padding: 7px 14px; border-top: 1px solid var(--line); }
.todo-item:first-child { border-top: none; }
.ti-check { font-size: 15px; line-height: 1; flex-shrink: 0; }
.ti-body { flex: 1; min-width: 0; }
.ti-top { display: flex; align-items: baseline; gap: 8px; }
.ti-label { font-weight: 600; font-size: 13.5px; }
.ti-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; margin-left: auto; }
.ti-count.ok { color: var(--green); font-weight: 600; }
.ti-bar { height: 4px; border-radius: 999px; background: #eef2f7; overflow: hidden; margin: 4px 0 0; }
.ti-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--pink); transition: width .4s ease; }
.todo-item.done .ti-bar > span { background: var(--green); }
.ti-hint { display: none; }

/* ───────────── Phễu "Theo dõi sản phẩm mới" ───────────── */
.ov-newcard { padding: 0; overflow: hidden; margin-bottom: 14px; }
.ov-newhead { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.ov-newhead small { font-weight: 400; }
.ov-new { padding: 0; }
.np-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 16px; }
.np-card { position: relative; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.np-card:hover { border-color: var(--pink); }
.np-card.open { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(21, 128, 61, .12) inset; }
.np-v { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.np-lb { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 4px; }
.np-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.np-caret { position: absolute; top: 12px; right: 12px; font-size: 11px; color: var(--muted); }
.np-pending { padding: 8px 12px; font-size: 12px; border-top: 1px solid var(--line); }
.np-panel { border-top: 1px solid var(--line); max-height: 44vh; overflow-y: auto; }
.np-row { display: grid; grid-template-columns: 1.6fr auto 56px 92px; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.np-row:last-child { border-bottom: none; }
.np-row:hover { background: #f8fafc; }
.np-name { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 500; }
.np-name-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.np-thumb { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--beige); border: 1px solid var(--line); }
.np-thumb-x { position: relative; }
.np-thumb-x::after { content: '📦'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; opacity: .5; }
.np-badges { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.np-b { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #94a3b8; white-space: nowrap; }
.np-b.on { background: #dcfce7; color: #166534; font-weight: 600; }
.np-b-btn { border: none; cursor: pointer; font-family: inherit; }
.np-b-btn:hover { background: #bbf7d0; }
/* Popup tồn kho */
.stk-box { padding: 6px 4px; }
.stk-row { display: grid; grid-template-columns: 130px auto 1fr; align-items: baseline; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.stk-row:last-child { border-bottom: none; }
.stk-lb { font-weight: 600; color: var(--ink); }
.stk-v { font-size: 20px; font-weight: 700; color: var(--pink); white-space: nowrap; }
.stk-v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.stk-hint { font-size: 12px; }
@media (max-width: 720px) { .stk-row { grid-template-columns: 1fr auto; } .stk-hint { grid-column: 1 / -1; } }
.np-when { text-align: center; color: var(--muted); font-size: 12.5px; }
.np-del { border: 1px solid #fecaca; background: #fff; color: #dc2626; font-weight: 600; font-size: 12px; padding: 5px 9px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.np-del:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
@media (max-width: 720px) {
  .np-cards { grid-template-columns: repeat(2, 1fr); }
  .np-row { grid-template-columns: 1.4fr auto 72px; }
  .np-when { display: none; }
  .np-badges { gap: 4px; }
  .np-b { font-size: 11px; padding: 2px 6px; }
}

/* ───────────── Video sản phẩm & trình kéo chọn vùng làm mờ ───────────── */
.video-box { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fcfdff; }
.video-h { font-weight: 600; margin-bottom: 10px; }
.video-h small { font-weight: 400; color: var(--muted); }
.vupload { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.vitem { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.vitem video { width: 100%; display: block; background: #000; max-height: 260px; }
.vitem-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px; }
.vbadge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: var(--muted); }
.vbadge.blur { background: #eef2ff; color: #4338ca; }

/* Trình kéo chọn vùng làm mờ */
.blur-editor { margin-top: 12px; padding: 12px; border: 1px dashed var(--pink); border-radius: 10px; background: #fff; }
.be-h { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.be-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; touch-action: none; -webkit-user-select: none; user-select: none; }
.be-stage video { max-width: 100%; max-height: 60vh; display: block; background: #000; }
.be-overlay { position: absolute; inset: 0; cursor: crosshair; }
.be-box { position: absolute; border: 2px solid #ef4444; background: rgba(239, 68, 68, .22); box-shadow: 0 0 0 1px #fff inset; }
.be-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.be-actions .muted { margin-left: auto; }

@media (max-width: 720px) {
  .vlist { grid-template-columns: 1fr; }
  .be-stage video { max-height: 55vh; }
}

/* ---------- TAB NHẬP HÀNG ---------- */
#view-nhaphang .card + .card { margin-top: 14px; }
.nh-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.nh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nh-sel { padding: 7px 9px; font-size: 13px; }
.nh-addshop { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.nh-addshop.hidden { display: none; }
.nh-addshop input { flex: 1; min-width: 140px; font-size: 13px; }
.nh-imgtd { width: 58px; min-width: 58px; padding: 4px 6px !important; }
.nh-table th[data-k="anh"] { cursor: default; }
.nh-img { width: 46px; min-width: 46px; max-width: none; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; background: var(--bg); }
.nh-img:hover { border-color: var(--green); }
#nh-zoom { position: fixed; z-index: 300; width: 260px; height: 260px; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.28); pointer-events: none; }
#nh-zoom.hidden { display: none; }
.nh-noimg { color: var(--muted); }
.nh-shopbar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.nh-chip { padding: 4px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; border: 1px solid var(--line); background: #fff; }
.nh-chip.on { background: #e7f6ec; border-color: var(--green); color: #14652f; }
.nh-chip.off { color: var(--muted); text-decoration: line-through; opacity: .6; }
.nh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.nh-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.nh-card span { font-size: 12px; color: var(--muted); }
.nh-card b { display: block; font-size: 22px; margin-top: 2px; }
.nh-card.red b { color: #dc2626; } .nh-card.amber b { color: var(--amber); }
.nh-card.blue b { color: var(--blue); } .nh-card.green b { color: var(--green); }
.nh-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.nh-tabs { display: flex; gap: 4px; }
.nh-pill { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.nh-pill.on { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }
.nh-search { flex: 1; min-width: 180px; font-size: 13px; }
.nh-tablewrap { overflow-x: auto; }
.nh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nh-table th { background: var(--beige); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; padding: 8px 10px; white-space: nowrap; cursor: pointer; position: sticky; top: 0; }
.nh-table td { padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.nh-table tr.gap td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.nh-table tr.am td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.nh-table tr.st-done { opacity: .55; }
.nh-num { text-align: right; font-variant-numeric: tabular-nums; }
/* cột số: tiêu đề canh phải cho thẳng hàng với số, và co sát nội dung để số không văng xa tiêu đề */
.nh-table th[data-k="coTheBan"], .nh-table th[data-k="sapVe"],
.nh-table th[data-k="tonKho"], .nh-table th[data-k="canNhap"] { text-align: right; width: 1%; }
.nh-table th[data-k="shop"], .nh-table th[data-k="maMau"],
.nh-table th[data-k="status"], .nh-table th[data-k="qtyOrdered"],
.nh-table th[data-k="nhap"] { width: 1%; }
.nh-table th[data-k="nhap"] { cursor: default; }
.nh-nhap { white-space: nowrap; }
.nh-nhap button { padding: 4px 9px; font-size: 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.nh-nhap .nh-tn { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.nh-nhap .nh-tn:disabled { opacity: .5; cursor: default; }
/* Chính ngạch: xanh vàng (olive) cho khác hẳn nút Tiểu ngạch xanh lá */
.nh-nhap .nh-cn { background: #65a30d; border-color: #65a30d; color: #fff; font-weight: 600; }
.nh-nhap .nh-cn:disabled { opacity: .5; cursor: default; }
.nh-phieu { margin-left: 6px; font-size: 12px; color: var(--blue); font-weight: 700; }
/* phiếu của đợt đặt đã chốt sổ (hàng đã nằm ở cột Sắp về) — mờ đi cho khỏi lẫn phiếu đang chờ */
.nh-phieu.cu { color: var(--muted); font-weight: 600; }
.nh-neg { color: #dc2626; font-weight: 700; }
.nh-need { color: var(--amber); font-weight: 700; }
.nh-attr { color: var(--muted); font-size: 12px; }
.nh-qty { width: 66px; padding: 4px 6px; font-size: 13px; }
.nh-note { width: 100%; min-width: 110px; padding: 4px 6px; font-size: 13px; }
.nh-stsel { padding: 4px 6px; font-size: 12px; }
.nh-foot { margin-top: 10px; }
@media (max-width: 720px) {
  .nh-table th, .nh-table td { padding: 6px; }
  .nh-search { min-width: 120px; }
}

/* SL đặt: ô CÓ số thật tô vàng đậm, ô trống chỉ hiện gạch "—" cho khỏi lẫn với gợi ý */
.nh-qty.co { background: #fff8e1; border-color: #e6b800; font-weight: 700; color: #7a5200; }
.nh-qty::placeholder { color: #c8ccd2; }

/* Tab con của Nhập hàng: Cần nhập | Theo dõi tiểu ngạch | Theo dõi chính ngạch */
.nh-subtabs { display: flex; gap: 6px; margin: 14px 0 -2px; }
.nh-subtabs button { padding: 8px 16px; border: 1px solid var(--line); border-bottom: none;
  border-radius: 10px 10px 0 0; background: #f3f5f7; color: var(--muted);
  font-size: 14px; font-weight: 600; cursor: pointer; }
.nh-subtabs button.on { background: #fff; color: var(--green); border-color: var(--line); }
.tn-table th { white-space: nowrap; }
.tn-table td { vertical-align: middle; }
.tn-mavc { width: 160px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tn-st { min-width: 140px; }
.tn-xoa { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; }
.tn-xoa:hover { color: #c0392b; }
/* Nút "+": tách phiếu nhiều mẫu thành mỗi mẫu một dòng để dán mã vận đơn riêng */
.tn-tach { border: 1px solid var(--line); background: #f3f5f7; color: var(--muted);
  cursor: pointer; font-size: 15px; font-weight: 700; line-height: 1;
  border-radius: 8px; padding: 3px 8px; }
.tn-tach:hover { background: #eef8f1; border-color: var(--green); color: var(--green); }
.tn-tach:disabled { opacity: .5; cursor: default; }
.card.hidden { display: none; }

/* Tình trạng vận chuyển: xanh nhạt (mới trả tiền) → xanh đậm (hàng đã về tay) */
.tn-st { font-weight: 600; border-width: 1px; border-style: solid; }
.tn-st option { background: #fff; color: var(--text); font-weight: 400; }
.tn-st.tt0 { background: #f1faf3; border-color: #cfe8d6; color: #4b7a58; }
.tn-st.tt1 { background: #dcf2e3; border-color: #a9d9b8; color: #2f6b45; }
.tn-st.tt2 { background: #b6e3c4; border-color: #7cc796; color: #1f5c37; }
.tn-st.tt3 { background: #67b884; border-color: #4ea56f; color: #fff; }
.tn-st.tt4 { background: #15803d; border-color: #15803d; color: #fff; }

/* Ô số lượng: tổng của cả phiếu + số lượng từng mẫu mã, sửa được tại chỗ */
.tn-qtytd { min-width: 210px; }
.tn-tong { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tn-tong b { font-size: 15px; color: var(--text); }
.tn-mau1 { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.tn-mname { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-q { width: 58px; text-align: right; padding: 3px 6px; }
/* phiếu nhiều màu: mỗi mẫu kèm ảnh của chính nó, khỏi nhìn chung một tấm rồi nhầm màu */
.tn-mimg { width: 26px; height: 26px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); flex: none; }

/* Nút Lưu: chỉ nổi bật khi thật sự có thay đổi chưa lưu */
.tn-act { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.tn-luu { padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #f3f5f7; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.tn-luu.doi { background: var(--green); border-color: var(--green); color: #fff; }
.tn-luu:disabled { opacity: .6; cursor: default; }

/* ĐIỆN THOẠI: kéo cột Số lượng vào trong màn hình. Ảnh hẹp lại,
   và trong mỗi mẫu thì SỐ đứng TRƯỚC tên (row-reverse) nên nhìn thấy ngay, khỏi kéo ngang. */
@media (max-width: 720px) {
  .tn-table th, .tn-table td { padding: 6px 5px; }
  /* Mã vận đơn J&T/GHTK dài 15-18 ký tự — ô phải đọc HẾT mã, khỏi phải bôi kéo trong ô.
     Bó padding lại để ăn thêm chữ mà không nới thêm bề ngang cột. */
  .tn-mavc { width: 138px; min-width: 138px; font-size: 12px; padding: 6px 6px; }
  .tn-table .nh-imgtd { width: 42px; min-width: 42px; }
  .tn-table .nh-img { width: 34px; min-width: 34px; height: 34px; }
  .tn-qtytd { min-width: 0; }
  .tn-mau1 { flex-direction: row-reverse; gap: 5px; }
  .tn-mname { font-size: 11px; }
  .tn-q { width: 46px; }
}

/* Hộp thoại tạo phiếu thủ công */
.tn-modal { position: fixed; inset: 0; background: rgba(15, 23, 32, .45);
  display: flex; align-items: center; justify-content: center; z-index: 60; }
.tn-modal.hidden { display: none; }
.tn-box { background: #fff; border-radius: 14px; width: min(620px, 94vw);
  max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
.tn-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tn-close { border: none; background: none; font-size: 16px; color: var(--muted); cursor: pointer; }
.tn-mbody { padding: 14px 18px; overflow: auto; }
.tn-frow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tn-frow label { width: 78px; font-size: 13px; color: var(--muted); }
.tn-frow .nh-sel, .tn-frow .nh-search { flex: 1; }
.tn-mau { border-top: 1px solid var(--line); padding-top: 10px; }
.tn-mrow { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f0f2f4; }
.tn-mrow .nh-img { width: 34px; height: 34px; }
.tn-mcode { font-size: 11px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tn-mton { font-size: 11px; }
.tn-mq { width: 64px; text-align: right; padding: 4px 6px; }
.tn-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px; border-top: 1px solid var(--line); }
.tn-foot > button { flex: none; }
/* Hàng về thiếu: nhắc rõ POS sẽ tách làm 2 phiếu */
#hv-tong { flex: 1; line-height: 1.35; }
#hv-tong.hv-tach { color: #b06c00; font-weight: 600; }

/* Hàng ngoài: sổ tay đơn lặt vặt, không dính POS nên không có cột ảnh / mẫu mã / phiếu */
.hn-note { font-size: 12px; }
.hn-ten { width: 200px; }
.hn-ngay { white-space: nowrap; font-size: 12px; }
.hn-xoa { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; }
.hn-xoa:hover { color: #c0392b; }
@media (max-width: 720px) { .hn-note { display: none; } .hn-ten { width: 130px; } }

/* Nút "Đã nhập": đẩy phiếu POS sang trạng thái Đã nhập hàng, bấm xong thì khoá lại */
.tn-nhap { padding: 5px 12px; border: 1px solid var(--green); border-radius: 8px;
  background: #fff; color: var(--green); font-size: 13px; font-weight: 600; cursor: pointer; }
.tn-nhap:hover { background: #eef8f1; }
.tn-nhap.xong, .tn-nhap:disabled { background: #eef1f4; border-color: var(--line);
  color: var(--muted); cursor: default; }

/* Hai trạng thái KẾT: phiếu huỷ (đỏ) và phiếu đã bị xoá khỏi POS (xám) — tách hẳn khỏi thang xanh */
.tn-st.tt5 { background: #fdecea; border-color: #f0b3ac; color: #b03a2e; }
.tn-st.tt6 { background: #eef1f4; border-color: #d6dbe0; color: #7a828a; }

/* ---- Theo dõi chính ngạch: ghi chú gộp + 2 ô tích chứng từ ---- */
.cn-shop { font-size: 11px; }
.cn-ghichu { min-width: 240px; font-size: 12px; }
.cn-ghichu > div { line-height: 1.5; }
.cn-frow { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.cn-frow span { width: 54px; color: var(--muted); }
.cn-frow input { flex: 1; padding: 3px 6px; font-size: 12px; }
.cn-ghichu .nh-note { width: 100%; margin-top: 4px; }
.cn-tick { text-align: center; white-space: nowrap; }
.cn-tick input { width: 17px; height: 17px; cursor: pointer; }
.cn-ro { flex: 1; padding: 6px 0; font-weight: 600; }
.cn-note { margin: 6px 0 0; line-height: 1.5; }

/* ───────────── Bật/tắt page hiển thị (Cài đặt) ───────────── */
.page-toggles > b { font-size: 15px; }
.pt-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pt-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.pt-row:last-child { border-bottom: none; }
.pt-row:hover { background: #f8fafc; }
.pt-name { font-weight: 600; font-size: 14px; }
/* Công tắc gạt */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 26px; transition: background .2s; }
.switch-slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .switch-slider { background: var(--pink); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--pink); outline-offset: 2px; }
@media (max-width: 720px) {
  .pt-row { padding: 12px 14px; }
  .pt-name { font-size: 15px; }
}

/* ===== Tab con "Tính SL nhập": màu ô bám theo file Excel gốc =====
   TRẮNG = ô tự gõ, XANH = máy tính, HỒNG = số cần đặt, VÀNG = tiêu đề. */
/* .nh-table mặc định 100% nên chỗ thừa bị chia đều cho các cột, ô gõ 68px nằm
   lọt thỏm bên trái còn tiêu đề canh phải → nhìn như lệch cột. Đo thật thì
   width:auto VẪN giãn hết (1001px), phải max-content mới co đúng nội dung (825px). */
.tinh-table { width: max-content; }
.tinh-table th { background: #ffe599; color: #5c4a10; text-align: right; cursor: default; padding: 6px 8px; }
.tinh-table th.tinh-name, .tinh-table td.tinh-name { text-align: left; }
.tinh-table td { padding: 3px 8px; text-align: right; }
.tinh-table .tinh-name { width: 1%; }
.tinh-in { padding: 3px 6px; font-size: 13px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.tinh-table .tinh-name .tinh-in { width: 140px; }
.tinh-num { width: 68px; text-align: right; font-variant-numeric: tabular-nums; }
.tinh-calc { background: #e6f2e1; color: #38571f; font-weight: 600; }
.tinh-out { background: #fbe4e4; color: #9c2b2b; font-weight: 700; }
.tinh-table tfoot td { border-top: 2px solid var(--line); font-weight: 700; }
.tinh-table tfoot .tinh-name { background: #e6f2e1; }
.tinh-del { width: 1%; }
.tinh-note { margin: 4px 0 0; max-width: 640px; }
.tinh-acts { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Hàng chọn shop → xổ danh sách sản phẩm. Dropdown để position:absolute nên
   .tinh-pick phải relative, và bảng bên dưới không bị đẩy xuống khi mở. */
.tinh-pick { position: relative; margin: 10px 0 6px; }
.tinh-shops { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tinh-shop {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.tinh-shop:hover { border-color: var(--pink); }
.tinh-shop.dang { border-color: var(--pink); color: var(--pink); font-weight: 600; }
.tinh-shop.on { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }
.tinh-drop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  width: min(520px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.16); padding: 8px;
}
/* file này KHÔNG có luật .hidden dùng chung (mỗi chỗ tự khai) → phải khai riêng */
.tinh-drop.hidden { display: none; }
.tinh-drop .nh-search { width: 100%; margin-bottom: 6px; }
.tinh-splist { max-height: 320px; overflow: auto; }
.tinh-spi {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 6px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.tinh-spi:hover { background: #f3f4f6; }
.tinh-spi img, .tinh-noimg {
  width: 34px; height: 34px; border-radius: 6px; object-fit: cover;
  background: #eceff3; flex: 0 0 34px;
}
.tinh-spname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tinh-spneed {
  background: #fbe4e4; color: #9c2b2b; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; font-size: 12px; white-space: nowrap;
}
.tinh-spmau { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tinh-empty { padding: 10px 6px; }
.tinh-cur { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.tinh-curshop {
  background: #eef2ff; color: #3730a3; padding: 2px 9px; border-radius: 999px; font-size: 12px;
}
.tinh-cursp { font-size: 14px; }
.tinh-reload { padding: 3px 10px; font-size: 12px; }
.tinh-warn { color: #9c2b2b; font-size: 12px; max-width: 480px; }
@media (max-width: 720px) {
  .tinh-table td, .tinh-table th { padding: 4px 4px; font-size: 12px; }
  /* .nh-table th là nowrap → "Đã bán được" chiếm nguyên hàng; cho xuống dòng
     và bó ~52px để 8 cột vừa màn điện thoại, khỏi phải kéo ngang. */
  .tinh-table th { white-space: normal; line-height: 1.2; max-width: 48px; }
  .tinh-table th.tinh-name { max-width: none; }
  .tinh-num { width: 42px; padding: 3px 3px; }
  .tinh-table .tinh-name .tinh-in { width: 70px; }
  /* 9 cột không thể nhét vừa 375px → cho kéo ngang nhưng GHIM cột Mẫu mã lại,
     kéo tới đâu vẫn biết đang xem mẫu nào. */
  .tinh-table .tinh-name { position: sticky; left: 0; z-index: 2; background: #fff; }
  .tinh-table thead .tinh-name { background: #ffe599; z-index: 3; }
  .tinh-table tfoot .tinh-name { background: #e6f2e1; }
  .tinh-table tbody .tinh-name { box-shadow: 1px 0 0 var(--line); }
  .tinh-drop { width: 100%; }
  .tinh-splist { max-height: 240px; }
  .tinh-note { font-size: 12px; }
  .tinh-warn { max-width: none; }
}

/* ===== Bản bán: đăng ký, gói dịch vụ, cài đặt tuỳ chỉnh ===== */
.login-switch { font-size: 13px; color: var(--muted); margin: 4px 0 0; text-align: center; }
.login-switch a { color: var(--pink); font-weight: 600; }
.sub-chip { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; background: #fef3c7; color: var(--amber); text-decoration: none; white-space: nowrap; }
.sub-chip.expired { background: #fee2e2; color: #b91c1c; }
.set-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.set-nav a { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--beige); color: var(--ink); text-decoration: none; }
.set-nav a:hover { background: var(--line); }
.set-block { scroll-margin-top: 80px; display: flex; flex-direction: column; gap: 8px; }
.bill-box { display: flex; flex-direction: column; gap: 10px; }
.bill-state { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.bill-state.ok { background: #dcfce7; color: #166534; }
.bill-state.trial { background: #fef3c7; color: #92400e; }
.bill-state.bad { background: #fee2e2; color: #b91c1c; }
.bill-pay { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.bill-pay p { margin: 0 0 6px; font-size: 14px; }
.bill-qr { width: 180px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bill-code { font-size: 15px; font-weight: 700; background: var(--beige); padding: 2px 8px; border-radius: 6px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--beige); color: var(--muted); }
.slot-chip.auto { background: #dcfce7; color: #166534; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; }
.ext-steps { margin: 0 0 6px 18px; padding: 0; font-size: 14px; line-height: 1.6; }
.ext-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.team-list { display: flex; flex-direction: column; gap: 6px; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sticky-save { position: sticky; bottom: 12px; align-self: flex-start; box-shadow: 0 4px 14px rgba(15, 23, 42, .15); }
@media (max-width: 700px) {
  .row3 { grid-template-columns: 1fr; }
  .bill-qr { width: 150px; }
  #shopNameChip { display: none; }
}
.login-box.hidden, .sub-chip.hidden { display: none; }

/* ===== Up ảnh trên web + form sản phẩm tuỳ chỉnh ===== */
.add-prod-btn { width: 100%; margin: 0 0 8px; padding: 10px 12px; }
.form-head-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ff-hidden { display: none !important; }
.req { color: #dc2626; font-weight: 700; }
.ff-list { display: flex; flex-direction: column; gap: 6px; }
.ff-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--pink); color: #fff; font-weight: 600; }
.seg button[data-m="hide"].on { background: #94a3b8; }
.seg button[data-m="required"].on { background: #b91c1c; }
.wm-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.wm-logo { width: 120px; height: 120px; border: 1px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.wm-logo img { max-width: 100%; max-height: 100%; }
.wm-fields { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.up-row { margin-bottom: 10px; }
.up-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; border: 2px dashed var(--line); border-radius: 12px; text-align: center; cursor: pointer; background: var(--beige); }
.up-drop.over { border-color: var(--pink); background: #f0fdf4; }
.up-drop input { display: none; }
.up-opts { margin: 8px 0; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.up-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid var(--line); }
.up-item img { width: 100%; height: 100%; object-fit: cover; }
.up-item.ok { border-color: #16a34a; } .up-item.err { border-color: #dc2626; } .up-item.busy img, .up-item.wait img { opacity: .55; }
.up-badge { position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; border-radius: 10px; background: rgba(15,23,42,.75); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.up-item.ok .up-badge { background: #16a34a; } .up-item.err .up-badge { background: #dc2626; }
.up-rm { position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 11px; border: 0; background: rgba(15,23,42,.7); color: #fff; cursor: pointer; line-height: 1; }
.up-retry { position: absolute; left: 4px; right: 4px; bottom: 4px; border: 0; border-radius: 6px; background: #dc2626; color: #fff; font-size: 12px; padding: 3px; cursor: pointer; }
.hidden.req { display: none; }
#wm-preview.hidden, #wm-none.hidden { display: none; }
@media (max-width: 700px) {
  .up-grid { grid-template-columns: repeat(4, 1fr); }
  .seg button { padding: 6px 9px; }
}
/* Ô flex/grid phải được co nhỏ hơn nội dung, nếu không ô phân loại + ô tiền tràn khỏi khung form hẹp */
.form-grid > *, .pos-grid > *, .row2 > *, .row3 > * { min-width: 0; }
.va-vals { min-width: 0; }
.field .va-vals .va-input { min-width: 90px; }
.money-wrap .money { min-width: 0; width: 100%; }
.up-row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.up-row select, .up-row input { width: 100%; }
@media (max-width: 700px) {
  /* đầu form sản phẩm: tên 1 dòng riêng, nút xuống dưới */
  .form-head { flex-wrap: wrap; gap: 8px; }
  .form-head h3 { flex: 1 1 100%; }
  .form-head-btns { justify-content: flex-start; }
  /* đầu trang gọn hơn để nội dung lên sớm */
  header { padding: 10px 12px; }
  .settings-btn { padding: 7px 12px; font-size: 14px; }
}
.tab.hidden { display: none !important; }
.login-links { font-size: 12px; color: var(--muted); text-align: center; margin: 2px 0 0; }
.login-links a { color: var(--muted); }
/* chọn danh mục / thẻ / nhà cung cấp từ POS */
.pos-lists { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }
.pl-refresh { margin-left: 6px; padding: 0 6px; }
/* đăng nhập Google + quên mật khẩu */
.g-wrap { display: flex; flex-direction: column; gap: 10px; }
.g-wrap.hidden, #fg-phone.hidden, #toForgot.hidden, #acc-old.hidden, #rs-code.hidden, #rs-again-wrap.hidden { display: none; }
#rs-code { text-align: center; font-size: 20px; letter-spacing: 6px; }
#rs-code::placeholder { font-size: 15px; letter-spacing: 0; }
/* khung hỗ trợ Bé Xíu */
.sup-fab { position: fixed; right: 16px; bottom: 16px; z-index: 150; display: flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; border-radius: 999px; background: #15803d; color: #fff; font: inherit; font-weight: 600; box-shadow: 0 6px 20px rgba(21,128,61,.35); cursor: pointer; }
.sup-fab.hidden, .sup-panel.hidden, .sup-badge.hidden, .sup-qr.hidden, .sup-resetf.hidden, .sup-reset .hidden { display: none; }
.sup-fab .sup-ic { font-size: 18px; line-height: 1; }
.sup-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.sup-panel { position: fixed; right: 16px; bottom: 16px; z-index: 160; width: 380px; max-width: calc(100vw - 32px); height: min(600px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 16px; box-shadow: 0 16px 48px rgba(15,23,42,.22); overflow: hidden; }
.sup-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #15803d; color: #fff; }
.sup-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sup-who > div { display: flex; flex-direction: column; min-width: 0; }
.sup-who small { opacity: .85; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-ava { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.sup-x { border: 0; background: transparent; color: #fff; font-size: 18px; cursor: pointer; padding: 4px 8px; }
.sup-safe { font-size: 11.5px; color: #166534; background: #f0fdf4; padding: 6px 12px; border-bottom: 1px solid #dcfce7; }
.sup-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; }
.sup-row { display: flex; }
.sup-row.me { justify-content: flex-end; }
.sup-bub { max-width: 85%; padding: 8px 11px; border-radius: 14px; background: #fff; border: 1px solid var(--line, #e5e7eb); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; min-width: 0; }
.sup-row.me .sup-bub { background: #15803d; color: #fff; border-color: #15803d; }
.sup-row.me .sup-bub a { color: #fff; }
.sup-row.admin .sup-bub { background: #eff6ff; border-color: #bfdbfe; }
.sup-name { font-size: 12px; font-weight: 600; color: #1d4ed8; margin-bottom: 2px; }
.sup-row.me .sup-name { color: #dcfce7; }
.sup-time { font-size: 10.5px; opacity: .6; margin-top: 3px; text-align: right; }
.sup-sys { align-self: center; font-size: 12px; color: var(--muted, #64748b); background: #eef2f7; padding: 4px 10px; border-radius: 999px; text-align: center; max-width: 92%; }
.sup-systime { font-size: 10.5px; opacity: .6; white-space: nowrap; }
.sup-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px 2px; background: var(--card, #fff); border-top: 1px solid var(--line, #e5e7eb); scrollbar-width: none; }
.sup-quick .chip { white-space: nowrap; flex: 0 0 auto; }
.sup-quick .chip:disabled { opacity: .45; cursor: default; }
.sup-input { display: flex; gap: 8px; padding: 8px 10px 10px; background: var(--card, #fff); align-items: flex-end; }
.sup-input textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line, #e5e7eb); max-height: 120px; overflow-y: hidden; scrollbar-width: none; }
.sup-input button { padding: 9px 14px; }
.sup-pay { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.sup-plans { display: flex; flex-wrap: wrap; gap: 6px; }
.sup-qr { width: 100%; max-width: 240px; align-self: center; border-radius: 8px; border: 1px solid var(--line, #e5e7eb); background: #fff; }
.sup-payinfo { font-size: 13px; line-height: 1.5; }
.sup-copy { border: 1px dashed #15803d; background: #f0fdf4; color: #15803d; font: inherit; font-weight: 700; padding: 1px 6px; border-radius: 6px; cursor: pointer; }
.sup-reset { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.sup-resetf { display: flex; flex-direction: column; gap: 6px; }
.sup-resetf input { padding: 8px 10px; font-size: 14px; }
.sup-err { color: #c0392b; font-size: 12.5px; }
.sup-err:empty { display: none; }
.sup-ok { color: #15803d; font-size: 13px; }
.sup-typing { display: flex; gap: 4px; padding: 12px 14px; }
.sup-typing i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: supdot 1s infinite ease-in-out; }
.sup-typing i:nth-child(2) { animation-delay: .15s; } .sup-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes supdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 600px) {
  .sup-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .sup-fab { right: 12px; bottom: 12px; padding: 10px 12px; }
  .sup-fab .sup-lbl { display: none; }
}
.g-btn { min-height: 44px; display: flex; justify-content: center; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.forgot-link { align-self: flex-end; font-size: 13px; color: var(--muted); margin-top: -4px; }
.login-ok { color: var(--green, #15803d); font-size: 13px; }
.login-ok:empty { display: none; }
