/* ===== Màu, chữ, khoảng cách ===== */
:root {
  --bg: #f4f5fb; --surface: #fff; --surface-2: #f8f9fc; --ink: #101828; --ink-2: #344054; --muted: #667085;
  --line: #e4e7ef; --line-2: #eef0f5;
  --brand: #7c3aed; --brand-2: #db2777; --brand-soft: #f3edff; --brand-ink: #5b21b6;
  --side: #0d0e1c; --side-2: #171933; --side-ink: #c9cbe0;
  --new: #64748b; --todo: #2563eb; --fix: #dc2626; --review: #d97706; --approved: #16a34a;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Be Vietnam Pro', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.55; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.red { color: var(--fix) !important; }
.green { color: var(--approved) !important; }
.center { text-align: center; }
.grow { flex: 1; }
.ic { flex: none; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ===== Nút ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: #d0d5e2; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* Nút đang chạy việc (busy() trong ui.js): rõ chữ, con trỏ chờ */
[aria-busy="true"], .btn[aria-busy="true"]:disabled { opacity: .85; cursor: progress; }
.btn.primary { background: linear-gradient(135deg, var(--brand), #9333ea); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(124, 58, 237, .28); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #6d28d9, #7e22ce); }
.btn.success { background: var(--approved); border-color: var(--approved); color: #fff; }
.btn.success:hover:not(:disabled) { background: #15803d; }
.btn.danger { color: var(--fix); }
.btn.danger:hover:not(:disabled) { background: #fef2f2; border-color: #fecaca; }
.btn.danger-solid { background: var(--fix); border-color: var(--fix); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.urgent-on { background: #fff1f0; border-color: #fca5a5; color: #c2410c; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.tiny { padding: 3px 8px; font-size: 12px; font-weight: 500; border-radius: 7px; gap: 4px; }
.btn.big { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 18px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover:not(:disabled) { background: var(--line-2); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.link { color: var(--brand); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Ô nhập ===== */
label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; margin: 0; cursor: pointer; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
input[type=text], input[type=password], input[type=date], input[type=search], textarea, select {
  width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
textarea { resize: vertical; }
textarea.bad { border-color: #f87171; background: #fff7f7; }
label.inline select, label.inline input { width: auto; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; }
input[type=color] { width: 54px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* ===== Khung: menu trái + nội dung ===== */
#app { min-height: 100vh; }
#app:has(.side) { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: radial-gradient(120% 60% at 0% 0%, #23204a 0%, var(--side) 55%); color: var(--side-ink); padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; text-decoration: none; color: #fff; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 11.5px; color: #8f92b8; }
.logo-mark { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 6px 14px rgba(219, 39, 119, .35)); }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: linear-gradient(135deg, rgba(139, 92, 246, .32), rgba(219, 39, 119, .22)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.side-toggle { margin-top: auto; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: #8f92b8; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.side-toggle:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
/* Menu thu gọn: chỉ còn icon (rê chuột vào icon để xem tên) */
@media (min-width: 961px) {
  #app:has(.side) { transition: grid-template-columns .2s ease; }
  #app.side-mini:has(.side) { grid-template-columns: 76px minmax(0, 1fr); }
  .side-mini .side { padding: 18px 12px; }
  .side-mini .brand { justify-content: center; padding: 6px 0 22px; }
  .side-mini .brand span, .side-mini .nav a span, .side-mini .side-toggle span, .side-mini .me-text { display: none; }
  .side-mini .nav a, .side-mini .side-toggle { justify-content: center; padding: 10px 0; }
  .side-mini .me { flex-direction: column; gap: 8px; padding: 12px 0 4px; }
}
@media (min-width: 961px) and (prefers-reduced-motion: reduce) { #app:has(.side) { transition: none; } }
.me-text { flex: 1; min-width: 0; text-decoration: none; color: #fff; }
.me-text b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: #8f92b8; font-size: 12px; }
.me .icon-btn { color: #8f92b8; }
.me .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.main { min-width: 0; }
.page { max-width: 1680px; margin: 0 auto; padding: 28px 32px 60px; display: grid; gap: 20px; align-content: start; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 960px) {
  #app:has(.side) { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; }
  .brand { padding: 0 6px 0 0; }
  .brand span, .nav a span, .me-text { display: none; }
  .nav { display: flex; gap: 2px; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; }
  .side-toggle { display: none; }
  .page { padding: 18px 16px 48px; }
}

/* ===== Khung nội dung ===== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2, .panel > h2 { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.panel-head h2 .ic { color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.actions.end { justify-content: flex-end; }

/* ===== Lời chào, ô số liệu ===== */
.hero { align-items: center; padding: 26px 28px; border-radius: 18px; background: linear-gradient(120deg, #1e1b4b 0%, #4c1d95 45%, #9d174d 100%); color: #fff; box-shadow: 0 18px 40px rgba(76, 29, 149, .25); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); }
.hero h1 { font-size: 30px; }
.hero .muted { color: #e9defd; }
.hero .red { color: #fecaca !important; }
.hero .btn.primary { background: #fff; color: var(--brand-ink); box-shadow: 0 8px 20px rgba(0, 0, 0, .2); position: relative; z-index: 1; }
.hero .btn.primary:hover:not(:disabled) { background: #f5f3ff; }
.hero .btn.primary:disabled { background: rgba(255, 255, 255, .5); }
.eyebrow { margin: 0 0 2px; font-weight: 600; color: #ddd6fe; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tiles.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tiles, .tiles.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { --c: var(--new); position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'ic v' 'l l' 's s'; align-items: center; column-gap: 12px; overflow: hidden; }
.tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.tile-ic { grid-area: ic; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.tile-v { grid-area: v; font-size: 30px; font-weight: 800; letter-spacing: -.02em; text-align: right; }
.tile-l { grid-area: l; margin-top: 10px; font-weight: 600; color: var(--ink-2); }
.tile-s { grid-area: s; font-size: 12.5px; color: var(--c); font-weight: 600; }
.t-new { --c: var(--new); } .t-todo { --c: var(--todo); } .t-fix { --c: var(--fix); } .t-review { --c: var(--review); } .t-approved { --c: var(--approved); }

/* ===== Tab ===== */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabbar button { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabbar button.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabbar .count, .st-btn span { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.tabbar button.on .count { background: var(--brand-soft); color: var(--brand-ink); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; color: var(--ink-2); }
.subtabs a.on { background: var(--brand-soft); border-color: #ddd6fe; color: var(--brand-ink); }

/* ===== Nhãn: người, shop, trạng thái, gấp ===== */
.avatar { --s: 32px; --h: 260; display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: 50%; font-size: calc(var(--s) * .38); font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, hsl(var(--h) 80% 62%), hsl(calc(var(--h) + 45) 75% 48%)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.avatar.empty { background: var(--line-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.person { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.person.muted { color: var(--muted); font-style: italic; }
.person-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.shop-tag { --c: #94a3b8; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 20px; background: color-mix(in srgb, var(--c) 11%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); font-size: 12px; font-weight: 700; white-space: nowrap; }
.shop-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-new { color: var(--new); background: #f1f5f9; }
.st-todo { color: var(--todo); background: #eff6ff; }
.st-fix { color: var(--fix); background: #fef2f2; }
.st-review { color: #b45309; background: #fffbeb; }
.st-approved { color: var(--approved); background: #f0fdf4; }
.urgent { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 6px; border-radius: 6px; background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; margin-right: 8px; vertical-align: 2px; box-shadow: 0 2px 8px rgba(239, 68, 68, .35); }

/* ===== Danh sách thẻ ===== */
.card-list { display: grid; gap: 8px; }
.card-row { --c: #94a3b8; position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-row::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.card-row:hover { border-color: #cfd4e4; box-shadow: var(--shadow); }
.card-row.is-urgent { background: linear-gradient(90deg, #fff5f2, #fff 40%); border-color: #fed7cc; }
.row-check { margin: 0; }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.thumb { flex: none; width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--muted); }
.row-text { min-width: 0; display: grid; gap: 4px; }
.row-title { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.row-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #92400e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-note.fix { color: var(--fix); font-weight: 600; }
.row-note-btn { flex: none; color: #b0b6c8; }
.row-note-btn:hover { color: #92400e; background: #fef3c7; }
.row-note-btn.has { color: #b45309; }
.row-person { width: 150px; flex: none; }
.row-status { width: 112px; flex: none; text-align: right; }
@media (max-width: 760px) { .row-person { display: none; } .row-status { width: auto; } }
.empty { display: grid; justify-items: center; gap: 6px; padding: 38px 16px; color: var(--muted); text-align: center; }
.empty .ic { color: #c4c8d8; }
.empty p { margin: 0; }

/* ===== Tổng quan của leader: team ===== */
.team { display: grid; gap: 10px; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.member-text { flex: 1; min-width: 0; }
.member-text b { display: block; }
.member-text small { color: var(--muted); }
.member-nums { display: flex; gap: 14px; text-align: center; }
.member-nums span { display: grid; font-size: 11.5px; color: var(--muted); }
.member-nums b { font-size: 17px; color: var(--ink); }
.member-nums .red b, .member-nums .green b { color: inherit; }

/* ===== Thông báo ===== */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 11px; font-size: 13.5px; border: 1px solid; }
.alert .ic { margin-top: 2px; }
.alert p { margin: 3px 0 0; white-space: pre-line; }
.alert.big { padding: 14px 16px; font-size: 14px; }
.alert.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; align-items: center; flex-wrap: wrap; }
.alert.note { background: #fefce8; border-color: #fde68a; color: #713f12; }
.conn { font-size: 13px; margin-top: 8px; font-weight: 600; }
.conn.ok { color: var(--approved); }
.conn.bad { color: var(--fix); }

/* ===== Lọc, chọn nhiều ===== */
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.st-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.st-btn.on { border-color: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent); }
.st-btn:not([class*='st-']).on, .st-btn:first-child.on { color: var(--brand-ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.filters select { width: auto; min-width: 150px; }
.search { position: relative; display: flex; align-items: center; margin: 0; flex: 1; min-width: 220px; }
.search .ic { position: absolute; left: 12px; color: var(--muted); }
.search input { padding-left: 36px; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line); }
.bulk select { width: auto; padding: 5px 10px; }
#sel-count { font-size: 13px; color: var(--muted); }

/* ===== Hộp thoại, xem ảnh ===== */
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(13, 14, 28, .55); backdrop-filter: blur(3px); animation: fade .15s; }
.modal { position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { width: min(1200px, 100%); }
.modal h3 { display: flex; align-items: center; gap: 9px; font-size: 18px; margin: 0 40px 10px 0; }
.modal-x { position: absolute; top: 14px; right: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal-back, .modal { animation: none; } }
.lb-modal { padding: 16px; }
.lb-stage { display: grid; place-items: center; max-height: calc(100vh - 170px); overflow: auto; border-radius: 12px; background: repeating-conic-gradient(#f1f2f6 0 25%, #fff 0 50%) 0 0 / 22px 22px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 170px); cursor: zoom-in; display: block; }
.lb-stage.full { place-items: start; }
.lb-stage.full img { max-width: none; max-height: none; cursor: zoom-out; }
.lb-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.lb-size { font-size: 12.5px; color: var(--muted); }

/* ===== Trang làm bài ===== */
.card-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.back { margin-top: 2px; }
.ch-title { flex: 1; min-width: 260px; display: grid; gap: 8px; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ch-meta .urgent { margin-right: 0; }
.ch-title h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ch-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.leader-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; background: linear-gradient(90deg, #faf7ff, #fff); border-color: #e9e0fd; }
#notes { display: grid; gap: 10px; }
#notes:empty { display: none; }
/* Hai khung bài (tiếng Việt | tiếng Anh) chiếm hết bề ngang; ảnh sản phẩm là một dải ngang dưới tiêu đề */
.work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .work { grid-template-columns: 1fr; } }
.gallery { display: flex; align-items: center; gap: 18px; padding: 12px 16px; }
.gal-head { flex: none; width: 200px; display: grid; gap: 4px; }
.gal-head b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.gal-head b .small { font-weight: 500; }
.gal-head .hint { margin: 0; }
.gal-strip { flex: 1; min-width: 0; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.gal-item { margin: 0; flex: none; width: 88px; display: grid; gap: 5px; }
.gal-item .btn.tiny { justify-content: center; }
@media (max-width: 760px) { .gallery { flex-direction: column; align-items: stretch; } .gal-head { width: auto; } }
.gal-zoom { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; aspect-ratio: 1; }
.gal-zoom img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.gal-zoom span { position: absolute; right: 5px; bottom: 5px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(13, 14, 28, .6); color: #fff; opacity: 0; transition: opacity .15s; }
.gal-zoom:hover img { transform: scale(1.04); }
.gal-zoom:hover span { opacity: 1; }
.lang .panel-head { margin-bottom: 12px; }
.flag { display: inline-grid; place-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.flag.en { background: #dbeafe; color: #1d4ed8; }
.save-state { font-size: 12.5px; color: var(--muted); }
.save-state.ok { color: var(--approved); }
.save-state.bad { color: var(--fix); }
.lang .alert { margin-bottom: 12px; }
.lang .actions + .hint { margin-top: 10px; }
.field-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; }
.field-head label { margin: 0; flex: 1; }
.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.bad { color: var(--fix); font-weight: 700; }

/* ===== Trình soạn thảo ===== */
.toolbar { position: relative; display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--surface-2); }
.tb { display: inline-flex; align-items: center; gap: 5px; min-width: 32px; height: 30px; justify-content: center; padding: 0 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.tb:hover { background: #fff; border-color: var(--line); }
.tb.media { color: var(--brand-ink); background: var(--brand-soft); }
.tb.media:hover { border-color: #ddd6fe; }
.tb.src { margin-left: auto; color: var(--muted); font-weight: 500; }
.editor, .source { width: 100%; border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: #fff; }
.editor { padding: 14px 18px; overflow-wrap: anywhere; outline: none; font-size: 15px; line-height: 1.65; }
.editor:focus { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(124, 58, 237, .1); }
.editor.is-empty::before { content: attr(data-placeholder); color: #a0a6b8; pointer-events: none; }
.editor h2 { font-size: 21px; margin: 6px 0 10px; }
.editor h3 { font-size: 17px; margin: 14px 0 8px; }
.editor p { margin: 0 0 11px; }
.editor ul, .editor ol { margin: 0 0 11px; padding-left: 24px; }
.editor img { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.editor figure { margin: 14px auto; text-align: center; }
.editor figure img { margin: 0 auto; max-height: 340px; width: auto; }
.editor figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.source { display: none; padding: 12px; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.show-src .editor { display: none; }
.show-src .source { display: block; }
.ed.readonly .toolbar { opacity: .5; pointer-events: none; }
.ed.readonly .editor { background: var(--surface-2); }
::highlight(banned) { background-color: #fecaca; color: #991b1b; text-decoration: underline wavy #dc2626; }
::highlight(longPara) { background-color: #fffaeb; }
::highlight(longSentence) { text-decoration: underline #fdba74; text-decoration-thickness: 1px; }
::highlight(keyword) { background-color: #dbeafe; color: #1e3a8a; }
::highlight(untranslated) { background-color: #ffe4cc; }
/* Hộp kiểm tra SEO phía trên mỗi khung soạn thảo: dòng tổng, rồi từng quy tắc (lỗi, nên sửa, đạt) */
.checks { display: grid; gap: 6px; margin-bottom: 12px; }
.checks:empty { display: none; }
.check-sum { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.check-sum b { color: var(--ink); margin-right: 4px; }
.check-sum .n { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.check-sum .n.bad { background: #fee2e2; color: #991b1b; }
.check-sum .n.warn { background: #fef3c7; color: #92400e; }
.check-sum .n.ok { background: #dcfce7; color: #166534; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; border: 1px solid; }
.check .ic { margin-top: 2px; flex: none; }
.check.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.check.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.check.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; padding: 5px 12px; }
.picker { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.picker .hint { width: 100%; margin: 0 0 2px; }
.picker button { padding: 0; border: 2px solid transparent; border-radius: 9px; background: none; cursor: pointer; }
.picker button:hover, .picker button:focus-visible { border-color: var(--brand); }
.picker img { width: 88px; height: 88px; object-fit: cover; border-radius: 7px; display: block; }

/* ===== Nhập từ Woo ===== */
.import { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .import { grid-template-columns: 1fr; } }
.import-form { position: sticky; top: 16px; }
.import-form label:first-child { margin-top: 0; }
.shop-pick { display: grid; gap: 6px; }
.shop-opt { --c: #94a3b8; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.shop-opt input { margin: 0; }
.shop-opt i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.shop-opt:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); }
.import-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.product-grid .empty { grid-column: 1 / -1; }
.product { position: relative; display: grid; gap: 6px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.product:hover { box-shadow: var(--shadow); }
.product:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .14); }
.product input { position: absolute; top: 16px; left: 16px; z-index: 1; }
.product img, .product .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.product.done { opacity: .55; cursor: default; }
.p-name { font-weight: 700; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.p-meta { font-size: 12px; color: var(--muted); }
.badge-done { position: absolute; top: 16px; right: 16px; padding: 2px 8px; border-radius: 20px; background: var(--approved); color: #fff; font-size: 11px; font-weight: 700; }
.import-bar { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid #ddd6fe; box-shadow: var(--shadow-lg); }
.import-bar input[type=text] { flex: 1; min-width: 200px; }
.import-bar select { width: auto; }

/* ===== Trạng thái sản phẩm trên web, index (trang Thẻ sản phẩm) ===== */
.row-web { flex: none; max-width: 330px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.wchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border: 1px solid transparent; border-radius: 99px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; text-decoration: none; }
button.wchip { cursor: pointer; }
button.wchip:hover, a.wchip:hover { filter: brightness(.95); box-shadow: 0 0 0 2px rgba(16, 24, 40, .06); }
.w-draft, .w-private, .w-future { background: #f1f5f9; color: #475569; }
.w-pending { background: #fef3c7; color: #92400e; }
.w-publish { background: #dcfce7; color: #166534; }
.w-missing { background: #fee2e2; color: #991b1b; }
.w-link { background: #eff6ff; color: var(--todo); }
.w-google { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.i-indexed { background: #16a34a; color: #fff; }
.i-not_indexed { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.i-none, .i-nosite { background: var(--surface); border-color: var(--line); border-style: dashed; color: var(--muted); }
.i-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.i-issue { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.w-act { background: var(--surface); border-color: #ddd6fe; color: var(--brand); }
.w-act:hover { background: #f5f3ff; }
.wchip .spin { width: 10px; height: 10px; border-width: 1.6px; }
/* Lượt Google hôm nay (trang Thẻ sản phẩm) */
.gsc-quota { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; font-size: 12.5px; }
.gsc-quota .muted { display: inline-flex; align-items: center; gap: 5px; }
.quota { padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.quota.warn { background: #fef3c7; color: #92400e; }
.quota-shop { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sm-list li span { line-height: 1.5; }
.sm-list b { overflow-wrap: anywhere; }
/* Kết quả submit, chi tiết index */
.result { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid; }
.result > .ic { flex: none; margin-top: 1px; }
.result b { font-size: 15px; }
.result p { margin: 4px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.result.good { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.result.bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.sub-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.sub-list li { display: flex; gap: 7px; align-items: flex-start; }
.sub-list li > .ic { flex: none; margin-top: 2px; }
.sub-list li.ok { color: #047857; }
.sub-list li.warn { color: #92400e; }
.ix-table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 13.5px; }
.ix-table th { width: 150px; padding: 7px 8px 7px 0; text-align: left; vertical-align: top; color: var(--muted); font-weight: 600; }
.ix-table td { padding: 7px 0; border-top: 1px solid var(--line-2); overflow-wrap: anywhere; }
.ix-table tr:first-child td { border-top: 0; }
.ix-table .sub-list { margin: 0; }
.ix-table .good { color: #047857; }
.ix-table .warn { color: #b45309; }
@media (max-width: 560px) { .ix-table th { width: 110px; } }
.ch-actions .row-web { max-width: none; }
.steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.gsc-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13.5px; }
.gsc-table td { padding: 8px 6px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.gsc-table .wchip { white-space: normal; }
@media (max-width: 1100px) { .card-row { flex-wrap: wrap; } .row-web { order: 5; max-width: none; flex-basis: 100%; justify-content: flex-start; padding-left: 26px; } }

/* ===== Nhãn nội dung nhạy cảm (chỉ leader / shop manager thấy, không chặn đẩy draft) ===== */
.alert.flag-note { align-items: center; background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.flag-note > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.alert.flag-note .btn { margin-left: auto; }
.flag-tag { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; padding: 1px 8px; border-radius: 99px; background: #dc2626; color: #fff; font-size: 11.5px; font-weight: 800; vertical-align: 1px; }

/* ===== Làm mockup: sheet giveaway ===== */
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: -8px; }
.sheet-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.sheet-tab span { padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.sheet-tab.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.m-panel { display: grid; gap: 12px; }
.m-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.m-toolbar .search { flex: 0 1 280px; }
.m-filters, .m-views { display: flex; flex-wrap: wrap; gap: 6px; }
.m-views .tab { padding: 6px 12px; font-size: 13px; }
.m-head-row, .m-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 190px 170px 140px 72px; gap: 12px; align-items: center; }
.m-head-row { padding: 0 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
#m-list { display: grid; gap: 14px; }
.m-team { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.m-team-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.m-team-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.m-team-name h3 { font-size: 16px; font-weight: 800; }
.m-team-act { display: flex; align-items: center; gap: 4px; }
.m-link { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: #eff6ff; color: var(--todo); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.m-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #92400e; }
.m-rows { display: grid; }
.m-row { position: relative; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.m-rows > .m-row:first-child { border-top: 0; }
.m-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.m-row.urg-urgent { background: #fff6f6; }
.m-row.urg-urgent::before { background: var(--fix); }
.m-row.urg-soon { background: #fffbf2; }
.m-row.urg-soon::before { background: #f59e0b; }
.m-row.is-done { background: #f6fef8; }
.m-row.is-done::before { background: var(--approved); }
.m-row.urg-past:not(.is-done) { opacity: .65; }
.m-thumb { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }
.m-name { min-width: 0; display: grid; gap: 5px; }
.m-title { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.m-title b { font-size: 14px; margin-right: 2px; }
.m-team-tag { margin-right: 6px; padding: 1px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); font-size: 11.5px; font-weight: 700; }
.icon-btn.tiny-icon { width: 26px; height: 26px; border-radius: 7px; }
.m-webs { display: grid; gap: 4px; }
.m-webs .hint { margin: 0; }
.m-web { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.m-web-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.m-toggle { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid #fecaca; border-radius: 99px; background: #fef2f2; color: #b91c1c; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.m-toggle.on { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.m-toggle.big { padding: 6px 12px; font-size: 13px; }
.m-date { display: grid; gap: 4px; font-size: 13px; }
.m-date .urg { justify-self: start; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.urg-urgent .m-date .urg { background: #fee2e2; color: #b91c1c; }
.urg-soon .m-date .urg { background: #fef3c7; color: #92400e; }
.urg-ok .m-date .urg { background: #dcfce7; color: #166534; }
.urg-none .m-date .urg { background: #fffbeb; color: #92400e; }
.m-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.m-who select { min-width: 0; padding: 5px 8px; font-size: 13px; }
.m-act { display: flex; justify-content: flex-end; gap: 2px; }
.m-empty { margin: 0; padding: 12px 14px; }
.modal:has(.w-rows) { width: min(680px, 100%); }
.w-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.w-rows:empty { display: none; }
.w-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
@media (max-width: 1100px) {
  .m-head-row { display: none; }
  .m-row { grid-template-columns: 56px minmax(0, 1fr); }
  .m-thumb { width: 56px; height: 56px; }
  .m-date, .m-who, .m-made, .m-act { grid-column: 2; }
  .m-act { justify-content: flex-start; }
  .m-web { flex-wrap: wrap; row-gap: 2px; }
  .m-web-name { order: 3; flex-basis: 100%; white-space: normal; }
}
@media (max-width: 560px) { .w-row { grid-template-columns: 1fr auto; } .w-row .w-shop { grid-column: 1 / -1; } }

/* ===== Upload sản phẩm ===== */
.tabs-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tab.on { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.tab:disabled { cursor: not-allowed; opacity: .6; }
.tab small { font-weight: 500; color: var(--muted); }
.up-form { position: static; }
.cat-list { max-height: 280px; overflow: auto; display: grid; align-content: start; gap: 1px; margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.cat { --d: 0; display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 8px 5px calc(8px + var(--d) * 16px); border-radius: 7px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.cat[hidden] { display: none; }
.cat:hover { background: var(--surface-2); }
.cat small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.cat:has(input:checked) { background: var(--brand-soft); color: var(--brand-ink); }
.cat input { margin: 0; }
input.bad { border-color: #f87171; background: #fff7f7; }
.bad-text { color: var(--fix); }
.up-panel { display: grid; gap: 12px; align-content: start; }
.drop { display: grid; justify-items: center; gap: 6px; margin: 0; padding: 44px 20px; border: 2px dashed #cfd4e4; border-radius: 14px; background: var(--surface-2); color: var(--muted); text-align: center; font-weight: 400; cursor: pointer; transition: border-color .15s, background .15s; }
.drop b { color: var(--ink); font-size: 16px; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.drop[hidden] { display: none; }
.up-file { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.up-file label.btn { margin: 0; }
.up-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.up-bar { position: sticky; top: 0; z-index: 3; display: grid; gap: 8px; padding: 10px 0; background: var(--surface); }
.up-bar .actions { margin: 0; }
.up-progress { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.up-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s ease; }
.up-progress.live i { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .22) 0 8px, transparent 8px 16px), linear-gradient(90deg, var(--brand), var(--brand-2)); background-size: 22px 22px, 100% 100%; animation: up-stripes .8s linear infinite; }
@keyframes up-stripes { to { background-position: 22px 0, 0 0; } }
.up-stats { font-size: 13px; color: var(--ink-2); }
.up-stats:empty { display: none; }
.up-list { display: grid; gap: 8px; }
.up-opts { display: grid; gap: 6px; min-width: 0; }
.up-cat { width: 100%; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-cat.own { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.row-cats { max-height: 50vh; }
.up-row { display: grid; grid-template-columns: auto 64px minmax(0, 1fr) 170px 190px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.up-row > input[type=checkbox] { margin: 0; }
.up-row.off { opacity: .5; }
.up-row.bad { border-color: #fecaca; background: #fef2f2; }
.up-row.done { border-color: #bbf7d0; background: #f6fef8; }
.up-thumb { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-main { min-width: 0; display: grid; gap: 4px; }
.up-title { font-weight: 600; }
.up-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-msg { font-size: 12.5px; color: #991b1b; }
.up-msg:empty { display: none; }
.up-state { justify-self: end; text-align: right; }
.up-state .chip { gap: 6px; }
.up-state .spin { width: 11px; height: 11px; }
.up-state a.chip { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .up-progress i, .up-progress.live i { transition: none; animation: none; } }
@media (max-width: 760px) {
  .up-row { grid-template-columns: auto 52px minmax(0, 1fr); }
  .up-thumb { width: 52px; height: 52px; }
  .up-opts, .up-state { grid-column: 2 / -1; justify-self: stretch; text-align: left; }
}
#i-sel { font-weight: 700; color: var(--brand-ink); }

/* ===== Thống kê ===== */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.big { font-size: 20px; font-weight: 800; color: var(--brand-ink); }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tr.open td { background: var(--brand-soft); }
.table tr.detail td { background: var(--surface-2); padding: 12px; }
.table tfoot td { font-weight: 700; border-bottom: 0; }

/* ===== Cài đặt ===== */
.users { display: grid; gap: 10px; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.user-row.inactive { opacity: .55; }
.user-text { flex: 1; min-width: 160px; }
.user-text b { display: block; }
.user-text small { display: block; color: var(--muted); }
.role-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--line-2); color: var(--ink-2); }
.role-tag.r-admin { background: var(--brand-soft); color: var(--brand-ink); }
.role-tag.r-manager { background: #e0f2fe; color: #075985; }
.shop-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.shop-check { --c: #94a3b8; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.shop-check i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.shop-check:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.narrow-panel { max-width: 760px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.word { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border-radius: 20px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-weight: 600; font-size: 13.5px; }
.word button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.word button:hover { background: #fecaca; }
.add-word { display: flex; gap: 8px; }
.profile { display: flex; align-items: center; gap: 18px; }
.profile h2 { font-size: 20px; }
.profile p { margin: 4px 0 0; }

/* Hồ sơ shop */
.shops { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .shops { grid-template-columns: 1fr; } }
.shop-list { display: grid; gap: 4px; }
.shop-list button { --c: #94a3b8; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; font-weight: 600; padding: 9px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink-2); }
.shop-list button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.shop-list button small { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.shop-list button.on { background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--ink); }
.name-color { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.section-title { font-size: 15px; margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.manual-key, .more { margin-top: 14px; }
.manual-key summary, .more summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--brand-ink); }
.more { padding: 12px 16px; border: 1px dashed var(--line); border-radius: 12px; margin-top: 22px; }
.type-row, .type-head { display: grid; grid-template-columns: 140px 1fr 1fr auto; gap: 8px; align-items: start; margin-top: 8px; }
.type-head { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 10px; }
.layout-row { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; align-items: start; margin-top: 8px; }
@media (max-width: 960px) { .type-row, .type-head, .layout-row { grid-template-columns: 1fr; } }
.lesson-row { display: flex; gap: 10px; align-items: center; margin: 8px 0 0; }
.lesson-row input[type=text] { flex: 1; }
.example-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.example-row summary { cursor: pointer; display: flex; gap: 10px; align-items: center; }
.example-row summary span { flex: 1; }
.example-row .preview { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more .btn.small { margin-top: 8px; }
.save-bar { position: sticky; bottom: 12px; padding: 12px; margin: 24px -8px 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border-radius: 12px; border: 1px solid var(--line); }

/* ===== Đăng nhập ===== */
.auth { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px; overflow: hidden; background: #0d0e1c; }
.auth-art { position: absolute; inset: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .7; }
.b1 { width: 520px; height: 520px; background: #7c3aed; top: -160px; left: -120px; }
.b2 { width: 460px; height: 460px; background: #db2777; bottom: -160px; right: -100px; }
.b3 { width: 300px; height: 300px; background: #2563eb; top: 40%; left: 55%; opacity: .45; }
.auth-card { position: relative; width: min(420px, 100%); padding: 32px; border-radius: 22px; background: rgba(255, 255, 255, .96); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand b { display: block; font-size: 17px; }
.auth-brand small { color: var(--muted); font-size: 12px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card > p { margin: 6px 0 4px; font-size: 13.5px; }
.auth-card .alert { margin-top: 14px; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 60; max-width: min(560px, calc(100vw - 32px)); transform: translateX(-50%) translateY(20px); background: #101828; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 500; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #b91c1c; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Trang WooCommerce đưa về sau khi bấm Approve */
.connected-page { max-width: 480px; margin: 12vh auto; text-align: center; }
.connected-page h1 { font-size: 22px; }
